/* napijatekok.hu — "glass game board" design. Game-specific styles live in css/games/<key>.css */

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/unbounded-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/unbounded-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("../fonts/figtree-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("../fonts/figtree-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Game colours (each page also sets --game from the registry) */
  --c-queens: #7b5cff;
  --c-zip: #ff7a3d;
  --c-tango: #ffb400;
  --c-sudoku: #12b5a2;
  --c-wend: #2f86ff;
  --c-cross: #ff4d7e;

  --base: #eeedff;           /* lilac mist */
  --text: #1c1847;           /* deep indigo ink */
  --muted: #5f5b8c;
  --line: rgba(60, 50, 140, .13);
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 18px 40px -18px rgba(48, 34, 140, .35), 0 2px 6px rgba(48, 34, 140, .06);
  --surface: #ffffff;                       /* solid: board cells, chips */
  --surface-2: rgba(92, 80, 200, .08);      /* subtle tinted fills, hovers */
  --field: rgba(255, 255, 255, .72);        /* form inputs on glass */
  --accent: #5b47f5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 71, 245, .12);
  --good: #0f9f6e;
  --good-soft: rgba(15, 159, 110, .14);
  --warn: #e0620b;
  --warn-soft: rgba(224, 98, 11, .13);
  --danger: #e0294f;
  --gold: #c98a00;
  --r-panel: 28px;
  --r-tile: 22px;
  --r-inset: 14px;
  --game: var(--accent);
  --display: "Unbounded", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --blob-opacity: .55;
  /* Aliases kept for game stylesheets */
  --bg: var(--base);
  --radius: var(--r-panel);
  --radius-sm: var(--r-inset);
  --shadow: var(--glass-shadow);
  --board-ink: #1c1847;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --base: #14123a;
    --text: #f2f0ff;
    --muted: #a9a5d6;
    --line: rgba(255, 255, 255, .1);
    --glass: rgba(34, 30, 84, .52);
    --glass-strong: rgba(40, 36, 96, .82);
    --glass-edge: rgba(255, 255, 255, .14);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
    --surface: #26235f;
    --surface-2: rgba(255, 255, 255, .07);
    --field: rgba(255, 255, 255, .07);
    --accent: #8d7dff;
    --accent-ink: #ffffff;
    --accent-soft: rgba(141, 125, 255, .18);
    --good: #3fd69a;
    --good-soft: rgba(63, 214, 154, .15);
    --warn: #ff9a4d;
    --warn-soft: rgba(255, 154, 77, .15);
    --danger: #ff6b8a;
    --gold: #ffcf5a;
    --blob-opacity: .42;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Aurora background: the five game colours drifting behind the glass ------ */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(70px); opacity: var(--blob-opacity); will-change: transform;
  animation: drift 38s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--c-queens); top: -14vmax; left: -10vmax; }
