/* Trifunovv games site. Mobile first, system fonts, no external resources. */
:root {
  --bg: #f6f2ea; --card: #ffffff; --ink: #1d1b18; --muted: #6b665e; --line: #e7e0d4;
  --accent: #1d1b18; --accent-ink: #ffffff; --bar: #e8a33d; --bar-bg: #f1eadc; --ok: #2f7a4f; --err: #b3402e;
  --soft: #efe8db; --shadow: 0 1px 2px rgba(29,27,24,.06), 0 8px 24px rgba(29,27,24,.06);
  --r: 20px; --logo-filter: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --card: #1e1c19; --ink: #f3efe7; --muted: #a8a196; --line: #2f2b26;
    --accent: #f3efe7; --accent-ink: #141311; --bar: #e8a33d; --bar-bg: #2a2621; --soft: #26231f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); --logo-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --card: #1e1c19; --ink: #f3efe7; --muted: #a8a196; --line: #2f2b26;
  --accent: #f3efe7; --accent-ink: #141311; --bar-bg: #2a2621; --soft: #26231f; --logo-filter: invert(1); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
.small { font-size: 13px; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--bar); outline-offset: 2px; border-radius: 6px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5; padding: 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.top-in { max-width: 1040px; margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { display: block; height: 30px; width: auto; filter: var(--logo-filter); }
.top nav { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.top nav a:hover { color: var(--ink); }
.top nav a.pill { color: var(--accent-ink); background: var(--accent); padding: 7px 14px; border-radius: 999px; }
@media (max-width: 420px) { .top nav a:not(.pill) { display: none; } }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* hero */
.hero { padding: 44px 0 20px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.hero h1 { font-size: clamp(34px, 9vw, 64px); font-weight: 800; letter-spacing: -.025em; max-width: 14ch; }
.lede { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); margin-top: 16px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.icon-wall { display: flex; gap: 10px; margin-top: 32px; overflow: hidden; mask-image: linear-gradient(90deg, #000 70%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); }
.icon-wall img { width: 56px; height: 56px; border-radius: 22%; flex: none; box-shadow: var(--shadow); }
@media (min-width: 960px) {
  .hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
  .icon-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; mask-image: none; -webkit-mask-image: none; transform: rotate(-6deg); }
  .icon-wall img { width: 100%; height: auto; aspect-ratio: 1; }
  .icon-wall img:nth-child(4n+2), .icon-wall img:nth-child(4n+4) { transform: translateY(22px); }
}

/* buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small-btn { padding: 7px 14px; min-height: 38px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.voted { background: var(--bar); border-color: var(--bar); color: #1d1b18; }

/* sections */
.sec { padding: 36px 0 8px; }
.sec-head { margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(24px, 5vw, 32px); font-weight: 800; }
.sec-head p { color: var(--muted); margin-top: 6px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.icon { border-radius: 22%; flex: none; display: block; background: var(--soft); }
.line { color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); vertical-align: middle; letter-spacing: .02em; }

/* live */
.live-card { padding: 22px; display: grid; gap: 22px; overflow: hidden; }
.shots { display: flex; gap: 12px; justify-content: center; }
.shots img { width: 46%; max-width: 200px; height: auto; aspect-ratio: 9 / 20; border-radius: 22px; border: 6px solid #1d1b18; box-shadow: var(--shadow); background: #1d1b18; }
.shots img + img { margin-top: 28px; }
@media (min-width: 760px) {
  .live-card.has-shots { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 32px; }
  .shots { margin-bottom: -60px; }
}
.live-head { display: flex; gap: 16px; align-items: center; }
.live-head h3 { font-size: 26px; font-weight: 800; }
.live-head .icon { width: 84px; height: 84px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; background: #111; color: #fff; text-decoration: none; border: 1px solid #111;
  padding: 8px 16px 8px 12px; border-radius: 12px; min-height: 52px; font: inherit; font-weight: 600; font-size: 17px; cursor: pointer; line-height: 1.1; text-align: left;
}
.store small { display: block; font-size: 11px; font-weight: 500; opacity: .85; letter-spacing: .02em; }
.store-soon { background: transparent; color: var(--ink); border-color: var(--line); }
.store-soon small { opacity: .7; }
:root .store { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.try { margin-top: 14px; }
.try a { color: var(--ink); font-weight: 600; text-decoration: none; }

/* demos */
.demo-grid { display: grid; gap: 12px; }
.demo-card { display: flex; gap: 14px; align-items: center; text-decoration: none; transition: transform .12s ease; }
.demo-card:hover { transform: translateY(-2px); }
.demo-card h3 { font-size: 19px; }
.demo-card .icon { width: 64px; height: 64px; }
.demo-card > div { flex: 1; min-width: 0; }
.play-btn { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 9px 18px; font-weight: 700; flex: none; }

/* coming soon */
.soon-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.soon-card { display: grid; grid-template-columns: 56px 1fr; gap: 6px 14px; align-items: center; padding: 14px; }
.soon-card .icon { width: 56px; height: 56px; grid-row: span 2; }
.soon-card h3 { font-size: 17px; }
.soon-card .line { font-size: 14px; line-height: 1.4; }
.soon-actions { grid-column: 2; display: flex; gap: 8px; margin-top: 4px; }
@media (min-width: 640px) {
  .soon-grid { grid-template-columns: 1fr 1fr; }
  .demo-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .soon-grid { grid-template-columns: 1fr 1fr 1fr; }
  .hero { padding: 72px 0 28px; }
}

/* vote */
.vote-card { padding: 8px 8px 12px; }
.vote-status { padding: 10px 10px 6px; color: var(--muted); font-size: 14px; }
.vote-list { list-style: none; margin: 0; padding: 0; }
.vote-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; }
.vote-row + .vote-row { border-top: 1px solid var(--line); border-radius: 0; }
.vote-row .icon { width: 40px; height: 40px; }
.vote-main { flex: 1; min-width: 0; }
.vote-label { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.vote-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-count { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bar { height: 8px; background: var(--bar-bg); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w, 0%); background: var(--bar); border-radius: 99px; transition: width .5s ease; }
.vote-row.mine .vote-name::after { content: " · your vote today"; color: var(--muted); font-weight: 500; }
.vote-row.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--bar) 35%, transparent); } 100% { background: transparent; } }

/* subscribe form */
.sub-form { display: grid; gap: 14px; }
.field span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--bar); border-color: transparent; }
.game-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.game-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 248px; overflow: auto; padding: 2px; }
.chk { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; cursor: pointer; background: var(--bg); }
.chk img { border-radius: 7px; }
.chk input { accent-color: var(--bar); width: 18px; height: 18px; margin: 0; }
.chk:has(input:checked) { border-color: var(--bar); background: color-mix(in srgb, var(--bar) 14%, var(--card)); }
.chk small { color: var(--muted); display: block; font-size: 11px; line-height: 1.1; }
.chk > span { min-width: 0; line-height: 1.2; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--bar); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-weight: 600; min-height: 1.2em; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--err); }
.ts:empty { display: none; }

