/* ============================================================
   PEPTIDE PUZZLE — Standalone game styles
   Scoped brand/font token mapping for target design system
   ============================================================ */
#game-overlay,
.game-fab,
.game-toast {
  --brand-white:       var(--text-primary, #F8FAFC);
  --brand-white-200:   var(--text-secondary, #CBD5E1);
  --brand-dark:        var(--color-primary, #0F172A);
  --brand-green:       var(--color-accent-dark, #00C2CC);
  --brand-green-200:   var(--color-accent, #00F5FF);
  --brand-blue-100:    var(--color-accent-light, #67FFFF);
  --brand-purple-100:  var(--color-mint, #A5FFD6);
  --ease-in-out:       cubic-bezier(.65, .05, .36, 1);
  --font-sans:         'Inter', system-ui, -apple-system, sans-serif;
  --font-sans-semi:    'Inter', system-ui, -apple-system, sans-serif;
  --font-sans-bold:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:         ui-monospace, 'SF Mono', 'Fira Code', monospace;
  --font-mono-bold:    ui-monospace, 'SF Mono', 'Fira Code', monospace;
}

/* Force correct weights for the semi/bold family slots that collapsed to Inter */
#game-overlay [style*="--font-sans-semi"],
#game-overlay .game-subtitle,
#game-overlay .cat-name,
#game-overlay .start-secondary,
#game-overlay .game-btn,
#game-overlay .back-link,
#game-overlay .email-card h3,
#game-overlay .email-submit { font-weight: 600; }

#game-overlay .game-title,
#game-overlay .result-word,
#game-overlay .game-stat-value,
#game-overlay .result-status,
#game-overlay .tile { font-weight: 700; }

#game-overlay .clue-label,
#game-overlay .puzzle-num,
#game-overlay .category-pill,
#game-overlay .kb-key,
#game-overlay .game-fab-icon,
#game-overlay .tool-btn,
#game-overlay .hint-btn,
.game-fab .game-fab-icon { font-weight: 600; letter-spacing: 1.2px; }

   PEPTIDE PUZZLE — GAME OVERLAY
   Glassmorphism + Fresnel glow over 3D scene
   ============================================ */

/* keyframes */
@keyframes gameFadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to   { opacity: 1; backdrop-filter: blur(24px); }
}
@keyframes gameFrameIn {
  0%   { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes tileFlip {
  0%   { transform: rotateX(0); background: rgba(201,220,236,0.04); }
  50%  { transform: rotateX(90deg); background: rgba(0,245,255,0.18); }
  100% { transform: rotateX(0); background: rgba(0,245,255,0.12); }
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(0,245,255,0.5)); }
  50%      { transform: scale(1.2); filter: drop-shadow(0 0 8px rgba(0,245,255,0.9)); }
}
@keyframes heartBreak {
  0%   { transform: scale(1.3); filter: drop-shadow(0 0 8px rgba(217,207,251,0.9)); }
  100% { transform: scale(0.85); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); opacity: 0.25; }
}
@keyframes fresnelRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes kbKeyPop {
  0% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes flashGlow {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(0,245,255,0); }
  50%      { box-shadow: inset 0 0 140px 0 rgba(0,245,255,0.18); }
}
@keyframes gamePulseRing {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0;   transform: scale(2.2); }
}
@keyframes toastSlide {
  0%   { opacity: 0; transform: translate(-50%, 10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes shimmerLine {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   OVERLAY ROOT
   ============================================ */
#game-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(6,26,46,0.55) 0%, rgba(6,26,46,0.92) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: gameFadeIn 400ms var(--ease-in-out);
  color: var(--brand-white);
  font-family: var(--font-sans);
  overflow: auto;
}
#game-overlay.open { display: flex; }
#game-overlay.shake .game-frame { animation: shake 380ms cubic-bezier(.36,.07,.19,.97); }
#game-overlay.flash .game-frame { animation: flashGlow 600ms ease-out; }

body.game-open { overflow: hidden; }

/* Close button */
.game-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(201,220,236,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201,220,236,0.18);
  color: var(--brand-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 200ms ease;
  z-index: 10;
}
.game-close:hover {
  background: rgba(0,245,255,0.18);
  border-color: rgba(0,245,255,0.4);
  transform: rotate(90deg);
}

/* ============================================
   FRAME (glass card) — shared
   ============================================ */
.game-frame {
  position: relative;
  width: min(680px, 100%);
  padding: 44px 40px 36px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(168,191,253,0.05) 0%, rgba(0,245,255,0.03) 55%, rgba(217,207,251,0.05) 100%),
    rgba(6,26,46,0.55);
  border: 1px solid rgba(201,220,236,0.14);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.55),
    0 0 0 1px rgba(201,220,236,0.04) inset,
    0 0 60px rgba(0,245,255,0.05) inset;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  animation: gameFrameIn 520ms var(--ease-in-out) both;
  overflow: hidden;
}

/* Fresnel rotating halo */
.game-frame::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 180%; height: 180%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(0,245,255,0.07) 15%,
    transparent 30%,
    rgba(168,191,253,0.06) 55%,
    transparent 70%,
    rgba(217,207,251,0.06) 88%,
    transparent 100%
  );
  animation: fresnelRotate 24s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.game-frame > * { position: relative; z-index: 1; }

/* ============================================
   MENU SCREEN
   ============================================ */
.game-brand { text-align: center; margin-bottom: 28px; }
.game-logo {
  display: block;
  margin: 0 auto 12px;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0,245,255,0.25);
}
.game-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3.5px;
  color: var(--brand-green-200);
  margin-bottom: 8px;
}
.game-title {
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 42px;
  letter-spacing: -1px;
  background: linear-gradient(90deg, #c9dcec 0%, #d9cffb 40%, #00F5FF 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerLine 6s ease-in-out infinite;
  margin-bottom: 4px;
}
.game-subtitle {
  font-size: 14px;
  color: rgba(201,220,236,0.7);
  letter-spacing: 0.3px;
}

.game-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px;
  background: rgba(201,220,236,0.04);
  border: 1px solid rgba(201,220,236,0.1);
  border-radius: 14px;
  transition: all 220ms ease;
}
.stat-chip.highlight {
  background: linear-gradient(180deg, rgba(0,245,255,0.14) 0%, rgba(0,245,255,0.04) 100%);
  border-color: rgba(0,245,255,0.4);
  box-shadow: 0 0 24px rgba(0,245,255,0.18);
}
.stat-num {
  font-family: var(--font-mono-bold); font-weight: 700;
  font-size: 22px;
  color: var(--brand-white);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(201,220,236,0.6);
  margin-top: 6px;
}

.progress-bar {
  position: relative;
  height: 6px;
  background: rgba(201,220,236,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #094f80 0%, #00F5FF 100%);
  box-shadow: 0 0 12px rgba(0,245,255,0.5);
  transition: width 500ms ease;
}
.progress-text {
  position: absolute;
  top: -22px; right: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(201,220,236,0.6);
  letter-spacing: 0.6px;
}

.game-menu-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: rgba(201,220,236,0.5);
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.cat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  background: rgba(201,220,236,0.03);
  border: 1px solid rgba(201,220,236,0.1);
  border-radius: 14px;
  color: var(--brand-white);
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 220ms ease;
  text-align: left;
}
.cat-tile:hover {
  background: rgba(168,191,253,0.08);
  border-color: rgba(168,191,253,0.3);
  transform: translateY(-2px);
}
.cat-tile.active {
  background: linear-gradient(180deg, rgba(0,245,255,0.15) 0%, rgba(0,245,255,0.04) 100%);
  border-color: rgba(0,245,255,0.55);
  box-shadow: 0 6px 20px rgba(0,245,255,0.15);
}
.cat-name { font-size: 14px; letter-spacing: 0.2px; }
.cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(201,220,236,0.55);
  letter-spacing: 0.5px;
}

.menu-actions { display: flex; gap: 12px; }
.menu-actions .game-btn { flex: 1; }

/* ============================================
   BUTTONS (shared)
   ============================================ */
.game-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.4px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 240ms var(--ease-in-out);
  overflow: hidden;
}
.game-btn.primary {
  background: linear-gradient(180deg, #00F5FF 0%, #00C2CC 100%);
  color: #061a2e;
  border-color: rgba(0,245,255,0.6);
  box-shadow:
    0 10px 30px rgba(0,245,255,0.3),
    0 0 0 1px rgba(0,245,255,0.4) inset,
    0 2px 0 rgba(255,255,255,0.3) inset;
}
.game-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px rgba(0,245,255,0.45),
    0 0 0 1px rgba(0,245,255,0.5) inset,
    0 2px 0 rgba(255,255,255,0.3) inset;
}
.game-btn.primary.pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(0,245,255,0.8);
  animation: gamePulseRing 2s ease-out infinite;
}
.game-btn.ghost {
  background: rgba(201,220,236,0.05);
  color: var(--brand-white);
  border-color: rgba(201,220,236,0.2);
}
.game-btn.ghost:hover {
  background: rgba(201,220,236,0.1);
  border-color: rgba(201,220,236,0.35);
}

