:root {
  --bg: #0b1020;
  --bg2: #111a33;
  --card: #17213d;
  --card2: #1d2a4d;
  --line: #2b3a66;
  --text: #eef2ff;
  --muted: #9aa7cc;
  --accent: #7c5cff;
  --accent2: #29d3c2;
  --gold: #f6c945;
  --green: #34d399;
  --red: #f87171;
  --radius: 16px;
}

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

body {
  font-family: 'Noto Sans Georgian', 'Segoe UI', 'Sylfaen', sans-serif;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(41, 211, 194, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, 0.75);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-size: 22px; font-weight: 900; text-decoration: none; color: var(--text); }
.logo span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-header nav { display: flex; gap: 18px; flex: 1; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--text); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box .uname { font-weight: 700; }
.user-box .urating { color: var(--gold); font-weight: 700; font-size: 14px; }

/* ---------- layout ---------- */
#app { max-width: 1060px; margin: 0 auto; padding: 34px 20px 80px; }
.view.hidden, .hidden { display: none !important; }
.page-title { font-size: 32px; font-weight: 900; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 26px; }
.center { text-align: center; }

/* ---------- hero + mode cards ---------- */
.hero { text-align: center; margin: 30px 0 40px; }
.hero h1 {
  font-size: 44px; font-weight: 900;
  background: linear-gradient(90deg, #fff, #b9c5ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 18px; margin-top: 10px; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.mode-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 34px rgba(124, 92, 255, 0.25); }
.mode-icon { font-size: 46px; margin-bottom: 12px; }
.mode-card h2 { font-size: 21px; margin-bottom: 10px; }
.mode-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.mode-card.small { padding: 22px 18px; }
.mode-card.as-form { cursor: default; }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input {
  flex: 1; min-width: 0; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 18px; text-transform: uppercase; text-align: center; letter-spacing: 4px;
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card2); color: var(--text);
  padding: 10px 20px; font-size: 15px; font-weight: 700;
  transition: filter 0.12s, transform 0.12s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #a06bff); border-color: transparent; }
.btn-success { background: linear-gradient(90deg, #10b981, #34d399); border-color: transparent; }
.btn-danger { background: linear-gradient(90deg, #ef4444, #f87171); border-color: transparent; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-lg { padding: 14px 30px; font-size: 17px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-tile {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 14px; text-align: center; color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--accent2); }
.cat-tile .icon { font-size: 38px; }
.cat-tile .name { font-weight: 700; margin-top: 10px; font-size: 15px; }
.cat-tile .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.cat-tile .best { color: var(--gold); font-size: 12px; margin-top: 2px; }

/* ---------- game shared ---------- */
.game-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.chip {
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.chip-score { color: var(--gold); font-size: 18px; }
.round-timer {
  margin-left: auto; font-size: 30px; font-weight: 900; color: var(--accent2);
  min-width: 70px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 10px;
}
.round-timer.low { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.q-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; position: relative;
}
.q-text { font-size: 21px; font-weight: 700; line-height: 1.6; margin-bottom: 22px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .options { grid-template-columns: 1fr; } }
.opt {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 16px; color: var(--text); text-align: left;
  transition: border-color 0.1s, background 0.1s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.correct { background: rgba(52, 211, 153, 0.18); border-color: var(--green); }
.opt.wrong { background: rgba(248, 113, 113, 0.18); border-color: var(--red); }
.opt.picked-you::after { content: ' 👤'; }
.opt.picked-opp::after { content: ' 🤺'; }
.opt.picked-both::after { content: ' 👤🤺'; }
.opt:disabled { cursor: default; }

.result-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center;
}
.result-card h2 { font-size: 30px; margin-bottom: 14px; }
.result-card .big-num { font-size: 56px; font-weight: 900; color: var(--gold); }
.result-card p { color: var(--muted); margin: 10px 0 22px; }
.result-card .btn { margin: 4px; }

.rules-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; max-width: 620px; margin: 0 auto;
}
.rules-card ul { margin: 14px 0 22px 22px; line-height: 2; color: var(--muted); }
.rules-card b { color: var(--text); }

/* ---------- chgk ---------- */
.chgk-scoreboard {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  margin-bottom: 20px; font-size: 18px;
}
.chgk-scoreboard .side { display: flex; align-items: center; gap: 12px; }
.chgk-scoreboard .side span { color: var(--muted); font-size: 14px; }
.chgk-scoreboard .side b { font-size: 34px; }
.chgk-scoreboard .you b { color: var(--accent2); }
.chgk-scoreboard .them b { color: var(--gold); }
.vs { color: var(--muted); font-size: 26px; }
.chgk-qnum { color: var(--muted); font-size: 13px; margin-bottom: 10px; letter-spacing: 1px; }
.chgk-timer-wrap { position: relative; width: 110px; height: 110px; margin: 6px auto 18px; }
.timer-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fg {
  fill: none; stroke: var(--accent2); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 276.5; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.ring-fg.low { stroke: var(--red); }
#chgk-clock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900;
}
.chgk-answer { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 20px; }
.answer-label { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
#chgk-answer-text { font-size: 22px; font-weight: 900; color: var(--green); margin: 8px 0; }
.chgk-comment { color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.verdict-btns { display: flex; gap: 12px; justify-content: center; }

/* ---------- pvp ---------- */
.pvp-menu-wrap { display: flex; flex-direction: column; gap: 22px; }
.pvp-cat-title { font-size: 16px; margin: 0 0 4px; }
.pvp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.pvp-cat-tile {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.pvp-cat-tile:hover { transform: translateY(-2px); border-color: var(--accent2); }
.pvp-cat-tile.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 1px var(--accent2);
}
.pvp-cat-tile .icon { font-size: 26px; }
.pvp-cat-tile .name { font-weight: 700; font-size: 13px; margin-top: 8px; }
.pvp-cat-tile .meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.pvp-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* მეხსიერების 1v1 */
.mem-duel-block {
  margin: 8px 0 28px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card), var(--card2));
}
.mem-duel-heading { font-size: 20px; margin: 0 0 6px; }
.mem-duel { display: flex; flex-direction: column; gap: 12px; }
.mem-duel-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  justify-content: space-between;
}
.mem-duel-vs { font-weight: 800; }
.mem-duel-ex { color: var(--muted); font-size: 14px; }
.mem-duel-status { color: var(--muted); font-size: 13px; flex: 1; min-width: 140px; }
.mem-duel-countdown {
  font-size: 56px; font-weight: 900; text-align: center; color: var(--accent2); padding: 12px 0;
}
.mem-duel-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.mem-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--card);
  min-width: 0;
}
.mem-pane.you { border-color: var(--accent2); }
.mem-pane.opp { opacity: 0.95; border-style: dashed; }
.mem-pane-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.mem-pane-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mem-pane .schulte.mem-compact button { min-height: 40px; font-size: 15px; }
.mem-pane .simon.mem-compact { max-width: 220px; margin: 0 auto; }
.mem-pane .stroop-word { font-size: 28px; margin: 12px 0; }
.mem-pane .grid-mem.mem-compact { max-width: 100%; }
@media (max-width: 800px) {
  .mem-duel-panes { grid-template-columns: 1fr; }
  .mem-pane.opp { order: 2; }
}
.spinner {
  width: 44px; height: 44px; margin: 0 auto 16px;
  border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.room-code {
  font-size: 40px; font-weight: 900; letter-spacing: 10px; color: var(--gold);
  background: var(--bg); border: 1px dashed var(--gold); border-radius: 14px;
  padding: 12px 20px; margin: 14px auto; display: inline-block;
}
.pvp-players { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pvp-player {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px;
}
.pvp-player.you { border-color: var(--accent2); }
.pvp-player span { font-size: 24px; font-weight: 900; color: var(--gold); }
.pvp-mid { color: var(--muted); font-weight: 700; white-space: nowrap; }
.timer-bar { height: 8px; background: var(--card); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
#pvp-timer-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.2s linear;
}
.pvp-countdown { font-size: 64px; font-weight: 900; text-align: center; color: var(--accent2); padding: 40px 0; }
.pvp-status { color: var(--muted); text-align: center; min-height: 24px; font-size: 14px; }
.rating-delta { font-size: 22px; font-weight: 900; }
.rating-delta.up { color: var(--green); }
.rating-delta.down { color: var(--red); }

/* ---------- leaderboard ---------- */
.lb-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.lb-card table { width: 100%; border-collapse: collapse; }
.lb-card th, .lb-card td { padding: 13px 18px; text-align: left; }
.lb-card th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--line); }
.lb-card tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.lb-card td.rank { font-weight: 900; color: var(--gold); width: 60px; }
.lb-card td.rating { font-weight: 700; color: var(--accent2); }
.lb-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 8, 18, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; width: 100%; max-width: 400px; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted); font-size: 18px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-weight: 700;
}
.tab.active { background: var(--accent); border-color: transparent; color: #fff; }
#auth-form label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
#auth-form input {
  display: block; width: 100%; margin-top: 6px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 15px;
}
#auth-form .btn { width: 100%; margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.google-signin { display: flex; justify-content: center; margin: 4px 0 0; }
.google-signin > div { color-scheme: light; }
.auth-or { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0; position: relative; }
.auth-or span { background: var(--card2); padding: 0 12px; position: relative; z-index: 1; }
.auth-or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 22px; font-weight: 700; z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- ვარჯიშის ჰაბი (მეხსიერება / მეტყველება) ---------- */
.evidence-note {
  background: rgba(41, 211, 194, 0.08);
  border: 1px solid rgba(41, 211, 194, 0.3);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 22px;
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.evidence-note b { color: var(--accent2); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.ex-tile {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: left; color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.ex-tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.ex-tile .ex-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ex-tile .ex-icon { font-size: 30px; }
.ex-tile h3 { font-size: 17px; }
.ex-tile p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.ex-tile .ex-best { color: var(--gold); font-size: 12px; font-weight: 700; margin-top: 10px; }
.ex-tile .ex-trains { color: var(--accent2); font-size: 11px; margin-top: 4px; letter-spacing: 0.3px; }

/* ---------- ვარჯიშის სცენა ---------- */
.ex-shell {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.ex-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.ex-head h2 { font-size: 22px; }
.ex-head .ex-back { margin-left: auto; }
.ex-stat {
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.ex-stat b { color: var(--accent2); }
.ex-intro { color: var(--muted); line-height: 1.65; margin-bottom: 20px; }
.ex-center { text-align: center; }
.ex-big { font-size: 52px; font-weight: 900; color: var(--gold); margin: 10px 0; }

/* შულტეს ცხრილი */
.schulte { display: grid; gap: 8px; margin: 0 auto; max-width: 440px; }
.schulte button {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); color: var(--text); font-size: 22px; font-weight: 700;
  transition: background 0.1s, transform 0.05s;
}
.schulte button:hover:not(:disabled) { background: var(--card2); }
.schulte button.hit { background: rgba(52, 211, 153, 0.25); border-color: var(--green); }
.schulte button.miss { background: rgba(248, 113, 113, 0.3); }
.schulte button:disabled { opacity: 0.35; }

/* Simon / თანმიმდევრობა */
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 340px; margin: 10px auto; }
.simon .pad {
  aspect-ratio: 1; border-radius: 16px; border: 2px solid rgba(255,255,255,0.12);
  opacity: 0.55; transition: opacity 0.12s, transform 0.05s; cursor: pointer;
}
.simon .pad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 26px currentColor; }
.simon .pad.p0 { background: #ef4444; color: #ef4444; }
.simon .pad.p1 { background: #34d399; color: #34d399; }
.simon .pad.p2 { background: #f6c945; color: #f6c945; }
.simon .pad.p3 { background: #60a5fa; color: #60a5fa; }

/* ციფრების / სივრცული ბადე */
.grid-mem { display: grid; gap: 8px; margin: 0 auto; max-width: 460px; }
.grid-mem .cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); color: var(--text); font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; transition: background 0.12s;
}
.grid-mem .cell.show { background: var(--accent); border-color: transparent; color: #fff; }
.grid-mem .cell.pickable { cursor: pointer; background: var(--card2); }
.grid-mem .cell.ok { background: rgba(52, 211, 153, 0.3); border-color: var(--green); }
.grid-mem .cell.bad { background: rgba(248, 113, 113, 0.35); border-color: var(--red); }
.nummem-display { font-size: 46px; font-weight: 900; letter-spacing: 8px; color: var(--accent2); text-align: center; margin: 24px 0; min-height: 60px; }
.nummem-input {
  width: 100%; max-width: 320px; margin: 0 auto; display: block;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 26px; text-align: center; letter-spacing: 6px;
}

/* სიტყვების დამახსოვრება */
.wordmem-display {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 24px 0; min-height: 64px; align-items: center;
}
.wordmem-chip {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 18px; font-size: 26px; font-weight: 800; color: var(--accent2);
}
.wordmem-chip.small { font-size: 16px; padding: 6px 12px; color: var(--text); }
.wordmem-bar { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; max-width: 420px; margin: 0 auto 18px; }
.wordmem-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.wordmem-input {
  width: 100%; max-width: 460px; margin: 0 auto 14px; display: block;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 20px; text-align: center;
}
.wordmem-picked { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 34px; margin-bottom: 14px; }
.wordmem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; max-width: 560px; margin: 0 auto; }
.wordmem-opt {
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 10px; font-size: 17px; font-weight: 700; cursor: pointer;
}
.wordmem-opt:hover:not(:disabled) { border-color: var(--accent); }
.wordmem-opt.used { opacity: 0.35; cursor: default; }
.wordmem-review { max-width: 420px; margin: 14px auto; text-align: left; }
.wordmem-row { padding: 8px 14px; border-radius: 10px; margin-bottom: 6px; background: var(--bg2); font-size: 15px; }
.wordmem-row.ok { border-left: 3px solid var(--green); }
.wordmem-row.bad { border-left: 3px solid var(--red); color: var(--muted); }

/* Stroop */
.stroop-word { font-size: 60px; font-weight: 900; text-align: center; margin: 30px 0; }
.stroop-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }

/* N-back */
.nback-cue {
  font-size: 90px; font-weight: 900; text-align: center; margin: 20px auto;
  width: 160px; height: 160px; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; color: var(--accent2);
}

/* მეტყველება: ენის გასატეხი */
.twister-card { text-align: center; }
.twister-text { font-size: 30px; font-weight: 800; line-height: 1.5; margin: 20px 0; }
.twister-focus { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.rep-dots { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.rep-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent2); }
.rep-dots span.done { background: var(--accent2); }

/* fluency / სიტყვების ნაკადი */
.fluency-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; min-height: 40px; }
.fluency-tag { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.fluency-tag.dup { border-color: var(--red); color: var(--red); }

/* ანაგრამა */
.anagram-letters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0; }
.anagram-letters .glyph {
  width: 52px; height: 60px; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  font-size: 30px; font-weight: 800; color: var(--gold);
}
.big-input {
  width: 100%; max-width: 340px; margin: 6px auto; display: block;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px; font-size: 22px; text-align: center;
}

/* ლიტერატურული მოზაიკა */
.lit-theme {
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--accent2);
  margin: 8px 0 4px;
  min-height: 1.4em;
}
.lit-cloud {
  position: relative;
  min-height: 150px;
  margin: 10px 0 16px;
  padding: 18px 12px;
  border-radius: var(--radius);
  background:
    radial-gradient(500px 180px at 20% 20%, rgba(246, 201, 69, 0.08), transparent 60%),
    radial-gradient(400px 160px at 80% 70%, rgba(124, 92, 255, 0.1), transparent 55%),
    var(--card);
  border: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.lit-word {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(23, 33, 61, 0.9);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0deg));
  animation: litFloat 4.5s ease-in-out infinite;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
@keyframes litFloat {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
.lit-area {
  width: 100%;
  max-width: 640px;
  margin: 8px auto;
  display: block;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
}
.lit-results { max-width: 720px; margin: 18px auto 0; }
.lit-review h3 { margin: 0 0 8px; font-size: 20px; }
.lit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 0;
}
.lit-list li {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.55;
  font-size: 15px;
}
.lit-list.examples li {
  border-color: rgba(246, 201, 69, 0.35);
  background: rgba(246, 201, 69, 0.06);
}
.lit-words-used {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
  justify-content: center;
}
.lit-word-tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.lit-word-tag.used {
  color: var(--text);
  border-color: var(--accent2);
  background: rgba(41, 211, 194, 0.12);
}

/* გამოცდის შედეგები და მიმოხილვა */
.exam-cats { max-width: 360px; margin: 18px auto; text-align: left; }
.exam-cat-row { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.exam-cat-row b { color: var(--accent2); }
.review-item {
  text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-left-width: 4px; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.review-item.good { border-left-color: var(--green); }
.review-item.bad { border-left-color: var(--red); }
.review-q { font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.review-line { color: var(--muted); font-size: 14px; margin-top: 2px; }
.review-line.correct-line { color: var(--green); }
.review-exp { color: var(--muted); font-size: 13px; margin-top: 8px; font-style: italic; border-top: 1px dashed var(--line); padding-top: 8px; }

/* row of controls */
.ex-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.seg { display: inline-flex; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button { border: none; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 700; }
.seg button.active { background: var(--accent); color: #fff; }

/* ---------- მატრიცული ამოცანები (Raven-ის ტიპი) ---------- */
.mx-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.mx-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; width: fit-content;
}
.mx-cell {
  width: 90px; height: 90px; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border-radius: 8px; color: var(--text);
}
.mx-cell.mx-missing {
  background: rgba(124, 92, 255, 0.12); border: 2px dashed var(--accent);
  font-size: 38px; font-weight: 900; color: var(--accent);
}
.mx-svg { display: block; }

.mx-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 420px; }
.mx-opt {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); cursor: pointer; position: relative;
  transition: border-color 0.12s, transform 0.06s, background 0.12s;
}
.mx-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--card2); }
.mx-opt:active { transform: scale(0.97); }
.mx-opt .mx-num {
  position: absolute; top: 3px; left: 6px; font-size: 11px; color: var(--muted); font-weight: 700;
}
.mx-opt.correct { border-color: var(--green); background: rgba(52, 211, 153, 0.16); }
.mx-opt.wrong { border-color: var(--red); background: rgba(248, 113, 113, 0.16); }
.mx-opt:disabled { cursor: default; }
.mx-hint { color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .mx-cell { width: 68px; height: 68px; }
  .mx-cell.mx-missing { font-size: 28px; }
  .mx-options { grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 100%; }
}

/* ---------- სუპერ-ტვინი (ბლიცი + პროტოკოლი) ---------- */
.mode-card.featured {
  border-color: var(--accent);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(41, 211, 194, 0.16), transparent 70%),
    var(--card);
  box-shadow: 0 10px 34px rgba(124, 92, 255, 0.18);
}

.tb-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tb-sum {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.tb-sum b { display: block; font-size: 34px; font-weight: 900; color: var(--gold); }
.tb-sum span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.tb-sum i { display: block; color: var(--accent2); font-size: 12px; font-style: normal; margin-top: 6px; }

.tb-plantitle { font-size: 20px; margin: 32px 0 14px; }
.tb-plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tb-planrow { display: grid; grid-template-columns: 70px 200px 1fr; gap: 12px; padding: 12px 18px; align-items: baseline; }
.tb-planrow:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.tb-planmin { color: var(--gold); font-weight: 800; font-size: 13px; }
.tb-planrow b { font-size: 15px; }
.tb-planrow i { color: var(--muted); font-size: 13px; font-style: normal; line-height: 1.5; }

.tb-tips {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 18px 40px; color: var(--muted); line-height: 1.75;
}
.tb-tips li { margin-bottom: 8px; }
.tb-tips li:last-child { margin-bottom: 0; }

/* ბლოკის თავსართი */
.tb-blockhead { margin-bottom: 12px; }
.tb-blocknum { color: var(--accent2); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.tb-blockhead h2 { font-size: 24px; margin: 6px 0; }
.tb-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
.tb-progress { height: 6px; background: var(--card); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.tb-progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.4s; }
.tb-blockctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tb-blockleft { font-size: 22px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.tb-blockctrl .btn { margin-left: auto; }
.tb-blockctrl .btn + .btn { margin-left: 0; }
.tb-host { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* ბლიცის ეკრანი */
.tb-hud { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.tb-chip {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; font-size: 13px; color: var(--muted);
}
.tb-chip b { color: var(--accent2); font-size: 15px; font-variant-numeric: tabular-nums; }
.tb-bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.tb-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); }
.tb-kind { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin: 10px 0 4px; }
.tb-prompt {
  min-height: 170px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 10px;
}
.tb-big { font-size: 58px; font-weight: 900; line-height: 1.15; color: var(--text); }
.tb-big.tb-arrows { letter-spacing: 4px; font-size: 46px; }
.tb-big.tb-rot { display: inline-block; }
.tb-sub { color: var(--muted); font-size: 15px; margin-top: 10px; }
.tb-compare { display: flex; align-items: center; justify-content: center; gap: 18px; }
.tb-compare .tb-big { font-size: 40px; }
.tb-vs { color: var(--muted); font-size: 18px; }
.tb-dots { position: relative; width: 260px; height: 160px; background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); }
.tb-dots span { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--accent2); }
.tb-answers { display: grid; gap: 12px; margin-top: 10px; }
.tb-answers.n1 { grid-template-columns: 1fr; max-width: 280px; margin-inline: auto; }
.tb-answers.n2 { grid-template-columns: 1fr 1fr; }
.tb-answers.n3 { grid-template-columns: repeat(3, 1fr); }
.tb-answers.n4 { grid-template-columns: repeat(4, 1fr); }
.tb-ans {
  background: var(--card2); color: var(--text); border: 2px solid var(--line);
  border-radius: 14px; padding: 20px 10px; font-size: 20px; font-weight: 800;
  /* დიდი სამიზნე — აცდენილი დაჭერა რეაქციის დროს ამახინჯებს */
  min-height: 76px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tb-ans:hover:not(:disabled) { border-color: var(--accent); }
.tb-ans.ok { background: rgba(52, 211, 153, 0.25); border-color: var(--green); }
.tb-ans.bad { background: rgba(248, 113, 113, 0.25); border-color: var(--red); }
.tb-ans:disabled { cursor: default; }

/* შედეგი */
.tb-result { text-align: center; padding: 10px 0; }
.tb-tsi-label { color: var(--muted); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.tb-tsi { font-size: 76px; font-weight: 900; color: var(--gold); line-height: 1.1; }
.tb-rank { font-size: 20px; font-weight: 800; color: var(--accent2); margin-bottom: 18px; }
.tb-rec { color: var(--green); font-weight: 700; margin: 12px 0; }
.tb-warn { color: var(--gold); font-size: 13px; line-height: 1.6; max-width: 520px; margin: 12px auto 0; }
.tb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; max-width: 560px; margin: 0 auto; }
.tb-stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; }
.tb-stat b { display: block; font-size: 20px; font-weight: 900; }
.tb-stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tb-rest { text-align: center; padding: 30px 0; }

@media (max-width: 640px) {
  .tb-planrow { grid-template-columns: 60px 1fr; }
  .tb-planrow i { grid-column: 2; }
  .tb-big { font-size: 42px; }
  .tb-compare .tb-big { font-size: 30px; }
  .tb-answers.n4 { grid-template-columns: 1fr 1fr; }
  .tb-ans { padding: 16px 8px; font-size: 17px; min-height: 72px; }
  .tb-tsi { font-size: 58px; }
  .tb-host { padding: 16px 12px; }
}

/* ---------- ჩაძირობანა ---------- */
.ship-wrap { display: flex; flex-direction: column; gap: 14px; }
.ship-mode-pick {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 8px;
  grid-column: 1 / -1; width: 100%;
}
#ship-mode-hint { grid-column: 1 / -1; text-align: center; margin: 0 0 4px; }
.ship-mode-btn {
  flex: 1; max-width: 200px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
}
.ship-mode-btn.active {
  color: var(--text);
  border-color: var(--accent2);
  background: rgba(41, 211, 194, 0.12);
  box-shadow: 0 0 0 1px rgba(41, 211, 194, 0.35);
}
.ship-mode-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.18);
  color: var(--accent2);
  font-weight: 800;
  font-size: 13px;
}
.ship-roster {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.ship-roster-team { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ship-roster-label { color: var(--muted); font-size: 12px; margin-right: 4px; }
.ship-roster-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  background: var(--card2);
}
.ship-roster-pill.you { border-color: var(--accent2); }
.ship-roster-pill.ally { border-color: #5b8def; }
.ship-roster-pill.enemy { border-color: #e85d4c; }
.ship-roster-pill.dead { opacity: 0.45; text-decoration: line-through; }
.ship-panes-2v2 { display: flex; flex-direction: column; gap: 14px; }
.ship-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ship-target-tabs {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.ship-target-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
}
.ship-target-tab.active {
  color: var(--text);
  border-color: #e85d4c;
  background: rgba(232, 93, 76, 0.15);
}
.ship-target-tab.dead { opacity: 0.4; }
.ship-row.enemies .mem-pane { opacity: 0.72; transition: opacity .2s, box-shadow .2s; }
.ship-row.enemies .mem-pane.targeted {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.45);
  border-radius: 12px;
}
.ship-row.enemies .mem-pane.dead { opacity: 0.35; filter: grayscale(0.6); }
.ship-board {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.ship-panes-2v2 .ship-board { max-width: 280px; }
.ship-cell {
  border: 1px solid rgba(100, 140, 180, 0.35);
  border-radius: 4px;
  background: #0c3a52;
  min-width: 0;
  min-height: 0;
  padding: 0;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.ship-cell.fog {
  background:
    repeating-linear-gradient(-45deg, #0a2f44, #0a2f44 4px, #0d3a52 4px, #0d3a52 8px);
  cursor: not-allowed;
}
.ship-cell.fog.armed {
  cursor: crosshair;
  background: #0e4a66;
}
.ship-cell.fog.armed:hover { background: #15607f; }
.ship-cell.ship {
  background: linear-gradient(180deg, #5a7a8c, #3d5a6c);
  box-shadow: inset 0 0 0 2px #8ab4c8;
}
.ship-cell.miss {
  background: #1a3344;
}
.ship-cell.miss::after {
  content: '·';
  color: #7ec8e3;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.ship-cell.hit {
  background: #7a1f1f;
}
.ship-cell.hit::after {
  content: '✕';
  color: #ffb4a8;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 14px;
}
.ship-cell.sunk {
  background: #2a0a0a;
  box-shadow: inset 0 0 0 2px #e85d4c;
}
.ship-cell.sunk::after {
  content: '☠';
  color: #ff8f7a;
  font-size: 12px;
}
.ship-cell.sinking {
  animation: shipSink 1.1s ease-in forwards;
}
@keyframes shipSink {
  0% { transform: translateY(0) scale(1); filter: brightness(1.4); }
  40% { transform: translateY(2px) rotate(-2deg); filter: brightness(1.1); }
  100% {
    transform: translateY(10px) scale(0.85);
    filter: brightness(0.55) saturate(0.7);
    opacity: 0.85;
  }
}
.ship-cell.boom::before {
  content: '';
  position: absolute;
  inset: -35%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff6a8 0%, #ffd166 18%, #ff6b35 42%, rgba(255, 40, 0, 0.35) 60%, transparent 72%);
  animation: shipBoom 0.85s cubic-bezier(.15,.85,.25,1) forwards;
  pointer-events: none;
  z-index: 2;
}
.ship-cell.boom::after {
  content: '';
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  box-shadow: 0 0 18px 6px rgba(255, 140, 60, 0.65);
  animation: shipFlash 0.45s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes shipBoom {
  0% { transform: scale(0.15); opacity: 1; }
  55% { transform: scale(1.35); opacity: 0.95; }
  100% { transform: scale(2.1); opacity: 0; }
}
@keyframes shipFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.ship-cell.splash::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 2px solid rgba(126, 200, 227, 0.8);
  animation: shipSplash 0.45s ease-out forwards;
  pointer-events: none;
}
@keyframes shipSplash {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.ship-particle {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  animation: shipParticle 0.75s ease-out forwards;
  background: #ffb347;
}
.ship-particle.sink { background: #7ec8e3; width: 4px; height: 4px; }
.ship-particle.fire { box-shadow: 0 0 6px #ff6b35; }
@keyframes shipParticle {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.ship-fog-preview {
  min-height: 180px;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(-45deg, #0a2f44, #0a2f44 6px, #0d3a52 6px, #0d3a52 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(100, 140, 180, 0.4);
}
.ship-fog-msg {
  color: var(--muted);
  text-align: center;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.5;
  padding: 16px;
}
.ship-place-ctrl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.ship-reveal {
  max-width: 280px;
  margin: 12px auto;
  opacity: 0.9;
}
.ship-reveal-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.ship-reveal-row .ship-reveal { max-width: 200px; }
@media (max-width: 800px) {
  .ship-board { max-width: 100%; }
  .ship-panes-2v2 .ship-board { max-width: 100%; }
  .ship-row { grid-template-columns: 1fr; }
}

/* ---------- ვინ ვარ მე? ---------- */
.who-wrap { display: flex; flex-direction: column; gap: 14px; }
.who-heading { font-size: 22px; margin: 0; }
.who-status { color: var(--muted); font-size: 14px; }
.who-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.who-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  justify-content: center;
}
button.who-card:hover:not(:disabled) {
  border-color: var(--accent2);
  background: var(--card2);
  transform: translateY(-1px);
}
button.who-card:disabled { opacity: 0.55; cursor: default; }
button.who-card.selected {
  opacity: 1;
  border-color: var(--accent2);
  box-shadow: inset 0 0 0 1px var(--accent2);
  background: rgba(41, 211, 194, 0.12);
}
.who-card-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.who-card-hint { color: var(--muted); font-size: 12px; }
.who-mystery {
  background:
    repeating-linear-gradient(-45deg, var(--card), var(--card) 6px, var(--card2) 6px, var(--card2) 12px);
  border-style: dashed;
  min-height: 110px;
  margin-bottom: 10px;
}
.who-mystery-mark {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold);
}
.who-opp-card {
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.18), var(--card));
  border-color: rgba(124, 92, 255, 0.45);
  min-height: 100px;
  margin-bottom: 14px;
}
.who-opp-card .who-card-name { font-size: 18px; }
.who-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.who-pane {
  background: rgba(23, 33, 61, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.who-pane-title { font-size: 18px; margin: 0; }
.who-log {
  background: rgba(11, 16, 32, 0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
}
.who-log-empty { color: var(--muted); font-size: 13px; margin: 0; }
.who-log-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(43, 58, 102, 0.5);
}
.who-log-row:last-child { border-bottom: none; }
.who-log-q { flex: 1; min-width: 0; word-break: break-word; }
.who-log-a { font-weight: 800; flex-shrink: 0; }
.who-log-a.yes { color: var(--green); }
.who-log-a.no { color: var(--red); }
.who-log-a.pending { color: var(--muted); }
.who-log-a.wrong { color: var(--gold); }
.who-ask-bar, .who-guess-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.who-ask-input, .who-guess-select {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.who-answer-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(246, 201, 69, 0.08);
  border: 1px solid rgba(246, 201, 69, 0.35);
}
.who-incoming-text { margin: 0; font-weight: 700; font-size: 16px; }
.who-answer-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 800px) {
  .who-panes { grid-template-columns: 1fr; }
  .who-people-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ---------- არენა (Arcade) ---------- */
.arc-acc { display: flex; flex-direction: column; gap: 10px; }
.arc-acc-item {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.arc-acc-item.open { border-color: var(--accent); box-shadow: 0 8px 28px rgba(124, 92, 255, 0.18); }
.arc-acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.arc-acc-head:hover { background: rgba(124, 92, 255, 0.08); }
.arc-acc-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.arc-acc-title { flex: 1; font-size: 17px; font-weight: 800; }
.arc-acc-chevron {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.18s ease;
}
.arc-acc-item.open .arc-acc-chevron { transform: rotate(180deg); color: var(--accent2); }
.arc-acc-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}
.arc-acc-item.open .arc-acc-body { display: block; }
.arc-acc-blurb { color: var(--muted); font-size: 14px; margin: 14px 0 16px; line-height: 1.5; }

.arc-lobby-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.arc-lobby-actions .mode-card.small { padding: 16px 14px; }
.arc-lobby-actions .mode-icon { font-size: 32px; margin-bottom: 8px; }
.arc-lobby-actions h2 { font-size: 16px; margin-bottom: 6px; }

#arc-game {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* XO */
.arc-xo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(320px, 100%);
}
.arc-xo button {
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 36px;
  font-weight: 900;
  transition: border-color 0.15s, background 0.15s;
}
.arc-xo button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.12);
}
.arc-xo button:disabled { cursor: default; opacity: 0.95; }

/* Connect 4 */
.arc-c4 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: min(420px, 100%);
  padding: 12px;
  background: rgba(41, 211, 194, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.arc-c4 button {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg);
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.arc-c4 button:hover:not(:disabled) { transform: scale(1.06); border-color: var(--accent2); }
.arc-c4 button.p0 { background: var(--accent); border-color: #a894ff; }
.arc-c4 button.p1 { background: var(--gold); border-color: #ffe08a; }
.arc-c4 button:disabled { cursor: default; }

/* RPS */
.arc-rps-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.arc-rps-row button {
  min-width: 96px;
  padding: 16px 18px;
  font-size: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s;
}
.arc-rps-row button:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.arc-rps-row button.picked { border-color: var(--accent2); box-shadow: 0 0 0 2px rgba(41, 211, 194, 0.25); }

/* Reaction pad */
.arc-react-pad {
  width: min(280px, 80vw);
  aspect-ratio: 1;
  border: none;
  border-radius: 24px;
  background: var(--red);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 12px 40px rgba(248, 113, 113, 0.35);
  transition: background 0.12s, box-shadow 0.12s, transform 0.1s;
  user-select: none;
}
.arc-react-pad.ready {
  background: var(--green);
  box-shadow: 0 12px 40px rgba(52, 211, 153, 0.4);
}
.arc-react-pad:active { transform: scale(0.97); }

/* Higher/lower card */
.arc-card {
  width: min(140px, 36vw);
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #fff, #e8ecff);
  color: #1a2240;
  border-radius: 14px;
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Dots & boxes */
.arc-dots {
  display: inline-grid;
  gap: 0;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.arc-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.arc-dots .hline, .arc-dots .vline {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.arc-dots .hline { height: 10px; min-width: 36px; }
.arc-dots .vline { width: 10px; min-height: 36px; }
.arc-dots .hline:hover:not(:disabled),
.arc-dots .vline:hover:not(:disabled) { background: rgba(124, 92, 255, 0.35); }
.arc-dots .hline.taken, .arc-dots .vline.taken { background: var(--accent2); cursor: default; }
.arc-dots .hline.p0, .arc-dots .vline.p0 { background: var(--accent); }
.arc-dots .hline.p1, .arc-dots .vline.p1 { background: var(--gold); }
.arc-dots .box {
  min-width: 36px;
  min-height: 36px;
  border-radius: 4px;
}
.arc-dots .box.p0 { background: rgba(124, 92, 255, 0.45); }
.arc-dots .box.p1 { background: rgba(246, 201, 69, 0.45); }

/* Pig dice */
.arc-pig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: min(360px, 100%);
}
.arc-pig .die {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--gold);
}
.arc-pig .arc-pig-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  text-align: center;
}
.arc-pig .arc-pig-scores b { display: block; font-size: 28px; color: var(--accent2); }
.arc-pig .arc-pig-scores span { color: var(--muted); font-size: 13px; }
.arc-pig .arc-pig-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- მობილური ადაპტაცია ---------- */
/* გვერდის დონეზე ჰორიზონტალური სქროლის აღკვეთა (clip არ არღვევს sticky header-ს) */
body { overflow-x: clip; }

@media (max-width: 640px) {
  .arc-xo { width: min(280px, 100%); }
  .arc-xo button { font-size: 28px; }
  .arc-c4 { gap: 4px; padding: 8px; }
  .arc-react-pad { width: min(240px, 78vw); font-size: 18px; }
  .arc-card { font-size: 34px; }

  /* header — logged-in მდგომარეობაში აღარ სცდება ეკრანს: ნავიგაცია მეორე რიგში ჩამოდის */
  .site-header { flex-wrap: wrap; padding: 10px 14px; gap: 8px 12px; }
  .logo { font-size: 19px; }
  .site-header nav {
    order: 3; flex: 0 0 100%; justify-content: center; gap: 22px;
    border-top: 1px solid var(--line); padding-top: 8px;
  }
  .user-box { gap: 8px; margin-left: auto; }
  .user-box .uname { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-box .btn { padding: 8px 12px; font-size: 13px; }

  #app { padding: 22px 14px 60px; }
  .page-title { font-size: 26px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 16px; }

  .ex-shell { padding: 18px 14px; }
  .ex-head h2 { font-size: 19px; }
  .q-card { padding: 20px 16px; }
  .q-text { font-size: 18px; }

  /* ლიდერბორდი — ვიწრო ეკრანზე კარტის შიგნით გადახვევადი და კომპაქტური */
  .lb-card { overflow-x: auto; }
  .lb-card th, .lb-card td { padding: 10px 10px; font-size: 13px; }
  .lb-card td.rank { width: 40px; }
}
