/* RawTrial - Human Sensory, Reflex & Perception Benchmark Suite */
:root {
  --bg: #050506;
  --bg-elevated: #131316;
  --bg-card: #0c0c0e;
  --bg-card-hover: #1d1d22;
  --border: #1e1e24;
  --border-strong: #32323b;
  --text: #f5f5f7;
  --text-muted: #5a5a63;
  --text-secondary: #9898a0;
  --accent: #10b981;
  --accent-hover: #34d399;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.65);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, span, a, button, label, div {
  overflow-wrap: break-word;
  word-break: normal;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #6ee7b7;
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 24px);
}

/* Header & Navigation */
.site-header {
  background: #0d1118;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 12px;
  padding: 8px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #161b26;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.brand-badge {
  background: #182030;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: #1c2434;
}

.nav-links a.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #161b26;
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-switch:hover {
  border-color: var(--accent);
  background: #1d2433;
}

.lang-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent-hover);
  font-weight: 700;
}

@media (max-width: 920px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 8px 0 6px;
  }
  .header-top {
    width: 100%;
  }
  .nav-wrap {
    width: 100%;
  }
  .nav-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 100%;
    background: linear-gradient(to right, rgba(13, 17, 24, 0), #0d1118);
    pointer-events: none;
  }
  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 22px;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-links a {
    background: #131823;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    padding: 5px 9px;
  }
  .nav-links a.nav-hardware {
    color: var(--accent-hover);
    border-color: rgba(16, 185, 129, 0.45);
  }
  .nav-links a.active {
    border-color: var(--accent);
    box-shadow: none;
  }
}

/* Main Game Stage */
.hero-stage {
  padding: 22px 0 16px;
}

.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stage-title {
  flex: 1 1 320px;
  min-width: 0;
}

.stage-title h1 {
  font-size: clamp(1.35rem, 3.1vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
}

.stage-title p {
  color: var(--text-secondary);
  font-size: clamp(0.86rem, 1.8vw, 0.98rem);
  margin-top: 5px;
  line-height: 1.5;
  max-width: 72ch;
}

.best-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.best-pill strong {
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .hero-stage {
    padding: 12px 0 12px;
  }
  .stage-header {
    margin-bottom: 10px;
    gap: 8px;
  }
  .stage-title h1 {
    font-size: 1.28rem;
  }
  .stage-title p {
    font-size: 0.83rem;
    line-height: 1.42;
    margin-top: 4px;
  }
  .best-pill {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .best-pill strong {
    font-size: 0.86rem;
  }
}

/* Interactive Arena Box */
.arena-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 380px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3.5vw, 30px) clamp(12px, 3vw, 24px);
  position: relative;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

@media (max-width: 640px) {
  .arena-box {
    min-height: 310px;
    padding: 16px 12px;
  }
}

.arena-box.state-wait {
  background: #7f1d1d;
  border-color: #dc2626;
  cursor: pointer;
}

.arena-box.state-ready {
  background: #065f46;
  border-color: #10b981;
  cursor: pointer;
}

.arena-box.state-idle,
.arena-box.state-result,
.arena-box.state-early {
  cursor: pointer;
}

.arena-protocol-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: #161d2b;
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.arena-big-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.1rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: center;
  color: var(--text);
}

.arena-subtext {
  font-size: clamp(0.88rem, 1.9vw, 1.02rem);
  color: var(--text-secondary);
  margin-top: 9px;
  text-align: center;
  max-width: 540px;
  line-height: 1.48;
}

.arena-box.state-wait .arena-subtext,
.arena-box.state-ready .arena-subtext {
  color: #f8fafc;
}

.record-banner {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 10px;
}

/* Buttons & Controls */
.btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 44px;
  height: auto;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: clamp(0.86rem, 1.9vw, 0.94rem);
  line-height: 1.3;
  white-space: normal;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
  font-family: var(--font);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: #f3f5f8;
  color: #0b0e14;
  border-color: #f3f5f8;
}

.btn-primary:hover {
  background: #ffffff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: #4b5873;
}

.btn-small {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

/* ==========================================================================
   BLIND TIMING TEST
   ========================================================================== */
.bt-wrapper {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.bt-controls {
  background: #0e121b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(12px, 2.5vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bt-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bt-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.bt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: stretch;
}

@media (max-width: 600px) {
  #bt-target-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  #bt-mode-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .bt-chip {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }
}

.bt-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 38px;
  height: auto;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: clamp(0.8rem, 1.9vw, 0.88rem);
  font-weight: 500;
  line-height: 1.28;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.bt-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.bt-chip.active {
  background: #1b283b;
  color: #ffffff;
  border-color: var(--accent);
}

.bt-custom-row {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #0b0e14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.bt-custom-row.visible {
  display: flex;
}

.bt-custom-row label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.bt-custom-input {
  width: 110px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #12161f;
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
}

.bt-stage {
  background: #0e121b;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: clamp(18px, 3.5vw, 30px) clamp(14px, 3vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.bt-stage:hover {
  border-color: #4b5873;
}

.bt-stage.running {
  border-color: var(--warning);
  background: #131722;
}

.bt-stage.finished {
  border-color: var(--success);
}

.bt-target-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  background: #161d2b;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
}

.bt-target-pill strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-hover);
}

