/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:        #0a0a0f;
  --bg2:       #12121a;
  --surface:   #1a1a26;
  --border:    #2a2a3e;
  --accent:    #00ff88;
  --accent2:   #ff3366;
  --text:      #e8e8f0;
  --muted:     #6666aa;
  --pixel:     'Press Start 2P', monospace;
  --mono:      'DM Mono', monospace;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

/* ── Screens ───────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Scanlines overlay ─────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.12) 3px,
    rgba(0,0,0,0.12) 4px
  );
}

/* ── Home screen ───────────────────────────────────────── */
#screen-home {
  background: var(--bg);
  flex-direction: column;
  gap: 0;
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  z-index: 2;
}

.logo-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo-eyebrow {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 4px;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.logo {
  font-family: var(--pixel);
  font-size: clamp(24px, 5vw, 48px);
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.logo-accent { color: var(--accent2); }

.tagline {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 8px;
}

.home-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* Bouncing pixel ball decoration */
.home-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.pixel-ball {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--accent);
  top: 40%;
  left: 10%;
  animation: dvd-bounce 7s linear infinite;
  image-rendering: pixelated;
}

@keyframes dvd-bounce {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(calc(80vw), calc(-20vh)); }
  50%  { transform: translate(calc(60vw), calc(10vh)); }
  75%  { transform: translate(calc(20vw), calc(-30vh)); }
  100% { transform: translate(0, 0); }
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  font-family: var(--pixel);
  font-size: 12px;
  padding: 16px 32px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  transition: transform 0.1s, box-shadow 0.1s;
  image-rendering: pixelated;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0,255,136,0.3);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-ghost {
  font-family: var(--pixel);
  font-size: 10px;
  padding: 12px 24px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  letter-spacing: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-text {
  font-family: var(--mono);
  font-size: 12px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
}

.btn-text:hover { color: var(--text); }

/* ── Waiting screen ────────────────────────────────────── */
.waiting-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.dot-row {
  display: flex;
  gap: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; background: var(--muted); }
.dot:nth-child(3) { animation-delay: 0.4s; background: var(--accent2); }

@keyframes pulse-dot {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50%       { transform: scaleY(2); opacity: 1; }
}

.waiting-title {
  font-family: var(--pixel);
  font-size: clamp(14px, 3vw, 22px);
  line-height: 1.6;
  color: var(--text);
}

.waiting-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ── Face-off / countdown screen ──────────────────────────── */
#screen-faceoff {
  background: var(--bg);
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.faceoff-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.faceoff-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
}

.faceoff-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.faceoff-panel.faceoff-them { border-right: 3px solid var(--accent2); }
.faceoff-panel.faceoff-you  { border-left:  3px solid var(--accent); }
.faceoff-panel.faceoff-you video { transform: scaleX(-1); }

.faceoff-name {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 3px;
  padding: 6px 14px;
  background: rgba(10,10,15,0.75);
  white-space: nowrap;
}

.faceoff-name.them { color: var(--accent2); }
.faceoff-name.you  { color: var(--accent); }

.faceoff-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 28px;
  background: var(--bg);
  z-index: 2;
  min-width: 150px;
  flex-shrink: 0;
}

.faceoff-vs {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 4px;
}

.countdown-number {
  font-family: var(--pixel);
  font-size: clamp(52px, 8vw, 88px);
  color: var(--accent);
  line-height: 1;
  animation: count-pulse 0.9s ease-out;
}

@keyframes count-pulse {
  0%   { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.faceoff-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

/* ── Game screen ───────────────────────────────────────── */
#screen-game {
  background: var(--bg);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.game-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* Mobile score bar — hidden on desktop */
.score-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.score-block.left  { align-items: flex-start; }
.score-block.right { align-items: flex-end; }

.score-label {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 2px;
}

.score-value {
  font-family: var(--pixel);
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

.score-center { display: flex; flex-direction: column; align-items: center; }

.game-status {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--accent2);
  letter-spacing: 2px;
}

/* Three-column game area */
.game-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Side video panels — big face energy */
.side-panel {
  width: clamp(200px, 22vw, 340px);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
}

.side-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-them { border-right: 4px solid var(--accent2); }
.panel-you  { border-left:  4px solid var(--accent); }
.panel-you video { transform: scaleX(-1); }

.panel-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 3px;
  padding: 6px 16px;
  background: rgba(0,0,0,0.75);
  white-space: nowrap;
}

.panel-label.them { color: var(--accent2); }
.panel-label.you  { color: var(--accent); }

.panel-score {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
}

.panel-them .panel-score { color: var(--accent2); }
.panel-you  .panel-score { color: var(--accent); }

/* Canvas centre column */
.canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  gap: 8px;
  min-width: 0;
}