/* ============================================
   PLAY SCREEN
   ============================================ */
.play-frame { width: min(720px, 100%); }
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.back-link {
  background: none;
  border: none;
  color: rgba(201,220,236,0.7);
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
}
.back-link:hover { color: var(--brand-green-200); }

.category-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(168,191,253,0.1);
  border: 1px solid rgba(168,191,253,0.3);
  color: var(--brand-blue-100);
}

.hearts {
  display: flex;
  gap: 5px;
  color: var(--brand-green-200);
}
.heart {
  display: inline-flex;
  animation: heartPulse 1.4s ease-in-out infinite;
  transition: all 400ms ease;
}
.heart:nth-child(2) { animation-delay: 0.15s; }
.heart:nth-child(3) { animation-delay: 0.3s; }
.heart:nth-child(4) { animation-delay: 0.45s; }
.heart:nth-child(5) { animation-delay: 0.6s; }
.heart:nth-child(6) { animation-delay: 0.75s; }
.heart:nth-child(7) { animation-delay: 0.9s; }
.heart:nth-child(8) { animation-delay: 1.05s; }
.heart.broken {
  animation: heartBreak 400ms ease-out forwards;
  color: var(--brand-purple-100);
}

.clue-card {
  padding: 20px 24px;
  background:
    linear-gradient(145deg, rgba(168,191,253,0.08) 0%, rgba(217,207,251,0.04) 100%);
  border: 1px solid rgba(168,191,253,0.18);
  border-radius: 18px;
  margin-bottom: 26px;
}
.clue-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(168,191,253,0.8);
  margin-bottom: 8px;
}
.clue-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--brand-white-200);
  letter-spacing: 0.1px;
}

