/* lite·fi — etusivu. Vaalea, iloinen, kevyt. Fontit itse-hostattuina (fonts/). */

@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url(../fonts/unbounded-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/figtree-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Figtree';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/figtree-latin-italic.woff2) format('woff2');
}

:root {
    /* Brändi (kirjattu myös AGENT_LOG.md:hen id.lite.fi:tä varten) */
    --paper: #fbf6ec;      /* tausta */
    --surface: #ffffff;    /* kortit, paneelit */
    --sand: #f3ecdd;       /* toissijainen pinta */
    --ink: #1b1d2e;        /* teksti, reunat */
    --muted: #5b5e72;      /* toissijainen teksti (5,9:1 paperilla) */
    --line: #e4dccb;
    --accent: #2350e8;     /* järvi — valkoinen teksti päällä 6,2:1 */
    --accent-hover: #1a3fc0;
    --link: #1a43b8;       /* linkit paperilla 7,7:1 */
    --sun: #ffc93c;        /* pallo, korostukset (ei tekstitaustaksi valkoiselle) */
    --coral: #ff6a5a;

    --font-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
    --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius: 18px;
    --wrap: min(1180px, 100% - 2.5rem);
    --shadow: 5px 5px 0 var(--ink);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(520px 360px at 8% -6%, rgba(255, 201, 60, .28), transparent 70%),
        radial-gradient(700px 420px at 100% 110%, rgba(35, 80, 232, .08), transparent 70%),
        var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--link); }
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
.defs { position: absolute; }

.ico {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--accent);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: 10px;
    z-index: 100;
}
.skip:focus { top: 1rem; }

/* ---------- Napit ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .62em 1.05em;
    background: var(--accent);
    color: #fff;
    font: 700 .9rem/1 var(--font-body);
    letter-spacing: .01em;
    text-decoration: none;
    border: 2px solid var(--ink);
    border-radius: 12px;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn .ico { fill: currentColor; stroke: none; width: .95em; height: .95em; }

/* ---------- Yläpalkki ---------- */
.topbar {
    width: var(--wrap);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 0 .4rem;
}
.brand { display: inline-flex; border-radius: 12px; }
.brand img { height: 40px; width: auto; }
.topnav { display: flex; align-items: center; gap: 1.1rem; }
.topnav > a:not(.account) {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
}
.topnav > a:not(.account):hover { color: var(--accent); }
.topnav > a[hidden] { display: none; }