.desktop-score { display: none; }

.ds-score {
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
}

.ds-score.them { color: var(--accent2); }
.ds-score.you  { color: var(--accent); }
.ds-sep { font-family: var(--pixel); font-size: 18px; color: var(--border); }

#pong-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - clamp(80px, 12vh, 140px) - 60px);
  image-rendering: pixelated;
}

.controls-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  padding: 4px 0 8px;
}

.hint-sep { color: var(--border); }

/* ── Responsive: narrow screens ────────────────────────── */
.mobile-pips { display: none; }

@media (max-width: 768px) {
  .faceoff-layout    { flex-direction: column; }
  .faceoff-panel.faceoff-them { border-right: none; border-bottom: 3px solid var(--accent2); }
  .faceoff-panel.faceoff-you  { border-left: none;  border-top:    3px solid var(--accent); }
  .faceoff-centre    { flex-direction: row; min-width: unset; min-height: 64px; padding: 8px 16px; gap: 10px; }
  .faceoff-hint      { display: none; }
  .side-panel        { display: none; }
  .desktop-score     { display: none; }
  .score-bar         { display: flex; }
  .canvas-wrap       { justify-content: flex-start; padding-top: 8px; }
  .mobile-pips       { display: flex; gap: 8px; width: 100%; padding: 0 8px; }
  .mobile-pip        { flex: 1; height: 120px; position: relative; overflow: hidden; background: var(--bg2); }
  .mobile-pip video  { width: 100%; height: 100%; object-fit: cover; }
  .mobile-pip.pip-you video { transform: scaleX(-1); }
  .mobile-pip span   { position: absolute; bottom: 4px; left: 6px; font-family: var(--pixel); font-size: 7px; letter-spacing: 1px; }
  .mobile-pip.pip-them { border: 1px solid var(--accent2); }
  .mobile-pip.pip-them span { color: var(--accent2); }
  .mobile-pip.pip-you  { border: 1px solid var(--accent); }
  .mobile-pip.pip-you  span { color: var(--accent); }
  .mobile-footer     { display: flex; }
  .picker-grid       { gap: 12px; }
  .game-card         { width: 140px; padding: 20px 12px; }
  .dpad              { display: grid; }
  .game-banner         { height: 56px; padding: 0 16px; border-bottom: 2px solid var(--accent2); position: relative; }
  .game-banner-left    { display: none; }
  .game-banner-right   { display: none; }
  .game-banner-centre  { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; }
  .banner-logo         { font-size: clamp(16px, 5vw, 22px); }
  .banner-tag          { font-size: 9px; letter-spacing: 1px; }
  .banner-status {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    font-size: 10px;
    padding: 4px 14px;
    background: #000;
  }
}

/* ── Game picker screen ────────────────────────────────── */
#screen-picker {
  background: var(--bg);
  flex-direction: column;
}

.picker-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.picker-title {
  font-family: var(--pixel);
  font-size: clamp(14px, 3vw, 24px);
  color: var(--text);
  letter-spacing: 3px;
}

.picker-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

.picker-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-card {
  width: 200px;
  padding: 28px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, transform 0.1s;
}

.game-card:hover      { border-color: var(--accent); transform: translateY(-3px); }
.snake-card:hover     { border-color: var(--accent2); }

.game-card-icon {
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 4px;
}

.snake-card .game-card-icon { color: var(--accent2); }

.game-card-name {
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 2px;
}

.game-card-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.game-card-controls {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--border);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  width: 100%;
  text-align: center;
}

