/* TelliApp Games — shell styles. The menu (2.0: a launcher) follows the light / dark theme (system, or ⚙ «Оформление» → html[data-theme]);
   the game screen and its panels are always dark. Manrope (the site's font, in /play/fonts/, works offline), no external resources. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/play/fonts/manrope-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/play/fonts/manrope-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: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/play/fonts/manrope-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; }
:root {
  --bg: #0B1220; --bg2: #070D19; --card: #121C30; --card2: #182540; --text: #F3F6FB; --muted: #B4C0D4; --accent: #3D8FE6; --accent2: #1F5FC5; --link: #8CC3FA;
  --ok: #38C172; --ok-text: #CFF5DE; --ok-bg: rgba(56,193,114,.12); --ok-line: rgba(56,193,114,.4); --warn: #F2B134; --warn-text: #FCE3B0; --err-text: #FFB4B4;
  --line: rgba(148,178,230,.16); --line2: rgba(148,178,230,.28); --glass: rgba(18,28,48,.82); --scrim: rgba(3,7,16,.66); --shadow: 0 18px 50px -18px rgba(0,0,0,.7);
  --tile-shadow: 0 14px 34px -14px rgba(0,0,0,.8); --tile-shadow-h: 0 26px 50px -18px rgba(20,60,140,.75);
  --r: 18px; --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; --ease: cubic-bezier(.22,1,.36,1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
/* light: the same brand blue, paper background (contrast: --text 17:1, --muted 6.6:1 on --bg, --link 5.5:1) */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #EEF3FA; --bg2: #E3EBF6; --card: #FFFFFF; --card2: #E8EFF8; --text: #0B1220; --muted: #4A5872; --accent: #2A6FD2; --accent2: #1F5FC5; --link: #1B5FC4;
  --ok: #1D8A4E; --ok-text: #12603A; --ok-bg: rgba(29,138,78,.1); --ok-line: rgba(29,138,78,.35); --warn: #9A5B00; --warn-text: #7A4A00; --err-text: #B42318;
  --line: rgba(11,18,32,.12); --line2: rgba(11,18,32,.22); --glass: rgba(255,255,255,.86); --scrim: rgba(11,18,32,.42); --shadow: 0 18px 50px -20px rgba(11,30,70,.35);
  --tile-shadow: 0 12px 28px -14px rgba(11,30,70,.45); --tile-shadow-h: 0 24px 46px -18px rgba(31,95,197,.55); color-scheme: light; } }
:root[data-theme="light"] {
  --bg: #EEF3FA; --bg2: #E3EBF6; --card: #FFFFFF; --card2: #E8EFF8; --text: #0B1220; --muted: #4A5872; --accent: #2A6FD2; --accent2: #1F5FC5; --link: #1B5FC4;
  --ok: #1D8A4E; --ok-text: #12603A; --ok-bg: rgba(29,138,78,.1); --ok-line: rgba(29,138,78,.35); --warn: #9A5B00; --warn-text: #7A4A00; --err-text: #B42318;
  --line: rgba(11,18,32,.12); --line2: rgba(11,18,32,.22); --glass: rgba(255,255,255,.86); --scrim: rgba(11,18,32,.42); --shadow: 0 18px 50px -20px rgba(11,30,70,.35);
  --tile-shadow: 0 12px 28px -14px rgba(11,30,70,.45); --tile-shadow-h: 0 24px 46px -18px rgba(31,95,197,.55); color-scheme: light; }