.word-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  padding: 8px;
}
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 56px;
  padding: 0 6px;
  font-family: var(--font-mono-bold); font-weight: 700;
  font-size: 24px;
  color: var(--brand-white);
  background: rgba(201,220,236,0.04);
  border: 1px solid rgba(201,220,236,0.14);
  border-bottom: 2px solid rgba(201,220,236,0.3);
  border-radius: 8px;
  transition: all 300ms var(--ease-in-out);
}
.tile.revealed {
  background: linear-gradient(180deg, rgba(0,245,255,0.2) 0%, rgba(0,245,255,0.06) 100%);
  border-color: rgba(0,245,255,0.55);
  border-bottom-color: rgba(0,245,255,0.9);
  box-shadow: 0 0 20px rgba(0,245,255,0.25);
  animation: tileFlip 380ms ease;
}
.tile.static {
  background: rgba(168,191,253,0.08);
  border-color: rgba(168,191,253,0.25);
  color: var(--brand-blue-100);
  animation: none;
}
.tile-space {
  display: inline-block;
  width: 16px;
}

.play-tools {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(217,207,251,0.06);
  border: 1px dashed rgba(217,207,251,0.28);
  color: var(--brand-purple-100);
  cursor: pointer;
  transition: all 200ms ease;
}
.tool-btn:hover:not(:disabled) {
  background: rgba(217,207,251,0.14);
  border-style: solid;
}
.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hint-btn .hint-icon {
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(139, 233, 239, 0.6));
}
.hint-btn:disabled .hint-icon {
  filter: none;
}