/* ── D-pad (Snake mobile controls) ────────────────────── */
.dpad {
  display: none;
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.dpad-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active { background: var(--accent2); color: var(--bg); }

.dpad-up    { top: 0;   left: 42px; }
.dpad-down  { bottom: 0; left: 42px; }
.dpad-left  { top: 42px; left: 0; }
.dpad-right { top: 42px; right: 0; }

/* ── Reaction card ─────────────────────────────────────── */
.reaction-card .game-card-icon { color: #00ff88; font-size: 32px; }
.reaction-card:hover { border-color: #00ff88; }

/* ── Reaction game UI ──────────────────────────────────── */
.reaction-ui {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 24px 0;
}

.reaction-round {
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 3px;
}

.reaction-scores {
  display: flex;
  gap: 40px;
}

.reaction-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reaction-score-label {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 2px;
}

.reaction-score-label.them { color: var(--accent2); }
.reaction-score-label.you  { color: var(--accent); }

.reaction-score-val {
  font-family: var(--pixel);
  font-size: 36px;
  line-height: 1;
  color: var(--text);
}

.reaction-light {
  width: 200px;
  height: 200px;
  border: 3px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  transition: border-color 0.1s;
}

.reaction-light.red   { border-color: var(--accent2); background: rgba(255,51,102,0.08); }
.reaction-light.green { border-color: var(--accent);  background: rgba(0,255,136,0.15); }

.reaction-light-inner {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--surface);
  transition: background 0.05s;
}

.reaction-light.green .reaction-light-inner { background: var(--accent); }
.reaction-light.red   .reaction-light-inner { background: var(--accent2); }

.reaction-instruction {
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-align: center;
  min-height: 20px;
}

.reaction-tap-btn {
  font-family: var(--pixel);
  font-size: 18px;
  padding: 20px 60px;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 4px;
  transition: background 0.05s, border-color 0.05s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}

.reaction-tap-btn.armed {
  border-color: var(--accent);
  color: var(--accent);
  animation: tap-pulse 0.6s ease-in-out infinite;
}

.reaction-tap-btn:active { transform: scale(0.96); }

@keyframes tap-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,0); }
  50%       { box-shadow: 0 0 0 8px rgba(0,255,136,0.15); }
}

.reaction-result {
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 2px;
  min-height: 24px;
  text-align: center;
}

/* ── Mobile footer ─────────────────────────────────────── */
.mobile-footer {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0 8px;
  width: 100%;
}

.mobile-footer-logo {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
}

.mobile-footer-logo span { color: var(--accent2); }

.mobile-footer-balls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mf-ball {
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.mf-ball.b2 { background: var(--muted); animation: mf-pulse 1.4s ease-in-out infinite 0.2s; }
.mf-ball.b3 { background: var(--accent2); animation: mf-pulse 1.4s ease-in-out infinite 0.4s; }
.mf-ball.b1 { animation: mf-pulse 1.4s ease-in-out infinite; }

@keyframes mf-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.4); }
}

/* ── Branded game banner ───────────────────────────────── */
.game-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: clamp(80px, 12vh, 140px);
  background: #000;
  border-bottom: 4px solid var(--accent2);
  flex-shrink: 0;
  z-index: 10;
}

.game-banner-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 100px;
}

.game-banner-centre {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.game-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 100px;
}

.banner-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.banner-logo {
  font-family: var(--pixel);
  font-size: clamp(28px, 5vw, 64px);
  color: var(--text);
  letter-spacing: 2px;
  line-height: 1;
  white-space: nowrap;
}

.banner-logo span { color: var(--accent2); }

.banner-tag {
  font-family: var(--mono);
  font-size: clamp(10px, 1vw, 13px);
  color: var(--muted);
  letter-spacing: 2px;
}

.banner-score-them {
  font-family: var(--pixel);
  font-size: clamp(28px, 4vw, 52px);
  color: var(--accent2);
  line-height: 1;
  text-align: right;
}

.banner-score-you {
  font-family: var(--pixel);
  font-size: clamp(28px, 4vw, 52px);
  color: var(--accent);
  line-height: 1;
  text-align: right;
}

.banner-sep {
  font-family: var(--pixel);
  font-size: 20px;
  color: var(--border);
  line-height: 1;
  display: none;
}

.banner-score-label {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 2px;
}

.banner-score-label.them { color: var(--accent2); }
.banner-score-label.you  { color: var(--accent); }

.banner-game {
  font-family: var(--pixel);
  font-size: clamp(9px, 1vw, 12px);
  color: var(--muted);
  letter-spacing: 3px;
}

.banner-status {
  font-family: var(--pixel);
  font-size: clamp(10px, 1vw, 13px);
  color: var(--accent2);
  letter-spacing: 3px;
  animation: blink 1s step-end infinite;
  padding: 6px 14px;
  border: 2px solid var(--accent2);
}

.banner-url { display: none; }

/* ── Share card ────────────────────────────────────────── */
.share-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#share-canvas {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
}