.bt-timer {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.3rem, 7.5vw, 4.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.bt-timer.blind {
  color: var(--warning);
}

.bt-status {
  font-size: clamp(0.88rem, 1.9vw, 1rem);
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 54ch;
  line-height: 1.42;
}

.bt-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.4;
}

.bt-stop-btn {
  background: #dc2626 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

.bt-results {
  display: none;
  flex-direction: column;
  gap: 12px;
  background: #0e121b;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: clamp(14px, 2.8vw, 20px);
}

.bt-results.visible {
  display: flex;
}

.bt-res-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bt-rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.bt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 680px) {
  .bt-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.bt-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bt-stat-label {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bt-stat-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 2.3vw, 1.3rem);
  font-weight: 700;
  color: var(--text);
}

.bt-stat-sub {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.bt-history {
  background: #0e121b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bt-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bt-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bt-history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.81rem;
  font-variant-numeric: tabular-nums;
}

/* Game Specific UI Elements */
.hud-bar {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #0b0e14;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.hud-bar span strong {
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.color-grid {
  display: grid;
  gap: 5px;
  width: min(86vw, 350px);
  height: min(86vw, 350px);
  min-height: 220px;
  grid-auto-rows: 1fr;
  background: #0b0e14;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  touch-action: manipulation;
}

.color-tile {
  border-radius: 4px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 18px;
  transition: transform 0.06s ease;
}

.color-tile:active {
  transform: scale(0.95);
}

.slider-wrap {
  width: 100%;
  max-width: 520px;
  margin: 14px 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: #1c2434;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  touch-action: pan-x;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-hover);
  border: 2px solid #0b0e14;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-hover);
  border: 2px solid #0b0e14;
  cursor: pointer;
}

.hz-step-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.canvas-wrap {
  width: 100%;
  max-width: 380px;
  min-height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
}

canvas.game-canvas {
  background: #050506;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: min(92vw, 380px);
  height: min(78vw, 360px);
  max-width: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: crosshair;
}

.chimp-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 620px;
  touch-action: manipulation;
}

@media (max-width: 600px) {
  .chimp-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 340px;
  }
}

.chimp-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  touch-action: manipulation;
}

.chimp-cell.active-num {
  background: var(--bg-card);
  border-color: var(--border-strong);
  cursor: pointer;
}

.chimp-cell.active-num:hover {
  border-color: var(--accent);
}

.chimp-cell.hidden-num {
  background: #cbd5e1;
  color: transparent;
  border-color: #94a3b8;
  cursor: pointer;
}

.chimp-cell.solved-num {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--success);
  color: var(--success);
}

.chimp-cell.wrong-num {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--danger);
  color: var(--danger);
}

.rhythm-pad {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.06s ease, border-color 0.08s ease, background-color 0.08s ease;
}

.rhythm-pad.pulse {
  border-color: var(--accent);
  background: #1b283b;
  transform: scale(1.04);
}

.rhythm-pad.tap-flash {
  border-color: var(--success);
  background: #112a24;
  transform: scale(0.97);
}

/* Hub Grid (All 8 Games) */
.section-block {
  padding: 24px 0;
}

.section-heading {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-sub {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

@media (max-width: 540px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .game-card {
    padding: 13px 14px;
  }
}

.game-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  color: var(--text);
}

.game-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
}

.game-card.current-card {
  border-color: var(--accent);
  background: #131b29;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.card-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-hover);
  background: #161d2b;
  border: 1px solid var(--border-strong);
  padding: 3px 7px;
  border-radius: 4px;
}

.card-score {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  background: #0b0e14;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.game-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.35;
  color: var(--text);
}

.game-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.48;
}

/* Cross-Promo Callout */
.cross-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cross-banner p {
  font-size: 0.87rem;
  color: var(--text-secondary);
  max-width: 760px;
  line-height: 1.48;
}

.cross-banner strong {
  color: var(--text);
}

/* Reference & Methodology Content */
.article-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 3.5vw, 28px);
  margin-top: 6px;
}

.article-box h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.015em;
}

.article-box h3 {
  font-size: clamp(0.98rem, 2.1vw, 1.05rem);
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}

.article-box p {
  color: var(--text-secondary);
  margin-bottom: 13px;
  font-size: 0.92rem;
}

.article-box ul {
  margin: 10px 0 15px 18px;
  color: var(--text-secondary);
}

.article-box li {
  margin-bottom: 6px;
  font-size: 0.91rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.bench-table th,
.bench-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}

.bench-table th:last-child,
.bench-table td:last-child {
  border-right: none;
}

.bench-table tr:last-child td {
  border-bottom: none;
}

.bench-table th {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
}

.bench-table td {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .bench-table {
    font-size: 0.8rem;
  }
  .bench-table th,
  .bench-table td {
    padding: 8px 9px;
  }
}

.notice-box {
  background: #16181d;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  width: 100%;
  max-width: 640px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #0d1118;
  padding: 20px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

/* Back to GhostingTest Header Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.gt-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399 !important;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.gt-back-link:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--accent);
}
@media (max-width: 440px) {
  .brand-badge { display: none; }
  .gt-back-link, .lang-switch { padding: 4px 7px; font-size: 0.72rem; }
}
