*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #020817;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --surface-3: #334155;
  --border: #334155;
  --border-2: #475569;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --purple: #9333ea;
  --purple-light: #a855f7;
  --cyan: #0e7490;
  --cyan-light: #06b6d4;
  --green: #16a34a;
  --green-light: #22c55e;
  --red: #dc2626;
  --red-light: #ef4444;
  --yellow: #ca8a04;
  --yellow-light: #eab308;
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
#app { min-height: 100vh; }

/* ── Utilities ────────────────────────────────────────────── */
.hidden { display: none !important; }
.gradient-text { background: linear-gradient(135deg, #a855f7, #22d3ee); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Buttons ──────────────────────────────────────────────── */
button { cursor: pointer; border: none; font-family: inherit; transition: all 0.18s ease; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, #9333ea, #0891b2); color: white; }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-cyan { background: linear-gradient(135deg, #0e7490, #06b6d4); color: white; }
.btn-cyan:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 14px; }
.btn-xs { padding: 6px 14px; font-size: 12px; border-radius: 8px; }

/* ── Site Header ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  background: rgba(2, 8, 23, 0.90);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-logo-btn, .site-logo-link {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  background: none;
  padding: 0;
  border-radius: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}
.site-logo-btn span, .site-logo-link span { color: #a855f7; }
.header-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}
.site-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.15s;
  cursor: pointer;
  line-height: 1;
}
.nav-link:hover { color: var(--text); background: rgba(30,41,59,0.8); }
.nav-link.active { color: var(--text); }

/* ── Hamburger menu ────────────────────────────────────── */
.nav-area { display: flex; align-items: center; gap: 2px; }
.nav-more  { position: relative; }
.hamburger-btn { background: none; border: none; cursor: pointer; padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; border-radius: 8px; transition: background 0.15s; }
.hamburger-btn:hover { background: rgba(255,255,255,0.07); }
.hamburger-bar { display: block; width: 20px; height: 2px; background: var(--text-muted); border-radius: 2px; transition: transform 0.28s ease, opacity 0.28s ease, background 0.15s; transform-origin: center; }
.hamburger-btn:hover .hamburger-bar { background: var(--text); }
.hamburger-btn.open .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open .hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-width: 152px; display: flex; flex-direction: column; gap: 2px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 300; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.nav-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-link { display: block; padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-muted); text-decoration: none; transition: background 0.15s, color 0.15s; }
.dropdown-link:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.dropdown-link.active { color: var(--text); background: rgba(255,255,255,0.06); }
.dropdown-sep { border: none; border-top: 1px solid var(--border); margin: 4px 2px; }
select.form-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }
select.form-input option { background: #1e293b; color: #f1f5f9; }

/* ── Contact email hint ────────────────────────────────── */
.contact-email-line { color: var(--text-muted); font-size: 14px; }
.contact-email-link { color: #c084fc; text-decoration: none; font-weight: 500; }
.contact-email-link:hover { text-decoration: underline; }

/* ── Pages ────────────────────────────────────────────────── */
.page { min-height: 100vh; padding-top: 56px; }
.page.active { display: flex; flex-direction: column; }
.overlay-page {
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,8,23,0.97);
  backdrop-filter: blur(4px);
  position: fixed; inset: 0;
  z-index: 200;
  padding-top: 0;
}
.game-page { padding: 72px 16px 24px; max-width: 640px; margin: 0 auto; width: 100%; }

/* ── Home Page ────────────────────────────────────────────── */
.home-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  padding-top: 56px;
}
.home-bg-1 { position: absolute; top: 80px;  left: 30px;   width: 280px; height: 280px; background: rgba(147,51,234,0.10); border-radius: 50%; filter: blur(70px); pointer-events: none; }
.home-bg-2 { position: absolute; bottom: 60px; right: 30px;  width: 340px; height: 340px; background: rgba(8,145,178,0.09);  border-radius: 50%; filter: blur(70px); pointer-events: none; }
.home-bg-3 { position: absolute; top: 40%;   left: 50%;    width: 200px; height: 200px; background: rgba(244,63,94,0.06);   border-radius: 50%; filter: blur(60px); pointer-events: none; transform: translate(-50%,-50%); }

.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  padding: 52px 20px 40px;
  position: relative;
  z-index: 1;
}