/* dialog */
.sheet { border: 0; padding: 22px 18px 18px; border-radius: 22px; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sheet::backdrop { background: rgba(20,19,17,.45); }
.sheet h2 { font-size: 22px; margin-bottom: 4px; padding-right: 40px; }
.dlg-sub { color: var(--muted); margin-bottom: 14px; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.sheet-close button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }

/* footer */
.foot { max-width: 1040px; margin: 48px auto 0; padding: 28px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); display: grid; gap: 6px; font-size: 14px; }
.foot-logo { height: 22px; width: auto; filter: var(--logo-filter); margin-bottom: 6px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--ink); }

/* privacy / plain pages */
.prose { max-width: 720px; padding-top: 32px; }
.prose h1 { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.prose h2 { font-size: 24px; margin: 32px 0 10px; }
.prose h3 { font-size: 18px; margin: 20px 0 6px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose li { margin-bottom: 8px; }
.prose code { background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.note-page { max-width: 520px; padding-top: 40px; }
.note-page .brand img { height: 34px; margin-bottom: 24px; }
.note { display: grid; gap: 14px; }
.note h1 { font-size: 26px; }

/* demo player */
body.play { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.play-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.play-bar img { border-radius: 8px; }
.play-bar .back { text-decoration: none; font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.play-bar .back:hover { background: var(--soft); }
.play-title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.play-title span { font-size: 13px; color: var(--muted); }
.play-main { flex: 1; position: relative; max-width: none; width: 100%; margin: 0; padding: 0; min-height: 0; overflow: hidden; }
/* Demos built from a game's dev build keep a placeholder strip at the very bottom: the frame runs that much taller and the strip sits below the fold. */
.play-main.crop-bottom iframe { height: calc(100% + 60px); }
.play-main iframe { border: 0; width: 100%; height: 100%; display: block; background: #f6f2ea; }
.demo-end { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.demo-end[hidden] { display: none; }
.demo-end-card { max-width: 420px; text-align: center; display: grid; gap: 14px; justify-items: center; padding: 28px 22px; }
.demo-end-card .icon { width: 80px; height: 80px; }
.demo-end-card h2 { font-size: 26px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (min-width: 760px) {
  .vote-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .vote-row + .vote-row { border-top: 0; }
  .vote-row { border-top: 1px solid var(--line) !important; border-radius: 0; }
  .vote-row:nth-child(-n+2) { border-top: 0 !important; }
}
/* Desktop: the games are made for phones, so the demo plays in a phone-shaped column. */
@media (min-width: 700px) {
  .play-main { background: var(--soft); }
  .play-main iframe { max-width: 440px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
}