.aurora span:nth-child(2) { background: var(--c-zip); top: 8vmax; right: -16vmax; animation-duration: 44s; animation-delay: -12s; }
.aurora span:nth-child(3) { background: var(--c-tango); bottom: -20vmax; left: 18vmax; width: 38vmax; height: 38vmax; animation-duration: 52s; animation-delay: -20s; opacity: calc(var(--blob-opacity) * .8); }
.aurora span:nth-child(4) { background: var(--c-sudoku); bottom: -12vmax; right: 6vmax; width: 34vmax; height: 34vmax; animation-duration: 47s; animation-delay: -5s; }
.aurora span:nth-child(5) { background: var(--c-wend); top: 30vh; left: 30vw; width: 30vmax; height: 30vmax; animation-duration: 58s; animation-delay: -30s; opacity: calc(var(--blob-opacity) * .7); }
/* On a game page the game's own colour takes over the light. */
.aurora.themed span:nth-child(1), .aurora.themed span:nth-child(4) { background: var(--game); }
.aurora::after {
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* --- Typography ------------------------------------------------------------------ */
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
h1 { font-family: var(--display); font-weight: 750; font-size: clamp(1.7rem, 4.6vw, 2.6rem); letter-spacing: -0.03em; }
h2 { font-family: var(--display); font-weight: 650; font-size: 1.12rem; letter-spacing: -0.01em; }
h3 { font-weight: 750; font-size: 1.02rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.display { font-family: var(--display); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* --- Glass ---------------------------------------------------------------------------- */
.glass, .card, .header-inner, .dropdown, .tabs, .suggest-list, #toast, .stat, .play-main {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .header-inner, .dropdown, .tabs, .suggest-list, .stat, .play-main { background: var(--glass-strong); }
}

/* --- Header / footer ------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 20; padding: 12px 16px 0; }
.header-inner { max-width: 1160px; margin: 0 auto; padding: 8px 10px 8px 16px; display: flex; align-items: center; gap: 14px; border-radius: 999px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.02rem; letter-spacing: -0.03em; }
.logo-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 28px; height: 28px; transform: rotate(-8deg); transition: transform .3s; }
.logo:hover .logo-mark { transform: rotate(8deg) scale(1.06); }
.logo-mark span { border-radius: 4px 4px 4px 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.logo small { font-family: var(--body); font-weight: 700; color: var(--muted); letter-spacing: 0; }
.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a, .user-menu summary {
  color: var(--text); text-decoration: none; font-weight: 650; font-size: .93rem;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: background .15s;
}
.main-nav a:hover { background: var(--surface-2); }
.main-nav a.active { background: var(--text); color: var(--base); }
.user-area { display: flex; align-items: center; gap: 6px; }
.badge-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; margin-left: 5px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] summary, .user-menu summary:hover { background: var(--surface-2); }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 6px; border-radius: 20px; background: var(--glass-strong); }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 14px; border-radius: 14px; color: var(--text); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
@media (max-width: 760px) {
  .site-header { padding: 8px 10px 0; }
  .header-inner { flex-wrap: wrap; gap: 6px; border-radius: 26px; padding: 8px 8px 6px 14px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex: none; scrollbar-width: none; }
  .main-nav a { white-space: nowrap; padding: 7px 12px; }
  .user-area { margin-left: auto; }
  .user-menu summary .user-name { display: none; }
}

main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 30px 16px 64px; }
.site-footer { color: var(--muted); font-size: .875rem; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 22px 16px 28px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.footer-inner a { color: var(--muted); }

/* --- Building blocks ----------------------------------------------------------------- */
.card { border-radius: var(--r-panel); padding: 24px; }
.card + .card { margin-top: 16px; }
.grid > .card, .game-grid > .card { margin-top: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-tight { padding: 18px; border-radius: var(--r-tile); }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Candy-glass buttons */
.btn {
  --btn: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 750; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 11px 20px; border-radius: 999px; border: 1px solid var(--glass-edge);
  background: var(--glass-strong); color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 16px -10px rgba(40, 30, 120, .4);
  transition: transform .12s, box-shadow .15s, filter .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 22px -12px rgba(40, 30, 120, .45); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary, .btn-game {
  color: #fff; border-color: transparent;
  background: linear-gradient(160deg, color-mix(in srgb, var(--btn) 75%, white) 0%, var(--btn) 55%, color-mix(in srgb, var(--btn) 82%, black) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -2px 0 rgba(0, 0, 0, .12) inset, 0 10px 24px -10px color-mix(in srgb, var(--btn) 75%, transparent);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
}
.btn-primary { --btn: var(--accent); }
.btn-game { --btn: var(--game); }
.btn-primary:hover, .btn-game:hover { filter: brightness(1.06) saturate(1.1); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -2px 0 rgba(0, 0, 0, .12) inset, 0 14px 28px -10px color-mix(in srgb, var(--btn) 80%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass-strong); color: var(--text); cursor: pointer; text-decoration: none; font-size: 1.15rem; font-weight: 700; transition: transform .12s; }
.icon-btn:hover { transform: scale(1.06); }
.icon-btn[aria-disabled="true"] { opacity: .3; pointer-events: none; }

.form-field { margin-bottom: 16px; }
label, .label { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 7px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: var(--r-inset); padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 96px; resize: vertical; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.help { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.field-error { font-size: .82rem; color: var(--danger); margin-top: 5px; font-weight: 650; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 550; font-size: .93rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.alert { padding: 13px 18px; border-radius: 18px; margin-bottom: 18px; font-weight: 650; border: 1px solid var(--glass-edge); background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.alert-success { box-shadow: inset 4px 0 0 var(--good); }
.alert-error { box-shadow: inset 4px 0 0 var(--danger); }
.alert-info { box-shadow: inset 4px 0 0 var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 750; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: #fff; font-weight: 800; font-size: .8rem; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.avatar-lg { width: 84px; height: 84px; border-radius: 28px; font-family: var(--display); font-size: 1.8rem; transform: rotate(-4deg); }

/* Segmented control */
.tabs { display: flex; gap: 3px; padding: 4px; border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); text-decoration: none; border: 0; background: none; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .active, .tabs .active:hover { background: var(--text); color: var(--base); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: .93rem; }

/* Leaderboard */
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb li { display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 6px; border-radius: 14px; }
.lb li:nth-child(odd) { background: var(--surface-2); }
.lb .rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; font-family: var(--display); font-weight: 700; font-size: .78rem; color: var(--muted); }
.lb li:nth-child(-n+3) .rank { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 8px -3px rgba(0, 0, 0, .3); }
.lb li:nth-child(1) .rank { background: radial-gradient(circle at 35% 30%, #ffe48a, #f2b200 60%, #c98a00); }
.lb li:nth-child(2) .rank { background: radial-gradient(circle at 35% 30%, #f2f4fa, #b7bfd2 60%, #8b94ab); }
.lb li:nth-child(3) .rank { background: radial-gradient(circle at 35% 30%, #ffc79a, #db8a4c 60%, #ad6331); }
.lb .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text); text-decoration: none; }
.lb .who:hover { text-decoration: underline; }
.lb .time { font-family: var(--display); font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.lb li.me { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }

/* --- Home ----------------------------------------------------------------------------- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 28px; margin: 6px 0 32px; }
.hero-day { font-family: var(--display); font-weight: 850; font-size: clamp(2.8rem, 10vw, 5.6rem); line-height: .9; letter-spacing: -0.055em; margin: 0; }
.hero-date { font-family: var(--display); font-weight: 500; font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--muted); margin: 12px 0 0; letter-spacing: -0.01em; }
.hero-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-weight: 700; font-size: .92rem; }
.hero-progress .dots { display: flex; gap: 7px; }
.hero-progress .dot { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 2.5px var(--g); }
.hero-progress .dot.done { background: var(--g); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 10px -4px var(--g); transform: rotate(-10deg); }
.streak { display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px 12px 14px; border-radius: 24px; }
.streak .flame { font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(255, 120, 40, .45)); }
.streak b { display: block; font-family: var(--display); font-size: 1.55rem; line-height: 1; letter-spacing: -0.03em; }
.streak small { font-size: .82rem; color: var(--muted); font-weight: 650; }

.game-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.game-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px 14px 16px;
  border-radius: var(--r-panel); overflow: hidden; isolation: isolate; margin: 0;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.3);
}
.game-card::before {  /* colour glow behind the glass */
  content: ""; position: absolute; z-index: -1; width: 160%; height: 80%; left: -30%; top: -30%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--game) 40%, transparent), transparent);
  opacity: .8; transition: opacity .3s;
}
.game-card:hover { transform: translateY(-5px) rotate(-.5deg); }
.game-card:hover .art .mini, .game-card:hover .art .mini-svg { transform: rotate(-2deg) scale(1.06); }
.game-card .art-wrap { position: relative; }
.game-card .info { padding: 0 4px; }
.game-card .info h2 { font-size: 1.3rem; margin: 0 0 4px; }
.game-card .tagline { color: var(--muted); font-size: .93rem; margin: 0; line-height: 1.4; }
.game-card .status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .84rem; min-height: 26px; padding: 0 4px; }
.game-card .actions { display: flex; gap: 8px; margin-top: auto; }
.game-card .actions .btn { flex: 1; padding: 11px 10px; }
.game-card.soon { filter: saturate(.7); }
.solved-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; font-size: 1.2rem; font-weight: 900; color: #fff;
  background: radial-gradient(circle at 35% 30%, #6ff0b8, #10b981 60%, #08875c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 14px -4px rgba(16, 185, 129, .6);
  transform: rotate(12deg);
}
.soon-badge { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: .78rem; color: #8a1d3d; background: rgba(255, 255, 255, .9); transform: rotate(6deg); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.section-title h2 { margin: 0; font-size: 1.35rem; }

/* --- Game "art": small previews of each board ------------------------------------------ */
.art {
  position: relative; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--game) 88%, white), color-mix(in srgb, var(--game) 78%, black));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -14px 30px rgba(0, 0, 0, .12);
}
.art::after { /* glass sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, 0) 40%);
}
.art .mini { display: grid; gap: 3px; width: 44%; aspect-ratio: 1; transform: rotate(-6deg); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25)); transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.art .mini > i { border-radius: 4px; display: grid; place-items: center; font-style: normal; }
.art svg.mini-svg { width: 50%; overflow: visible; transform: rotate(-6deg); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25)); transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.art-queens .mini { grid-template-columns: repeat(5, 1fr); }
.art-queens .mini i { background: var(--q); }
.art-queens .mini i.k::after { content: ""; width: 64%; height: 64%; background: #1c1847;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7.5l4.5 3.5L12 4l4.5 7L21 7.5 19 18H5L3 7.5zM5 19.5h14V21H5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7.5l4.5 3.5L12 4l4.5 7L21 7.5 19 18H5L3 7.5zM5 19.5h14V21H5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.art-tango .mini { grid-template-columns: repeat(4, 1fr); width: 42%; }
.art-tango .mini i { background: rgba(255, 255, 255, .94); font-size: clamp(.7rem, 2vw, 1rem); }
.art-sudoku .mini { grid-template-columns: repeat(3, 1fr); width: 38%; gap: 4px; }
.art-sudoku .mini i { background: rgba(255, 255, 255, .94); font-family: var(--display); font-weight: 700; color: #0d6e63; font-size: clamp(.8rem, 2.4vw, 1.15rem); }
.art-sudoku .mini i.e { background: rgba(255, 255, 255, .45); }
.art-crossword .mini { grid-template-columns: repeat(5, 1fr); width: 42%; gap: 2px; }
.art-crossword .mini i { background: rgba(255, 255, 255, .95); font-family: var(--display); font-weight: 700; font-size: clamp(.5rem, 1.6vw, .78rem); color: #8a1d3d; }
.art-crossword .mini i.b { background: rgba(60, 10, 30, .55); }

/* --- Play page ---------------------------------------------------------------------------- */
.play-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 22px; }
.play-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.game-icon {
  display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 18px; font-size: 1.55rem;
  background: linear-gradient(150deg, color-mix(in srgb, var(--game) 82%, white), color-mix(in srgb, var(--game) 82%, black));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 22px -10px var(--game);
  transform: rotate(-6deg);
}
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .play-layout { grid-template-columns: 1fr; } }
.play-main { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; padding: 20px 16px 24px; border-radius: 34px; }
.play-bar { width: 100%; max-width: 600px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.date-nav { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.timer {
  font-family: var(--display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  padding: 7px 18px; border-radius: 999px; background: var(--text); color: var(--base); min-width: 108px; text-align: center;
  box-shadow: 0 8px 20px -10px rgba(20, 10, 80, .6);
}
.timer.done { background: linear-gradient(160deg, #3ddc97, #0f9f6e); color: #fff; }
.timer .penalty { font-family: var(--body); font-size: .75rem; font-weight: 800; color: #ffb27a; margin-left: 6px; }
.game-root { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.toolbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.toolbar .btn { padding: 9px 16px; font-size: .9rem; }

.start-screen {
  position: relative; width: 100%; max-width: 600px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 28px; border-radius: var(--r-panel); overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, color-mix(in srgb, var(--game) 26%, transparent), color-mix(in srgb, var(--game) 6%, transparent));
  border: 1px solid var(--glass-edge);
}
.start-screen::before { content: ""; position: absolute; z-index: -1; inset: 15% 20% auto; aspect-ratio: 1; border-radius: 50%; background: var(--game); filter: blur(70px); opacity: .45; }
.start-screen .big-icon { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .25)); animation: bob 3s ease-in-out infinite; }
.start-screen .art { width: min(320px, 70%); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.start-screen h2 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); margin: 0; }
.start-screen p { margin: 0; color: var(--muted); max-width: 380px; font-weight: 550; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 60px; font-weight: 650; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--game); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint-panel { width: 100%; max-width: 600px; padding: 16px 20px; border-radius: var(--r-tile); box-shadow: var(--glass-shadow), inset 4px 0 0 var(--accent); }
.hint-panel.warn { box-shadow: var(--glass-shadow), inset 4px 0 0 var(--danger); }
.hint-panel .hint-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hint-panel p { margin: 6px 0 12px; }

.result-card { position: relative; width: 100%; max-width: 600px; text-align: center; padding: 26px 24px; overflow: hidden; isolation: isolate; }
.result-card::before { content: ""; position: absolute; z-index: -1; inset: -50% 10% auto; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--game) 55%, transparent), transparent); }
.result-card .result-time { font-family: var(--display); font-size: clamp(2.6rem, 9vw, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 14px; animation: pop .5s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.result-card .facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.result-card .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Confetti (play.js / room.js add it on solve) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: fall var(--d, 1.6s) cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 720deg)); opacity: .9; }
}

.share-box { display: flex; gap: 6px; }
.share-box input { font-size: .85rem; padding: 9px 12px; }
.rules { margin: 0; padding-left: 0; list-style: none; color: var(--muted); font-size: .93rem; display: flex; flex-direction: column; gap: 8px; }
.rules li { position: relative; padding-left: 22px; }
.rules li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 3px; background: var(--game); transform: rotate(45deg); }
ol.rules { counter-reset: r; }
ol.rules li { padding-left: 28px; }
ol.rules li::before { counter-increment: r; content: counter(r); width: 20px; height: 20px; left: 0; top: .05em; transform: none; border-radius: 7px; color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.code-chip { font-family: var(--display); font-weight: 600; font-size: .78rem; background: var(--surface-2); border-radius: 8px; padding: 2px 8px; color: var(--text); }

/* Shared board look: games put .board-frame around their grid. */
.board-frame { position: relative; width: min(600px, calc(100vw - 64px)); user-select: none; -webkit-user-select: none; touch-action: none; }
@media (max-width: 560px) {
  .board-frame { width: calc(100vw - 48px); }
  .play-main { padding: 14px 8px 18px; border-radius: 28px; }
  main { padding-top: 22px; }
}
.board-overlay {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 16px; border-radius: 12px; background: #1c1847; color: #fff;
}
.board-overlay .big { font-family: var(--display); font-size: 4rem; font-weight: 800; line-height: 1; }
.solved-shine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%);
  background-size: 250% 100%; animation: shine 1.2s ease-out 1 forwards;
}
@keyframes shine { from { background-position: 120% 0; } to { background-position: -40% 0; } }

/* --- Auth / forms -------------------------------------------------------------------------- */
.auth-wrap { max-width: 440px; margin: 10px auto; }
.auth-wrap .card { padding: 30px; }
.auth-wrap h1 { font-size: 1.8rem; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .93rem; color: var(--muted); }

/* --- Profile ------------------------------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.profile-head h1 { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 16px 18px; border-radius: var(--r-tile); }
.stat .value { font-family: var(--display); font-size: 1.9rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.03em; }
.stat .label { color: var(--muted); font-size: .84rem; font-weight: 650; margin: 4px 0 0; }
.game-stat { position: relative; overflow: hidden; }
.game-stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--game), color-mix(in srgb, var(--game) 30%, transparent)); }
.game-stat dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0 0; font-size: .92rem; }
.game-stat dt { color: var(--muted); }
.game-stat dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }

.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .name { flex: 1; min-width: 0; }
.person .name a { font-weight: 750; color: var(--text); text-decoration: none; }
.person .name small { display: block; color: var(--muted); }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; border-radius: 16px; padding: 4px; background: var(--glass-strong); }
.suggest-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; color: var(--text); border-radius: 12px; cursor: pointer; }
.suggest-list button:hover { background: var(--surface-2); }

/* --- Versus ------------------------------------------------------------------------------------ */
.players { list-style: none; margin: 0; padding: 0; }
.players li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.players li:last-child { border-bottom: 0; }
.players .name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.game-pick { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; cursor: pointer; margin: 0; font-weight: 750; border: 1.5px solid var(--glass-edge); background: var(--glass); transition: transform .15s, border-color .15s, box-shadow .15s; }
.game-pick:hover { transform: translateY(-2px); }
.game-pick:has(input:checked) { border-color: var(--game); box-shadow: 0 0 0 4px color-mix(in srgb, var(--game) 22%, transparent); }
.game-pick input { position: absolute; opacity: 0; pointer-events: none; }
.game-pick .game-icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 13px; }
.winner { text-align: center; }
.winner .trophy { font-size: 4rem; line-height: 1; filter: drop-shadow(0 10px 18px rgba(240, 170, 0, .5)); animation: bob 3s ease-in-out infinite; }
.winner .winner-name { font-family: var(--display); font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -0.04em; }
td.best { color: var(--good); font-weight: 800; }

#toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translateX(-50%) translateY(20px);
  background: var(--glass-strong); color: var(--text); padding: 12px 22px; border-radius: 999px; font-weight: 750;
  opacity: 0; pointer-events: none; transition: all .25s cubic-bezier(.2, .9, .3, 1.3); max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin: 5px 0; }