/* Hero */
.home-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 56px; }
.home-logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, #9333ea, #06b6d4); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text { font-size: 42px; font-weight: 900; color: var(--text); margin: 0; letter-spacing: -1px; }
.home-tagline { color: var(--text-muted); font-size: 16px; margin-bottom: 18px; }
.home-hero-img {
  width: 100%; max-width: 780px;
  height: 220px; object-fit: cover;
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 32px rgba(139,92,246,0.3), 0 2px 8px rgba(0,0,0,0.5);
  border: 1px solid rgba(139,92,246,0.2);
}

/* User badge */
.user-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(30,41,59,0.8); border: 1px solid rgba(51,65,85,0.6); border-radius: 999px; padding: 7px 16px; font-size: 13px; color: var(--text-muted); backdrop-filter: blur(8px); }
.user-badge strong { color: var(--text); }
.badge-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.5; } }
.edit-btn { background: none; padding: 3px; color: var(--text-dim); border-radius: 4px; line-height: 1; }
.edit-btn:hover { color: var(--text-muted); }
.edit-username-area { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.edit-username-area input { width: 140px; text-align: center; padding: 6px 12px; font-size: 13px; border-radius: 999px; }

/* Games section */
.games-section { width: 100%; margin-bottom: 36px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); text-align: center; margin-bottom: 22px; }

/* ── Game Grid (responsive) ──────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  width: 100%;
}

/* ── Game Card ───────────────────────────────────────────── */
.game-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(51, 65, 85, 0.65);
  border-radius: 22px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.game-card:hover { transform: translateY(-8px) scale(1.015); }
.game-card--numerix:hover { box-shadow: 0 32px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(147,51,234,0.4); border-color: rgba(147,51,234,0.55); }
.game-card--flash:hover   { box-shadow: 0 32px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(6,182,212,0.4);  border-color: rgba(6,182,212,0.55); }
.game-card--pulse:hover   { box-shadow: 0 32px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(244,63,94,0.4);  border-color: rgba(244,63,94,0.55); }