/* ============================================
   KEYBOARD
   ============================================ */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.kb-row {
  display: flex;
  gap: 6px;
}
.kb-key {
  width: 40px;
  height: 52px;
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 15px;
  color: var(--brand-white);
  background: rgba(201,220,236,0.06);
  border: 1px solid rgba(201,220,236,0.16);
  border-bottom: 2px solid rgba(201,220,236,0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 180ms ease;
  backdrop-filter: blur(8px);
}
.kb-key:hover:not(:disabled) {
  background: rgba(168,191,253,0.15);
  border-color: rgba(168,191,253,0.45);
  transform: translateY(-2px);
  animation: kbKeyPop 280ms ease;
}
.kb-key.hit {
  background: linear-gradient(180deg, rgba(0,245,255,0.35) 0%, rgba(0,245,255,0.15) 100%);
  border-color: rgba(0,245,255,0.65);
  color: var(--brand-green-200);
  box-shadow: 0 0 12px rgba(0,245,255,0.35);
  cursor: default;
}
.kb-key.miss {
  background: rgba(217,207,251,0.04);
  border-color: rgba(217,207,251,0.1);
  color: rgba(217,207,251,0.4);
  cursor: default;
  opacity: 0.6;
}

/* ============================================
   RESULT SCREEN
   ============================================ */
.result-frame { width: min(560px, 100%); text-align: center; }
.result-card {
  padding: 36px 28px 28px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(0,245,255,0.08) 0%, rgba(168,191,253,0.05) 100%),
    rgba(6,26,46,0.4);
  border: 1px solid rgba(0,245,255,0.25);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.result-frame.lost .result-card {
  background:
    linear-gradient(145deg, rgba(217,207,251,0.08) 0%, rgba(168,191,253,0.04) 100%),
    rgba(6,26,46,0.4);
  border-color: rgba(217,207,251,0.25);
}
.result-status {
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  color: var(--brand-green-200);
}
.result-frame.lost .result-status { color: var(--brand-purple-100); }
.result-word {
  font-family: var(--font-mono-bold); font-weight: 700;
  font-size: 36px;
  letter-spacing: 3px;
  color: var(--brand-white);
  margin-bottom: 14px;
  word-wrap: break-word;
}
.result-clue {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(201,220,236,0.7);
  margin-bottom: 22px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.result-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.sg-cell {
  width: 14px; height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.sg-cell.hit   { background: #00F5FF; box-shadow: 0 0 6px rgba(0,245,255,0.6); }
.sg-cell.miss  { background: rgba(217,207,251,0.6); }
.sg-cell.empty { background: rgba(201,220,236,0.08); }

.result-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(201,220,236,0.6);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-actions .game-btn { width: 100%; }

/* ============================================
   EMAIL SCREEN
   ============================================ */
.email-frame {
  width: min(460px, 100%);
  text-align: center;
  padding-top: 56px;
}
.email-halo {
  position: absolute;
  top: -120px; left: 50%;
  width: 360px; height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0,245,255,0.25) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(20px);
}
.email-title {
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 26px;
  color: var(--brand-white);
  margin-bottom: 10px;
  line-height: 1.2;
}
.email-sub {
  font-size: 14px;
  color: rgba(201,220,236,0.7);
  margin-bottom: 26px;
  line-height: 1.5;
}
.email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.email-input {
  padding: 16px 20px;
  background: rgba(201,220,236,0.06);
  border: 1px solid rgba(201,220,236,0.2);
  border-radius: 999px;
  color: var(--brand-white);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: all 200ms ease;
}
.email-input:focus {
  background: rgba(201,220,236,0.1);
  border-color: rgba(0,245,255,0.55);
  box-shadow: 0 0 0 4px rgba(0,245,255,0.12);
}
.email-skip {
  background: none;
  border: none;
  color: rgba(201,220,236,0.5);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-sans);
  padding: 8px;
}
.email-skip:hover { color: var(--brand-white); }
.email-thanks {
  padding: 20px;
  color: var(--brand-green-200);
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 18px;
}

/* ============================================
   TOAST
   ============================================ */
.game-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  background: rgba(6,26,46,0.92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(0,245,255,0.5);
  border-radius: 999px;
  color: var(--brand-green-200);
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 300ms ease;
  box-shadow: 0 10px 30px rgba(0,245,255,0.2);
}
.game-toast.show {
  opacity: 1;
  animation: toastSlide 260ms ease-out;
}

/* ============================================
   FLOATING ACTION BUTTON (entry point #2)
   ============================================ */
.game-fab {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 40;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(0,245,255,0.45);
  background:
    radial-gradient(circle at 30% 30%, rgba(0,245,255,0.35) 0%, rgba(9,79,128,0.5) 55%, rgba(6,26,46,0.85) 100%);
  backdrop-filter: blur(16px);
  color: var(--brand-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 14px 40px rgba(0,245,255,0.28),
    0 0 0 1px rgba(201,220,236,0.1) inset;
  transition: all 280ms var(--ease-in-out);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}
.game-fab.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.game-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 18px 50px rgba(0,245,255,0.5);
}
.game-fab::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid rgba(0,245,255,0.6);
  animation: gamePulseRing 2.2s ease-out infinite;
}
.game-fab-icon {
  font-family: var(--font-mono-bold); font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--brand-green-200);
  text-transform: uppercase;
}