.btn-share {
  font-family: var(--pixel);
  font-size: 10px;
  padding: 12px 24px;
  background: var(--accent2);
  color: var(--bg);
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  transition: transform 0.1s;
}

.btn-share:hover  { transform: translateY(-2px); }
.btn-share:active { transform: translateY(1px); }

.share-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.share-hint strong { color: var(--accent); }

/* ── Game over screen ──────────────────────────────────── */
.gameover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 16px;
  width: 100%;
  max-width: 600px;
}

.gameover-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gameover-brand-logo {
  font-family: var(--pixel);
  font-size: clamp(14px, 4vw, 36px);
  color: var(--text);
  letter-spacing: 2px;
  line-height: 1.2;
  white-space: nowrap;
}

.gameover-brand-logo span { color: var(--accent2); }

.result-badge {
  font-family: var(--pixel);
  font-size: clamp(20px, 4vw, 36px);
  padding: 12px 28px;
  border: 3px solid var(--accent);
  color: var(--accent);
  letter-spacing: 4px;
  animation: result-flash 0.6s ease-out;
}

.result-badge.loss {
  border-color: var(--accent2);
  color: var(--accent2);
}

@keyframes result-flash {
  0%   { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Score layout — opponent left, you right */
.gameover-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.gameover-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.gameover-score-block.you  { align-items: flex-end; }
.gameover-score-block.them { align-items: flex-start; }

.gameover-score-label {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}

.gameover-score-block.them .gameover-score-label { color: var(--accent2); }
.gameover-score-block.you  .gameover-score-label { color: var(--accent); }

.gameover-score-val {
  font-family: var(--pixel);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
}

.gameover-score-block.them .gameover-score-val { color: var(--accent2); }
.gameover-score-block.you  .gameover-score-val { color: var(--accent); }

.gameover-score-sep {
  font-family: var(--pixel);
  font-size: clamp(24px, 4vw, 48px);
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
}

.gameover-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.rematch-status {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  min-height: 20px;
}

.postgame-videos {
  display: flex;
  gap: 2px;
  height: 140px;
  border-bottom: 1px solid var(--border);
}

.postgame-pip {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.postgame-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.postgame-pip.pip-you   { border-right: 2px solid var(--accent); }
.postgame-pip.pip-you video { transform: scaleX(-1); }
.postgame-pip.pip-them  { border-left: 2px solid var(--accent2); }

.postgame-pip span {
  position: absolute;
  bottom: 5px;
  left: 8px;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
}

.postgame-pip.pip-you  span { color: var(--accent); }
.postgame-pip.pip-them span { color: var(--accent2); }

/* ── Post-game chat ────────────────────────────────────── */
.postgame-chat {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.postgame-chat-label {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.postgame-messages {
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.postgame-msg {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.postgame-msg-who {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 1px;
  flex-shrink: 0;
  padding-top: 1px;
}

.postgame-msg-who.you  { color: var(--accent); }
.postgame-msg-who.them { color: var(--accent2); }

.postgame-msg-text {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.postgame-empty {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}

.postgame-input-row {
  display: flex;
  border-top: 1px solid var(--border);
}

.postgame-input-row input {
  flex: 1;
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.postgame-input-row input::placeholder { color: var(--muted); }
.postgame-input-row input:focus { background: var(--surface); }

.postgame-send {
  font-family: var(--pixel);
  font-size: 9px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  flex-shrink: 0;
  transition: opacity 0.1s;
}

.postgame-send:hover  { opacity: 0.85; }
.postgame-send:active { opacity: 0.7; }

/* ── Email capture ─────────────────────────────────────── */
.email-capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.email-capture-label {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
}

.email-capture-row {
  display: flex;
  width: 100%;
  gap: 8px;
}

.email-capture-row input {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.email-capture-row input:focus {
  border-color: var(--accent);
}

.email-capture-row input::placeholder {
  color: var(--muted);
}

.btn-email {
  font-family: var(--pixel);
  font-size: 9px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  white-space: nowrap;
  transition: transform 0.1s;
  flex-shrink: 0;
}

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

.email-capture-done {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
}

.hidden { display: none !important; }

/* ── Overlays ──────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.overlay.hidden { display: none; }

.overlay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.overlay-icon {
  font-size: 40px;
  line-height: 1;
}

.overlay-box h3 {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

.overlay-box p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .video-pip { width: 100px; height: 75px; }
  .score-bar  { padding: 8px 12px; }
}