/* card thumbnail */
.card-thumb { width: 100%; height: 162px; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.game-card:hover .card-thumb img { transform: scale(1.07); }

/* card body */
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 18px; font-weight: 800; color: var(--text); margin: 0; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.card-desc-ext {
  font-size: 12px; color: var(--text-dim); line-height: 1.6; margin: 0;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s ease, opacity 0.35s ease;
}
.game-card:hover .card-desc-ext { max-height: 80px; opacity: 1; }
.card-play-btn { font-size: 13px; font-weight: 700; margin-top: 6px; display: inline-block; }
.play-link--purple { color: #a855f7; }
.play-link--cyan   { color: #22d3ee; }
.play-link--rose   { color: #f472b6; }

/* Home actions */
.home-actions { margin-bottom: 24px; }

/* ── Site Footer ─────────────────────────────────────────── */
.site-footer { border-top: 1px solid rgba(51,65,85,0.35); padding: 22px 20px; width: 100%; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; max-width: 960px; margin: 0 auto; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: 12px; color: var(--text-dim); }
.footer-nav { display: flex; gap: 2px; }
.footer-link { font-size: 12px; color: var(--text-dim); text-decoration: none; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: color 0.15s; }
.footer-link:hover { color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 36px 32px; width: 100%; max-width: 380px; margin: 16px; box-shadow: 0 32px 64px rgba(0,0,0,0.6); display: flex; flex-direction: column; align-items: center; }
.modal-icon { width: 64px; height: 64px; background: linear-gradient(135deg, #9333ea, #06b6d4); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(147,51,234,0.3); }
.logo-text { font-size: 28px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.modal-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; text-align: center; }
.username-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.input-group { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.input-group input, input[type="text"] { width: 100%; padding: 12px 16px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); border-radius: 12px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.18s; }
.input-group input:focus, input[type="text"]:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(147,51,234,0.15); }
.input-error { color: #f87171; font-size: 12px; }
.input-hint { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.divider { width: 100%; display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { color: var(--text-dim); font-size: 12px; }

/* ── How to Play collapsible ─────────────────────────────── */
.htp-wrap { width: 100%; max-width: 420px; margin: 0 auto; }
.htp-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  background: rgba(30,41,59,0.55);
  border: 1px solid rgba(51,65,85,0.7);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  transition: all 0.2s;
}
.htp-btn:hover, .htp-btn.active { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.htp-content { max-height: 0; overflow: hidden; transition: max-height 0.42s ease; }
.htp-content.open { max-height: 420px; }
.htp-inner { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; margin-top: 10px; text-align: left; }
.htp-inner h4 { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 14px; }
.htp-inner ul { display: flex; flex-direction: column; gap: 8px; padding-left: 0; list-style: none; }
.htp-inner li { font-size: 13px; color: var(--text-muted); line-height: 1.6; padding-left: 18px; position: relative; }
.htp-inner li::before { content: '▸'; position: absolute; left: 0; color: #a855f7; font-size: 12px; top: 2px; }

/* ── Back / Top bar ──────────────────────────────────────── */
.back-btn { background: none; color: var(--text-muted); font-size: 14px; padding: 8px 0; margin-bottom: 24px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.back-btn:hover { color: var(--text); }
.game-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-back-btn { font-size: 12px; font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 3px 10px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.topbar-back-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.topbar-name { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.topbar-right { display: flex; gap: 16px; }
.stat-box { text-align: center; }
.stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 18px; font-weight: 700; color: var(--text); }
.timer { font-variant-numeric: tabular-nums; }
.diff-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; background: rgba(147,51,234,0.2); color: #c084fc; border: 1px solid rgba(147,51,234,0.3); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.diff-badge--cyan { background: rgba(14,116,144,0.2); color: #22d3ee; border-color: rgba(14,116,144,0.3); }

/* ── Difficulty Select ───────────────────────────────────── */
.select-header { text-align: center; margin-bottom: 24px; }
.select-header h1 { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.select-header p { color: var(--text-muted); font-size: 14px; max-width: 360px; margin: 0 auto; }
.game-banner {
  width: 100%; max-width: 560px;
  height: 160px; object-fit: cover;
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 2px 8px rgba(139,92,246,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  display: block; margin-left: auto; margin-right: auto;
}
/* ── Compact tag-style difficulty selector ────────────────── */
.diff-grid { display: flex; flex-direction: row; gap: 10px; margin-bottom: 28px; justify-content: center; flex-wrap: wrap; }
.diff-card { background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px 24px; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; cursor: pointer; flex: 1; min-width: 88px; max-width: 160px; }
.diff-card:hover { transform: none; }
.diff-emoji { display: none; }
.diff-card h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; margin: 0; }
.diff-card p  { font-size: 11px; color: var(--text-muted); margin: 0; }
.diff-example { display: none; }
/* Easy — green tone */
.diff-card--easy { border-color: rgba(34,197,94,0.22); }
.diff-card--easy h3 { color: #4ade80; }
.diff-card--easy:hover  { border-color: rgba(34,197,94,0.6); background: rgba(34,197,94,0.08); box-shadow: 0 0 14px rgba(34,197,94,0.15); }
/* Medium — amber/yellow tone */
.diff-card--medium { border-color: rgba(234,179,8,0.22); }
.diff-card--medium h3 { color: #facc15; }
.diff-card--medium:hover { border-color: rgba(234,179,8,0.6); background: rgba(234,179,8,0.08); box-shadow: 0 0 14px rgba(234,179,8,0.15); }
/* Hard — red tone */
.diff-card--hard { border-color: rgba(239,68,68,0.22); }
.diff-card--hard h3 { color: #f87171; }
.diff-card--hard:hover   { border-color: rgba(239,68,68,0.6); background: rgba(239,68,68,0.08); box-shadow: 0 0 14px rgba(239,68,68,0.15); }
@media (max-width: 360px) { .diff-card { padding: 10px 14px; } }
.roman-ref { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; text-align: center; }
.ref-title { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; font-weight: 600; }
.ref-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-size: 13px; color: var(--text-muted); }

/* ── Numerix Game ────────────────────────────────────────── */
.nx-playing-area { flex: 1; display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.nx-feedback { text-align: center; font-size: 18px; font-weight: 800; padding: 10px; border-radius: 12px; animation: pop 0.25s ease; }
.nx-feedback.correct { background: rgba(22,163,74,0.2); color: #4ade80; border: 1px solid rgba(22,163,74,0.4); }
.nx-feedback.wrong   { background: rgba(220,38,38,0.2); color: #f87171; border: 1px solid rgba(220,38,38,0.4); }
@keyframes pop { 0%{ transform:scale(0.9); } 100%{ transform:scale(1); } }
.nx-question-card { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 20px; padding: 36px 24px; text-align: center; }
.nx-hint { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.nx-question { font-size: 52px; font-weight: 900; letter-spacing: -1px; color: var(--text); min-height: 72px; display: flex; align-items: center; justify-content: center; }
.nx-input-row { display: flex; gap: 10px; }
.nx-input-row input { flex: 1; padding: 14px 18px; font-size: 16px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); border-radius: 14px; font-family: inherit; outline: none; text-transform: uppercase; }
.nx-input-row input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(147,51,234,0.15); }
.nx-over-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.over-card { border-radius: 20px; padding: 32px; text-align: center; width: 100%; }
.over-card--red { background: rgba(220,38,38,0.1); border: 1.5px solid rgba(220,38,38,0.3); }
.over-title { font-size: 22px; font-weight: 900; color: #f87171; margin-bottom: 8px; }
.over-score { font-size: 48px; font-weight: 900; color: var(--text); }
.over-label { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.over-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.saved-notice  { color: var(--yellow-light); font-size: 13px; font-weight: 600; margin-top: 8px; }
.saving-notice { color: var(--text-dim); font-size: 12px; margin-top: 8px; }

/* ── FlashGrid ───────────────────────────────────────────── */
.fg-idle-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.fg-idle-area h1 { font-size: 32px; font-weight: 900; }
.fg-idle-area > p { color: var(--text-muted); font-size: 14px; max-width: 320px; }
.info-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.info-row strong { color: var(--text); }
.fg-phase-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.phase-label { padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.phase-label.memorize { background: rgba(14,116,144,0.2); border: 1px solid rgba(14,116,144,0.4); color: #22d3ee; }
.phase-label.recall   { background: rgba(202,138,4,0.2); border: 1px solid rgba(202,138,4,0.4); color: var(--yellow-light); }
.tiles-left { font-size: 13px; color: var(--text-muted); }
.fg-banner { border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px; }
.fg-banner--won  { background: rgba(22,163,74,0.15); border: 1.5px solid rgba(22,163,74,0.4); }
.fg-banner--lost { background: rgba(220,38,38,0.10); border: 1.5px solid rgba(220,38,38,0.3); }
.banner-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.fg-banner--won  .banner-title { color: #4ade80; }
.fg-banner--lost .banner-title { color: #f87171; }
.banner-pts   { font-size: 14px; font-weight: 700; color: #4ade80; margin-bottom: 4px; }
.banner-score { font-size: 36px; font-weight: 900; color: var(--text); }
.banner-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.fg-grid-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.fg-grid { display: grid; gap: 8px; }
.tile { border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; transition: all 0.15s ease; }
.tile:hover { background: var(--surface-3); transform: scale(0.96); }
.tile.target  { border-color: #22d3ee; background: rgba(34,211,238,0.25); box-shadow: 0 0 16px rgba(34,211,238,0.5); animation: pulseTile 1s infinite; }
@keyframes pulseTile { 0%,100%{ opacity:1; } 50%{ opacity:0.7; } }
.tile.correct { border-color: #4ade80; background: rgba(74,222,128,0.25); box-shadow: 0 0 12px rgba(74,222,128,0.4); cursor: default; }
.tile.wrong   { border-color: #f87171; background: rgba(248,113,113,0.25); box-shadow: 0 0 12px rgba(248,113,113,0.4); cursor: default; }
.tile.idle { cursor: default; }
.game-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }

/* ── Leaderboard ─────────────────────────────────────────── */
.lb-header { text-align: center; margin-bottom: 24px; }
.lb-icon { font-size: 40px; margin-bottom: 10px; }
.lb-header h1 { font-size: 28px; font-weight: 900; }
.lb-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.tab-bar { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); background: none; transition: all 0.18s; }
.tab.active { background: #9333ea; color: white; }
.tab:not(.active):hover { color: var(--text); }
.subtab-bar { display: flex; background: rgba(30,41,59,0.5); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.subtab { flex: 1; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-dim); background: none; transition: all 0.18s; }
.subtab.active { background: var(--surface-3); color: var(--text); }
.pulse-subtab { flex: 1; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-dim); background: none; transition: all 0.18s; }
.pulse-subtab.active { background: var(--surface-3); color: #f472b6; }
.lb-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lb-section-title { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.refresh-btn { background: none; color: var(--text-dim); font-size: 12px; display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 4px 8px; }
.refresh-btn:hover { color: var(--text-muted); background: var(--surface-2); }
.lb-table { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.lb-head { display: grid; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lb-head span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.lb-row { display: grid; padding: 14px 16px; border-bottom: 1px solid rgba(51,65,85,0.4); font-size: 13px; align-items: center; }
.lb-row:last-child { border-bottom: none; }
.lb-row.gold { background: rgba(234,179,8,0.05); }
.lb-rank { font-weight: 700; }
.lb-username { font-weight: 500; }
.lb-username.gold-name { color: #fde047; }
.lb-score-val { text-align: right; font-weight: 700; color: #c084fc; }
.lb-score-val.flash { color: #22d3ee; }
.lb-level { text-align: right; color: var(--text-muted); }
.lb-empty   { text-align: center; padding: 48px 16px; color: var(--text-dim); font-size: 14px; }
.lb-loading { text-align: center; padding: 48px 16px; color: var(--text-dim); font-size: 14px; }
.lb-error   { margin-bottom: 10px; padding: 10px 14px; background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.3); color: #f87171; font-size: 12px; border-radius: 10px; line-height: 1.5; }
.lb-section.hidden { display: none; }

/* ── Game icons ──────────────────────────────────────────── */
.game-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.game-icon--purple { background: linear-gradient(135deg, #9333ea, #ea580c); box-shadow: 0 6px 20px rgba(147,51,234,0.3); }
.game-icon--cyan   { background: linear-gradient(135deg, #0e7490, #06b6d4); box-shadow: 0 6px 20px rgba(8,145,178,0.3); }
.game-icon--pulse  { background: linear-gradient(135deg, #e11d48, #9333ea); box-shadow: 0 6px 20px rgba(225,29,72,0.35); }
.large-icon { width: 80px; height: 80px; font-size: 40px; margin: 0 auto 20px; }

/* ── PulseGrid ───────────────────────────────────────────── */
.pg-game-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pg-status { text-align: center; font-size: 20px; font-weight: 800; color: var(--text); margin: 24px 0 28px; letter-spacing: -0.3px; }
.pg-grid { display: grid; gap: 14px; margin: 0 auto; }

.pg-tile {
  position: relative;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow:
    inset 0 2px 0   rgba(255,255,255,0.50),
    inset 2px 0 0   rgba(255,255,255,0.18),
    inset 0 -5px 0  rgba(0,0,0,0.40),
    inset -2px 0 0  rgba(0,0,0,0.18),
    0 8px 20px      rgba(0,0,0,0.55),
    0 3px 6px       rgba(0,0,0,0.35);
}
.pg-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.10) 30%, transparent 60%);
  pointer-events: none;
}
.pg-tile:not(:disabled):hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    inset 0 2px 0   rgba(255,255,255,0.55),
    inset 2px 0 0   rgba(255,255,255,0.20),
    inset 0 -5px 0  rgba(0,0,0,0.40),
    inset -2px 0 0  rgba(0,0,0,0.18),
    0 14px 28px     rgba(0,0,0,0.60),
    0 5px 10px      rgba(0,0,0,0.40);
}
.pg-tile:not(:disabled):active {
  transform: translateY(2px) scale(0.97);
  box-shadow:
    inset 0 1px 0   rgba(255,255,255,0.25),
    inset 0 -2px 0  rgba(0,0,0,0.20),
    0 2px 6px       rgba(0,0,0,0.35);
}
.pg-tile:disabled { cursor: default; filter: brightness(0.72) saturate(0.85); }

/* ── Homepage About section ──────────────────────────────── */
.home-about { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 16px; padding: 28px 32px; margin-bottom: 24px; max-width: 780px; width: 100%; }
.home-about h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.home-about p  { color: var(--text-muted); font-size: 15px; line-height: 1.8; margin-bottom: 10px; }
.home-about p:last-of-type { margin-bottom: 16px; }
.btn-sm { font-size: 13px; padding: 8px 18px; }

/* ── Contact Form ────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-group   { display: flex; flex-direction: column; gap: 6px; }
.form-label   { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-input,
.form-textarea { width: 100%; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 12px 16px; color: var(--text); font-size: 15px; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s; box-sizing: border-box; }
.form-input:focus,
.form-textarea:focus { outline: none; border-color: rgba(147,51,234,0.55); box-shadow: 0 0 0 3px rgba(147,51,234,0.12); }
.form-input.error,
.form-textarea.error { border-color: rgba(239,68,68,0.55); }
.form-error   { font-size: 12px; color: #f87171; display: none; }
.form-error.visible { display: block; }
.form-textarea { resize: vertical; min-height: 130px; }
.form-submit  { width: 100%; }
.success-card { background: rgba(34,197,94,0.08); border: 1.5px solid rgba(34,197,94,0.3); border-radius: 14px; padding: 40px 32px; text-align: center; display: none; }
.success-card.visible { display: block; }
.success-icon { font-size: 42px; margin-bottom: 14px; }
.success-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #4ade80; }
.success-card p { color: var(--text-muted); font-size: 14px; }

/* ── Color Hunt card thumbnail ───────────────────────────── */
.card-thumb--color {
  background: #1a1040;
  display: flex;
  align-items: center;
  justify-content: center;
}
.color-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 90px;
  height: 90px;
}
.color-thumb-grid div {
  border-radius: 4px;
}
.game-card--color { border-color: rgba(34, 197, 94, 0.25); }
.game-card--color:hover { border-color: rgba(34, 197, 94, 0.5); }
.play-link--green { background: linear-gradient(135deg, #15803d, #22c55e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Color Hunt Game ─────────────────────────────────────── */
.cg-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 76px 20px 40px;
  gap: 18px;
  min-height: 100vh;
}

.cg-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-align: center;
}

.cg-diff-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.cg-diff-label {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.cg-diff-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}

.cg-diff-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green-light);
  width: 100%;
  transition: width 0.4s ease, background 0.4s ease;
}

.cg-grid {
  display: grid;
  gap: 5px;
  width: min(400px, calc(100vw - 40px));
}

.cg-tile {
  aspect-ratio: 1;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease;
  outline: none;
}

.cg-tile:hover { transform: scale(1.04); }

.cg-tile.cg-correct {
  animation: cg-pop 0.28s ease;
}

.cg-tile.cg-wrong {
  animation: cg-shake 0.32s ease;
}

@keyframes cg-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}

@keyframes cg-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.cg-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

#cg-game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}
#cg-game-area.hidden { display: none !important; }

/* Result overlay */
.cg-result {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 8, 23, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cg-result.hidden { display: none !important; }

.cg-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-icon { font-size: 40px; }

.result-title {
  font-size: 24px;
  font-weight: 800;
}

.result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.result-row strong {
  color: var(--text);
  font-weight: 700;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 600px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-thumb { min-height: 110px; }
  .home-content { padding: 40px 16px 32px; }
  .home-hero { margin-bottom: 40px; }
  .logo-text { font-size: 34px; }
  .footer-inner { justify-content: center; text-align: center; }
  .site-nav { gap: 0; }
  .nav-link { padding: 5px 8px; font-size: 12px; }
  .home-about { padding: 20px; }
}
@media (min-width: 601px) and (max-width: 1023px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   WordHunt
   ══════════════════════════════════════════════════════════════ */

/* ── Guess grid ──────────────────────────────────────────────── */
.wh-grid {
  display: grid;
  gap: 6px;
}

.wh-cell {
  aspect-ratio: 1;
  border: 2px solid var(--border-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 4.5vw, 26px);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text);
  user-select: none;
  transition: border-color 0.1s, background 0.12s;
}
.wh-cell--filled  { border-color: var(--border-2); background: rgba(255,255,255,0.06); }
.wh-cell--correct { background: #16a34a; border-color: #16a34a; color: #fff; }
.wh-cell--present { background: #a16207; border-color: #a16207; color: #fff; }
.wh-cell--absent  { background: var(--surface-3); border-color: var(--surface-3); color: var(--text-dim); }

.wh-shake { animation: wh-shake 0.38s ease; }
@keyframes wh-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-5px); }
  40%     { transform: translateX(5px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}

/* ── Toast message ───────────────────────────────────────────── */
.wh-message {
  background: rgba(30,41,59,0.95);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ── On-screen keyboard ──────────────────────────────────────── */
.wh-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 430px;
  padding: 0 4px;
}
.wh-key-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.wh-key {
  flex: 1;
  height: 52px;
  max-width: 44px;
  min-width: 24px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.wh-key:active { filter: brightness(0.85); }
.wh-key--wide  { flex: 1.65; max-width: 68px; font-size: 11px; font-weight: 800; }
.wh-key--correct { background: #16a34a; color: #fff; }
.wh-key--present { background: #a16207; color: #fff; }
.wh-key--absent  { background: var(--surface-2); color: var(--text-dim); }

/* ── Result overlay word display ─────────────────────────────── */
.wh-result-word {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  text-align: center;
  margin-top: 6px;
}

/* ── Homepage thumbnail ──────────────────────────────────────── */
.wh-thumb {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.wh-thumb-row {
  display: flex;
  gap: 4px;
}
.wh-thumb-cell {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

/* ── WordHunt game card ───────────────────────────────────── */
.game-card--word { border-color: rgba(99,102,241,0.25); }
.game-card--word:hover { box-shadow: 0 32px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(99,102,241,0.4); border-color: rgba(99,102,241,0.55); }

/* ── WordHunt desktop improvements ──────────────────────────── */

/* Keyboard hint: visible on desktop, hidden on mobile */
.wh-kb-hint {
  display: none;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.02em;
}
.wh-kb-hint kbd {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-muted);
  margin: 0 2px;
}

/* On-screen keyboard label on desktop */
.wh-onscreen-label {
  display: none;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: -2px;
}

@media (min-width: 768px) {
  /* Show keyboard hints */
  .wh-kb-hint         { display: block; }
  .wh-onscreen-label  { display: block; }

  /* Larger cells on desktop */
  .wh-cell {
    font-size: clamp(20px, 3.2vw, 32px);
  }

  /* Larger keyboard keys on desktop */
  .wh-key {
    height: 58px;
    max-width: 52px;
    font-size: 15px;
    border-radius: 9px;
  }
  .wh-key--wide {
    max-width: 78px;
    font-size: 12px;
  }

  /* Slightly wider keyboard on desktop */
  .wh-keyboard {
    max-width: 500px;
  }
}

@media (min-width: 1024px) {
  /* Even bigger cells on large screens */
  .wh-cell {
    font-size: 28px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Search — Nav Icon Button
   ══════════════════════════════════════════════════════════════ */

.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
.nav-search-btn:hover {
  background: var(--surface-3);
  border-color: var(--purple-light);
  color: var(--text);
  transform: scale(1.08);
}
.nav-search-btn:active { transform: scale(0.95); }

/* ══════════════════════════════════════════════════════════════
   Search — Full-screen Overlay
   ══════════════════════════════════════════════════════════════ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.search-overlay.open {
  pointer-events: all;
  opacity: 1;
}

.search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.search-overlay-panel {
  position: relative;
  width: min(580px, calc(100vw - 32px));
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  transform: translateY(-16px);
  transition: transform 0.2s ease;
}
.search-overlay.open .search-overlay-panel {
  transform: translateY(0);
}

/* ── Input bar ─────────────────────────────────────────────── */
.search-overlay-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-overlay-icon {
  color: var(--text-dim);
  flex-shrink: 0;
  display: flex;
}
.search-overlay-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
}
.search-overlay-input::placeholder { color: var(--text-dim); }

.search-overlay-close {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.search-overlay-close:hover { background: var(--border); color: var(--text); }

/* ── Results list ──────────────────────────────────────────── */
.search-overlay-results {
  max-height: 340px;
  overflow-y: auto;
}

.search-hint, .search-no-result {
  padding: 20px 16px;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}
.search-no-result strong { color: var(--text); }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.14s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover  { background: var(--surface-3); }
.search-result-item:active { background: var(--surface-3); }

.search-result-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.search-result-body  { flex: 1; min-width: 0; }
.search-result-name  { font-size: 14px; font-weight: 700; }
.search-result-name mark {
  background: rgba(168,85,247,0.3);
  color: var(--purple-light);
  border-radius: 3px;
  padding: 0 2px;
}
.search-result-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.search-result-arrow { font-size: 20px; color: var(--text-dim); flex-shrink: 0; }

/* Block body scroll while overlay is open */
body.search-open { overflow: hidden; }

/* ── Mobile adjustments ───────────────────────────────────── */
@media (max-width: 480px) {
  .search-overlay { padding-top: 60px; }
  .search-overlay-panel { border-radius: 14px; }
  .search-overlay-input { font-size: 15px; }
}

/* ══════════════════════════════════════════════════════════════
   WordRush — game styles
   ══════════════════════════════════════════════════════════════ */

/* Extra badge colours */
.diff-badge--green { background: rgba(22,163,74,0.18); color: var(--green-light); border-color: rgba(22,163,74,0.35); }
.diff-badge--red   { background: rgba(220,38,38,0.18); color: var(--red-light);   border-color: rgba(220,38,38,0.35); }

/* WordRush game card */
.game-card--rush { border-color: rgba(147,51,234,0.25); }
.game-card--rush:hover { box-shadow: 0 32px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(147,51,234,0.4); border-color: rgba(147,51,234,0.55); }
.play-link--rush { background: linear-gradient(135deg, #9333ea, #0891b2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.wr-tp-wrap { display:flex; flex-direction:column; gap:10px; align-items:center; justify-content:center; }
.wr-tp-word { font-size:1.45rem; font-weight:900; letter-spacing:8px; color:#c084fc; font-family:inherit; }
.wr-tp-word span { color:#22d3ee; }
.wr-tp-timer { display:flex; align-items:center; gap:6px; font-size:0.72rem; color:rgba(255,255,255,0.4); font-weight:600; }

/* Game icon */
.game-icon--wordrush { background: linear-gradient(135deg, #9333ea, #0891b2); box-shadow: 0 6px 20px rgba(147,51,234,0.35); }

/* Over card purple variant */
.over-card--purple { background: rgba(147,51,234,0.1); border: 1.5px solid rgba(147,51,234,0.3); }

/* ── Playing area ─────────────────────────────────────────── */
.wr-playing-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 16px;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* ── Ring timer ───────────────────────────────────────────── */
.wr-ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}
.wr-ring-svg {
  width: 68px;
  height: 68px;
  transform: rotate(-90deg);
}
.wr-ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 4;
}
.wr-ring-fill {
  fill: none;
  stroke: var(--cyan-light);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 131.9;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s;
}
.wr-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Clue card ────────────────────────────────────────────── */
.wr-clue-card {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px 20px;
  text-align: center;
}
.wr-clue-main {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--cyan-light);
  word-break: break-word;
  line-height: 1.2;
  text-transform: uppercase;
}
.wr-clue-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Lives ────────────────────────────────────────────────── */
.wr-lives { display: flex; gap: 10px; }
.wr-heart {
  font-size: 1.5rem;
  color: var(--purple-light);
  transition: color 0.2s, transform 0.2s;
}
.wr-heart--dead {
  color: var(--surface-3);
  transform: scale(0.85);
}

/* ── Input row ────────────────────────────────────────────── */
.wr-input-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.wr-input {
  flex: 1;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  outline: none;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
.wr-input:focus { border-color: var(--cyan-light); }
.wr-input::placeholder { text-transform: none; font-weight: 400; color: var(--text-dim); }

/* ── Feedback ─────────────────────────────────────────────── */
.wr-fb-zone {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wr-feedback {
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
.wr-feedback--show     { opacity: 1; }
.wr-feedback--correct  { color: var(--green-light); }
.wr-feedback--wrong    { color: var(--red-light); }
.wr-feedback--skip     { color: var(--yellow-light); }

/* ── Shake animation ──────────────────────────────────────── */
@keyframes wr-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-7px); }
  40%     { transform: translateX(7px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.wr-shake { animation: wr-shake 0.35s ease; }

/* ── Result stats row ─────────────────────────────────────── */
.wr-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}
.wr-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wr-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--purple-light); }
.wr-stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.wr-stat-div { width: 1px; height: 36px; background: var(--border); }