/* Play button in start overlay */
.start-secondary {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(201,220,236,0.06);
  border: 1px solid rgba(0,245,255,0.4);
  border-radius: 999px;
  color: var(--brand-white);
  font-family: var(--font-sans-semi); font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 260ms ease;
  backdrop-filter: blur(10px);
}
.start-secondary:hover {
  background: rgba(0,245,255,0.18);
  border-color: rgba(0,245,255,0.7);
  transform: translateY(-1px);
}
.start-secondary::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-green-200);
  box-shadow: 0 0 8px rgba(0,245,255,0.9);
}

/* Organ-panel "Play" item gets a lime accent */
.organ-panel-item.game-entry {
  position: relative;
}
.organ-panel-item.game-entry::after {
  content: '';
  position: absolute;
  top: 50%; right: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-green-200);
  box-shadow: 0 0 8px rgba(0,245,255,0.9);
  transform: translateY(-50%);
}

/* ============================================
   RESPONSIVE
   ============================================ */
/* ============================================
   LOGO STYLES
   ============================================ */
.result-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--brand-green-200);
  margin-bottom: 14px;
}
.result-logo {
  border-radius: 50%;
  flex-shrink: 0;
}
.email-logo {
  display: block;
  margin: 0 auto 20px;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(0,245,255,0.3);
}

/* ============================================
   LEADERBOARD SCREEN
   ============================================ */
