/* Kadryk Games launcher. Warm dark, poster-like tiles, one soft apricot accent; each category has its own colour (--cat). Phone first. */
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../fonts/rubik-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../fonts/rubik-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: "Rubik"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(../fonts/rubik-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #121113; --s1: #1a191c; --s2: #232126; --s3: #2d2a30; --line: #ffffff14; --text: #ece7df; --mute: #a19a92;
  --acc: #eaa978; --acc-ink: #2b1608; --upd: #9cc3d5; --red: #d0605a;
  --r: 14px; --gut: 16px; --bar: 56px;
  color-scheme: dark;
}
.cat-all { --cat: var(--text); } .cat-games { --cat: #eaa978; } .cat-mini { --cat: #d6a2c2; } .cat-horror { --cat: #c95f55; } .cat-fav { --cat: #d6a2c2; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 52px); }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--text); font: 400 16px/1.45 "Rubik", system-ui, sans-serif;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.6; }
[hidden] { display: none !important; }
html:has(dialog[open]) { overflow: hidden; } /* the page behind a sheet doesn't scroll */
main, .foot { max-width: 1120px; margin: 0 auto; padding: 0 var(--gut); }

/* ---- top bar */
.bar { position: sticky; top: 0; z-index: 20; height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gut) 0;
  display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.mark { display: flex; align-items: baseline; min-height: 44px; padding-top: 9px; text-decoration: none; font-weight: 900; font-size: 25px; letter-spacing: -1px; margin-right: auto; }
.mark i { color: var(--acc); font-style: normal; }
.mark b { margin-left: 7px; align-self: center; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--acc-ink);
  background: var(--acc); padding: 3px 6px 2px; border-radius: 5px; transform: translateY(1px) rotate(-3deg); }
.bar-actions { display: flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--s1); cursor: pointer; }
.icon-btn:hover { background: var(--s2); }
.lang { font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.search { position: absolute; inset: env(safe-area-inset-top) var(--gut) 0; display: flex; align-items: center; gap: 8px; }
.search > .ic { position: absolute; left: 13px; color: var(--mute); pointer-events: none; }
.search input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--s1); padding: 0 12px 0 42px; font-size: 16px; outline: none; }
.search input:focus { border-color: var(--acc); }
.bar.searching .mark, .bar.searching .bar-actions { visibility: hidden; }

/* ---- category tabs: text with an underline in the category colour */
.tabs { position: sticky; top: calc(var(--bar) + env(safe-area-inset-top)); z-index: 19; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 0 calc(var(--gut) - 10px); background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; min-width: 44px; padding: 0 10px; border: 0; background: none; cursor: pointer;
  color: var(--mute); font-weight: 600; font-size: 15px; position: relative; }
.tab small { font-size: 11px; font-weight: 700; color: var(--mute); background: var(--s2); border-radius: 6px; padding: 1px 5px; }
.tab small.s { color: var(--cat); background: none; padding: 0; text-transform: uppercase; letter-spacing: .5px; }
.tab .ic { width: 17px; height: 17px; }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--cat); }
.tab.cat-fav.on .ic { fill: var(--cat); stroke: var(--cat); }

/* ---- home */
.intro { margin: 16px 0 14px; color: var(--mute); font-size: 15px; max-width: 46ch; }
.hero { position: relative; border-radius: 20px; overflow: hidden; background: var(--s1); border: 1px solid var(--line); }
.hero .art { border-radius: 0; aspect-ratio: 16 / 10; }
.hero-txt { position: relative; margin-top: -70px; padding: 64px 16px 16px; background: linear-gradient(transparent, var(--s1) 62px); }
.kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--cat, var(--acc)); }
.hero h2 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -.6px; line-height: 1.05; }
.hero .blurb { margin: 6px 0 14px; color: var(--mute); }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.hero-actions .devs { margin-left: auto; display: flex; gap: 6px; color: var(--mute); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--s2); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.play { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.play:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 52px; font-size: 17px; flex: 1; }

.row, .shelf { margin-top: 28px; }
.row-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-h h2, .list-h h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.row-h h2 small { font-size: 14px; color: var(--mute); font-weight: 500; margin-left: 4px; }
.shelf .row-h h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--cat); margin-right: 9px; transform: translateY(-2px); }
.see-all { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--cat); font-weight: 700; cursor: pointer; }
.see-all .ic { width: 17px; height: 17px; }
.shelf-blurb { margin: 0 0 12px; color: var(--mute); font-size: 14px; }
.row .strip { margin-top: 10px; }