/* the game screen (and the panels over it) is dark in both themes */
.game { --bg: #0B1220; --card: #121C30; --card2: #182540; --text: #F3F6FB; --muted: #B4C0D4; --accent: #3D8FE6; --ok: #38C172; --ok-text: #CFF5DE; --warn: #F2B134; --warn-text: #FCE3B0; --err-text: #FFB4B4; --line: rgba(255,255,255,.1); --line2: rgba(255,255,255,.22); --glass: rgba(18,28,48,.85); color-scheme: dark; color: var(--text); }
* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { margin: 0; min-height: 100%; background: var(--bg); }
body.in-game { height: 100%; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; position: fixed; inset: 0; }
body.layer-open { overflow: hidden; }
button { font: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.noscript { padding: 24px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: var(--link); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-weight: 700; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: transform .16s var(--ease), box-shadow .2s, background-color .2s; }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; box-shadow: 0 10px 26px -12px rgba(31,95,197,.9), inset 0 1px 0 rgba(255,255,255,.22); }
.btn--secondary { background: var(--card2); }
.btn--ghost { background: transparent; }
.btn--big { min-height: 56px; font-size: 1.12rem; padding: 12px 30px; }
.btn--small { min-height: 44px; padding: 4px 14px; border-radius: 12px; font-size: .92rem; }
.btn:active { transform: translateY(1px) scale(.985); }
@media (hover: hover) { .btn--primary:hover { box-shadow: 0 14px 34px -12px rgba(31,95,197,1), inset 0 1px 0 rgba(255,255,255,.28); } .btn--secondary:hover, .btn--ghost:hover { background: var(--card2); border-color: var(--line2); } }
.btn:focus-visible, .icon-btn:focus-visible, .lang:focus-visible, .seg button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon-btn { flex: none; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 0; transition: background-color .2s, transform .16s var(--ease); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) { .icon-btn:hover { background: var(--card2); border-color: var(--line2); } }
.icon-btn--small { width: 44px; height: 44px; border-radius: 12px; }
.icon-btn--small svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] .mute { display: none; }
.icon-btn[aria-pressed="false"] .wave1, .icon-btn[aria-pressed="false"] .wave2 { display: none; }

/* ---- menu (2.0): bar + tiles. A phone upright: 2 × 2 big tiles that fill the screen (nothing scrolls); sideways and on a computer:
   one row of 4 (3:4 covers, centred); a short wide window under 640 px: 2 × 2 wide tiles with the wide covers. ---- */
.menu { min-height: 100vh; min-height: 100dvh; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 10px; max-width: 1280px; margin: 0 auto;
  padding: calc(10px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); }
body:not(.in-game) { background: radial-gradient(120% 70% at 50% -10%, rgba(61,143,230,.16), transparent 60%), var(--bg); background-attachment: fixed; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.bar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar__logo { flex: none; width: 38px; height: 38px; filter: drop-shadow(0 6px 16px rgba(61,143,230,.4)); }
.bar__logo svg { width: 100%; height: 100%; stroke: none; display: block; }
.bar__title { margin: 0; font-size: 1.18rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar__btns { display: flex; align-items: center; gap: 6px; }
.bar .icon-btn { width: 46px; height: 46px; }
.net { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(242,177,52,.15); color: var(--warn); }
.net__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net--on { background: var(--ok-bg); color: var(--ok); }
/* a narrow phone: the online / offline mark becomes a dot on the logo's corner, so the title fits */
.bar__brand { position: relative; }
@media (max-width: 459px) { .net { position: absolute; left: 27px; top: 27px; width: 14px; height: 14px; padding: 0; justify-content: center; border: 2px solid var(--bg); background: var(--bg); } .net__dot { width: 10px; height: 10px; } .net__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .bar__btns { gap: 4px; } .bar .icon-btn { width: 44px; height: 44px; } }
@media (max-width: 349px) { .net { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; } }
@media (max-width: 349px) { .bar__logo { display: none; } .bar__brand { gap: 6px; } .bar__title { font-size: .98rem; } .bar .icon-btn { width: 44px; height: 44px; } .bar__btns { gap: 4px; } }
.menu__tagline { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.4; }
@media (max-height: 640px), (max-width: 359px) { .menu__tagline { display: none; } }
.secret-note { margin: 0; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: 14px; padding: 10px 14px; color: var(--ok-text); font-size: .92rem; }
.install-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow); }
.install-bar__t { flex: 1; min-width: 0; font-size: .9rem; color: var(--muted); line-height: 1.35; }
@media (max-height: 560px) { .install-bar__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

.tiles { flex: 1 1 auto; min-height: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(150px, 1fr)); }
.tile { position: relative; min-width: 0; min-height: 0; container-type: size; }
.tile__btn { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 22px; overflow: hidden; cursor: pointer; text-align: left; color: #fff; background: var(--lq, #16233F);
  box-shadow: var(--tile-shadow), inset 0 0 0 1px rgba(255,255,255,.08); -webkit-tap-highlight-color: transparent; isolation: isolate;
  transition: transform .32s var(--ease), box-shadow .32s var(--ease); }
