@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/golos-text-cyrillic.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/golos-text-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/golos-text-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:500 700;font-display:swap;src:url(/fonts/unbounded-cyrillic.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:500 700;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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:500 700;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}

/* Zehnli arcade */
:root {
  --bg: #f7f4ed; --bg-2: #eeebe3; --surface: #fffdf8; --surface-2: #f4f0e8;
  --ink: #23212b; --ink-2: #4e4956; --muted: #665f6c;
  --line: #e2ded4; --line-2: #d0cabe;
  --tile: #fffefa; --tile-edge: #d8d0c5;
  --danger: #a72726; --danger-soft: #fce3e1;
  --orange: #ff784c; --orange-edge: #cd4927; --orange-ink: #8b2f18;
  --night: #221e2a; --night-line: #433b4b; --night-muted: #c5b9c8; --white: #fff8ef;
  --words: #7951b2; --words-soft: #eee4ff; --words-edge: #5c338e;
  --groups: #bb4e2b; --groups-soft: #ffe5d6; --groups-edge: #8c3016;
  --sudoku: #27735c; --sudoku-soft: #e1f3e7; --sudoku-edge: #23543f; --sudoku-fill: #ffc765;
  --sequence: #8d6419; --sequence-soft: #fff0cb; --sequence-edge: #694600;
  --weekly: #322752; --weekly-soft: #eee6ff; --weekly-edge: #4c357b;
  --band-0: #ffe2a4; --band-1: #c5edd8; --band-2: #ffd3c4; --band-3: #e5d6fa;
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-s: 10px; --r: 16px; --r-l: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --accent: var(--ink); --accent-soft: var(--bg-2); --accent-edge: var(--ink);
  color-scheme: light;
}
.g-words { --accent: var(--words); --accent-soft: var(--words-soft); --accent-edge: var(--words-edge); }
.g-groups { --accent: var(--groups); --accent-soft: var(--groups-soft); --accent-edge: var(--groups-edge); }
.g-sudoku { --accent: var(--sudoku); --accent-soft: var(--sudoku-soft); --accent-edge: var(--sudoku-edge); }
.g-sequence { --accent: var(--sequence); --accent-soft: var(--sequence-soft); --accent-edge: var(--sequence-edge); }
.g-weekly { --accent: var(--weekly); --accent-soft: var(--weekly-soft); --accent-edge: var(--weekly-edge); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.ic { width: 20px; height: 20px; flex: none; }
.mark { width: 24px; height: 24px; flex: none; }
.mark path { fill: var(--sudoku-fill); }
.mark circle { fill: var(--ink); }

/* Shell */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 73px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 10px; text-decoration: none; font: 700 23px/1 var(--display); letter-spacing: -.055em; min-height: 44px; }
.brand .mark { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--orange); }
.brand .mark path { fill: var(--ink); }
.brand .mark circle { fill: var(--orange); }
.nav { display: flex; gap: 8px; }
.nav-a { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .18s, color .18s; }
.nav-a .ic { width: 17px; height: 17px; }
.nav-a:hover { background: var(--bg-2); color: var(--ink); }
.nav-a[aria-current] { background: #fbe4d9; color: var(--orange-ink); }
.lang { display: inline-flex; justify-self: end; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.lang button { min-width: 42px; min-height: 36px; border: 0; background: transparent; border-radius: 8px; font: 600 11px/1 var(--display); color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #231b1d22; }
.main { max-width: 1280px; margin: 0 auto; padding: 30px 32px 72px; outline: none; }
.foot { max-width: 1216px; margin: 0 auto; padding: 22px 4px 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 600; font-size: 16px; text-decoration: none; transition: transform .12s var(--ease), background .2s, box-shadow .12s; white-space: nowrap; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary[disabled] { background: var(--line-2); color: var(--ink-2); }
.btn-primary { background: var(--orange); color: #29160f; box-shadow: 0 3px 0 var(--orange-edge); }
.btn-primary:hover:not([disabled]) { background: #ff906b; }
.btn-primary:active:not([disabled]) { box-shadow: 0 1px 0 var(--orange-edge); transform: translateY(2px); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); }
.btn-link { background: none; padding: 0 8px; text-decoration: underline; text-underline-offset: 4px; color: var(--ink-2); font-weight: 500; }
.btn-light { background: #FFF9EF; color: var(--weekly-edge); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.icon-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); }
.chip .ic { width: 16px; height: 16px; color: var(--groups); }
.chip-preview { background: var(--sudoku-soft); border-color: var(--sudoku-fill); color: var(--sudoku-edge); }

/* Lobby */
.hero {
  min-height: 410px;
  display: flex;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  background: radial-gradient(ellipse at 75% 55%, #3c2a43, transparent 57%), var(--night);
  color: var(--white);
  text-decoration: none;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(circle, #f8deff26 1px, transparent 1.5px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 9%, #000 58%);
}
.hero::after {
  content: '';
  position: absolute;
  width: min(34vw, 430px);
  aspect-ratio: 1;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid #f1cafa25;
  border-radius: 50%;
  box-shadow: 0 0 0 32px #e0caff0a, 0 0 0 75px #e0caff08;
  z-index: -2;
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 1% 0 auto;
  width: 58%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  pointer-events: none;
}
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 13px 0;
  object-fit: contain;
  filter: drop-shadow(0 22px 28px #140f1b65);
  animation: marquee-in .72s var(--ease) both;
  transition: transform .42s var(--ease);
}
a.hero:hover img { transform: translate(0, -5px) rotate(1deg); }
.hero-body {
  align-self: center;
  width: 54%;
  padding: 42px 0 46px clamp(34px, 5vw, 74px);
  animation: rise .45s var(--ease) both;
}
.hero h1, .arcade-banner h1 { font-size: clamp(36px, 5.35vw, 76px); font-weight: 700; line-height: 1.06; letter-spacing: -.067em; }
.hero h1 em, .arcade-banner h1 em { color: var(--orange); font-style: normal; }
.hero-done h1 { font-size: clamp(30px, 4.5vw, 57px); }
.hero-date { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; color: var(--night-muted); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.hero-date span { background: var(--orange); width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 4px #ff784c25; }
.hero-action { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.hero .btn-primary { min-height: 54px; }
.hero-next { display: grid; gap: 1px; }
.hero-next small { color: var(--night-muted); font-size: 12px; }
.hero-next strong { color: var(--white); font-weight: 600; }
.hero-total { margin: 16px 0; color: var(--night-muted); font-weight: 600; }
@keyframes marquee-in { from { opacity: 0; scale: .91; translate: 1rem .6rem; } to { opacity: 1; scale: 1; translate: 0 0; } }

.daily-meter { display: grid; grid-template-columns: 1.35fr 1fr 1fr; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; margin-top: 16px; }
.meter-item { display: flex; align-items: center; min-width: 0; gap: 11px; padding: 15px 17px; }
.meter-item + .meter-item { border-left: 1px solid var(--line); }
.meter-icon { flex: none; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: var(--orange-ink); background: #fbe7db; }
.meter-item:first-child .meter-icon { color: var(--sudoku-edge); background: var(--sudoku-soft); }
.meter-item:last-child .meter-icon { color: var(--words-edge); background: var(--words-soft); }
.meter-icon .ic { width: 18px; height: 18px; }
.meter-text { display: grid; gap: 2px; }
.meter-text small { color: var(--muted); font-size: 12px; }
.meter-text strong { font-weight: 600; font-size: 15px; line-height: 1.3; }
.day-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-left: auto; }
.seg { width: clamp(10px, 1.25vw, 17px); height: 6px; border-radius: 3px; background: var(--line); }
.seg.on { background: var(--accent); }

.daily-library, .arcade-library, .discovery { margin-top: 42px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 15px; }
.section-head h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 700; letter-spacing: -.05em; }
.section-head p { color: var(--muted); font-size: 14px; }
.section-link, .practice-menu summary { color: var(--ink-2); font-size: 14px; font-weight: 600; text-underline-offset: 4px; }
.section-link { display: inline-flex; gap: 7px; min-height: 44px; align-items: center; }
.section-link .ic { width: 16px; height: 16px; }
.practice-menu { position: relative; }
.practice-menu summary { cursor: pointer; min-height: 44px; align-content: center; }
.practice-menu > div { position: absolute; inset: 100% 0 auto auto; width: min(290px, 82vw); z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 25px #231b1d20; }
.practice-menu a { display: flex; align-items: center; min-height: 44px; text-underline-offset: 3px; font-size: 14px; }

.game-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.arcade-list, .discovery-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-link { display: grid; grid-template-rows: auto 1fr; height: 100%; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; overflow: hidden; transition: border-color .2s, transform .22s var(--ease), box-shadow .22s var(--ease); }
.game-link:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 18px #26192d12; }
.game-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 149px;
  isolation: isolate;
  overflow: hidden;
  background: var(--cover);
  color: var(--cover-ink);
}
.game-visual::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#fff3 1px, transparent 1px), linear-gradient(90deg, #fff3 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse at 50% 100%, #000, transparent 88%);
}
.g-words { --cover: #debffc; --cover-ink: #402766; --piece: #a779db; --piece-shadow: #8051b8; }
.g-groups { --cover: #ffc9ac; --cover-ink: #6b2e1d; --piece: #f1865e; --piece-shadow: #be5939; }
.g-sudoku { --cover: #bce8ce; --cover-ink: #194c38; --piece: #63be94; --piece-shadow: #438b6e; }
.g-sequence { --cover: #ffde8c; --cover-ink: #5b3d11; --piece: #efaf3d; --piece-shadow: #c78c28; }
.g-route { --cover: #aedfdf; --cover-ink: #164d52; --piece: #57b5b8; --piece-shadow: #3b8189; }
.g-nonogram { --cover: #ffd0dc; --cover-ink: #702743; --piece: #ec8ea9; --piece-shadow: #b75b75; }
.g-towers { --cover: #c7d8ff; --cover-ink: #283f71; --piece: #8ca9ed; --piece-shadow: #5e78b5; }
.g-weekly { --cover: #e1c9fc; --cover-ink: #452d72; --piece: #bb89fb; --piece-shadow: #8257ba; }
.g-pulse { --accent: #b667f2; --accent-soft: #f0dfff; --accent-edge: #692a9d; --cover: #d8aff9; --cover-ink: #4b236c; --piece: #b86bea; --piece-shadow: #8644b2; }
.g-hunt { --accent: #ff875b; --accent-soft: #ffe6da; --accent-edge: #8b321b; --cover: #ffbba0; --cover-ink: #722f1f; --piece: #f67045; --piece-shadow: #ba4526; }
.g-duel { --accent: #63d5aa; --accent-soft: #e1f7ec; --accent-edge: #205944; --cover: #acf0d1; --cover-ink: #1c533e; --piece: #55ce9c; --piece-shadow: #358762; }

.game-genre { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 600; border: 1px solid #28183e24; padding: 3px 8px; border-radius: 6px; background: #fff5; }
.game-launch { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff7; transition: background .2s, color .2s; }
.game-launch .ic { width: 16px; height: 16px; }
.game-card.is-done .game-launch { color: var(--sudoku-edge); background: #fff9; }
.game-link:hover .game-launch { background: var(--ink); color: var(--white); }
.game-info { display: grid; align-content: start; grid-template-rows: auto 1fr auto; gap: 5px; padding: 15px 14px 12px; min-width: 0; }
.game-info strong { font: 650 clamp(14px, 1.3vw, 18px)/1.3 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.game-info p { color: var(--muted); font-size: 14px; line-height: 1.4; }
.game-label { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-edge); font-weight: 600; font-size: 12px; margin-top: 7px; }
.game-label .ic { width: 15px; height: 15px; }

.weekly { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; margin-top: 20px; padding: 20px 24px; border-radius: 17px; background: var(--weekly); color: var(--white); text-decoration: none; }
.weekly-art { display: grid; place-items: center; width: 81px; height: 79px; border-radius: 12px; background: #fff1; }
.weekly-text h2 { font-size: clamp(17px, 2vw, 23px); }
.weekly-text p { margin-top: 3px; color: #e3d7f1; font-size: 14px; }
.weekly-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; color: #e6d9f0; font-size: 12px; margin-top: 5px; }
.weekly-meta .ic { width: 15px; height: 15px; }
.weekly:hover { background: #3a2e60; }

.art { display: grid; gap: 4px; transform: rotate(-9deg); transition: transform .27s var(--ease); }
.game-visual > .art { scale: 1.12; }
.game-link:hover .art { transform: rotate(0deg) scale(1.07); }
.art span { display: grid; place-items: center; border-radius: 4px; font: 650 12px/1 var(--display); color: var(--cover-ink); background: #fff8ef; box-shadow: 0 3px 0 var(--piece-shadow); }
.art-words { grid-template-columns: repeat(3, 30px); }
.art-words span { height: 30px; border-radius: 6px; font-size: 14px; }
.art-words .ok, .art .on, .art .q { background: var(--piece); color: var(--cover-ink); }
.art-groups { grid-template-columns: repeat(4, 15px); }
.art-groups span { height: 15px; }
.art-groups span:nth-child(n+9):nth-child(-n+12) { background: #fbdf79; }
.art-groups span:nth-child(n+13) { background: #dcaff2; }
.art-sudoku, .art-logic, .art-pulse { gap: 3px; grid-template-columns: repeat(4, 17px); padding: 5px; border-radius: 7px; background: var(--piece-shadow); }
.art-sudoku span, .art-logic span, .art-pulse span { height: 17px; font-size: 10px; box-shadow: none; }
.art-sudoku span:empty, .art-logic span:not(.on), .art-pulse span:not(.on) { background: #fffc; }
.art-logic { grid-template-columns: repeat(5, 14px); }
.art-logic span { height: 14px; }
.art-towers { grid-template-columns: repeat(4, 17px); }
.art-seq, .art-duel { grid-template-columns: repeat(4, 27px); }
.art-seq span, .art-duel span { height: 27px; border-radius: 6px; }
.art-duel span:last-child { background: var(--piece); }
.art-weekly { grid-template-columns: repeat(6, 7px); gap: 2px; }
.art-weekly span { height: 7px; border-radius: 1px; background: #ddc5ff42; box-shadow: none; }
.art-pulse { grid-template-columns: repeat(3, 22px); }
.art-pulse span { height: 22px; }
.art-hunt { position: relative; width: 78px; height: 78px; place-items: center; }
.art-hunt span { position: absolute; width: 100%; height: 100%; border: 8px solid var(--piece); border-radius: 50%; }
.art-hunt span:nth-child(2) { width: 68%; height: 68%; border-width: 6px; box-shadow: none; }
.art-hunt span:last-child { width: 25%; height: 25%; border: 0; background: var(--piece); box-shadow: none; }

/* ---------- Play ---------- */
.play { max-width: 960px; margin: 0 auto; }
.play-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 20px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 6px; margin-left: -6px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.back:hover { background: var(--bg-2); color: var(--ink); }
.play-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.play-title h1 { font-size: clamp(22px, 3vw, 30px); }
.diff { font: 600 12px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-edge); }
.play-meta { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.stat { white-space: nowrap; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; min-width: 64px; }
.timer .ic { width: 16px; height: 16px; color: var(--muted); }
.rules { margin: -4px 0 20px; padding: 16px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; max-width: 720px; animation: rise .25s var(--ease); }
.stage { display: grid; justify-items: center; gap: 16px; padding: 28px 16px 24px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); position: relative; }
.stage[aria-busy="true"] .board-wrap { opacity: .85; }
.board-wrap { display: grid; justify-items: center; gap: 20px; width: 100%; transition: opacity .15s; }
.status { min-height: 24px; font-weight: 500; color: var(--ink-2); text-align: center; }
.status[data-tone="warn"] { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.state-box { display: grid; justify-items: center; gap: 14px; padding: 48px 20px; text-align: center; }
.mark-empty, .mark-boot { width: 56px; height: 56px; }
.boot { display: grid; place-items: center; gap: 12px; padding: 120px 0; color: var(--muted); }
.mark-boot { animation: spin 2.4s linear infinite; }

/* Tiles */
.tile, .gtile, .cell {
  border: 1px solid var(--tile-edge); background: var(--tile); color: var(--ink);
  box-shadow: 0 3px 0 var(--tile-edge);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .25s, color .25s, border-color .25s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tile:active:not([aria-disabled]), .gtile:active, .cell:active:not([aria-disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--tile-edge); }

/* Words */
.words { --ts: clamp(50px, 13.2vw, 66px); display: grid; grid-template-columns: auto minmax(220px, 300px); gap: 8px 28px; align-items: center; }
.wrow { display: grid; grid-template-columns: repeat(5, var(--ts)); gap: 8px; }
.wrow > .wnum { display: none; }
.tile { width: var(--ts); height: var(--ts); border-radius: 14px; font: 600 calc(var(--ts) * .4)/1 var(--display); display: grid; place-items: center; padding: 0; }
.tile.u2 { font-size: calc(var(--ts) * .31); letter-spacing: -0.04em; }
.tile.sel { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 6px 0 var(--tile-edge); transform: translateY(-3px); }
.tile.ok { background: var(--accent); border-color: var(--accent-edge); color: #FFFDF8; box-shadow: 0 3px 0 var(--accent-edge); cursor: default; }
.tile.pop { animation: glaze .5s var(--ease); }
.wclue { display: flex; gap: 10px; align-items: baseline; color: var(--ink-2); font-size: 15px; line-height: 1.35; padding: 6px 0; border-left: 3px solid transparent; padding-left: 12px; transition: border-color .2s, color .2s; }
.wclue.active { border-color: var(--accent); color: var(--ink); }
.wclue.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.wnum { font: 600 12px/1 var(--display); color: var(--accent-edge); min-width: 14px; }
.clue-list { display: none; }

/* Groups */
.found { display: grid; gap: 8px; width: min(100%, 560px); }
.found:empty { display: none; }
.band { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; text-align: center; color: var(--ink); }
.band strong { font: 600 14px/1.3 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.band span { font-size: 15px; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.band em { font-style: normal; font-size: 14px; color: var(--ink-2); }
.band-0 { background: var(--band-0); } .band-1 { background: var(--band-1); } .band-2 { background: var(--band-2); } .band-3 { background: var(--band-3); }
.band.fresh { animation: settle .45s var(--ease); }
.gboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(100%, 560px); }
.gtile { min-height: 72px; padding: 6px 4px; border-radius: 14px; font: 600 clamp(12px, 2.6vw, 15px)/1.15 var(--display); letter-spacing: -0.01em; text-transform: uppercase; overflow-wrap: break-word; display: grid; place-items: center; text-align: center; min-width: 0; }
.gtile.l { font-size: clamp(10px, 2.3vw, 13.5px); letter-spacing: -0.02em; }
.gtile.xl { font-family: var(--body); font-weight: 700; font-size: clamp(10.5px, 2.5vw, 14px); letter-spacing: -0.01em; padding: 4px 2px; overflow-wrap: anywhere; }
.gtile.sel { background: var(--groups); border-color: var(--groups-edge); color: #FFFDF8; box-shadow: 0 3px 0 var(--groups-edge); }

/* Sudoku */
.sgrid { --cs: clamp(58px, 17vw, 84px); display: grid; grid-template-columns: repeat(var(--n), auto); gap: 6px; padding: 10px; border-radius: 20px; background: var(--bg-2); }
.sgrid.n4 { --n: 4; }
.sgrid.n6 { --n: 6; --cs: clamp(44px, 12.6vw, 64px); gap: 5px; }
.cell { width: var(--cs); height: var(--cs); border-radius: 12px; font: 600 calc(var(--cs) * .42)/1 var(--display); color: var(--accent-edge); padding: 0; }
.cell.br { margin-right: 8px; }
.cell.bb { margin-bottom: 8px; }
.cell.given { background: var(--surface-2); color: var(--ink); box-shadow: none; border-color: var(--line); cursor: default; }
.cell.peer { background: color-mix(in srgb, var(--accent-soft) 55%, var(--tile)); }
.cell.given.peer { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-2)); }
.cell.same { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.cell.sel { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 4px 0 var(--tile-edge); transform: translateY(-2px); }
.cell.bad { color: var(--danger); background: var(--danger-soft); }
.g-sudoku .cell:not(.given) { color: var(--sudoku-edge); }
.pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pad button { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font: 600 22px/1 var(--display); box-shadow: 0 2px 0 var(--line-2); transition: transform .12s, background .2s; }
.pad button:hover { background: var(--accent-soft); }
.pad button:active { transform: translateY(2px); box-shadow: none; }
.pad .pad-erase { color: var(--ink-2); display: grid; place-items: center; }

/* Sequence */
.seq { display: grid; gap: 10px; width: min(100%, 620px); }
.seq-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 10px 12px; border-radius: 16px; background: var(--tile); border: 1px solid var(--line); }
.seq-n { font: 600 13px/1 var(--display); color: var(--accent-edge); text-align: center; }
.seq-vals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
.bead { display: inline-grid; place-items: center; min-width: 52px; height: 52px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font: 600 18px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bead-input { width: 96px; text-align: center; background: var(--tile); border: 2px dashed var(--accent); color: var(--accent-edge); outline: none; transition: border-color .2s, background .2s; }
.bead-input::placeholder { text-align: center; color: color-mix(in srgb, var(--accent) 60%, transparent); }
.bead-input:focus { border-style: solid; background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.bead-answer { background: var(--accent); color: #FFFDF8; border-color: var(--accent-edge); }
.seq-rule { grid-column: 2; color: var(--ink-2); font-size: 14px; }

/* Skeleton */
.board-skeleton { display: grid; gap: 8px; justify-content: center; padding: 32px 0; }
.board-skeleton span { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-2); animation: pulse 1.2s ease-in-out infinite alternate; }
.sk-words { grid-template-columns: repeat(5, 56px); }
.sk-groups { grid-template-columns: repeat(4, 96px); } .sk-groups span { width: 96px; height: 64px; }
.sk-sudoku { grid-template-columns: repeat(4, 64px); } .sk-sudoku span { width: 64px; height: 64px; }
.sk-weekly { grid-template-columns: repeat(6, 48px); } .sk-weekly span { width: 48px; height: 48px; }
.sk-sequence { grid-template-columns: 1fr; } .sk-sequence span { width: min(560px, 80vw); height: 64px; }

/* Complete */
.is-complete .stage { padding-bottom: 28px; }
.is-complete .tile, .is-complete .cell { cursor: default; }
.result { margin-top: 20px; padding: 28px; border-radius: var(--r-l); background: var(--ink); color: #F5EFE6; display: grid; gap: 22px; outline: none; animation: rise .45s var(--ease); }
.result-head { display: flex; align-items: center; gap: 16px; }
.result h2 { font-size: clamp(26px, 3.4vw, 34px); }
.result .muted { color: #B9BCD3; }
.mark-result { width: 56px; height: 56px; animation: bloom .7s var(--ease); }
.result .mark circle { fill: var(--ink); }
.result-stats { display: flex; gap: 12px; margin: 0; }
.result-stats div { flex: 1; max-width: 220px; padding: 14px 18px; border-radius: 16px; background: rgba(255,255,255,.07); }
.result-stats dt { font-size: 13px; color: #B9BCD3; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.result-stats dd { margin: 4px 0 0; font: 600 34px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.reveal { display: grid; gap: 10px; padding: 18px 20px; border-radius: 16px; background: var(--surface); color: var(--ink); }
.reveal h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.reveal h3:not(:first-child) { margin-top: 6px; }
.rv-words { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rv-words li { padding: 6px 12px; border-radius: 10px; background: var(--words-soft); font: 600 15px/1.2 var(--display); color: var(--words-edge); }
.rv-groups { display: grid; gap: 6px; }
.rv-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result .btn-ghost { background: rgba(255,255,255,.08); color: #F5EFE6; border-color: rgba(255,255,255,.2); }
.result .btn-link { color: #D7DAEC; }

/* ---------- Pages ---------- */
.page { max-width: 760px; margin: 0 auto; }
.page-head { margin-bottom: 20px; display: grid; gap: 6px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); }
.tabs { display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 999px; margin-bottom: 16px; }
.tabs button { min-height: 40px; padding: 0 18px; border: 0; background: transparent; border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.ranking { margin-bottom: 16px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; min-height: 60px; padding: 8px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.rank-n { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; font: 600 14px/1 var(--display); background: var(--bg-2); }
.rank-row.top .rank-n { background: var(--sudoku-fill); }
.rank-row.you { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--ink); }
.rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.rank-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name em { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: var(--bg); }
.rank-games { color: var(--muted); font-size: 14px; white-space: nowrap; }
.rank-score { font: 600 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.rank-row.sk span { height: 14px; border-radius: 6px; background: var(--bg-2); animation: pulse 1.2s ease-in-out infinite alternate; }
.rank-row.sk { grid-template-columns: 34px 1fr 80px; }

.profile { display: grid; gap: 24px; }
.profile h2 { font-size: 20px; }
.name-form { display: grid; gap: 8px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.name-form label { font-weight: 600; }
.name-row { display: flex; gap: 10px; }
.name-row input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--tile); font-size: 17px; }
.name-row input:focus { outline: 3px solid var(--ink); outline-offset: 1px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats div { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--muted); font-weight: 500; }
.stats dd { margin: 4px 0 0; font: 600 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.history li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.hist-dot { width: 12px; height: 12px; border-radius: 99px; background: var(--accent); }
.hist-name { display: grid; min-width: 0; }
.hist-name small { color: var(--muted); }
.hist-score { font: 600 16px/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 500; text-align: center; transition: opacity .2s, transform .25s var(--ease); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion ---------- */
.shake { animation: shake .42s var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes glaze { 0% { transform: scale(.92); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes settle { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bloom { from { transform: rotate(-90deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Responsive */
@media (max-width: 900px) {
  .words { grid-template-columns: auto; }
  .wclue { display: none; }
  .wrow { grid-template-columns: 14px repeat(5, var(--ts)); align-items: center; }
  .wrow > .wnum { display: block; text-align: center; }
  .clue-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; width: min(100%, 420px); }
  .clue-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.35; border-left: 3px solid transparent; }
  .clue-list li.active { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
  .clue-list li.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
}
@media (max-width: 640px) {
  .top-in { grid-template-columns: 1fr auto; padding: 0 15px; gap: 10px; height: 60px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 30; }
  .nav-a { flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 3px; font-size: 11px; border-radius: 12px; flex: 1; justify-content: center; }
  .lang { margin-left: auto; }
  body[data-view="play"] .nav, body[data-view="arcade-play"] .nav { display: none; }
  .main { padding: 16px 15px 38px; }
  .foot { padding: 20px 16px 100px; }
  .play-bar { grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; margin-bottom: 14px; }
  .back span { display: none; }
  .play-meta { grid-column: 1 / -1; justify-content: space-between; font-size: 14px; }
  .play-meta .icon-btn { margin-left: auto; }
  .stage { padding: 18px 8px 16px; border-radius: 20px; margin: 0 -8px; }
  .words { --ts: min(calc((100vw - 92px) / 5), 64px); }
  .wrow { gap: 6px; }
  .tile { border-radius: 11px; }
  .gboard { gap: 6px; }
  .gtile { min-height: 64px; border-radius: 12px; }
  .sgrid.n4 { --cs: min(calc((100vw - 84px) / 4), 76px); }
  .sgrid.n6 { --cs: min(calc((100vw - 102px) / 6), 56px); gap: 4px; padding: 8px; }
  .cell.br { margin-right: 6px; } .cell.bb { margin-bottom: 6px; }
  .pad { gap: 6px; }
  .pad button { width: 48px; height: 52px; }
  .g-weekly .pad button { width: calc((100vw - 92px) / 7); max-width: 48px; }
  .bead { min-width: 44px; height: 46px; font-size: 16px; padding: 0 8px; }
  .bead-input { width: 76px; padding: 0; }
  .seq-row { padding: 8px; gap: 4px 8px; grid-template-columns: 20px minmax(0, 1fr); }
  .seq-vals { gap: 6px; }
  .actions .btn { flex: 1 1 auto; padding: 0 14px; }
  .result { padding: 22px 18px; margin: 16px -8px 0; }
  .result-actions .btn { width: 100%; }
  .rank-row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 8px 12px; gap: 10px; }
  .rank-games { display: none; }
  .stats dd { font-size: 22px; }
  .stats div { padding: 12px; }
  .name-row { flex-direction: column; }
}
@media (max-width: 360px) {
  .bead { min-width: 40px; height: 42px; font-size: 15px; }
}

/* Keep optional ads clear of controls. Reserve the space before the request. */
.ad-region { min-height: 320px; max-width: 900px; margin: 150px auto 40px; text-align: center; }
.ad-region p { font-size: .75rem; color: var(--muted); }
.adsbygoogle { display: block; width: 100%; height: 280px; }
.preferences { max-width: min(32rem,90vw); padding: 2rem; border: 1px solid #877968; border-radius: 12px; background: #F5EFE6; color: #322E29; }
.preferences::backdrop { background: #322e2966; }
.preferences label { display: flex; gap: .7rem; padding: 1rem 0; }
.foot nav { line-height: 2.5; }
.legal { max-width: 48rem; line-height: 1.7; }
.legal h1 { margin-top: 2rem; }
.legal nav a { display: inline-block; padding: .5rem 0; }

.foot a { display: inline-block; min-height: 44px; line-height: 44px; }

/* Logic boards */
.g-route { --accent:#21737a; --accent-soft:#d9f3f2; --accent-edge:#16525a; }
.g-nonogram { --accent:#ac3d6a; --accent-soft:#fae1eb; --accent-edge:#81294a; }
.g-towers { --accent:#436bb7; --accent-soft:#e4eeff; --accent-edge:#2f4e86; }
.route-grid { --size:min(60px,calc((100vw - 60px)/5)); display:grid; grid-template-columns:repeat(5,var(--size)); position:relative; background:var(--bg-2); border:1px solid var(--line-2); border-radius:18px; overflow:hidden; isolation:isolate; }
.route-cell { width:var(--size); height:var(--size); background:transparent; border:0; border-right:1px solid var(--line-2); border-bottom:1px solid var(--line-2); color:var(--ink); display:grid; place-items:center; padding:0; transition:background .14s; }
.route-cell.visited { background:color-mix(in srgb,var(--accent-soft) 65%,transparent); }
.route-cell span { z-index:2; border-radius:50%; display:grid; place-items:center; width:32px; height:32px; background:var(--surface); font:600 17px/1 var(--display); }
.route-cell.head span { color:var(--surface); background:var(--accent); }
.route-cell:not(.head).visited span { background:var(--accent-soft); color:var(--accent-edge); }
.route-cell:focus-visible { outline:3px solid var(--ink); outline-offset:-4px; }
.route-line { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; }
.route-line polyline { fill:none; stroke:var(--accent); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.nono-grid { --size:min(48px,calc((100vw - 104px)/6)); display:grid; grid-template-columns:44px repeat(6,var(--size)); gap:2px; padding:6px; background:var(--bg-2); border-radius:14px; }
.nono-cell { width:var(--size); height:var(--size); border:1px solid var(--line-2); border-radius:4px; background:var(--surface); padding:0; color:var(--ink-2); font-size:26px; transition:background .12s; }
.nono-cell.state-1 { background:var(--accent); border-color:var(--accent-edge); }
.nono-clue { font:600 15px/1.2 var(--body); color:var(--ink); display:flex; align-items:center; justify-content:center; gap:4px; white-space:pre; }
.nono-clue.nono-col-clue { flex-direction:column; min-height:62px; padding:5px 0; }
.nono-clue.nono-row-clue { justify-content:flex-end; padding-right:6px; }
.nono-clue.matched { color:var(--accent-edge); text-decoration:underline; text-underline-offset:4px; }
.tower-grid { --size:min(68px,calc((100vw - 144px)/4)); display:grid; grid-template-columns:28px repeat(4,var(--size)) 28px; gap:5px; background:var(--bg-2); padding:8px; border-radius:18px; }
.tower-grid .tower-cell { --cs:var(--size); width:var(--size); height:var(--size); border:1px solid var(--line-2); color:var(--accent-edge); }
.tower-clue { display:grid; place-items:center; font:600 18px/1 var(--body); color:var(--ink-2); min-height:26px; }
@media(prefers-reduced-motion:reduce) { .route-cell,.nono-cell { transition:none; } }

.logic-help summary { cursor:pointer; color:var(--ink-2); font-size:14px; min-height:36px; display:list-item; padding-top:6px; }
.logic-help p { margin-top:10px; }
.result > *, .result-head > div, .result-stats > div { min-width:0; }
.result-actions .btn { white-space:normal; text-align:center; line-height:1.4; padding-top:12px; padding-bottom:12px; }
@media(max-width:360px) { .result-stats dd { font-size:26px; } }

/* Puzzle workspace */
.play { max-width: 1080px; }
.play-bar { padding: 12px 0 17px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.play-title h1 { font-size: clamp(20px, 3.05vw, 36px); letter-spacing: -.05em; }
.play-meta .stat { padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-edge); font-size: 13px; }
.play-layout { display: grid; }
.rules { max-width: none; align-content: start; padding: 21px; margin: 0 0 14px; color: var(--ink-2); border-top: 3px solid var(--accent); }
.rules h2 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.rules p { font-size: 14px; }
.rules .logic-help { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 3px; }
.stage { min-height: 190px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 58%, var(--surface)), var(--surface) 73%); }
.stage .actions { padding-top: 6px; }
.tile, .gtile, .cell, .bead, .pad button { border-radius: 9px; }
.tile:not(.ok):not(.sel):hover, .gtile:not(.sel):hover, .cell:not(.given):not(.sel):hover { border-color: var(--accent); }
.tile.ok { background: var(--sudoku); border-color: var(--sudoku-edge); box-shadow: 0 3px 0 var(--sudoku-edge); }
.sgrid, .tower-grid { background: var(--accent-soft); }
.cell.given { background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-2)); }
.route-cell span:empty { width: 6px; height: 6px; background: var(--line-2); }
.is-complete .stage { min-height: 0; }
.result { background: var(--night); }
.state-box:not(.ranking .state-box) { background: var(--surface); border-radius: var(--r-l); }
.preferences { border-color: var(--line-2); background: var(--surface); color: var(--ink); }
.preferences::backdrop { background: #221e2a99; }
.foot nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 7px; line-height: 1.3; }
.foot .btn-link { font-size: inherit; }
@media (min-width: 1080px) {
  .play-layout:has(.rules:not([hidden])) { grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: 18px; }
  .rules { grid-column: 2; grid-row: 1; }
  .play-layout .stage { grid-column: 1; grid-row: 1; }
}

/* Arcade */
.arcade-home { display: grid; gap: 24px; }
.arcade-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(26px, 5vw, 60px);
  gap: 10px;
  min-height: 230px;
  border-radius: 23px;
  background: radial-gradient(ellipse at 89% 40%, #68405a, transparent 55%), var(--night);
  color: var(--white);
  overflow: hidden;
}
.arcade-banner p { color: var(--night-muted); margin-top: 10px; }
.arcade-banner > .ic { width: clamp(70px, 15vw, 175px); height: auto; margin-right: 6%; stroke-width: 1; fill: var(--orange); color: var(--orange); filter: drop-shadow(9px 12px 0 #c44b2a); transform: rotate(8deg); animation: rise .45s var(--ease) both; }
.arcade-local { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 14px; }
.arcade-local .ic { color: var(--orange-ink); width: 17px; height: 17px; }
.arcade-play { max-width: 760px; margin: 0 auto; }
.arc-play-head { margin: 8px 0 17px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.arc-play-head h1 { font-size: clamp(25px, 4vw, 42px); letter-spacing: -.05em; order: -1; }
.arc-console {
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 420px;
  overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--accent) 14%, var(--night)), var(--night) 68%);
  color: var(--white);
}
.arc-hud { display: flex; gap: 8px; justify-content: space-between; margin: 0; padding: 15px 20px 12px; border-bottom: 1px solid var(--night-line); }
.arc-hud div { display: grid; gap: 3px; }
.arc-hud div:last-child { text-align: right; }
.arc-hud dt { color: var(--night-muted); font-size: 12px; }
.arc-hud dd { margin: 0; font: 600 clamp(16px, 3.8vw, 25px)/1.25 var(--display); font-variant-numeric: tabular-nums; }
.arc-hud div:first-child dd { color: var(--accent); }
.arc-clock { display: flex; align-items: center; gap: 12px; padding: 6px 20px 0; }
.arc-clock span { font-size: 13px; min-width: 20px; text-align: end; }
.arc-timer { flex: 1; height: 7px; appearance: none; border: 0; border-radius: 9px; overflow: hidden; background: var(--night-line); color: var(--accent); }
.arc-timer::-webkit-progress-bar { background: var(--night-line); }
.arc-timer::-webkit-progress-value { background: var(--accent); }
.arc-timer::-moz-progress-bar { background: var(--accent); }
.arc-stage { grid-row: 3; padding: 24px 16px; display: grid; justify-items: center; align-content: center; gap: 12px; }
.arc-idle { min-height: 96px; display: grid; place-items: center; padding: 10px 0; }
.arc-stage .arc-idle .art { scale: 1.32; }
.arc-console:not([data-phase="ready"], [data-phase="end"]) .arc-idle { display: none; }
.arc-prompt { min-height: 0; font: 650 clamp(17px, 3.5vw, 28px)/1.2 var(--display); letter-spacing: -.04em; text-align: center; }
.arc-status { min-height: 21px; color: var(--night-muted); font-size: 14px; text-align: center; }
.arc-prompt:empty, .arc-status:empty { display: none; }
.arc-board { width: min(100%, 274px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arc-options { width: min(100%, 360px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.arc-cell {
  appearance: none;
  min-width: 0;
  min-height: 68px;
  position: relative;
  border: 1px solid #a895ad58;
  border-radius: 12px;
  background: #ffffff0a;
  color: var(--night-muted);
  box-shadow: 0 4px 0 #110c1599;
  font: 600 15px/1 var(--display);
}
.arc-cell:focus-visible, .arc-stage .btn:focus-visible, .hero-done .btn:focus-visible { outline-color: var(--white); }
.arc-cell:active { transform: translateY(2px); box-shadow: 0 2px 0 #110c1599; }
.arc-cell.lit { color: var(--night); background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 0 var(--piece-shadow), 0 0 22px color-mix(in srgb, var(--accent) 37%, transparent); }
.arc-cell.lit span { text-decoration: underline; text-underline-offset: 5px; }
.arc-options .arc-cell span { position: absolute; top: 9px; left: 9px; color: var(--night-muted); font-size: 10px; }
.arc-options strong { color: var(--white); font-size: 24px; }
.arc-options .arc-cell:hover { border-color: var(--accent); }
.arc-help { display: grid; gap: 6px; padding: 16px 0; color: var(--ink-2); }
.arc-help p:first-child { font-size: 15px; }
.arc-console[data-phase="end"] .arc-prompt { color: var(--accent); animation: rise .35s var(--ease) both; }

@media (max-width: 1079px) {
  .foot { margin: 0 32px; }
  .hero { min-height: 360px; }
  .game-visual { min-height: 130px; }
}
@media (max-width: 880px) {
  .top-in { padding: 0 20px; }
  .nav { gap: 3px; }
  .nav-a { padding: 0 9px; }
  .main { padding-left: 20px; padding-right: 20px; }
  .foot { margin: 0 20px; }
  .meter-item { padding: 12px; gap: 8px; }
  .day-progress { display: none; }
  .game-list:not(.arcade-list, .discovery-list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .nav-a .ic { display: none; }
  .hero-body { padding-left: 26px; }
  .meter-icon { width: 30px; height: 30px; }
  .meter-text small { line-height: 1.2; }
  .game-list:not(.arcade-list, .discovery-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arcade-list, .discovery-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .top-in { padding: 0 15px; }
  .nav { gap: 4px; }
  .nav-a .ic { display: block; }
  .main { padding-left: 15px; padding-right: 15px; }
  .foot { margin: 0 15px; padding: 12px 0 calc(82px + env(safe-area-inset-bottom)); }
  body[data-view="play"] .foot, body[data-view="arcade-play"] .foot { padding-bottom: 32px; }
  .hero { min-height: 0; border-radius: 18px; }
  .hero-body { width: 100%; padding: 24px 18px clamp(164px, 48vw, 290px); }
  .hero h1 { max-width: 9ch; font-size: clamp(29px, 9.75vw, 50px); }
  .hero:lang(ru) h1 { font-size: clamp(24px, 7.8vw, 44px); max-width: 15ch; }
  .hero-done h1 { max-width: 15ch; }
  .hero-date { font-size: 10px; letter-spacing: .07em; margin: 0 0 12px; }
  .hero-art { inset: auto 0 0; width: 100%; height: clamp(155px, 45vw, 275px); }
  .hero-art img { width: 98%; padding: 0; }
  .hero::after { width: 64%; top: 76%; right: 18%; }
  .hero::before { mask-image: linear-gradient(180deg, transparent, #000); }
  .hero-action { margin-top: 13px; gap: 11px; }
  .hero .btn-primary { padding: 0 12px; min-height: 44px; font-size: 14px; }
  .hero .btn .ic { width: 16px; height: 16px; }
  .hero-next strong { font-size: 13px; }
  .hero-next small { font-size: 11px; }
  .daily-meter { margin-top: 11px; grid-template-columns: 1fr .88fr 1fr; }
  .meter-item { padding: 9px 7px; gap: 5px; flex-wrap: wrap; align-content: start; }
  .meter-icon { width: 26px; height: 26px; border-radius: 7px; }
  .meter-icon .ic { width: 15px; height: 15px; }
  .meter-text { flex-basis: 100%; }
  .meter-text strong { font-size: 12px; }
  .meter-text small { font-size: 10px; }
  .daily-library, .arcade-library, .discovery { margin-top: 27px; }
  .section-head { margin-bottom: 9px; }
  .practice-menu summary, .section-link { font-size: 12px; }
  .game-list { gap: 10px; }
  .game-visual { min-height: 117px; padding-top: 16px; }
  .game-visual .art { scale: .86; }
  .game-genre { top: 7px; left: 7px; font-size: 10px; }
  .game-launch { width: 25px; height: 25px; right: 6px; bottom: 6px; }
  .game-info { padding: 10px 9px 9px; gap: 4px; }
  .game-info p { font-size: 12px; }
  .weekly { grid-template-columns: auto minmax(0, 1fr); padding: 14px; gap: 12px; }
  .weekly .btn { grid-column: 1 / -1; }
  .weekly-art { width: 62px; height: 62px; }
  .arcade-home { gap: 16px; }
  .arcade-banner { min-height: 168px; padding: 22px; }
  .arcade-banner > .ic { margin-right: 0; }
  .arcade-banner h1 { font-size: clamp(28px, 9vw, 47px); }
  .play-meta { flex-wrap: wrap; }
  .stage { padding: 20px 8px 18px; }
  .rules { padding: 13px 15px; }
  .board-skeleton { scale: .77; }
}
@media (max-width: 360px) {
  .hero-body { padding-left: 15px; padding-right: 15px; }
  .hero-action { gap: 9px; }
  .hero-next strong { font-size: 12px; }
  .arc-cell { min-height: 58px; }
}