/* ---- tiles: art first, text under it */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 18px 12px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 4px; scroll-padding: 0 var(--gut); }
.strip::-webkit-scrollbar { display: none; }
.tile { display: block; min-width: 0; text-decoration: none; scroll-snap-align: start; }
.art { position: relative; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--h) 45% 30%), hsl(calc(var(--h) + 50) 50% 16%)); box-shadow: inset 0 0 0 1px var(--line); }
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art .emoji { font-size: 48px; }
.tile .art { transition: transform .15s ease, box-shadow .15s ease; }
.tile:hover .art, .tile:focus-visible .art { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--acc), 0 10px 24px #0008; }
.tile:focus-visible { outline: none; }
.tile:active .art { transform: scale(.97); }
.tags { position: absolute; left: 7px; top: 7px; display: flex; gap: 5px; }
.tag { font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 6px 2px; border-radius: 6px; background: #000a; color: var(--text); }
.tag.new { background: var(--acc); color: var(--acc-ink); }
.tag.upd { background: var(--upd); color: #0f1e26; }
.tag.age { background: var(--red); color: #fff; }
.fav-dot { position: absolute; right: 7px; top: 7px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #000a; color: #d6a2c2; }
.fav-dot .ic { width: 15px; height: 15px; fill: currentColor; }
.t-body h3 { margin: 8px 0 0; font-size: 15px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 3px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--mute); }
.meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devs { display: inline-flex; gap: 3px; }
.devs .ic { width: 15px; height: 15px; }
.tile.small .t-body h3 { font-size: 14px; }
.tile.mini { width: 100%; }
.tile.mini .t-body h3 { font-size: 13px; -webkit-line-clamp: 1; margin-top: 6px; }
.row .strip { grid-auto-columns: 124px; }

/* ---- coming soon (horror gets grain and red) */
.soon { position: relative; overflow: hidden; border-radius: 18px; padding: 22px 18px; border: 1px solid color-mix(in srgb, var(--cat) 40%, transparent);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--cat) 28%, transparent), transparent 60%),
    repeating-radial-gradient(circle at 30% 40%, #ffffff06 0 1px, transparent 1px 3px), var(--s1); }
.soon h3 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.4px; }
.soon p { margin: 6px 0 0; color: var(--mute); max-width: 40ch; }
.chip-soon { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--cat); border: 1px solid var(--cat); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.cat-horror .soon h3 { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; letter-spacing: 0; }

/* ---- install and support */
.promo { margin-top: 24px; display: grid; grid-template-columns: 48px 1fr; gap: 6px 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line); }
.promo img { width: 48px; height: 48px; border-radius: 12px; }
.promo p { margin: 0; font-size: 14px; }
.promo-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; }
.support { margin: 40px 0 0; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; border: 1px dashed #ffffff2e; }
.support .ic.big { color: var(--acc); }
.support h2 { margin: 0; font-size: 18px; }
.support p { margin: 4px 0 12px; color: var(--mute); font-size: 14px; }
.btn.jar { background: var(--text); color: var(--ink); }
.dev-note { font-style: italic; }

/* ---- list view */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px calc(-1 * var(--gut)) 0; padding: 0 var(--gut); }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--s1); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip .ic { width: 17px; height: 17px; }
.chip.on { background: var(--text); color: var(--ink); border-color: var(--text); }
.sep { flex: none; width: 1px; margin: 8px 2px; background: var(--line); }
.list-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 6px; }
.sort { position: relative; display: inline-flex; align-items: center; color: var(--mute); }
.sort .ic { position: absolute; left: 10px; width: 17px; height: 17px; pointer-events: none; }
.sort select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--s1);
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.cat-blurb { margin: 0 0 14px; color: var(--mute); font-size: 14px; }
.banner { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; margin-bottom: 18px; padding: 10px; border-radius: 16px; background: var(--s1);
  border: 1px solid var(--line); text-decoration: none; }
.banner h3 { margin: 0; font-size: 16px; }
.banner p { margin: 2px 0 4px; color: var(--mute); font-size: 13px; line-height: 1.3; }
.banner .link { display: inline-flex; align-items: center; gap: 4px; color: var(--cat, var(--acc)); font-weight: 700; font-size: 14px; }
.banner .link .ic { width: 16px; height: 16px; }
.empty { text-align: center; color: var(--mute); padding: 30px 0; }
.empty .soon { text-align: left; }