.tile__art, .tile__art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile__art img { object-fit: cover; object-position: var(--pos, 50% 50%); transition: transform .6s var(--ease); }
.tile__btn::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(to top, rgba(4,9,20,.94) 0%, rgba(4,9,20,.72) 24%, rgba(4,9,20,.12) 52%, rgba(4,9,20,0) 64%), linear-gradient(to bottom, rgba(4,9,20,.42), rgba(4,9,20,0) 26%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.tile__txt { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: 3px; padding: 14px 14px 14px; }
.tile__name { font-weight: 800; font-size: 1.1rem; font-size: clamp(1.05rem, 10.5cqi, 1.55rem); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.tile__cap { font-size: .86rem; font-size: clamp(.8rem, 6.6cqi, 1rem); line-height: 1.3; color: rgba(236,242,252,.86); font-weight: 600; }
.tile__badge, .tile__best { position: absolute; z-index: 2; top: 10px; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.tile__badge { left: 10px; color: #fff; background: linear-gradient(135deg, #3D93EC, #1B5FC4); box-shadow: 0 6px 16px -6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); }
.tile__badge svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.tile__best { right: 10px; color: #FFE7A8; background: rgba(6,12,26,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); font-variant-numeric: tabular-nums; }
.tile__best svg { width: 14px; height: 14px; stroke-width: 2.2; }
.tile__badge:not([hidden]) ~ .tile__best { max-width: calc(100% - 20px); }
.tile__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .tile__btn:hover { transform: translateY(-5px); box-shadow: var(--tile-shadow-h), inset 0 0 0 1px rgba(255,255,255,.16); }
  .tile__btn:hover .tile__art img { transform: scale(1.05); }
}
.tile__btn:active { transform: scale(.975); transition-duration: .12s; }
/* covers: the placeholder colour (shown until the picture is decoded — it is in the cache, so a moment) and the crop of each game */
.tile[data-id="defend"] { --lq: radial-gradient(60% 50% at 50% 45%, #1E4C9E, #0A1324 70%); --pos: 50% 46%; }
.tile[data-id="signal"] { --lq: linear-gradient(#11224A, #0C1733); --pos: 50% 50%; }
.tile[data-id="flight"] { --lq: radial-gradient(50% 40% at 50% 45%, #6B2C8F, #071026 75%); --pos: 50% 50%; }
.tile[data-id="lighthouse"] { --lq: linear-gradient(#8EC8F2, #CFE8F7 55%, #6FA35A); --pos: 50% 50%; }
/* a phone / window on its side, wide enough: one row of four poster tiles, centred */
@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  .menu { max-width: clamp(960px, calc((100vh - 190px) * 3 + 100px), 1680px); max-width: clamp(960px, calc((100dvh - 190px) * 3 + 100px), 1680px); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); align-items: center; gap: clamp(10px, 1.6vw, 22px); }
  .tile { height: auto; max-height: 100%; aspect-ratio: 3 / 4; width: 100%; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) { .menu { gap: 8px; padding-top: calc(6px + var(--sat)); padding-bottom: calc(10px + var(--sab)); } .bar { min-height: 46px; } .tile__cap { display: none; } .tile__txt { padding: 10px 12px; } }
@media (min-aspect-ratio: 1/1) and (max-width: 639px) { .tiles { grid-template-rows: repeat(2, minmax(110px, 1fr)); } }
@media (min-width: 900px) and (min-height: 600px) { .menu { padding-top: calc(18px + var(--sat)); gap: 14px; } .menu__tagline { font-size: 1.05rem; } .tile__txt { padding: 18px; } }
@media (max-width: 380px) and (max-aspect-ratio: 1/1) { .tile__txt { padding: 12px 11px; } .tile__badge, .tile__best { top: 8px; height: 26px; padding: 0 8px; font-size: .74rem; } .tile__badge { left: 8px; } .tile__best { right: 8px; } }
/* two badges on a narrow tile: the record goes under the «continue» badge */
@media (max-width: 459px) { .tile__badge:not([hidden]) ~ .tile__best { top: 42px; } }

/* ---- layers (2.0): the game card, 🏆, ⚙ — a bottom sheet on a phone, a window on a computer ---- */
.layer { position: fixed; inset: 0; z-index: 25; display: flex; align-items: flex-end; justify-content: center; }
.layer__scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in .24s ease-out both; }
.layer__panel { position: relative; width: 100%; max-height: calc(100dvh - 24px - var(--sat)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.55);
  padding: 8px calc(18px + var(--sar)) calc(20px + var(--sab)) calc(18px + var(--sal)); animation: sheet-up .34s var(--ease) both; outline: none; }
.layer.is-closing .layer__panel { animation: sheet-down .2s ease-in both; }
.layer.is-closing .layer__scrim { animation: fade-out .2s ease-in both; }
.layer__grab, .layer__head, .sheet__media, .tile__btn { -webkit-user-select: none; user-select: none; }
.layer__grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: 2px auto 8px; touch-action: none; }
.layer__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; touch-action: none; }
.layer__title { margin: 0; font-size: 1.35rem; font-weight: 800; }
.layer__x { width: 44px; height: 44px; border-radius: 12px; }
.layer__x svg { width: 20px; height: 20px; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (min-width: 700px) and (min-height: 521px) {
  .layer { align-items: center; padding: 24px; }
  .layer__panel { width: min(100%, 560px); max-height: calc(100dvh - 48px); border-radius: 26px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow), 0 30px 80px -30px rgba(0,0,0,.6); padding: 20px 24px 24px; animation-name: pop-in; animation-duration: .28s; }
  .layer.is-closing .layer__panel { animation-name: pop-out; animation-duration: .16s; }
  .layer__grab { display: none; }
  #sheet .layer__panel { width: min(100%, 640px); }
}

/* the game card */
.sheet { padding-top: 0; }
.sheet .layer__grab { position: absolute; z-index: 3; left: 50%; top: 8px; margin: 0; transform: translateX(-50%); background: rgba(255,255,255,.7); }
.sheet .layer__x { position: absolute; z-index: 3; top: 12px; right: calc(12px + var(--sar)); background: rgba(6,12,26,.55); color: #fff; border-color: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet__media { position: relative; margin: 0 calc(-18px - var(--sar)) 0 calc(-18px - var(--sal)); aspect-ratio: 16 / 9; max-height: 46dvh; width: auto; overflow: hidden; border-radius: 26px 26px 0 0; background: var(--lq, #16233F); color: #fff; }
.sheet__art, .sheet__art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sheet__art img { object-fit: cover; }
.sheet__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,9,20,.9), rgba(4,9,20,.3) 42%, rgba(4,9,20,0) 62%); }
.sheet__head { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px calc(20px + var(--sar)) 14px calc(20px + var(--sal)); }
.sheet__name { margin: 0; font-size: clamp(1.45rem, 3vw + .8rem, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -.015em; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.sheet__cap { margin: 4px 0 0; font-weight: 600; color: rgba(236,242,252,.88); }
.sheet__body { display: grid; gap: 12px; padding-top: 16px; }
.sheet__desc { margin: 0; color: var(--muted); }
.sheet__saved { margin: 0; font-size: .92rem; font-weight: 700; color: var(--warn); }
.sheet__actions { display: grid; gap: 10px; grid-template-columns: 1fr; }
.sheet__actions .btn { width: 100%; }
@media (min-width: 460px) { .sheet__actions:has(#sheet-new:not([hidden])) { grid-template-columns: 1.4fr 1fr; } }
.sheet__best { margin: 0; font-size: .95rem; color: var(--muted); }
.sheet__best b { color: var(--text); font-variant-numeric: tabular-nums; }
#sheet[data-id="defend"] { --lq: radial-gradient(60% 50% at 50% 45%, #1E4C9E, #0A1324 70%); }
#sheet[data-id="signal"] { --lq: linear-gradient(#11224A, #0C1733); }
#sheet[data-id="flight"] { --lq: radial-gradient(50% 40% at 50% 45%, #6B2C8F, #071026 75%); }
#sheet[data-id="lighthouse"] { --lq: linear-gradient(#8EC8F2, #CFE8F7 55%, #6FA35A); }
@media (min-width: 700px) and (min-height: 521px) { .sheet { padding: 0 24px 24px; } .sheet__media { margin: 0 -24px; } .sheet .layer__x { right: 12px; } }
/* a phone on its side: the card fills the height, the cover on the left, the rest scrolls on the right */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .layer { align-items: stretch; justify-content: center; padding: calc(8px + var(--sat)) calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal)); }
  .layer__panel { width: min(100%, 760px); max-height: none; height: 100%; border-radius: 22px; border-bottom: 1px solid var(--line); animation-name: pop-in; animation-duration: .26s; padding: 12px 18px 14px; }
  .layer.is-closing .layer__panel { animation-name: pop-out; animation-duration: .16s; }
  .layer__grab { display: none; }
  .sheet { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 0 18px; padding: 0 18px 0 0; overflow: hidden; }
  .sheet__media { margin: 0; aspect-ratio: auto; max-height: none; height: 100%; border-radius: 22px 0 0 22px; }
  .sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 0 14px; align-content: start; }
  .sheet .layer__x { left: 10px; right: auto; top: 10px; }
  .sheet__name { font-size: 1.4rem; }
}

/* 🏆: tabs of the games (a row that scrolls sideways on a narrow phone), one table at a time */
.rtabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-18px - var(--sar)) 12px calc(-18px - var(--sal)); padding: 2px calc(18px + var(--sar)) 4px calc(18px + var(--sal)); scroll-snap-type: x proximity; }
.rtabs::-webkit-scrollbar { display: none; }
.rtab { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 14px 4px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--muted); font-weight: 700; font-size: .9rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rtab__img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--bg2); }
.rtab[aria-selected="true"] { color: var(--text); border-color: var(--accent); background: linear-gradient(135deg, rgba(61,143,230,.22), rgba(31,95,197,.12)); }
.rtab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (min-width: 700px) and (min-height: 521px) { .rtabs { margin: 0 0 14px; padding: 2px 0 4px; flex-wrap: wrap; } }
.board--records { border-top: 0; padding-top: 0; }
.board--records:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.board--sheet { margin-top: 2px; }

/* ⚙ */
.set { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.set:first-of-type { border-top: 0; padding-top: 2px; }
.set__h { margin: 0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.set__p { margin: 0; color: var(--muted); font-size: .95rem; }
.set__links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 700; }
.set__links a { display: inline-flex; align-items: center; min-height: 44px; }
.set__ver { margin: 0; color: var(--muted); font-size: .88rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); width: fit-content; max-width: 100%; }
.seg button { min-height: 44px; min-width: 52px; padding: 6px 11px; font-size: .94rem; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seg button[aria-pressed="true"], .seg button[aria-current="true"] { background: var(--card); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0,0,0,.35), inset 0 0 0 1px var(--line2); }
.lang { text-transform: uppercase; }
.btn--danger-text { color: var(--err-text); justify-self: start; }
.install { margin: 0; display: grid; gap: 8px; justify-items: start; }
.install__hint { margin: 0; color: var(--muted); font-size: .92rem; }
.install--ios { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; justify-items: stretch; }
.install__title { margin: 0 0 4px; font-size: 1rem; }
.ios-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ios-steps li { display: flex; gap: 12px; align-items: center; }
.ios-steps__icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.ios-steps__icon svg { width: 22px; height: 22px; }
.installed { margin: 0; color: var(--ok); font-weight: 700; }
.storage { margin: 0; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .tile__btn, .tile__art img, .btn, .icon-btn { transition: none; }
  .tile__btn:hover, .tile__btn:active { transform: none; }
  .tile__btn:hover .tile__art img { transform: none; }
  .layer__panel, .layer__scrim, .layer.is-closing .layer__panel, .layer.is-closing .layer__scrim { animation: none; }
}

/* game */
.game { position: fixed; inset: 0; background: #000; }
.game__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + var(--sat)) calc(8px + var(--sar)) 18px calc(8px + var(--sal)); pointer-events: none; background: linear-gradient(rgba(3, 7, 18, .55), rgba(3, 7, 18, 0)); }
.hud > * { pointer-events: auto; }
.hud__stats { display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.hud__score { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud__best, .hud__extra { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud__right { display: flex; gap: 8px; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(5,10,22,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel { width: min(100%, 420px); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.panel__title { margin: 0; font-size: 1.6rem; }
.panel__text { margin: 0; color: var(--muted); }
.panel__score { margin: 0; font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.panel__secret { margin: 0; font-size: .85rem; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .06em; }
.panel .btn { width: 100%; max-width: 300px; }
.banner { position: absolute; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); width: min(92%, 480px); background: rgba(56,193,114,.16); border: 1px solid rgba(56,193,114,.5); color: #E3FBEC; border-radius: 14px; padding: 12px 16px; text-align: center; backdrop-filter: blur(6px); animation: banner-in .4s ease-out; pointer-events: none; }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.rotate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 22px; background: rgba(5,10,22,.85); border-radius: 18px; border: 1px solid var(--line); pointer-events: none; text-align: center; }
.rotate svg { width: 44px; height: 44px; animation: rot 1.6s ease-in-out infinite alternate; }
@keyframes rot { from { transform: rotate(0); } to { transform: rotate(90deg); } }
.toast { position: fixed; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); width: min(94%, 520px); display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 12px 36px rgba(0,0,0,.4); z-index: 35; }
.toast span { flex: 1; }
.panel__note { margin: 0; font-size: .88rem; line-height: 1.4; color: var(--warn-text); background: rgba(242,177,52,.12); border: 1px solid rgba(242,177,52,.35); border-radius: 12px; padding: 10px 12px; text-align: left; }
.choice { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice:first-of-type { border-color: rgba(61,143,230,.6); background: linear-gradient(135deg, rgba(61,143,230,.22), rgba(31,95,197,.18)); }
.choice:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.choice__icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.06); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.choice__icon svg { width: 26px; height: 26px; }
.choice__text { display: grid; gap: 2px; }
.choice__name { font-weight: 700; font-size: 1.05rem; }
.choice__badge { display: inline-block; vertical-align: 2px; margin-left: 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); background: rgba(56,193,114,.14); border-radius: 999px; padding: 2px 8px; }
.choice__hint { font-size: .88rem; color: var(--muted); }
.sens { width: 100%; max-width: 300px; display: grid; gap: 6px; font-size: .9rem; color: var(--muted); text-align: left; }
.sens input { width: 100%; accent-color: var(--accent); min-height: 32px; }
.panel .btn--small { width: auto; }
/* 1.6: «Музыка» / «Звуки» in the pause (games with their own music) — two switches side by side, off = dimmed with a slash */
.mix { width: 100%; max-width: 300px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel .mix .btn { width: 100%; min-width: 0; padding: 6px 8px; gap: 8px; }
.mix__t { display: grid; text-align: left; line-height: 1.15; min-width: 0; }
.mix__n { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix__s { font-size: .76rem; font-weight: 500; color: var(--muted); }
.mix__btn[aria-pressed="true"] .mix__s { color: var(--ok); }
.mix__btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mix__btn[aria-pressed="false"] { color: var(--muted); opacity: .75; }
.mix__btn[aria-pressed="false"] .mix__n { text-decoration: line-through; text-decoration-thickness: 1.5px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .rotate svg, .banner { animation: none; } }

/* 1.2: nickname row, high-score tables, saved game, size on the device, dialogs */
.me { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 12px; margin: 0; }
.me__icon { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: var(--card2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.me__icon svg { width: 18px; height: 18px; }
.me__text { flex: 1; min-width: 0; font-size: .92rem; color: var(--muted); overflow-wrap: anywhere; }
.board { border-top: 1px solid var(--line); padding-top: 10px; width: 100%; text-align: left; }
.board__title { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.board__tabs { display: inline-flex; gap: 2px; padding: 2px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 999px; }
.board__tab { font: inherit; font-size: .84rem; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 4px 14px; min-height: 44px; cursor: pointer; }
.board__tab[aria-pressed="true"] { background: rgba(61,143,230,.22); color: var(--text); }
.board__tab:focus-visible { outline: 2px solid var(--accent, #3d8fe6); outline-offset: 1px; }
.board__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.board__list li { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 8px; align-items: baseline; padding: 3px 8px; border-radius: 8px; }
.board--sheet .board__list li, .board--records .board__list li { padding: 7px 10px; }
.board--sheet .board__list li:nth-child(odd), .board--records .board__list li:nth-child(odd) { background: var(--bg2); }
.board--sheet .board__list li.is-me, .board--records .board__list li.is-me { background: rgba(61,143,230,.2); box-shadow: inset 3px 0 0 var(--accent); }
.board__list li:nth-child(-n+3) .board__n { color: var(--warn); font-weight: 800; }
.board__list li.is-me { background: rgba(61,143,230,.18); }
.board__n { color: var(--muted); text-align: right; }
.board__nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__score { font-weight: 700; }
.board__me { margin: 8px 0 0; font-size: .88rem; font-weight: 600; color: var(--text); }
.board__note { margin: 6px 0 0; font-size: .84rem; color: var(--muted); }
.board--over { margin-top: 4px; }
.panel--scroll { max-height: calc(100% - 8px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.panel__send { margin: 0; font-size: .92rem; font-weight: 600; color: var(--muted); }
.panel__send.is-ok { color: var(--ok); }
.panel__send.is-bad { color: var(--warn-text); }
.panel__hint { margin: 0; font-size: .85rem; color: var(--muted); }
.panel__title--sm { font-size: 1.25rem; }
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,10,22,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal .panel { text-align: left; justify-items: stretch; }
.modal .panel .btn { max-width: none; }
.modal input, .modal label { -webkit-user-select: text; user-select: text; touch-action: auto; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .9rem; font-weight: 600; }
.field__input { font: inherit; font-size: 1.1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%; }
.field__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field__hint { margin: 0; font-size: .84rem; color: var(--muted); }
.field__err { margin: 0; font-size: .9rem; font-weight: 600; color: var(--err-text); }
.btn--danger { background: #B8323A; border-color: transparent; color: #fff; }

/* 1.7: the island of the day's line on the ready screen — left out on very low screens (the «Play» button must stay in view) */
@media (max-height: 370px) { #ready-daily { display: none; } }

/* «new version» card (1.8): at the top, a clear title + a big button; it never sits over a running game (app.js waits) */
.upd { position: fixed; left: 50%; top: calc(10px + var(--sat)); transform: translateX(-50%); width: min(94%, 560px); z-index: 40; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px 16px; background: linear-gradient(160deg, #1B2D52, #142240); border: 1px solid rgba(61,143,230,.55); border-radius: 18px; box-shadow: 0 18px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04) inset; animation: upd-in .35s cubic-bezier(.22,1,.36,1) both; }
.upd[hidden] { display: none; }
.upd__ic { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.upd__txt { display: grid; gap: 2px; min-width: 0; }
.upd__txt b { font-size: 1.05rem; line-height: 1.25; }
.upd__txt span { font-size: .88rem; line-height: 1.4; color: var(--muted); }
.upd__btns { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 6px; }
.upd__go { flex: 1 1 auto; min-height: 48px; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.upd__later { flex: 0 0 auto; min-height: 48px; background: transparent; }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .upd { animation: none; } }
@media (orientation: landscape) and (max-height: 480px) { .upd { grid-template-columns: auto 1fr auto; padding: 10px 14px; } .upd__btns { grid-column: auto; margin: 0; } .upd__ic { grid-row: auto; width: 38px; height: 38px; } }