.leaderboard-frame { width: min(600px, 100%); }
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.leaderboard-title {
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 22px;
  color: var(--brand-white);
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.leaderboard-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(201,220,236,0.5);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(201,220,236,0.1);
}
.leaderboard-table th:last-child,
.leaderboard-table td:last-child { text-align: right; }
.leaderboard-table td {
  padding: 12px 12px;
  font-size: 14px;
  color: var(--brand-white-200);
  border-bottom: 1px solid rgba(201,220,236,0.06);
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr.is-me td { color: var(--brand-green-200); }
.lb-rank {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 13px;
  color: rgba(201,220,236,0.5);
  width: 32px;
}
.lb-rank-1 { color: #FFD700; }
.lb-rank-2 { color: #C0C0C0; }
.lb-rank-3 { color: #CD7F32; }
.lb-name { font-weight: 600; color: var(--brand-white); }
.lb-streak {
  font-family: var(--font-mono); font-weight: 700;
  color: var(--brand-green-200);
}
.lb-won { font-family: var(--font-mono); }
.leaderboard-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(201,220,236,0.5);
  font-size: 14px;
}

/* Nickname-Prompt Screen */
.nick-frame { width: min(460px, 100%); text-align: center; padding-top: 48px; }
.nick-halo {
  position: absolute;
  top: -120px; left: 50%;
  width: 360px; height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0,245,255,0.18) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(20px);
}
.nick-title {
  font-family: var(--font-sans-bold); font-weight: 700;
  font-size: 24px;
  color: var(--brand-white);
  margin-bottom: 10px;
}
.nick-sub {
  font-size: 14px;
  color: rgba(201,220,236,0.7);
  margin-bottom: 24px;
  line-height: 1.5;
}
.nick-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.nick-input {
  padding: 16px 20px;
  background: rgba(201,220,236,0.06);
  border: 1px solid rgba(201,220,236,0.2);
  border-radius: 999px;
  color: var(--brand-white);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: all 200ms ease;
  text-align: center;
}
.nick-input:focus {
  background: rgba(201,220,236,0.1);
  border-color: rgba(0,245,255,0.55);
  box-shadow: 0 0 0 4px rgba(0,245,255,0.12);
}
.nick-skip {
  background: none;
  border: none;
  color: rgba(201,220,236,0.5);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-sans);
  padding: 8px;
}
.nick-skip:hover { color: var(--brand-white); }

/* ── Mobile base (≤ 640px) ─────────────────── */
@media (max-width: 640px) {
  #game-overlay { padding: 10px; align-items: flex-start; }
  .game-frame { padding: 26px 18px 20px; border-radius: 20px; }
  .play-frame { padding: 20px 14px 16px; }

  /* Menu screen */
  .game-logo { width: 36px; height: 36px; margin-bottom: 8px; }
  .game-brand { margin-bottom: 16px; }
  .game-title { font-size: 30px; }
  .game-subtitle { font-size: 12px; }
  .game-stats-row { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
  .stat-chip { padding: 8px 4px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 9px; }
  .progress-bar { margin-bottom: 14px; }
  .progress-text { font-size: 10px; top: -18px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 16px; }
  .cat-tile { padding: 10px 8px; }
  .cat-name { font-size: 12px; }
  .menu-actions { gap: 8px; }
  .game-btn { padding: 13px 16px; font-size: 13px; }

  /* Play screen */
  .play-header { margin-bottom: 12px; gap: 10px; }
  .clue-card { padding: 12px 14px; margin-bottom: 14px; }
  .clue-text { font-size: 13px; line-height: 1.4; }
  .word-row { gap: 5px; margin-bottom: 14px; padding: 4px; }
  .tile { min-width: 32px; height: 42px; font-size: 17px; padding: 0 4px; }
  .play-tools { gap: 6px; margin-bottom: 12px; }
  .tool-btn { padding: 6px 12px; font-size: 10px; }
  .keyboard { gap: 5px; }
  .kb-row { gap: 3px; }
  .kb-key { width: 28px; height: 42px; font-size: 13px; }

  /* Result screen */
  .result-frame { width: 100%; }
  .result-card { padding: 22px 18px 18px; margin-bottom: 14px; }
  .result-status { font-size: 24px; margin-bottom: 12px; }
  .result-word { font-size: 24px; letter-spacing: 2px; margin-bottom: 10px; }
  .result-clue { font-size: 13px; margin-bottom: 14px; }
  .result-grid { gap: 4px; margin-bottom: 12px; }
  .sg-cell { width: 12px; height: 12px; }
  .result-actions { gap: 7px; }

  /* Email / Nick screens */
  .email-frame { padding-top: 36px; }
  .email-logo { width: 44px; height: 44px; margin-bottom: 14px; }
  .email-title { font-size: 20px; }
  .email-sub { font-size: 13px; margin-bottom: 18px; }
  .nick-frame { padding-top: 36px; }
  .nick-title { font-size: 20px; }
  .nick-sub { font-size: 13px; }

  /* FAB */
  .game-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .game-fab-icon { font-size: 11px; }
}

/* ── Very small portrait (≤ 390px, e.g. iPhone SE) ── */
@media (max-width: 390px) {
  #game-overlay { padding: 8px; }
  .game-frame { padding: 20px 14px 16px; }
  .play-frame { padding: 16px 12px 14px; }

  .game-title { font-size: 26px; }
  .game-stats-row { gap: 4px; margin-bottom: 10px; }
  .stat-chip { padding: 6px 2px; }
  .stat-num { font-size: 16px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .cat-tile { padding: 8px 6px; }

  .clue-card { padding: 10px 12px; margin-bottom: 10px; }
  .clue-text { font-size: 12px; }
  .word-row { gap: 4px; margin-bottom: 10px; }
  .tile { min-width: 28px; height: 38px; font-size: 15px; }
  .play-tools { margin-bottom: 8px; }
  .tool-btn { padding: 5px 10px; font-size: 9px; }
  .keyboard { gap: 4px; }
  .kb-key { width: 26px; height: 38px; font-size: 12px; }

  .result-status { font-size: 22px; }
  .result-word { font-size: 20px; letter-spacing: 1.5px; }
}