/* ---- game sheet: a bottom sheet on phones, a centred card on wide screens */
.sheet { padding: 0; border: 0; color: var(--text); background: var(--s1); width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0;
  border-radius: 22px 22px 0 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: #000b; backdrop-filter: blur(3px); }
.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-in { position: relative; padding-bottom: env(safe-area-inset-bottom); }
.sheet .art { border-radius: 0; aspect-ratio: 16 / 9; }
.sheet-x { position: absolute; right: 12px; top: 12px; background: #000a; border-color: #ffffff2a; }
.sheet-body { padding: 16px var(--gut) 22px; }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.5px; line-height: 1.1; }
.sheet h2 .tag { vertical-align: middle; font-size: 12px; }
.sheet .blurb { margin: 8px 0 0; color: #d9d5e2; }
.warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #d0605a1f; border: 1px solid #d0605a66; font-size: 14px; }
.note { margin: 10px 0 0; color: var(--upd); font-size: 14px; }
.sheet-actions { display: flex; gap: 8px; margin: 16px 0; }
.sheet-actions .icon-btn { width: 52px; height: 52px; }
.fav-btn.on { color: #d6a2c2; border-color: #d6a2c266; }
.fav-btn.on .ic { fill: currentColor; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 0; }
.fact { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-content: start; padding: 10px 12px; border-radius: 12px; background: var(--s2); }
.fact > .ic { grid-row: span 2; width: 22px; height: 22px; margin-top: 2px; color: var(--mute); }
.fact dt { font-size: 12px; color: var(--mute); grid-column: -2; }
.fact dd { margin: 0; font-weight: 600; font-size: 14px; grid-column: -2; }
.fact.dev-best dd, .fact.dev-best > .ic { color: var(--acc); }
.fact.dev-no dd { color: var(--red); }
.fact.here { box-shadow: inset 0 0 0 1px #ffffff30; }
.from { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px; color: var(--cat, var(--acc)); font-weight: 700; text-decoration: none; }
.from .ic { width: 17px; height: 17px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--ink); font-weight: 700; font-size: 14px; }
.foot { color: var(--mute); font-size: 13px; padding-top: 28px; padding-bottom: 32px; }
.foot p { margin: 0 0 4px; }
.foot .small { opacity: .6; }

@media (min-width: 700px) {
  :root { --gut: 24px; }
  .hero { display: grid; grid-template-columns: 1.35fr 1fr; align-items: end; }
  .hero .art { aspect-ratio: 3 / 2; height: 100%; }
  .hero-txt { margin: 0; padding: 28px; background: none; }
  .hero h2 { font-size: 38px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 16px; }
  .strip { grid-auto-columns: 190px; margin: 0; padding: 0 0 4px; }
  .row .strip { grid-auto-columns: 150px; }
  .tabs { justify-content: center; }
  .sheet { max-width: 560px; margin: auto; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { .tile .art, .sheet[open] { transition: none; animation: none; } }

/* ---- account and feedback panels (same bottom sheet, no art) */
.acct-btn.in { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.initial { font-weight: 800; font-size: 17px; }
.panel .sheet-body { position: relative; padding-top: 22px; }
.panel h2 { padding-right: 56px; }
.panel .sheet-x { top: 12px; right: 12px; background: var(--s2); }
.small-print { margin: 12px 0 0; color: var(--mute); font-size: 13px; }
.small-print a, .foot a { color: var(--text); }
.signin { display: grid; justify-items: start; gap: 12px; margin-top: 16px; min-height: 44px; }
.sync-status { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--mute); font-size: 14px; }
.sync-status.err { color: var(--red); }
.conflict { margin-top: 12px; padding: 12px; border-radius: 12px; background: #eaa97814; border: 1px solid #eaa97855; }
.conflict p { margin: 0 0 10px; font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.conflict .row-btns { margin-top: 0; }
.btn[disabled] { opacity: .6; cursor: default; }
.danger { display: block; min-height: 44px; margin-top: 18px; padding: 0; border: 0; background: none; color: var(--red); font-weight: 600; font-size: 14px; cursor: pointer; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--mute); }
.field select, .fb-text { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--s2); color: var(--text); font-size: 16px; }
.field select { min-height: 44px; padding: 0 12px; }
.fb-text { display: block; padding: 12px; resize: vertical; min-height: 120px; outline: none; margin-bottom: 14px; }
.fb-text:focus, .field select:focus { border-color: var(--acc); }
.fb-form .btn.big { width: 100%; }
.fb-form .fb-signin { margin-top: 8px; }
.thanks { margin: 14px 0 6px; font-size: 17px; }
button.from { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--mute); }
.foot .fb-open { margin-bottom: 18px; }
.foot .small a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- likes */
.rate { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; }
.rate p { margin: 0 0 0 4px; color: var(--mute); font-size: 13.5px; line-height: 1.3; }
.vote.on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.vote[data-v="-1"].on { background: var(--s3); color: var(--text); border-color: #ffffff40; }
.pct { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; color: var(--text); font-weight: 600; }
.pct .ic { width: 13px; height: 13px; }
.rate-prompt { display: grid; grid-template-columns: 64px 1fr; gap: 10px 12px; align-items: center; margin: 14px 0; padding: 12px; border-radius: 16px;
  background: var(--s2); border: 1px solid #eaa97855; }
.rate-prompt img { width: 64px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.rate-prompt p { margin: 0; font-weight: 700; }
.rate-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.rate-btns .skip { margin-left: auto; background: none; border-color: transparent; color: var(--mute); }