.account {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 2.2rem;
    padding: 0 .8rem 0 .55rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: 600 .85rem/1 var(--font-body);
    text-decoration: none;
    transition: background-color .15s ease;
}
.account[hidden] { display: none; }
.account:hover { background: var(--sand); }
.account .ico { width: 1rem; height: 1rem; }
.account-avatar { width: 1.6rem; height: 1.6rem; margin-left: -.3rem; border-radius: 50%; border: 2px solid var(--ink); background: var(--sand); }
.account-avatar[hidden] { display: none; }
.account-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang button {
    background: none;
    border: 0;
    color: var(--muted);
    font: 700 .75rem/1 var(--font-body);
    letter-spacing: .06em;
    padding: .55rem .7rem;
    cursor: pointer;
}
.lang button[aria-pressed="true"] { color: #fff; background: var(--ink); }
.lang button:not([aria-pressed="true"]):hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
    width: var(--wrap);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    gap: 2rem;
    padding: 1.2rem 0 1.4rem;
}
.eyebrow {
    margin: 0 0 .6rem;
    color: var(--accent);
    font: 700 .78rem/1 var(--font-body);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0;
    font: 800 clamp(2rem, 3.7vw, 3.3rem)/1.04 var(--font-display);
    letter-spacing: -.02em;
    text-wrap: balance;
}
.hero h1 em {
    font-style: normal;
    color: var(--accent);
    background: linear-gradient(transparent 62%, rgba(255, 201, 60, .75) 62%, rgba(255, 201, 60, .75) 92%, transparent 92%);
}
.lede { max-width: 44rem; margin: .8rem 0 0; color: var(--muted); font-size: 1.05rem; }
.promise { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; }
.promise li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem .35rem .55rem;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-weight: 600;
    font-size: .85rem;
}
.promise .ico { color: #1f8a4c; stroke-width: 3; }

/* tarrapino: lajipiktogrammit vinossa, heittokaari kuten logossa */
.hero-art { position: relative; height: 230px; }
.hero-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero-arc path { fill: none; stroke: var(--accent); stroke-opacity: .45; stroke-width: 5; stroke-linecap: round; stroke-dasharray: .1 16; }
.sticker {
    --c: var(--accent);
    position: absolute;
    width: 104px;
    height: 104px;
    padding: 12px;
    border-radius: 26px;
    background: var(--c);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow);
}
.sticker img { width: 100%; height: 100%; }
.s1 { --c: #2b8f55; left: 4%; top: 46%; transform: rotate(-8deg); }
.s2 { --c: #7a5af0; left: 36%; top: 2%; transform: rotate(6deg); width: 120px; height: 120px; }
.s3 { --c: #d2622a; right: 0; top: 40%; transform: rotate(9deg); width: 96px; height: 96px; }
.s4 { --c: #a8732f; left: 40%; top: 60%; transform: rotate(-4deg); width: 88px; height: 88px; }
.hero-ball {
    position: absolute;
    right: 8%;
    top: 10%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sun);
    border: 2px solid var(--ink);
    animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- Päivän haasteet (heron oikea palsta) ---------- */
.hero.has-daily .hero-art { display: none; }
.daily {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: .9rem 1rem .8rem;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background-image: radial-gradient(circle at 100% 0, rgba(255, 201, 60, .35) 0 46px, transparent 47px);
}
.daily[hidden] { display: none; }
.daily-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.daily-head h2 { margin: 0; font: 800 1.02rem/1.1 var(--font-display); letter-spacing: -.01em; }
.daily-date { margin: 0; font: 700 .78rem/1 var(--font-body); color: var(--muted); text-transform: capitalize; }
.daily-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.daily-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .45rem .4rem .4rem;
    border-radius: 13px;
    background: var(--paper);
}
.daily-row .soon-tile { width: 40px; height: 40px; border-radius: 10px; }
.daily-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.daily-name { font: 700 .9rem/1.2 var(--font-body); }
.daily-top { color: var(--muted); font-size: .76rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-play {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .42rem .65rem;
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: 10px;
    font: 700 .78rem/1 var(--font-body);
    text-decoration: none;
}
.daily-play .ico { fill: currentColor; stroke: none; width: .8rem; height: .8rem; }
.daily-play::after { content: ''; position: absolute; inset: 0; } /* koko rivi klikattava */
.daily-row:hover .daily-play { background: var(--accent-hover); }
.daily-row:hover { background: var(--sand); }
.daily-row.is-soon { opacity: .62; }
.daily-soon { flex: none; font: 700 .7rem/1 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.daily-more { display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start; font-weight: 700; font-size: .82rem; color: var(--link); text-decoration: none; }
.daily-more[hidden] { display: none; }
.daily-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.daily-more .ico { width: .9rem; height: .9rem; }
.daily-foot { margin: auto 0 0; display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .76rem; }
.daily-foot .ico { width: .95rem; height: .95rem; }

/* ---------- Pelit ---------- */
.games-section,
.coming-section {
    width: var(--wrap);
    margin: 0 auto;
}
.coming-section { padding: 1.4rem 0 2.4rem; }
.coming-section[hidden] { display: none; }
.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}
.section-head h2 { margin: 0; font: 800 1.45rem/1 var(--font-display); letter-spacing: -.01em; }
.section-note { margin: 0; color: var(--muted); font-size: .92rem; }
.section-cta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 700;
    font-size: .9rem;
    color: var(--link);
    text-decoration: none;
}
.section-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-cta .ico { width: 1rem; height: 1rem; transition: transform .15s ease; }
.section-cta:hover .ico { transform: translateX(3px); }

.games {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}
.game { --c: var(--accent); min-width: 0; }
.card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover,
.card:focus-within { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.card:focus-within { outline: 3px solid var(--accent); outline-offset: 4px; }
.card:focus-within .card-link:focus-visible { outline: none; }

.card-tile {
    --c: var(--accent);
    position: relative;
    display: grid;
    place-items: center;
    height: 132px;
    background:
        radial-gradient(circle at 82% 22%, rgba(255, 255, 255, .22) 0 14px, transparent 15px),
        radial-gradient(circle at 12% 88%, rgba(255, 255, 255, .14) 0 34px, transparent 35px),
        var(--c);
    border-bottom: 2px solid var(--ink);
}
.card-tile img { width: 96px; height: 96px; transition: transform .25s ease; }
.card:hover .card-tile img { transform: rotate(-6deg) scale(1.06); }

.card-body { flex: 1; display: flex; flex-direction: column; padding: .85rem 1rem 1rem; }
.card-kicker {
    margin: 0 0 .25rem;
    color: var(--muted);
    font: 700 .72rem/1.2 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-title { margin: 0 0 .35rem; font: 800 1.15rem/1.15 var(--font-display); letter-spacing: -.01em; }
.card-record {
    position: relative;
    z-index: 3;  /* kortin klikkauspeitteen yläpuolella → oma linkki Top 100:aan */
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: -.1rem 0 .45rem;
    padding: .15rem .5rem .15rem .35rem;
    background: #fff4cc;
    border-radius: 999px;
    color: #5c3d00;
    font: 700 .74rem/1.2 var(--font-body);
    text-decoration: none;
    max-width: 100%;
}
.card-record[hidden] { display: none; }
.games.is-compact .has-record .card-text { -webkit-line-clamp: 1; } /* ennätysrivi mahtuu ilman että rivi kasvaa */
.card-record span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-record .ico { width: .95rem; height: .95rem; stroke-width: 2; color: #b07800; flex: none; }
.card-record:hover { background: #ffe58a; }
.card-text {
    margin: 0 0 .9rem;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
/* koko kortti klikattava, vain yksi linkki saavutettavuuspuussa */
.card-link { display: inline-flex; text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.card:hover .btn,
.card:focus-within .btn { background: var(--accent-hover); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

.size,
.sister {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .25rem .5rem;
    border-radius: 999px;
    font: 700 .74rem/1 var(--font-body);
    white-space: nowrap;
}
.size { background: #fff4cc; color: #6b4b00; }
.size[hidden] { display: none; }
.footer-small .size { margin-right: .35rem; vertical-align: 1px; }
.size .ico { fill: #e0a400; stroke: none; width: .9rem; height: .9rem; }
.sister { background: #0a0a14; color: #00ff88; letter-spacing: .02em; }
.card-tile .sister { position: absolute; left: .6rem; top: .6rem; border: 1px solid rgba(0, 255, 136, .45); }

/* Kompakti tila (> 4 pelattavaa): 3 saraketta, vaakakortit — laatta vasemmalla */
.games.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.games.is-compact .card { flex-direction: row; }
.games.is-compact .card-tile { height: auto; width: 112px; flex: none; border-bottom: 0; border-right: 2px solid var(--ink); }
.games.is-compact .card-tile img { width: 72px; height: 72px; }
.games.is-compact .card-tile .sister { display: none; } /* ylärivi kertoo jo krypta.gg */
.games.is-compact .card-body { padding: .7rem .9rem .8rem; min-width: 0; }
.games.is-compact .card-kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.games.is-compact .card-title { font-size: 1.05rem; margin-bottom: .25rem; }
.games.is-compact .card-text { font-size: .84rem; margin-bottom: .6rem; }
.games.is-compact .btn { padding: .5em .85em; font-size: .82rem; }

/* > 6 pelattavaa: 4 saraketta kompakteja kortteja (8 = 4×2) */
.games.is-compact.is-wide4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.games.is-wide4 .card-tile { width: 84px; }
.games.is-wide4 .card-tile img { width: 56px; height: 56px; }
.games.is-wide4 .card-body { padding: .6rem .75rem .7rem; }
.games.is-wide4 .card-kicker { font-size: .66rem; }
.games.is-wide4 .card-title { font-size: .98rem; }
.games.is-wide4 .card-text { font-size: .8rem; -webkit-line-clamp: 2; }
.games.is-wide4 .size { font-size: .68rem; padding: .2rem .4rem; }
/* > 8 pelattavaa: 5 saraketta (9–10 peliä = 2 riviä), kapeammilla näytöillä takaisin wide4-sääntöihin */
@media (min-width: 1181px) {
    .games.is-compact.is-wide4.is-wide5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
    .games.is-wide5 .card-tile { width: 62px; }
    .games.is-wide5 .card-tile img { width: 44px; height: 44px; }
    .games.is-wide5 .card-body { padding: .55rem .65rem .65rem; min-width: 0; }
    .games.is-wide5 .card-kicker { font-size: .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .games.is-wide5 .card-title { font-size: .84rem; letter-spacing: -.01em; }
    .games.is-wide5 .card-text { font-size: .76rem; }
    .games.is-wide5 .btn { padding: .42em .6em; font-size: .76rem; gap: .3em; }
    .games.is-wide5 .card-foot { flex-wrap: nowrap; gap: .35rem; }
    .games.is-wide5 .size { font-size: .62rem; padding: .18rem .32rem; white-space: nowrap; }
    .games.is-wide5 .size .ico { width: .75rem; height: .75rem; }
}

/* ---------- Tulossa ---------- */
.coming {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: .75rem;
}
.soon {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    padding: .55rem .7rem .55rem .55rem;
    background: rgba(255, 255, 255, .6);
    border: 2px dashed #b9b09c;
    border-radius: 14px;
}
.soon-tile {
    --c: var(--accent);
    flex: none;
    width: 46px;
    height: 46px;
    padding: 5px;
    border-radius: 12px;
    background: var(--c);
}
.soon-tile img { width: 100%; height: 100%; }
.soon-text { display: flex; flex-direction: column; min-width: 0; }
.soon-name { font: 700 .9rem/1.2 var(--font-body); hyphens: manual; }
.soon-line { color: var(--muted); font-size: .76rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.load-error { grid-column: 1 / -1; color: #b3261e; font-weight: 600; }

/* ---------- Alisivut (ehdota, liiga, upota, joulu) ---------- */
.topnav > a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.page { width: var(--wrap); margin: 0 auto; padding-bottom: 2.5rem; }
.page-hero { padding: 1.2rem 0 1.4rem; max-width: 52rem; }
.page-hero h1 { margin: 0; font: 800 clamp(2rem, 4.2vw, 3.1rem)/1.05 var(--font-display); letter-spacing: -.02em; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 1rem 0 0; padding: 0; font-weight: 600; font-size: .92rem; }
.steps li { display: inline-flex; align-items: center; gap: .5rem; }
.step-n {
    display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--sun); border: 2px solid var(--ink); font: 800 .8rem/1 var(--font-display);
}
.panel {
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem 1.2rem;
}
.panel h2 { margin: 0 0 .8rem; font: 800 1.15rem/1.1 var(--font-display); }
.gate p { margin: 0 0 .9rem; color: var(--muted); }
.gate[hidden], form[hidden] { display: none; }
.btn { cursor: pointer; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--sand); }

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; font-weight: 700; font-size: .88rem; }
.field input, .field select, .field textarea {
    font: 500 1rem/1.4 var(--font-body);
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 12px;
    padding: .6rem .75rem;
    width: 100%;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; background: #fff; }
.field-hint { align-self: flex-end; color: var(--muted); font-weight: 600; font-size: .75rem; }
.form-msg { min-height: 1.3em; margin: .7rem 0 0; font-weight: 700; font-size: .9rem; color: #b3261e; }
.form-msg.is-ok { color: #1f7a45; }
.form-note { margin: .3rem 0 0; color: var(--muted); font-size: .8rem; }

.ideas-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.idea-form-panel { position: sticky; top: 1rem; }
.tabs { margin-left: auto; display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--surface); }
.tabs button { background: none; border: 0; padding: .5rem .85rem; font: 700 .82rem/1 var(--font-body); color: var(--muted); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ideas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.idea {
    display: flex; gap: .9rem; align-items: flex-start;
    background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; padding: .8rem .9rem;
}
.vote {
    flex: none; display: flex; flex-direction: column; align-items: center; gap: .1rem;
    width: 3.4rem; padding: .45rem 0 .4rem; cursor: pointer;
    background: var(--paper); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
    font: 800 1rem/1 var(--font-display);
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.vote .ico { fill: currentColor; stroke: none; width: 1rem; height: 1rem; }
.vote:hover { background: var(--sand); }
.vote:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.vote[aria-pressed="true"] { background: var(--accent); color: #fff; }
.idea-body { min-width: 0; flex: 1; }
.idea-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.idea-title { margin: 0; font: 800 1.02rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.chip { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; background: var(--sand); font: 700 .72rem/1.1 var(--font-body); }
.chip[hidden] { display: none; }
.idea-status.is-tyon-alla { background: #fff4cc; color: #6b4b00; }
.idea-status.is-julkaistu { background: #d9f5e3; color: #145c33; }
.idea-text { margin: .35rem 0 0; color: var(--ink); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.idea-meta { margin: .45rem 0 0; color: var(--muted); font-size: .8rem; display: flex; gap: .8rem; align-items: center; }
.idea-delete { background: none; border: 0; padding: 0; color: #b3261e; font: 700 .8rem/1 var(--font-body); cursor: pointer; text-decoration: underline; }
.ideas-empty { color: var(--muted); font-weight: 600; }
#more { margin-top: 1rem; }
#more[hidden] { display: none; }

@media (max-width: 860px) {
    .ideas-layout { grid-template-columns: minmax(0, 1fr); }
    .idea-form-panel { position: static; }
}

/* ---------- Joulukalenteri ---------- */
.xmas-status { margin: .9rem 0 0; display: inline-block; padding: .45rem .85rem; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: .92rem; }
.xmas-status:empty { display: none; }
.xmas-board {
    position: relative;
    overflow: hidden;
    padding: 2.4rem 1.4rem 1.6rem;
    border: 2px solid var(--ink);
    border-radius: 24px;
    box-shadow: var(--shadow);
    background:
        radial-gradient(1200px 300px at 50% 110%, rgba(255, 255, 255, .16), transparent 70%),
        linear-gradient(180deg, #0d1640 0%, #1b2a6b 100%);
}
/* lumisade: kaksi pistekerrosta eri nopeuksilla */
.xmas-board::before,
.xmas-board::after {
    content: '';
    position: absolute;
    inset: -200px 0 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 120px 90px, rgba(255, 255, 255, .8) 50%, transparent 51%),
        radial-gradient(3px 3px at 200px 160px, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 70px 190px, rgba(255, 255, 255, .7) 50%, transparent 51%);
    background-size: 240px 220px;
    animation: snow 14s linear infinite;
    opacity: .8;
}
.xmas-board::after { background-size: 320px 260px; animation-duration: 22s; opacity: .5; filter: blur(.6px); }
@keyframes snow { to { transform: translateY(220px); } }
.xmas-lights {
    position: absolute;
    left: 0; right: 0; top: 10px;
    height: 16px;
    background:
        radial-gradient(circle at 12px 10px, #ff5a5f 0 5px, transparent 6px) 0 0 / 96px 16px,
        radial-gradient(circle at 36px 10px, #ffc93c 0 5px, transparent 6px) 0 0 / 96px 16px,
        radial-gradient(circle at 60px 10px, #4ade80 0 5px, transparent 6px) 0 0 / 96px 16px,
        radial-gradient(circle at 84px 10px, #7cc4ff 0 5px, transparent 6px) 0 0 / 96px 16px;
    animation: twinkle 2.4s steps(2) infinite;
}
.xmas-lights::before { content: ''; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid rgba(255, 255, 255, .35); }
@keyframes twinkle { 50% { filter: brightness(.6) saturate(.7); } }

.doors {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: minmax(108px, auto);
    grid-auto-flow: dense;  /* 22 + 2×(2×2) = 30 = 6×5 */
    gap: .85rem;
}
.doors li { display: contents; }
.door {
    --paper: #c8323c;
    --c: #2350e8;
    position: relative;
    display: grid;
    place-items: center;
    min-height: 108px;
    padding: .5rem;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .07) 0 8px, transparent 8px 16px),
        var(--paper);
    color: #fff;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, .45);
    cursor: pointer;
    font: inherit;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.door.is-big { grid-row: span 2; grid-column: span 2; }
.door-n { font: 800 clamp(1.6rem, 3vw, 2.4rem)/1 var(--font-display); text-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
.door.is-big .door-n { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.door.is-openable:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 6px 0 rgba(0, 0, 0, .5); }
.door.is-locked { cursor: default; filter: saturate(.45) brightness(.75); }
.door.is-locked::after {
    content: '';
    position: absolute;
    right: .55rem; bottom: .5rem;
    width: 12px; height: 10px;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 2px;
    box-shadow: 0 -6px 0 -2px rgba(255, 255, 255, .0);
}
.door.is-locked::before {
    content: '';
    position: absolute;
    right: calc(.55rem + 3px); bottom: calc(.5rem + 10px);
    width: 6px; height: 6px;
    border: 2px solid rgba(255, 255, 255, .8);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
}
.door.is-today { outline: 4px solid var(--sun); outline-offset: 3px; animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { outline-color: rgba(255, 201, 60, .45); } }
.door.is-opening { animation: flip .5s ease-in forwards; }
@keyframes flip { to { transform: perspective(600px) rotateY(-75deg); filter: brightness(1.2); } }
.door.is-opened { background: var(--c); }
.door.is-opened img { width: 62%; max-width: 86px; }
.door.is-opened .door-n { position: absolute; left: .55rem; top: .4rem; font-size: 1rem; text-shadow: none; }

.xmas-detail { display: flex; gap: 1.1rem; align-items: center; margin-top: 1.4rem; }
.xmas-detail[hidden] { display: none; }
.xmas-detail .soon-tile { width: 96px; height: 96px; padding: 10px; border-radius: 22px; border: 2px solid var(--ink); }
.xmas-detail .soon-tile[hidden] { display: none; }
.xd-body { min-width: 0; }
.xd-body h2 { margin: .1rem 0 .3rem; font: 800 1.35rem/1.15 var(--font-display); }
.xd-body p { margin: 0 0 .8rem; color: var(--muted); }
.xd-body .eyebrow { margin: 0; }
.btn[hidden] { display: none; }

@media (max-width: 760px) {
    .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(84px, auto); gap: .6rem; }
    .door { min-height: 84px; }
    .door.is-big { grid-row: auto; grid-column: auto; }
    .door.is-big .door-n { font-size: clamp(1.6rem, 3vw, 2.4rem); }
    .xmas-board { padding: 2.2rem .8rem 1rem; }
    .xmas-detail { flex-direction: column; align-items: flex-start; }
}

/* ---------- Upota ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.embed-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.embed-h2 { margin-top: 1.2rem !important; }
.embed-games { display: flex; flex-direction: column; gap: .5rem; }
.embed-game {
    display: flex; align-items: center; gap: .65rem; width: 100%;
    padding: .45rem .7rem .45rem .45rem; cursor: pointer; text-align: left;
    background: var(--paper); color: var(--ink);
    border: 2px solid var(--line); border-radius: 14px; font: 700 .92rem/1.2 var(--font-body);
}
.embed-game .soon-tile { width: 40px; height: 40px; border-radius: 10px; }
.embed-game[aria-checked="true"] { border-color: var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.embed-game[aria-checked="true"]::after { content: ''; margin-left: auto; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); }
.embed-game:disabled { cursor: default; opacity: .6; }
.embed-game-name { flex: 1; }
.embed-soon { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.embed-sizes { margin: 0 0 .7rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.code {
    width: 100%; resize: vertical;
    font: 500 .8rem/1.5 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    color: var(--ink); background: var(--sand);
    border: 2px solid var(--ink); border-radius: 12px; padding: .7rem .8rem;
}
.embed-actions { display: flex; align-items: center; gap: .8rem; margin-top: .6rem; }
.embed-actions .form-msg { margin: 0; min-height: 0; }
.embed-preview h2 { margin: 0 0 .8rem; font: 800 1.15rem/1.1 var(--font-display); }
.embed-frame {
    --ratio: 16/9;
    aspect-ratio: var(--ratio);
    max-height: 72vh;
    margin: 0 auto;
    background: repeating-linear-gradient(45deg, var(--sand) 0 12px, #fff 12px 24px);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.embed-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) { .embed-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Liigat ---------- */
.lg-side { display: flex; flex-direction: column; gap: 1.1rem; }
.lg-list { list-style: none; margin: 0 0 .2rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.lg-item {
    width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
    padding: .55rem .75rem; cursor: pointer; text-align: left;
    background: var(--paper); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; font: inherit;
}
.lg-item[aria-pressed="true"] { border-color: var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.lg-item-name { font-weight: 700; }
.lg-item-meta { color: var(--muted); font-size: .78rem; }
.lg-inline { display: flex; gap: .5rem; }
.lg-inline input {
    flex: 1; min-width: 0;
    font: 600 1rem/1.3 var(--font-body); color: var(--ink);
    background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: .55rem .7rem;
}
.lg-inline input:focus { outline: 3px solid var(--accent); outline-offset: 1px; background: #fff; }
.code-input { text-transform: uppercase; letter-spacing: .18em; font-family: ui-monospace, Menlo, Consolas, monospace !important; }
.gate.panel { max-width: 44rem; }
.gate.panel[hidden], #lg-app[hidden] { display: none; }
.lg-detail[hidden] { display: none; }
.lg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lg-head h2 { margin: .15rem 0 0; font: 800 1.5rem/1.1 var(--font-display); overflow-wrap: anywhere; }
.lg-head .eyebrow { margin: 0; }
.lg-actions { display: flex; gap: .5rem; }
.lg-invite {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    margin: 1rem 0; padding: .6rem .7rem; background: var(--sand); border-radius: 12px; font-weight: 700; font-size: .85rem;
}
.lg-invite code { flex: 1; min-width: 12rem; font: 600 .85rem/1.3 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.lg-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.lg-filters .tabs { margin-left: 0; flex-wrap: wrap; }
.board { width: 100%; border-collapse: separate; border-spacing: 0; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.board th, .board td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.board th { background: var(--ink); color: #fff; font: 700 .78rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.board tr:last-child td { border-bottom: 0; }
.board td:first-child { width: 3rem; font: 800 .95rem/1 var(--font-display); }
.board .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.board tr.is-me td { background: #fff4cc; }
.board td.board-empty { color: var(--muted); text-align: center; padding: 1.2rem; width: auto; font: 600 .92rem/1.4 var(--font-body); }

/* ---------- Top ---------- */
.top-panel { display: flex; flex-direction: column; gap: .9rem; }
.top-games { margin-left: 0; flex-wrap: wrap; border-radius: 16px; }
.top-games button { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem .4rem .4rem; }
.top-tile { --c: var(--accent); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--c); }
.top-tile img { width: 22px; height: 22px; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.top-bar .tabs { margin-left: 0; }
.top-player { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.top-ava { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: var(--sand); }
.top-date { color: var(--muted); font-weight: 500 !important; }
.top-mine { margin: 0; padding: .55rem .8rem; background: #fff4cc; border: 2px solid var(--ink); border-radius: 12px; font-weight: 700; }
.top-mine[hidden] { display: none; }
.top-overview[hidden], .top-detail[hidden] { display: none; }
.top-detail { display: flex; flex-direction: column; gap: .9rem; }
.top-ov-note { margin: 0 0 .8rem; }
.top-ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.top-ov { border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--surface); }
.top-ov-head {
    width: 100%; display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem .5rem .5rem; cursor: pointer;
    background: var(--sand); border: 0; border-bottom: 2px solid var(--ink); font: inherit; color: var(--ink); text-align: left;
}
.top-ov-head:hover { background: #fff4cc; }
.top-ov-name { flex: 1; font: 800 .95rem/1.15 var(--font-display); }
.top-ov-more { display: inline-flex; align-items: center; gap: 3px; font: 700 .76rem/1 var(--font-body); color: var(--link); white-space: nowrap; }
.top-ov-more .ico { width: 13px; height: 13px; }
.top-ov-list { list-style: none; margin: 0; padding: .3rem 0; }
.top-ov-list li { display: flex; align-items: baseline; gap: .55rem; padding: .3rem .8rem; font-size: .9rem; }
.top-ov-list li + li { border-top: 1px solid var(--line); }
.top-ov-list li.is-me { background: #fff4cc; }
.top-ov-rank { width: 1.2rem; font: 800 .85rem/1 var(--font-display); }
.top-ov-nick { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-ov-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.top-ov-list li.top-ov-empty { color: var(--muted); font-size: .84rem; padding: .7rem .8rem; }
@media (max-width: 560px) { .top-date { display: none; } }

/* ---------- Footer ---------- */
.footer {
    width: var(--wrap);
    margin: 0 auto;
    padding: 1.6rem 0 2.4rem;
    border-top: 2px solid var(--line);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    font-size: .88rem;
    color: var(--muted);
}
.footer p { margin: 0; }
.footer-brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.footer-brand img { border-radius: 9px; }
.footer-small a { font-weight: 700; }
.footer-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; font-weight: 700; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 404 ---------- */
.lost {
    width: var(--wrap);
    margin: 0 auto;
    min-height: 70vh;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 1.1rem;
}
.lost h1 { margin: 0; font: 800 clamp(2.6rem, 9vw, 5.5rem)/1 var(--font-display); letter-spacing: -.02em; }
.lost p { margin: 0; color: var(--muted); max-width: 36rem; font-size: 1.05rem; }
.lost .btn { margin-top: .4rem; }

/* ---------- Matalat näytöt: kaikki pelit samalle ruudulle ---------- */
@media (max-height: 800px) and (min-width: 901px) {
    .hero { padding: .6rem 0 1rem; }
    .hero-art { height: 190px; }
    .lede { display: none; }
    .card-tile { height: 108px; }
    .card-tile img { width: 80px; height: 80px; }
    .coming-section { padding-top: .8rem; }
    .hero h1 { font-size: 2.7rem; }
    .promise { margin-top: .7rem; }
    .section-head { margin-bottom: .65rem; }
    .topbar { padding-top: .6rem; }
    .daily-row.is-soon { display: none; }  /* tulossa-lajit näkyvät omassa rivissään */
    .games.is-compact .card-text { display: none; }  /* ylärivi + otsikko riittävät matalalla näytöllä */
    .games.is-compact .card-title { margin-bottom: .55rem; }
    .games.is-compact .card-tile { width: 96px; }
    .games.is-compact .card-tile img { width: 60px; height: 60px; }
    .games.is-compact .has-record .card-title { margin-bottom: .3rem; }  /* ennätysrivi ei saa kasvattaa riviä yli ruudun */
    .games.is-compact .card-record { margin-bottom: .35rem; }
    .games.is-compact .card-body { padding-top: .55rem; padding-bottom: .6rem; }
    .games.is-compact.is-wide4 { gap: .7rem; }
    .games.is-compact.is-wide4 .card-tile { width: 80px; }  /* leveämpi teksti → pitkät nimet (Saappaanheitto) yhdelle riville */
    .games.is-compact.is-wide4 .card-tile img { width: 54px; height: 54px; }
    .coming-section { padding-top: .4rem; }
    .daily { gap: .45rem; padding: .7rem .9rem .65rem; align-self: center; }
    .daily-list { gap: .35rem; }
    .daily-row { padding: .3rem .4rem .3rem .3rem; }
    .daily-row .soon-tile { width: 34px; height: 34px; }
}

/* ---------- Kapeat näytöt ---------- */
@media (max-width: 1180px) {
    .games.is-compact.is-wide4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .games, .games.is-compact, .games.is-compact.is-wide4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .hero-art { display: none; }
    .daily { align-self: auto; }
}
@media (max-width: 560px) {
    .topnav > a:not(.account) { display: none; }
    .topnav { gap: .5rem; }
    .account-name { max-width: 9ch; }
    .brand img { height: 34px; }
    .games, .games.is-compact, .games.is-compact.is-wide4 { grid-template-columns: 1fr; gap: .9rem; }
    .card { flex-direction: row; }
    .card-tile { height: auto; width: 96px; flex: none; border-bottom: 0; border-right: 2px solid var(--ink); }
    .card-tile img { width: 64px; height: 64px; }
    .card-tile .sister { display: none; } /* ylärivi kertoo jo krypta.gg */
    .card-body { padding: .7rem .8rem .8rem; }
    .card-text { font-size: .84rem; margin-bottom: .6rem; }
    .coming { grid-template-columns: 1fr 1fr; }
    .soon-line { display: none; }
    .soon-name { font-size: .84rem; }
    .footer { grid-template-columns: 1fr; gap: .7rem; }
}
/* wide5 matalalla näytöllä: kapea laatta, jotta Pelaa + koko mahtuvat samalle riville (ohittaa yllä olevan 96 px) */
@media (max-height: 800px) and (min-width: 1181px) {
    .games.is-compact.is-wide5 .card-tile { width: 58px; }
    .games.is-compact.is-wide5 .card-tile img { width: 42px; height: 42px; }
    .games.is-compact.is-wide5 .card-title { margin-bottom: .4rem; }
    .games.is-wide5 .card-record { margin-bottom: .35rem; }
    .games.is-compact.is-wide5 { gap: .7rem; }
}
