/* Colour themes. Blue (Digimon World 3) is the default; the header toggle sets data-theme="green" on <html>
   to bring back the original green. Every themed colour is a --th-* variable named after its green value. */
:root {
    --th-111713: #111417;
    --th-121611: #111416;
    --th-131813: #131618;
    --th-151b18: #15181b;
    --th-171c14: #14191c;
    --th-171d15: #151a1d;
    --th-171d19: #171a1d;
    --th-18201a: #181d20;
    --th-182112: #121b21;
    --th-191f1b: #191c1f;
    --th-1b221e: #1b1f22;
    --th-1b221ee8: #1b1f22e8;
    --th-1b221ef2: #1b1f22f2;
    --th-1b231e: #1b2023;
    --th-1b2410: #101c24;
    --th-1c231e: #1c2023;
    --th-20271c: #1c2227;
    --th-202822: #202528;
    --th-203015: #152530;
    --th-222b25: #22272b;
    --th-232d27: #23292d;
    --th-233021: #212a30;
    --th-242e24: #242a2e;
    --th-26331c: #1c2933;
    --th-283024: #242b30;
    --th-283123: #232b31;
    --th-283327: #272e33;
    --th-293323: #232c33;
    --th-2b362d: #2b3136;
    --th-2e3a26: #26323a;
    --th-2f392c: #2c3439;
    --th-2f3f22: #22333f;
    --th-30392d: #2d3439;
    --th-30392df2: #2d3439f2;
    --th-303c27: #27333c;
    --th-303d25: #25333d;
    --th-303e25: #25343e;
    --th-34432a: #2a3943;
    --th-344626: #263946;
    --th-344d38: #34434d;
    --th-354137: #353c41;
    --th-38463b: #384046;
    --th-3a4636: #363f46;
    --th-3a4a2c: #2c3e4a;
    --th-3b4731: #313e47;
    --th-43503a: #3a4750;
    --th-44523f: #3f4a52;
    --th-46513f: #3f4a51;
    --th-48513f: #3f4a51;
    --th-49533d: #3d4a53;
    --th-49533e: #3e4a53;
    --th-4d5b3a: #3a4d5b;
    --th-4e613b: #3b5161;
    --th-52634a: #4a5963;
    --th-526449: #495964;
    --th-52653e: #3e5565;
    --th-53604a: #4a5760;
    --th-586450: #505c64;
    --th-647b42: #42637b;
    --th-657055: #556570;
    --th-65705b: #5b6770;
    --th-65774b: #4b6577;
    --th-6f8a4f: #4f718a;
    --th-718064: #647480;
    --th-788766: #667987;
    --th-7d9466: #668194;
    --th-94b85b: #5b91b8;
    --th-accent-18: rgba(112, 192, 250, .18);
    --th-bcc7af: #afbdc7;
    --th-c0cab6: #b6c2ca;
    --th-c8d1c0: #c0cad1;
    --th-ccfa70: #70c0fa;
    --th-ccfa700a: #70c0fa0a;
    --th-ccfa700b: #70c0fa0b;
    --th-ccfa700f: #70c0fa0f;
    --th-ccfa7018: #70c0fa18;
    --th-ccfa7026: #70c0fa26;
    --th-ccfa7030: #70c0fa30;
    --th-ddffa2: #a2d8ff;
    --th-e1ffaa: #aadcff;
    --th-e5eadf: #dfe5ea;
    --th-e6ebe3: #e3e8eb;
    --th-e7eddf: #dfe7ed;
}

:root[data-theme="green"] {
    --th-111713: #111713;
    --th-121611: #121611;
    --th-131813: #131813;
    --th-151b18: #151b18;
    --th-171c14: #171c14;
    --th-171d15: #171d15;
    --th-171d19: #171d19;
    --th-18201a: #18201a;
    --th-182112: #182112;
    --th-191f1b: #191f1b;
    --th-1b221e: #1b221e;
    --th-1b221ee8: #1b221ee8;
    --th-1b221ef2: #1b221ef2;
    --th-1b231e: #1b231e;
    --th-1b2410: #1b2410;
    --th-1c231e: #1c231e;
    --th-20271c: #20271c;
    --th-202822: #202822;
    --th-203015: #203015;
    --th-222b25: #222b25;
    --th-232d27: #232d27;
    --th-233021: #233021;
    --th-242e24: #242e24;
    --th-26331c: #26331c;
    --th-283024: #283024;
    --th-283123: #283123;
    --th-283327: #283327;
    --th-293323: #293323;
    --th-2b362d: #2b362d;
    --th-2e3a26: #2e3a26;
    --th-2f392c: #2f392c;
    --th-2f3f22: #2f3f22;
    --th-30392d: #30392d;
    --th-30392df2: #30392df2;
    --th-303c27: #303c27;
    --th-303d25: #303d25;
    --th-303e25: #303e25;
    --th-34432a: #34432a;
    --th-344626: #344626;
    --th-344d38: #344d38;
    --th-354137: #354137;
    --th-38463b: #38463b;
    --th-3a4636: #3a4636;
    --th-3a4a2c: #3a4a2c;
    --th-3b4731: #3b4731;
    --th-43503a: #43503a;
    --th-44523f: #44523f;
    --th-46513f: #46513f;
    --th-48513f: #48513f;
    --th-49533d: #49533d;
    --th-49533e: #49533e;
    --th-4d5b3a: #4d5b3a;
    --th-4e613b: #4e613b;
    --th-52634a: #52634a;
    --th-526449: #526449;
    --th-52653e: #52653e;
    --th-53604a: #53604a;
    --th-586450: #586450;
    --th-647b42: #647b42;
    --th-657055: #657055;
    --th-65705b: #65705b;
    --th-65774b: #65774b;
    --th-6f8a4f: #6f8a4f;
    --th-718064: #718064;
    --th-788766: #788766;
    --th-7d9466: #7d9466;
    --th-94b85b: #94b85b;
    --th-accent-18: rgba(204, 250, 112, .18);
    --th-bcc7af: #bcc7af;
    --th-c0cab6: #c0cab6;
    --th-c8d1c0: #c8d1c0;
    --th-ccfa70: #ccfa70;
    --th-ccfa700a: #ccfa700a;
    --th-ccfa700b: #ccfa700b;
    --th-ccfa700f: #ccfa700f;
    --th-ccfa7018: #ccfa7018;
    --th-ccfa7026: #ccfa7026;
    --th-ccfa7030: #ccfa7030;
    --th-ddffa2: #ddffa2;
    --th-e1ffaa: #e1ffaa;
    --th-e5eadf: #e5eadf;
    --th-e6ebe3: #e6ebe3;
    --th-e7eddf: #e7eddf;
}

:root {
    color-scheme: dark;
    --bg: #111315;
    --panel: #1a1d20;
    --line: #303335;
    --muted: #a2a6a5;
    --accent: var(--th-ccfa70);
    --text: #f2f2ed
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 "Segoe UI", Arial, sans-serif
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select {
    font: inherit
}

a,
input,
select {
    outline-offset: 5px
}

a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent)
}

.site {
    max-width: 1280px;
    padding: 0 60px;
    margin: auto
}

/* On wide screens, frame the content column so it stands apart from the empty sides. */
/* With the starfield on, the column turns translucent so the stars show faintly behind the content. */
@media(min-width:1320px) {
    body {
        background: #08090a
    }

    .site {
        min-height: 100vh;
        background: var(--bg);
        border-inline: 1px solid var(--line);
        box-shadow: 0 0 60px #0006
    }

    .space-on .site {
        background: #111315d9
    }
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 0;
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    gap: 13px;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 1.2px
}

.brand-mark {
    position: relative;
    font-size: 26px;
    letter-spacing: -3px;
    border: 1px solid #686e62;
    padding: 10px 13px 12px 10px
}

.brand-mark span {
    font-size: 16px;
    color: var(--accent);
    vertical-align: top;
    letter-spacing: 0
}

.brand-sub {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.7px;
    margin-top: 6px
}

.lang-switch {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px
}

.header-toggles {
    display: flex;
    align-items: center;
    gap: 8px
}

.space-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s
}

.space-toggle:hover {
    color: var(--text)
}

.space-toggle[aria-pressed="true"] {
    color: var(--accent);
    border-color: var(--th-4e613b);
    background: var(--th-ccfa700f)
}

.space-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* Starfield canvas (space.js) sits behind everything; the page background shows through around it. */
.space-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.lang-note {
    max-width: 260px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
    text-align: right
}

.lang-note[hidden] {
    display: none
}

.lang-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px
}

.lang-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background .2s, color .2s
}

.lang-toggle button:hover {
    color: var(--text)
}

.lang-toggle button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--bg)
}

.lang-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.lang-toggle svg {
    flex: none;
    width: 21px;
    height: 14px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25)
}

/* Keep the Google Translate engine invisible: no top banner, hover tooltip, or highlight. */
#google-translate-element,
iframe.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-yAWNEb-L7lbkb {
    display: none !important
}

body {
    top: 0 !important
}

.goog-text-highlight,
.VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q {
    background: none !important;
    box-shadow: none !important
}

.intro {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 70px;
    align-items: center;
    padding: 76px 0 80px
}

.eyebrow {
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 22px
}

.eyebrow>span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--accent);
    margin-right: 9px
}

h1 {
    font-size: clamp(38px, 4.8vw, 64px);
    line-height: 1.1;
    letter-spacing: -3px;
    font-weight: 650;
    margin: 0 0 24px
}

h1 em {
    font-style: normal;
    color: var(--accent)
}

.intro-copy {
    color: var(--muted);
    margin-bottom: 28px
}

.primary {
    display: inline-flex;
    align-items: center;
    gap: 38px;
    background: var(--accent);
    color: var(--th-1b2410);
    padding: 13px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700
}

.primary:hover {
    background: var(--th-ddffa2)
}

.edition {
    border: 1px solid var(--th-49533d);
    background: var(--th-20271c);
    padding: 24px 26px;
    transform: rotate(2deg);
    border-radius: 5px;
    box-shadow: 10px 12px 0 var(--th-171c14)
}

.edition-top {
    display: flex;
    justify-content: space-between;
    font: 11px monospace;
    letter-spacing: 1px;
    color: var(--th-bcc7af);
    gap: 15px
}

.language {
    font-weight: 800;
    font-size: 90px;
    letter-spacing: -7px;
    line-height: .95;
    margin: 30px 0;
    color: #828d75
}

.language>span {
    font-size: 60px;
    font-weight: 400;
    margin-left: 28px
}

.language strong {
    color: var(--accent);
    font-size: 110px
}

.language strong span {
    font-weight: 400
}

.edition-bottom {
    border-top: 1px solid var(--th-48513f);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--th-c0cab6)
}

.badge {
    border: 1px solid var(--th-788766);
    padding: 5px 9px;
    font: 10px/1.5 monospace;
    letter-spacing: 1px;
    align-self: center
}

.collection {
    padding: 35px 0 68px;
    border-top: 1px solid var(--line)
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px
}

.section-heading .eyebrow {
    margin-bottom: 8px
}

.section-heading p:last-child {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 5px
}

h2 {
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: -1px;
    margin: 0
}

h2>span {
    font: 12px monospace;
    color: var(--accent);
    vertical-align: top;
    display: inline-block;
    margin: 3px 0 0 12px;
    border: 1px solid var(--th-4d5b3a);
    border-radius: 20px;
    padding: 3px 8px
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 20px
}

.search {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 10px 16px;
    border-radius: 4px;
    width: 440px
}

.search>span {
    font-size: 26px;
    line-height: 1;
    color: var(--muted)
}

input {
    color: var(--text);
    width: 100%;
    background: transparent;
    border: 0;
    min-width: 0;
    font-size: 14px
}

input::placeholder {
    color: var(--muted)
}

.platform-label {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 14px;
    color: var(--muted)
}

select {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    max-width: 100%
}

.results {
    font-size: 13px;
    color: var(--muted);
    margin-top: 16px
}

.empty {
    margin-top: 20px;
    padding: 42px 20px;
    text-align: center;
    border: 1px dashed #3b403a;
    border-radius: 5px;
    background: #151819
}

.empty-symbol {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--th-49533e);
    border-radius: 8px;
    color: var(--accent);
    font-size: 26px
}

.empty h3 {
    margin: 16px 0 8px;
    font-size: 18px
}

.empty p {
    color: var(--muted);
    font-size: 14px;
    margin: 0
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px
}

.game-grid:empty {
    display: none
}

.game-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: var(--panel)
}

.cover {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background: var(--th-283024)
}

.cover-fallback {
    display: grid;
    place-items: center;
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -3px;
    color: var(--accent);
    background: linear-gradient(125deg, var(--th-293323), var(--th-18201a))
}

.card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1
}

.card-meta {
    color: var(--accent);
    font: 12px monospace;
    letter-spacing: 1px
}

.game-card h3 {
    font-size: 21px;
    line-height: 1.3;
    margin: 12px 0
}

.game-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 20px
}

.card-links {
    margin-top: auto;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center
}

.card-links a {
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 4px
}

.card-links a:first-child {
    color: var(--accent)
}

.guide {
    border-top: 1px solid var(--line);
    padding: 40px 0 55px;
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 60px
}

.guide .eyebrow {
    margin-bottom: 12px
}

.guide ol {
    list-style: none;
    padding: 0;
    margin: 0
}

.guide li {
    display: flex;
    gap: 22px;
    padding: 0 0 23px
}

.guide li>span {
    color: var(--accent);
    font: 13px monospace;
    padding-top: 5px
}

.guide h3 {
    font-size: 16px;
    margin: 0 0 3px;
    font-weight: 600
}

.guide p {
    font-size: 14px;
    color: var(--muted);
    margin: 0
}

footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    border-top: 1px solid var(--line);
    padding: 24px 0 30px;
    color: var(--muted);
    font-size: 12px
}

.skip {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--accent);
    color: #111;
    padding: 10px;
    z-index: 10
}

.skip:focus {
    top: 10px
}

[hidden] {
    display: none !important
}

@media(max-width:800px) {
    .site {
        padding: 0 28px
    }

    .intro {
        gap: 30px;
        padding: 50px 0
    }

    .language {
        font-size: 65px
    }

    .language strong {
        font-size: 85px
    }

    .edition {
        padding: 20px
    }

    .edition-top {
        font-size: 9px
    }

    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .guide {
        gap: 30px
    }

    .section-heading>p {
        display: none
    }

    footer {
        flex-wrap: wrap
    }
}

@media(max-width:560px) {
    .site {
        padding: 0 20px
    }

    header {
        padding: 22px 0
    }

    .lang-note {
        max-width: 150px;
        font-size: 10px
    }

    .header-toggles {
        gap: 6px
    }

    .space-toggle {
        width: 32px;
        height: 32px
    }

    .lang-toggle button {
        padding: 6px 9px;
        gap: 6px
    }

    .intro {
        grid-template-columns: 1fr;
        gap: 35px
    }

    h1 {
        font-size: 44px;
        letter-spacing: -2px
    }

    .edition {
        transform: none
    }

    .language {
        font-size: 64px;
        margin: 24px 0
    }

    .language br {
        display: none
    }

    .language strong {
        font-size: 74px;
        margin-left: 28px
    }

    .language>span {
        font-size: 40px;
        margin-left: 10px
    }

    .edition-bottom {
        font-size: 12px
    }

    .toolbar {
        flex-direction: column;
        gap: 12px
    }

    .search {
        width: 100%
    }

    .platform-label {
        justify-content: space-between
    }

    .platform-label select {
        flex: 1
    }

    .game-grid {
        grid-template-columns: 1fr
    }

    .guide {
        grid-template-columns: 1fr
    }

    h2 {
        font-size: 27px
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }
}

.cover-logo {
    object-fit: contain;
    padding: 20px;
    background: #101725
}

.resource-section {
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 18px
}

.resource-section h4 {
    font-size: 16px;
    line-height: 1.4;
    margin: 0 0 10px
}

.resource-section p {
    margin-bottom: 14px
}

.resource-section .card-links {
    margin-top: 0
}

.translation-section,
.download-section {
    background: var(--th-20271c);
    border: 1px solid var(--th-49533d);
    border-radius: 4px;
    padding: 16px
}

.translation-section h4,
.download-section h4 {
    color: var(--accent)
}

.donation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    border-top: 1px solid var(--line);
    padding: 36px 0 44px
}

.donation .eyebrow {
    margin-bottom: 10px
}

.donation p:last-child {
    max-width: 610px;
    color: var(--muted);
    font-size: 14px;
    margin: 12px 0 0
}

.donation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-shrink: 0;
    padding: 14px 22px;
    border-radius: 5px;
    background: #be123c;
    color: #fff;
    font-size: 14px;
    font-weight: 700
}

.donation-button:hover {
    background: #9f1239
}

@media(max-width:560px) {
    .donation {
        align-items: stretch;
        flex-direction: column;
        gap: 22px
    }

    .donation-button {
        align-self: flex-start
    }
}

.mod-mark {
    font-size: 70px;
    letter-spacing: -4px;
    line-height: 1.05
}

.mod-mark strong {
    font-size: 82px
}

@media(max-width:800px) {
    .mod-mark {
        font-size: 48px
    }

    .mod-mark strong {
        font-size: 58px
    }
}

@media(max-width:560px) {
    .mod-mark {
        font-size: 58px
    }

    .mod-mark br {
        display: block
    }

    .mod-mark strong {
        font-size: 68px;
        margin-left: 0
    }
}

.version-history {
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 12px
}

.version-history summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    color: var(--accent)
}

.version-history summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px
}

.version-entries {
    list-style: none;
    margin: 14px 0 0;
    padding: 0
}

.version-entries li+li {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: 14px
}

.version-entries h5 {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 6px
}

.version-entries p {
    margin: 0;
    font-size: 14px
}

/*  */
.item-section {
    background: var(--th-20271c);
    border: 1px solid var(--th-49533d);
    border-radius: 4px;
    padding: 16px
}

.item-section h4 {
    color: var(--accent)
}

.item-type {
    display: inline-block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px
}

.type-filter {
    margin-top: 14px;
    justify-content: flex-end
}

.type-filter select {
    min-width: 170px
}

/* Unified search and filters */
.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
    padding: 20px;
    background: #171a1c;
    border: 1px solid var(--line);
    border-radius: 12px
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0
}

.filter-caption {
    font-size: 14px;
    font-weight: 600;
    color: #bdc3bb
}

.filter-control {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    background: #111416;
    border: 1px solid #393e3e;
    border-radius: 7px;
    transition: border-color .15s, box-shadow .15s
}

.filter-control:hover {
    border-color: var(--th-657055)
}

.filter-control:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--th-ccfa7018)
}

.search-control {
    gap: 11px;
    padding: 0 14px
}

.search-control>svg {
    flex-shrink: 0;
    color: var(--muted)
}

.toolbar input {
    min-width: 0;
    height: 46px;
    font-size: 14px
}

.toolbar input:focus-visible {
    outline: none
}

.toolbar select {
    appearance: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 46px;
    padding: 0 38px 0 14px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text)
}

.toolbar select:focus-visible {
    outline: none
}

.toolbar select option {
    background: #1a1d20;
    color: var(--text)
}

.select-control>svg {
    position: absolute;
    right: 14px;
    pointer-events: none;
    color: var(--accent)
}

@media(max-width:800px) {
    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .search-field {
        grid-column: 1/-1
    }
}

@media(max-width:400px) {
    .toolbar {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
        gap: 14px
    }
}

@media(prefers-reduced-motion:reduce) {
    .filter-control {
        transition: none
    }
}

.item-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px
}

.item-types .item-type {
    margin: 0;
    padding: 2px 8px;
    border: 1px solid var(--th-49533d);
    border-radius: 20px;
    font-size: 12px
}

.extra-links {
    margin-top: 18px;
    border: 1px solid var(--th-49533d);
    border-radius: 6px;
    padding: 0 16px;
    background: var(--th-171d15)
}

.extra-links>summary {
    cursor: pointer;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent)
}

.extra-links>summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.extra-links>.item-section {
    margin: 0 0 16px;
    padding: 14px
}

.extra-links[open]>summary {
    margin-bottom: 2px
}

.publish-date {
    font-size: 13px;
    color: var(--muted);
    display: block;
    margin: 0 0 2px
}

.toolbar {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr))
}

@media(max-width:1000px) {
    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .toolbar .search-field {
        grid-column: auto
    }
}

@media(max-width:560px) {
    .toolbar {
        grid-template-columns: minmax(0, 1fr)
    }
}

.project-taxonomy {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 8px;
    line-height: 1.6
}

.toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

@media(max-width:800px) {
    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:560px) {
    .toolbar {
        grid-template-columns: minmax(0, 1fr)
    }
}

.pinned-badge {
    align-self: flex-start;
    display: inline-block;
    padding: 3px 9px;
    margin-bottom: 12px;
    border: 1px solid var(--th-647b42);
    border-radius: 20px;
    background: var(--th-26331c);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600
}


.pin-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    width: fit-content;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    min-height: 40px
}

.pin-filter input {
    appearance: none;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    border: 1px solid #626a60;
    border-radius: 20px;
    background: #303635;
    position: relative;
    cursor: pointer;
    transition: background .15s
}

.pin-filter input::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--th-e5eadf);
    top: 3px;
    left: 3px;
    transition: transform .15s
}

.pin-filter input:checked {
    background: var(--accent);
    border-color: var(--accent)
}

.pin-filter input:checked::before {
    background: var(--th-203015);
    transform: translateX(16px)
}

.pin-filter:has(input:checked) {
    color: var(--text)
}

@media(prefers-reduced-motion:reduce) {

    .pin-filter input,
    .pin-filter input::before {
        transition: none
    }
}

.title-pin {
    display: inline-block;
    margin-left: 8px;
    font-size: 16px;
    vertical-align: middle;
    line-height: 1
}

.media-stage {
    background: #101725
}

.media-stage .cover {
    display: block
}

.media-video {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: 0
}

.media-error {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--muted);
    font-size: 14px
}

.media-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #151b20;
    border-bottom: 1px solid var(--line)
}

.media-controls button {
    width: 40px;
    min-height: 36px;
    border: 1px solid var(--th-49533d);
    border-radius: 6px;
    color: var(--accent);
    background: var(--th-20271c);
    cursor: pointer
}

.media-controls button:hover {
    background: var(--th-303e25)
}

.media-controls button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.media-count {
    font-size: 13px;
    color: var(--muted)
}

.media-enlarge {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in
}

.media-enlarge:focus-visible,
.media-video-preview:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -4px
}

.media-video-preview {
    width: 100%;
    min-height: 180px;
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    background: #101725;
    color: var(--text);
    border: 0;
    padding: 20px;
    cursor: pointer
}

.video-play-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--th-182112);
    font-size: 24px
}

.media-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    padding: 64px 24px 24px;
    border: 0;
    background: rgba(8, 10, 12, .96);
    color: var(--text);
    box-sizing: border-box
}

.media-lightbox::backdrop {
    background: rgba(0, 0, 0, .85)
}

.media-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid #626a60;
    border-radius: 50%;
    background: #202529;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 1
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 88px);
    object-fit: contain
}

.lightbox-video {
    display: block;
    width: min(1200px, calc(100vw - 48px), calc((100dvh - 88px)*16/9));
    aspect-ratio: 16/9;
    border: 0
}

/* Lightbox zoom and fade */
@keyframes lightbox-fade-in {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes lightbox-zoom-in {
    from {
        opacity: 0;
        transform: scale(.82) translateY(14px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

@keyframes lightbox-fade-out {
    from {
        opacity: 1
    }

    to {
        opacity: 0
    }
}

@keyframes lightbox-zoom-out {
    from {
        opacity: 1;
        transform: scale(1)
    }

    to {
        opacity: 0;
        transform: scale(.9)
    }
}

.media-lightbox[open] {
    animation: lightbox-fade-in 240ms ease-out both
}

.media-lightbox[open]::backdrop {
    animation: lightbox-fade-in 240ms ease-out both
}

.media-lightbox[open] .lightbox-content {
    animation: lightbox-zoom-in 320ms cubic-bezier(.16, 1, .3, 1) both;
    transform-origin: center
}

.media-lightbox.is-closing {
    animation: lightbox-fade-out 200ms ease-in both
}

.media-lightbox.is-closing::backdrop {
    animation: lightbox-fade-out 200ms ease-in both
}

.media-lightbox.is-closing .lightbox-content {
    animation: lightbox-zoom-out 200ms ease-in both
}

@media(prefers-reduced-motion:reduce) {

    .media-lightbox[open],
    .media-lightbox[open]::backdrop,
    .media-lightbox[open] .lightbox-content {
        animation: none
    }
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 1px solid var(--th-65705b);
    border-radius: 50%;
    background: #202529e8;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer
}

.lightbox-previous {
    left: 16px
}

.lightbox-next {
    right: 16px
}

.lightbox-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: #202529e8;
    border-radius: 20px;
    padding: 4px 12px;
    color: var(--text);
    font-size: 14px
}

.media-lightbox {
    padding-bottom: 60px
}

.lightbox-image {
    max-height: calc(100dvh - 124px)
}

.lightbox-video {
    width: min(1200px, calc(100vw - 48px), calc((100dvh - 124px)*16/9))
}

@media(max-width:560px) {
    .lightbox-nav {
        top: auto;
        bottom: 12px;
        transform: none
    }
}

.media-video-preview {
    position: relative;
    overflow: hidden;
    isolation: isolate
}

.youtube-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2
}

.media-video-preview::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    z-index: -1
}

.video-preview-caption {
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 4px #000
}

.media-video-preview:hover .video-play-icon {
    background: var(--th-e1ffaa)
}

.collection-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px
}

.collection-tabs button {
    padding: 12px 24px;
    background: transparent;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    font: inherit;
    cursor: pointer
}

.collection-tabs button[aria-selected="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent)
}

.collection-tabs button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px
}

h2>#collection-title {
    font: inherit;
    color: inherit;
    vertical-align: baseline;
    display: inline;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0
}

.post-content,
.post-description {
    margin-top: 16px
}

.post-content p {
    white-space: pre-wrap;
    line-height: 1.7
}

.donation-floating {
    position: fixed;
    z-index: 20;
    margin: 0;
    padding: 0 12px;
    gap: 10px;
    min-width: 0;
    border-radius: 8px;
    box-shadow: 0 5px 24px #0005;
    white-space: nowrap;
    box-sizing: border-box
}

.donation-floating:hover {
    box-shadow: 0 6px 28px #0008
}

.donation-floating:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px
}

/* Trakteer hover: soft backlight, lift, and one shine per hover. */
.donation-button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease
}

.donation-floating {
    position: fixed
}

.donation-button::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .08) 39%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, .08) 61%, transparent 75%);
    transform: translateX(-130%)
}

@keyframes trakteer-shine {
    from {
        transform: translateX(-130%)
    }

    to {
        transform: translateX(130%)
    }
}

@media(hover:hover) {
    .donation-button:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 22px rgba(0, 0, 0, .35), 0 0 22px rgba(244, 63, 94, .48), 0 0 46px rgba(225, 29, 72, .22);
        background: #d01949
    }

    .donation-button:hover::after {
        animation: trakteer-shine 700ms ease-out 1 both
    }
}

.donation-button:focus-visible {
    box-shadow: 0 0 24px rgba(244, 63, 94, .45)
}

@media(prefers-reduced-motion:reduce) {
    .donation-button {
        transition: none
    }

    .donation-button:hover {
        transform: none
    }

    .donation-button:hover::after {
        animation: none
    }
}

/* Visitor statistics card, aligned to the right of the collection tabs */
.collection-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px
}

/* Tab underline sits on the bar's divider line. */
.collection-bar .collection-tabs {
    border-bottom: 0;
    margin-bottom: -1px
}

.collection-bar .visitor-counter {
    margin-bottom: 8px
}

.visitor-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 8px 16px 8px 10px;
    border: 1px solid var(--th-3b4731);
    border-radius: 12px;
    background: linear-gradient(120deg, var(--th-20271c), #171c1b);
    box-shadow: 0 6px 20px #0002
}

.visitor-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid var(--th-4e613b);
    border-radius: 9px;
    background: var(--th-ccfa700b);
    color: var(--accent)
}

.visitor-metric {
    display: flex;
    flex-direction: column;
    min-width: 72px
}

.visitor-label {
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
    letter-spacing: .5px;
    white-space: nowrap
}

.visitor-metric strong {
    font-size: 20px;
    line-height: 1.15;
    color: var(--accent);
    font-variant-numeric: tabular-nums
}

.visitor-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid var(--th-3b4731)
}

.visitor-caption {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text)
}

#visitor-status {
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted)
}

.visitor-counter[data-state="loading"] .visitor-metric strong {
    animation: visitor-pulse 1.2s ease-in-out infinite
}

.visitor-counter[data-state="error"] .visitor-metric strong {
    color: var(--muted)
}

@keyframes visitor-pulse {
    50% {
        opacity: .35
    }
}

/* Narrow screens stack the card above the tabs, since three tabs plus the card no longer fit on one row. */
@media(max-width:640px) {
    .collection-bar {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 14px
    }

    .collection-bar .visitor-counter {
        margin-bottom: 0
    }

    .visitor-counter {
        padding: 8px 14px 8px 8px;
        gap: 10px
    }

    .visitor-icon {
        width: 30px;
        height: 30px
    }

    .visitor-metric strong {
        font-size: 18px
    }
}

@media(prefers-reduced-motion:reduce) {
    .visitor-counter[data-state="loading"] .visitor-metric strong {
        animation: none
    }
}

/* Expanded post reader */
.post-title-button {
    font: inherit;
    line-height: inherit;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer
}

.post-title-button:hover {
    color: var(--accent)
}

.post-title-button:focus-visible,
.post-open-button:focus-visible,
.post-dialog-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px
}

.post-open-button {
    align-self: flex-start;
    margin-top: 20px;
    padding: 10px 15px;
    border: 1px solid var(--th-52653e);
    border-radius: 7px;
    background: var(--th-26331c);
    color: var(--accent);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.post-open-button:hover {
    background: var(--th-344626)
}

.post-dialog {
    width: min(780px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: 90dvh;
    padding: 0;
    border: 1px solid var(--th-46513f);
    border-radius: 16px;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 24px 100px #0009;
    overflow: auto;
    overscroll-behavior: contain;
    animation: post-enter 220ms ease-out both
}

.post-dialog::backdrop {
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(4px)
}

.post-dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: #191e1b;
    font-size: 14px;
    font-weight: 600
}

.post-dialog-actions {
    display: flex;
    align-items: center;
    gap: 10px
}

.post-dialog-link {
    padding: 8px 14px;
    border: 1px solid var(--th-52653e);
    border-radius: 999px;
    background: var(--th-26331c);
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap
}

.post-dialog-link:hover {
    background: var(--th-344626)
}

.post-dialog-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.post-dialog-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--th-53604a);
    border-radius: 50%;
    background: var(--th-283123);
    color: var(--text);
    font-size: 26px;
    cursor: pointer
}

.post-dialog .game-card {
    border: 0;
    border-radius: 0
}

.post-dialog .card-body {
    padding: 28px
}

.post-dialog .cover {
    height: auto;
    max-height: 460px;
    min-height: 180px;
    object-fit: contain
}

.post-dialog .cover-logo {
    padding: 20px
}

.post-dialog .card-body>h3 {
    font-size: 28px
}

.post-dialog .post-content p,
.post-dialog .resource-section p {
    font-size: 16px;
    line-height: 1.75
}

.post-dialog.is-closing {
    animation: post-exit 180ms ease-in both
}

@keyframes post-enter {
    from {
        opacity: 0;
        transform: scale(.94) translateY(12px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes post-exit {
    to {
        opacity: 0;
        transform: scale(.96)
    }
}

@media(max-width:560px) {
    .post-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: 94dvh
    }

    .post-dialog .card-body {
        padding: 20px
    }

    .post-dialog .card-body>h3 {
        font-size: 23px
    }
}

@media(prefers-reduced-motion:reduce) {

    .post-dialog,
    .post-dialog.is-closing {
        animation: none
    }
}

.game-card .post-subtitle {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin: 16px 0 20px;
    white-space: pre-line
}

.card-body>.post-open-button {
    margin-top: auto
}

.post-dialog .post-subtitle {
    font-size: 16px
}

/* Shared close control for post and media dialogs. */
.modal-close {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--th-accent-18);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--th-30392d), var(--th-1b221e));
    color: var(--th-e7eddf);
    box-shadow: inset 0 1px 0 #ffffff0c, 0 3px 10px #0003;
    cursor: pointer;
    line-height: 1;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, color 180ms ease;
    -webkit-tap-highlight-color: transparent
}

.modal-close svg {
    display: block;
    pointer-events: none;
    transition: transform 180ms ease
}

@media(hover:hover) {
    .modal-close:hover {
        background: var(--th-34432a);
        color: var(--accent);
        border-color: var(--th-94b85b);
        box-shadow: 0 0 0 4px var(--th-ccfa700a), 0 4px 18px #0005;
        transform: translateY(-1px)
    }

    .modal-close:hover svg {
        transform: rotate(90deg)
    }
}

.modal-close:active {
    transform: scale(.94)
}

.modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-color: var(--accent)
}

.lightbox-close.modal-close {
    top: max(16px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    z-index: 3
}

@media(prefers-reduced-motion:reduce) {

    .modal-close,
    .modal-close svg {
        transition: none
    }

    .modal-close:hover,
    .modal-close:hover svg,
    .modal-close:active {
        transform: none
    }
}

/* Consistent media navigation in cards and lightboxes. */
.media-controls {
    gap: 16px;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--th-1c231e), var(--th-151b18))
}

.media-nav-button,
.media-controls .media-nav-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--th-ccfa7030);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--th-30392d), var(--th-1b221e));
    color: var(--th-e7eddf);
    box-shadow: inset 0 1px 0 #ffffff0c, 0 3px 10px #0003;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
    -webkit-tap-highlight-color: transparent
}

.media-nav-button svg {
    display: block;
    pointer-events: none;
    transition: transform 180ms ease
}

.lightbox-nav.media-nav-button {
    width: 48px;
    height: 48px;
    backdrop-filter: blur(12px);
    background: linear-gradient(145deg, var(--th-30392df2), var(--th-1b221ef2))
}

.media-count {
    min-width: 60px;
    text-align: center;
    padding: 4px 12px;
    border: 1px solid #ffffff0c;
    border-radius: 20px;
    background: var(--th-111713);
    color: var(--th-c8d1c0);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px
}

.lightbox-counter {
    padding: 7px 16px;
    border: 1px solid var(--th-ccfa7026);
    background: var(--th-1b221ee8);
    backdrop-filter: blur(12px);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px
}

@media(hover:hover) {

    .media-nav-button:hover,
    .media-controls .media-nav-button:hover {
        background: var(--th-34432a);
        color: var(--accent);
        border-color: var(--th-94b85b);
        box-shadow: 0 0 0 4px var(--th-ccfa700a), 0 4px 18px #0005
    }

    .media-nav-button[data-direction="previous"]:hover svg {
        transform: translateX(-2px)
    }

    .media-nav-button[data-direction="next"]:hover svg {
        transform: translateX(2px)
    }
}

.media-nav-button:active svg {
    transform: scale(.88)
}

.media-nav-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px
}

@media(prefers-reduced-motion:reduce) {

    .media-nav-button,
    .media-nav-button svg {
        transition: none
    }

    .media-nav-button:hover svg,
    .media-nav-button:active svg {
        transform: none !important
    }
}

.post-comments {
    padding: 24px 28px;
    border-top: 1px solid var(--line)
}

.post-comments>h3 {
    margin: 0 0 20px
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.comment-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--muted)
}

.comment-form label:has(textarea),
.comment-form .comment-notice {
    grid-column: 1/-1
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--th-43503a);
    border-radius: 8px;
    background: var(--th-131813);
    color: var(--text);
    font: inherit
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px
}

.comment-form .comment-notice {
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
    margin: 0
}

.comment-form button {
    justify-self: start;
    margin: 0
}

.comment-status {
    font-size: 14px;
    color: var(--accent)
}

.comment {
    padding: 18px 0;
    border-top: 1px solid var(--line)
}

.comment-heading {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap
}

.comment-heading strong {
    overflow-wrap: anywhere
}

.comment-heading time {
    color: var(--muted);
    font-size: 12px
}

.comment p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.7
}

.comment-empty {
    color: var(--muted);
    font-size: 14px
}

.post-comments button:disabled {
    opacity: .5;
    cursor: wait
}

.comment-form textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

@media(max-width:560px) {
    .post-comments {
        padding: 20px
    }

    .comment-form {
        grid-template-columns: 1fr
    }
}

/* Post and discussion share the desktop dialog, with independent reading areas. */
.post-dialog {
    width: min(1220px, calc(100vw - 48px));
    overflow: hidden
}

.post-dialog-content {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
    height: min(780px, calc(90dvh - 70px));
    min-height: 0
}

.post-detail-scroll,
.post-comments {
    overflow-y: auto;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--th-586450) transparent
}

.post-comments {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 24px;
    background: #171c19
}

.post-comments>h3 {
    font-size: 18px;
    margin-bottom: 22px
}

.post-card-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: auto
}

.comment-count,
.comment-action {
    border: 0;
    background: none;
    padding: 4px 0;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer
}

.comment-count:hover,
.comment-action:hover {
    color: var(--accent);
    text-decoration: underline
}

.comment-count:focus-visible,
.comment-action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 0;
    padding: 0;
    margin-bottom: 20px
}

.comment-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid var(--th-526449);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--th-344d38), var(--th-232d27));
    color: var(--accent);
    font-size: 13px;
    font-weight: 700
}

.comment-main {
    min-width: 0;
    flex: 1
}

.comment-bubble {
    background: #262e28;
    border: 1px solid var(--th-354137);
    border-radius: 0 16px 16px;
    padding: 11px 14px;
    overflow-wrap: anywhere
}

.comment-bubble strong {
    font-size: 13px
}

.comment-bubble p {
    margin: 5px 0 0;
    font-size: 14px;
    line-height: 1.6
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 4px 0
}

.comment-actions time {
    font-size: 11px;
    color: var(--muted)
}

.comment-action {
    font-weight: 600
}

.comment-replies {
    margin-top: 12px;
    padding-left: 10px;
    border-left: 2px solid var(--th-38463b)
}

.comment-replies:empty {
    display: none
}

.comment-replies .comment {
    margin-bottom: 12px
}

.comment-replies .comment-avatar {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 11px
}

.comment-image-link {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent)
}

.comment-image {
    display: block;
    max-width: 100%;
    max-height: 280px;
    border-radius: 10px;
    object-fit: contain
}

.comment-form {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    gap: 12px;
    margin-top: 20px
}

.comment-form label {
    font-size: 12px
}

.comment-form input,
.comment-form textarea {
    font-size: 14px;
    border-radius: 12px;
    background: var(--th-202822);
    padding: 10px 12px
}

.comment-form textarea {
    min-height: 80px
}

.comment-image-field,
.comment-reply-label {
    grid-column: 1/-1
}

.comment-reply-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--accent);
    font-size: 13px
}

.comment-form .comment-notice {
    font-size: 11px;
    line-height: 1.6
}

.comment-status:empty {
    display: none
}

@media(max-width:760px) {
    .post-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        overflow: auto
    }

    .post-dialog-content {
        display: block;
        height: auto
    }

    .post-detail-scroll,
    .post-comments {
        overflow: visible
    }

    .post-comments {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 20px
    }

    .comment-form {
        grid-template-columns: 1fr
    }

    .comment-replies {
        padding-left: 6px
    }
}

/* Show the complete avatar artwork; source images may be manually cropped. */
.comment-avatar {
    position: relative;
    overflow: hidden
}

.comment-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none
}

.avatar-guilmon,
.avatar-veemon,
.avatar-agumon {
    background: #fff
}

.avatar-picker {
    grid-column: 1/-1;
    border: 0;
    padding: 0;
    margin: 0 0 4px;
    min-width: 0
}

.avatar-picker legend {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px
}

.avatar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.comment-form .avatar-option {
    position: relative;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-width: 65px;
    font-size: 11px
}

.avatar-option .comment-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px
}

.avatar-option input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    padding: 0
}

.avatar-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--th-303c27);
    color: var(--accent)
}

.avatar-option:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.avatar-option:hover {
    border-color: var(--accent)
}

.post-card-actions {
    justify-content: space-between;
    align-items: flex-end
}

.post-card-actions .comment-count {
    margin-left: auto;
    text-align: right
}

.post-card-actions .post-share {
    margin-left: 0
}

/* Keep the feed independent from the collapsible composer. */
.post-comments {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    min-height: 0
}

.post-comments>h3 {
    padding: 20px 24px 0;
    margin: 0 0 12px;
    flex-shrink: 0
}

.comment-sort {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px 14px;
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0
}

.comment-sort select,
.reply-controls select {
    font: inherit;
    background: var(--th-202822);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px
}

.comment-feed {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    padding: 8px 24px 20px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--th-586450) transparent
}

.comment-composer {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    background: var(--th-191f1b);
    padding: 14px 24px
}

.composer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.comment-composer .comment-form {
    max-height: 40dvh;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    overscroll-behavior: contain
}

.comment-composer .comment-status {
    margin: 8px 0 0;
    font-size: 12px
}

.comment-author-number {
    font-size: 11px;
    font-weight: 400;
    color: var(--accent);
    margin-left: 3px;
    white-space: nowrap
}

.reply-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center
}

.reply-controls select {
    font-size: 11px;
    max-width: 100%
}

.comment-feed:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: -2px
}

@media(max-width:760px) {
    .post-comments {
        overflow: visible
    }

    .comment-feed {
        flex: none;
        max-height: 60dvh;
        min-height: 100px
    }

    .comment-composer {
        position: sticky;
        bottom: 0;
        z-index: 1
    }

    .post-comments>h3 {
        padding-left: 20px
    }

    .comment-sort,
    .comment-feed,
    .comment-composer {
        padding-left: 20px;
        padding-right: 20px
    }

    .comment-composer .comment-form {
        max-height: 40dvh
    }
}/* Keep focus indicators inside scrollable forms and give selects a consistent arrow. */
.comment-composer .comment-form {
    padding: 20px 12px 6px 6px;
    scrollbar-gutter: stable;
}
.comment-form input:focus-visible,
.comment-form textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-color: var(--accent);
}
.comment-sort select,
.reply-controls select {
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    cursor: pointer;
    padding: 10px 36px 10px 13px;
    min-height: 38px;
    border-radius: 10px;
    background-color: var(--th-222b25);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23bdc9b6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.comment-sort select:hover,
.reply-controls select:hover {
    background-color: var(--th-2b362d);
    border-color: var(--th-718064);
    box-shadow: 0 2px 8px #0002;
}
.comment-sort select:focus-visible,
.reply-controls select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.reply-controls {
    margin: 12px 4px 8px;
    gap: 12px;
}
.comment-actions { gap: 14px; row-gap: 5px; }
@media (prefers-reduced-motion: reduce) {
    .comment-sort select, .reply-controls select { transition: none; }
}
.comment-bubble .comment-mention { color: var(--accent); font-weight: 700; font-size: inherit; }
.post-comments > .comment-sort { padding-top: 18px; padding-bottom: 18px; }
.owner-badge { color: var(--accent); font-weight: 700; }
.comment-author-number.owner-badge { padding: 2px 6px; border: 1px solid var(--th-65774b); border-radius: 6px; background: var(--th-303d25); }
.comment-owner-status { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.comment-owner-status:empty { display: none; }
.comment-owner-status .comment-action { margin-left: auto; }
.comment-form input[readonly] { opacity: .8; cursor: default; }
.owner-page { max-width: 540px; margin: 12vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--th-191f1b); }
.owner-page h1 { font-size: 28px; }.owner-page p { line-height: 1.8; }.owner-page a { color: var(--accent); }
footer .owner-entry { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 4px; color: var(--muted); border-radius: 6px; }
footer .owner-entry:hover { color: var(--accent); background: #ffffff08; }
footer .owner-entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* One continuous panel for the accordion and collection filters. */
.collection-filters { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--th-171d19); box-shadow: 0 8px 24px #0002; }
.collection-filters > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; padding: 18px 22px; border-radius: 15px; color: var(--text); background: linear-gradient(110deg,var(--th-242e24),var(--th-1b231e)); font-size: 14px; font-weight: 600; transition: background-color 160ms ease,color 160ms ease; }
.collection-filters > summary::-webkit-details-marker { display: none; }
.filter-summary-title { display: inline-flex; align-items: center; gap: 12px; }
.filter-summary-title svg { color: var(--accent); }
.filter-summary-chevron { color: var(--muted); transition: transform 180ms ease; }
.collection-filters > summary:hover { color: var(--accent); background: var(--th-283327); }
.collection-filters > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.collection-filters[open] > summary { border-radius: 15px 15px 0 0; border-bottom: 1px solid var(--line); }
.collection-filters[open] .filter-summary-chevron { transform: rotate(180deg); }
.collection-filters > .toolbar { margin: 0; padding: 22px 22px 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.collection-filters > .pin-filter { margin: 0 22px 16px; }
@media(max-width:560px) { .collection-filters > summary { padding: 16px; }.collection-filters > .toolbar { padding: 18px 16px 10px; }.collection-filters > .pin-filter { margin: 0 16px 14px; } }
@media(prefers-reduced-motion:reduce) { .collection-filters > summary,.filter-summary-chevron { transition: none; } }
/* On mobile, let inner scroll areas hand scrolling to the post modal at either edge. */
@media (max-width: 760px) {
    .post-dialog .post-comments,
    .post-dialog .comment-feed,
    .post-dialog .comment-composer .comment-form {
        overscroll-behavior-y: auto;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px
}

.pagination[hidden] {
    display: none
}

.page-button {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #191e1b;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.page-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent)
}

.page-button:disabled {
    opacity: .4;
    cursor: default
}

.page-button[aria-current="page"] {
    opacity: 1;
    border-color: var(--accent);
    background: var(--th-26331c);
    color: var(--accent);
    font-weight: 700
}

.page-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.page-gap {
    color: var(--muted);
    padding: 0 4px
}

.date-control {
    padding: 0 14px
}

.date-control input {
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    color-scheme: dark;
    cursor: pointer
}

.media-caption {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--th-151b18);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center
}

.media-caption[hidden] {
    display: none
}

.lightbox-content.has-caption {
    flex-direction: column;
    gap: 12px
}

.lightbox-caption {
    max-width: min(900px, 100%);
    max-height: 4.5em;
    overflow-y: auto;
    margin: 0;
    color: #d6dbd3;
    font-size: 14px;
    line-height: 1.5;
    text-align: center
}

.lightbox-content.has-caption .lightbox-image {
    max-height: calc(100dvh - 124px - 5.5em)
}

.lightbox-content.has-caption .lightbox-video {
    width: min(1200px, calc(100vw - 48px), calc((100dvh - 124px - 5.5em)*16/9))
}

/* Minigame played inside its post detail */
.minigame-play {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: #14181a
}

.minigame-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    text-align: center;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 40%, var(--th-233021), #111416 70%)
}

.minigame-play-button {
    padding: 12px 26px;
    border: 1px solid var(--th-6f8a4f);
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer
}

.minigame-play-button:hover:not(:disabled) {
    filter: brightness(1.08)
}

.minigame-play-button:disabled {
    opacity: .6;
    cursor: progress
}

.minigame-play-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

/* Minesweeper */
.ms-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.ms-level {
    flex: 1 1 200px;
    max-width: 280px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.ms-flag-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.ms-flag-mode[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--th-2f3f22);
    color: var(--accent)
}

.ms-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.ms-frame.is-won {
    border-color: var(--accent)
}

.ms-frame.is-lost {
    border-color: #a8352c
}

.ms-hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px
}

.ms-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    padding: 6px 12px;
    border-radius: 8px;
    background: #050607;
    font: 700 18px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    color: #ff5a4f
}

.ms-hud .ms-stat:last-child {
    justify-self: end
}

.ms-stat-icon {
    font-size: 15px
}

.ms-face {
    width: 44px;
    height: 44px;
    border: 1px solid var(--th-46513f);
    border-radius: 50%;
    background: #202722;
    font-size: 22px;
    line-height: 1;
    cursor: pointer
}

.ms-face:hover {
    border-color: var(--accent)
}

.ms-face:focus-visible,
.ms-flag-mode:focus-visible,
.ms-level:focus-visible,
.ms-cell:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px
}

/* Board is centred; it scrolls sideways only when it cannot shrink enough. */
.ms-scroll {
    overflow-x: auto;
    scrollbar-color: var(--th-3a4636) transparent
}

.ms-board {
    --ms-cell: 30px;
    display: grid;
    gap: 2px;
    width: max-content;
    margin: 0 auto;
    padding: 6px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation
}

.ms-cell {
    width: var(--ms-cell);
    height: var(--ms-cell);
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--th-44523f), var(--th-2f392c));
    box-shadow: inset 0 1px 0 #ffffff14;
    color: var(--text);
    font: 700 calc(var(--ms-cell) * .5)/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    cursor: pointer
}

.ms-cell:hover:not(.is-open) {
    background: linear-gradient(180deg, var(--th-52634a), var(--th-3a4636))
}

.ms-cell.is-open {
    background: #1b2022;
    box-shadow: none;
    cursor: default
}

.ms-cell.is-hit {
    background: #7a1f1a
}

.ms-cell[data-count="1"] { color: #6cb6ff }
.ms-cell[data-count="2"] { color: #7ee07e }
.ms-cell[data-count="3"] { color: #ff7a6b }
.ms-cell[data-count="4"] { color: #c49bff }
.ms-cell[data-count="5"] { color: #ffb454 }
.ms-cell[data-count="6"] { color: #5fe0d6 }
.ms-cell[data-count="7"] { color: #f0f0f0 }
.ms-cell[data-count="8"] { color: #9aa29a }

.ms-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 12px
}

.ms-status {
    margin: 0;
    color: var(--accent);
    font-weight: 600
}

.ms-best {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.ms-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .minigame-play { padding: 12px }
    .ms-frame { padding: 6px }
    .ms-flag-label { display: none }
    .ms-level { max-width: none }
}

/* Four tabs: tighten them on phones and let the row scroll instead of clipping. */
@media(max-width:640px) {
    .collection-bar .collection-tabs {
        overflow-x: auto;
        scrollbar-width: none
    }

    .collection-bar .collection-tabs::-webkit-scrollbar {
        display: none
    }

    .collection-tabs button {
        flex-shrink: 0;
        padding: 12px 14px
    }
}

/* Snake */
.sn-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.sn-select,
.sn-toggle {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.sn-select {
    flex: 1 1 140px;
    max-width: 200px
}

.sn-toggle {
    border-color: var(--th-46513f);
    background: #202722
}

.sn-toggle[aria-pressed="false"] {
    color: var(--accent)
}

.sn-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.sn-frame.is-over {
    border-color: #a8352c
}

.sn-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.sn-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ff5a4f;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.sn-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.sn-pause:disabled {
    opacity: .4;
    cursor: default
}

.sn-stage {
    position: relative;
    display: flex;
    justify-content: center
}

.sn-canvas {
    display: block;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.sn-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.sn-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ecc;
    border-radius: 8px;
    text-align: center
}

.sn-overlay[hidden] {
    display: none
}

.sn-overlay-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800
}

.sn-overlay-text {
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.sn-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.sn-select:focus-visible,
.sn-toggle:focus-visible,
.sn-pause:focus-visible,
.sn-start:focus-visible,
.sn-pad button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* On-screen arrows: shown on touch screens only. */
.sn-pad {
    display: none;
    grid-template-areas: ". up ." "left down right";
    grid-template-columns: repeat(3, 60px);
    gap: 8px;
    justify-content: center;
    margin-top: 12px
}

.sn-pad button {
    height: 52px;
    border: 1px solid var(--th-46513f);
    border-radius: 12px;
    background: #202722;
    color: var(--accent);
    font-size: 20px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none
}

.sn-pad-up { grid-area: up }
.sn-pad-left { grid-area: left }
.sn-pad-down { grid-area: down }
.sn-pad-right { grid-area: right }

@media (pointer: coarse) {
    .sn-pad { display: grid }
}

.sn-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .sn-frame { padding: 6px }
    .sn-select { max-width: none }
}

/* Nonogram */
.nn-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px
}

.nn-select,
.nn-button,
.nn-mode {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.nn-select {
    flex: 1 1 180px;
    max-width: 240px
}

.nn-button {
    border-color: var(--th-46513f);
    background: #202722
}

.nn-button[hidden] {
    display: none
}

.nn-modes {
    display: inline-flex;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    overflow: hidden
}

.nn-mode {
    border: 0;
    border-radius: 0;
    background: #202722
}

.nn-mode[aria-pressed="true"] {
    background: var(--th-2f3f22);
    color: var(--accent);
    font-weight: 700
}

.nn-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.nn-frame.is-solved {
    border-color: var(--accent)
}

.nn-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.nn-stat {
    display: inline-flex;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ff5a4f;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.nn-progress {
    color: var(--muted);
    font-size: 13px
}

.nn-restart {
    height: 34px;
    margin-left: auto
}

.nn-scroll {
    overflow-x: auto;
    scrollbar-color: var(--th-3a4636) transparent
}

.nn-board {
    --nn-cell: 30px;
    display: grid;
    gap: 1px;
    width: max-content;
    margin: 0 auto;
    padding: 4px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none
}

.nn-clue {
    display: flex;
    gap: 5px;
    color: #bdc3bb;
    font: 700 calc(var(--nn-cell) * .42)/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    transition: color .15s, opacity .15s
}

.nn-col-clue {
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 6px
}

.nn-row-clue {
    justify-content: flex-end;
    align-items: center;
    padding-right: 8px
}

.nn-clue.is-done {
    color: #5b655a;
    opacity: .7
}

.nn-cell {
    width: var(--nn-cell);
    height: var(--nn-cell);
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: #1f2527;
    color: #6b7579;
    font: 700 calc(var(--nn-cell) * .55)/1 system-ui, sans-serif;
    cursor: pointer;
    touch-action: none
}

.nn-cell:hover:not(.is-fill) {
    background: #2a3234
}

.nn-cell.is-fill {
    background: var(--accent)
}

.nn-cell.is-cross::after {
    content: "✕"
}

/* Thicker guide lines every five squares. */
.nn-edge-r {
    margin-right: 2px
}

.nn-edge-b {
    margin-bottom: 2px
}

.nn-cell:focus-visible,
.nn-select:focus-visible,
.nn-button:focus-visible,
.nn-mode:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px
}

.nn-frame.is-solved .nn-cell {
    cursor: default
}

.nn-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 12px
}

.nn-status {
    margin: 0;
    color: var(--accent);
    font-weight: 600
}

.nn-best {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.nn-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .nn-frame { padding: 6px }
    .nn-select { max-width: none }
    .nn-modes { margin-left: 0 }
}

/* Header badge shown while owner mode is active */
.owner-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 8px;
    border: 1px solid #6f5a2a;
    border-radius: 999px;
    background: #2a2414;
    color: #f2c94c;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap
}

.owner-mode-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f2c94c;
    box-shadow: 0 0 0 3px #f2c94c33
}

.owner-mode-badge-local {
    padding: 1px 6px;
    border-radius: 999px;
    background: #f2c94c22;
    color: #e8d9a8;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px
}

.owner-mode-badge-exit {
    margin-left: 2px;
    padding: 2px 8px;
    border: 1px solid #6f5a2a;
    border-radius: 999px;
    background: transparent;
    color: #f2c94c;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer
}

.owner-mode-badge-exit:hover:not(:disabled) {
    background: #f2c94c22
}

.owner-mode-badge-exit:focus-visible {
    outline: 2px solid #f2c94c;
    outline-offset: 2px
}

.owner-mode-badge-exit:disabled {
    opacity: .6;
    cursor: progress
}

/* Owner-only "Komentar" tab */
.owner-comments[hidden] {
    display: none
}

.owner-comments-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px
}

.owner-comments-type,
.owner-comments-refresh {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.owner-comments-refresh {
    border-color: var(--th-46513f);
    background: #202722
}

.owner-comments-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px
}

.owner-comments-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none
}

.owner-comment {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #171a1c
}

.owner-comment.is-reply {
    border-left: 3px solid var(--th-4e613b)
}

.owner-comment-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 13px
}

.owner-comment-head strong {
    font-size: 14px
}

.owner-comment-head strong.is-owner {
    color: #f2c94c
}

.owner-comment-reply {
    color: var(--accent);
    font-size: 12px
}

.owner-comment-head time {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px
}

.owner-comment-body {
    margin: 8px 0 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.5
}

.owner-comment-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--muted);
    font-size: 12px
}

.owner-comment-foot a {
    color: var(--accent)
}

.owner-comment-post {
    padding: 4px 10px;
    border: 1px solid var(--th-46513f);
    border-radius: 999px;
    background: #202722;
    color: var(--accent);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.owner-comment-post:disabled {
    color: var(--muted);
    cursor: default
}

.owner-comments-type:focus-visible,
.owner-comments-refresh:focus-visible,
.owner-comment-post:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.owner-comments-state {
    margin: 14px 0 0;
    color: var(--muted)
}

.owner-comments-more {
    display: block;
    margin: 16px auto 0
}

.owner-comments-more[hidden] {
    display: none
}

/* Up to five tabs (owner mode adds one). When tabs and the visitor card do not fit on one line, the card
   wraps onto its own row above the tabs (wrap-reverse), so every tab stays visible and on the divider. */
@media(min-width:641px) {
    .collection-bar {
        flex-wrap: wrap-reverse;
        align-items: flex-start;
        row-gap: 12px
    }

    .collection-bar .visitor-counter {
        margin-left: auto
    }
}

@media(max-width:900px) {
    .collection-tabs button {
        padding: 12px 16px
    }
}

@media(max-width:640px) {
    .owner-mode-badge {
        gap: 5px;
        padding: 3px 4px 3px 8px;
        font-size: 11px
    }

    .owner-mode-badge-more {
        display: none
    }

    .owner-mode-badge-local {
        padding: 1px 5px;
        font-size: 9px
    }
}

.owner-comments-post,
.owner-comments-status {
    height: 40px;
    max-width: 240px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.owner-comments-post:focus-visible,
.owner-comments-status:focus-visible,
.owner-comment-hide:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.owner-comment-flag {
    padding: 1px 8px;
    border-radius: 999px;
    background: #7a1f1a55;
    color: #ff9a8f;
    font-size: 11px;
    font-weight: 700
}

.owner-comment.is-hidden,
.owner-comment.is-parent-hidden {
    border-style: dashed;
    opacity: .72
}

.owner-comment.is-hidden .owner-comment-body {
    text-decoration: line-through;
    text-decoration-color: #ff9a8f88
}

.owner-comment-hide {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid #5a3a36;
    border-radius: 999px;
    background: transparent;
    color: #ff9a8f;
    font: inherit;
    font-size: 12px;
    cursor: pointer
}

.owner-comment.is-hidden .owner-comment-hide {
    border-color: var(--th-46513f);
    color: var(--accent)
}

.owner-comment-hide:disabled {
    opacity: .6;
    cursor: progress
}

/* A select is as wide as its longest option (post titles), so let these shrink instead of widening the page. */
.owner-comments-post,
.owner-comments-status,
.owner-comments-type {
    min-width: 0;
    text-overflow: ellipsis
}

@media(max-width:640px) {
    .owner-comments-post,
    .owner-comments-status,
    .owner-comments-type {
        flex: 1 1 140px;
        max-width: none
    }

    .owner-comments-post {
        flex-basis: 100%;
        width: 100%
    }
}

.owner-page form { margin: 18px 0 }
.owner-page .owner-page-logout { border-color: #6f5a2a; background: #2a2414; color: #f2c94c }
.owner-page .owner-page-logout:hover { background: #3a3119 }

.comment-image-hint {
    grid-column: 1/-1;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

.comment-image-hint a {
    color: var(--accent)
}

/* Owner view of hidden comments inside a post */
.comment.is-hidden > .comment-main > .comment-bubble {
    border-style: dashed;
    opacity: .6
}

.comment-hidden-flag {
    display: inline-block;
    white-space: nowrap;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #7a1f1a55;
    color: #ff9a8f;
    font-size: 11px;
    font-weight: 700
}

.comment-hidden-flag[hidden] {
    display: none
}

.comment-moderate {
    color: #ff9a8f
}

.sn-stat[hidden] {
    display: none
}

.sn-stat-cpu {
    color: #c49bff
}

.sn-frame.is-won {
    border-color: var(--accent)
}

/* Sudoku */
.su-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.su-select,
.su-button,
.su-tool {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.su-select {
    flex: 1 1 140px;
    max-width: 200px
}

.su-button,
.su-tool {
    border-color: var(--th-46513f);
    background: #202722
}

.su-tool[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--th-2f3f22);
    color: var(--accent)
}

.su-tool:disabled,
.su-digit:disabled {
    opacity: .45;
    cursor: default
}

.su-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.su-frame.is-solved {
    border-color: var(--accent)
}

.su-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.su-stat {
    display: inline-flex;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ff5a4f;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.su-progress {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px
}

.su-board-wrap {
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: hidden
}

.su-board {
    --su-cell: 30px;
    display: grid;
    grid-template-columns: repeat(var(--su-n, 9), var(--su-cell));
    gap: 1px;
    padding: 0;
    border: 3px solid var(--th-7d9466);
    border-radius: 8px;
    background: #2a3130;
    user-select: none;
    -webkit-user-select: none
}

.su-cell {
    display: grid;
    place-items: center;
    width: var(--su-cell);
    height: var(--su-cell);
    padding: 0;
    border: 0;
    background: #1b2022;
    color: var(--accent);
    font: 700 calc(var(--su-cell) * .5)/1 system-ui, sans-serif;
    cursor: pointer;
    touch-action: manipulation
}

.su-cell.is-given {
    color: var(--th-e6ebe3)
}

/* Guide lines between the boxes (3×3 on Normal, 3×2 on Mini), drawn inside the cell so the grid stays even. */
.su-cell {
    box-sizing: border-box
}

.su-cell.su-edge-r {
    border-right: 3px solid var(--th-7d9466)
}

.su-cell.su-edge-b {
    border-bottom: 3px solid var(--th-7d9466)
}

.su-cell.is-peer {
    background: #232a2c
}

.su-cell.is-same {
    background: var(--th-2e3a26)
}

.su-cell.is-selected {
    background: var(--th-3a4a2c);
    outline: 2px solid var(--accent);
    outline-offset: -2px
}

.su-cell.is-conflict {
    color: #ff7a6b;
    background: #3a1f1c
}

.su-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 1px;
    color: #9aa29a;
    font: 600 calc(var(--su-cell) * .24)/1 system-ui, sans-serif;
    text-align: center;
    align-items: center
}

.su-pad {
    display: grid;
    grid-template-columns: repeat(var(--su-digits, 9), 1fr);
    gap: 6px;
    max-width: 460px;
    margin: 12px auto 0
}

.su-digit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 0;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    touch-action: manipulation
}

.su-digit-n {
    font-size: 20px;
    font-weight: 700
}

.su-digit-left {
    color: var(--muted);
    font-size: 10px
}

.su-digit.is-done {
    opacity: .5
}

.su-tools {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px
}

.su-select:focus-visible,
.su-button:focus-visible,
.su-tool:focus-visible,
.su-digit:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.su-cell:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px
}

.su-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 12px
}

.su-status {
    margin: 0;
    color: var(--accent);
    font-weight: 600
}

.su-best {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.su-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .su-frame { padding: 6px }
    .su-select { max-width: none }
    .su-pad { gap: 4px }
    .su-digit-n { font-size: 17px }
    .su-tool { padding: 0 9px; font-size: 13px }
}

/* Header colour-theme toggle: the dot shows the current theme colour. */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: border-color .2s
}

.theme-toggle:hover {
    border-color: var(--accent)
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.theme-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--accent)
}

@media(max-width:640px) {
    .theme-toggle {
        width: 32px;
        height: 32px
    }

    .theme-dot {
        width: 13px;
        height: 13px
    }
}

/* Very narrow phones: three header controls plus the brand need a little less room. */
@media(max-width:400px) {
    .header-toggles {
        gap: 4px
    }

    .theme-toggle,
    .space-toggle {
        width: 30px;
        height: 30px
    }

    .lang-toggle button {
        padding: 6px 7px;
        gap: 5px
    }
}

/* Owner-only "Kelola post" tab (owner-posts.js) */
.owner-posts[hidden],
.owner-posts-list li[hidden] {
    display: none
}

.owner-posts-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px
}

.owner-posts-select,
.owner-posts-search,
.owner-posts-refresh,
.owner-post-editor .owner-field input:not([type=checkbox]),
.owner-post-editor .owner-field select,
.owner-post-editor .owner-field textarea,
.owner-post-json {
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px
}

.owner-posts-search {
    flex: 1 1 180px
}

.owner-posts-refresh {
    border-color: var(--th-46513f);
    background: #202722;
    cursor: pointer
}

.owner-posts-new {
    width: auto;
    margin: 0
}

.owner-posts-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px
}

.owner-posts-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none
}

.owner-post {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #171a1c
}

.owner-post.is-hidden {
    border-style: dashed;
    opacity: .72
}

.owner-post-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px
}

.owner-post-head strong {
    font-size: 15px;
    overflow-wrap: anywhere
}

.owner-post-head time {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px
}

.owner-post-chip {
    padding: 1px 8px;
    border: 1px solid var(--th-46513f);
    border-radius: 999px;
    color: var(--accent);
    font-size: 11px
}

.owner-post-flag {
    padding: 1px 8px;
    border-radius: 999px;
    background: #7a1f1a55;
    color: #ff9a8f;
    font-size: 11px;
    font-weight: 700
}

.owner-post-id {
    display: block;
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere
}

.owner-post-foot,
.owner-list-tools,
.owner-post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px
}

.owner-post-button {
    padding: 5px 12px;
    border: 1px solid var(--th-46513f);
    border-radius: 999px;
    background: #202722;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    cursor: pointer
}

.owner-post-button.is-danger {
    border-color: #5a3a36;
    background: transparent;
    color: #ff9a8f
}

.owner-post-foot .owner-post-button:last-child {
    margin-left: auto
}

.owner-post-button:disabled {
    opacity: .5;
    cursor: default
}

.owner-posts-select:focus-visible,
.owner-posts-search:focus-visible,
.owner-posts-refresh:focus-visible,
.owner-post-button:focus-visible,
.owner-post-editor input:focus-visible,
.owner-post-editor select:focus-visible,
.owner-post-editor textarea:focus-visible,
.owner-list-entry summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.owner-posts-state,
.owner-post-status {
    margin: 14px 0 0;
    color: var(--muted)
}

.owner-post-status:empty {
    display: none
}

.owner-post-form {
    display: grid;
    gap: 14px;
    padding: 18px 20px 20px
}

.owner-form {
    display: grid;
    gap: 12px
}

.owner-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px
}

.owner-field.is-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text)
}

.owner-field small {
    font-size: 12px;
    line-height: 1.4
}

.owner-post-editor .owner-field textarea,
.owner-post-json {
    height: auto;
    padding: 10px 12px;
    line-height: 1.5;
    resize: vertical
}

.owner-post-json {
    width: 100%;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px
}

.owner-post-editor .owner-field input[readonly] {
    color: var(--muted)
}

.owner-list {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px
}

.owner-list legend {
    padding: 0 6px;
    color: var(--accent);
    font-weight: 700
}

.owner-list-body {
    display: grid;
    gap: 8px
}

.owner-list>.owner-post-button {
    justify-self: start
}

.owner-list-entry {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #171a1c
}

.owner-list-entry summary {
    cursor: pointer;
    overflow-wrap: anywhere
}

.owner-list-entry[open] summary {
    margin-bottom: 10px
}

.owner-list-tools {
    margin-bottom: 10px
}

.owner-post-actions {
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    padding: 12px 0 0;
    background: var(--bg)
}

.owner-post-actions .post-open-button {
    width: auto;
    margin: 0
}

.owner-post-preview[hidden] {
    display: none
}

@media(max-width:640px) {
    .owner-posts-select {
        flex: 1 1 140px
    }

    .owner-post-form {
        padding: 14px
    }
}

.owner-field small {
    color: #8b908f
}

.owner-field.is-extra>span {
    color: var(--accent);
    font-family: ui-monospace, Consolas, monospace
}

.owner-post-editor .owner-field textarea.owner-field-json {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px
}

.owner-media-preview img {
    display: block;
    max-width: 100%;
    max-height: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover
}

.owner-media-preview img.is-contain {
    object-fit: contain;
    background: #0d0f10
}

.owner-media-preview img[hidden],
.owner-media-preview small:empty {
    display: none
}

.owner-media-preview small {
    color: var(--muted);
    font-size: 12px
}

/* The post dialog clips its own overflow (its columns scroll); the editor is one long form, so it scrolls. */
.post-dialog.owner-post-editor {
    width: min(880px, calc(100vw - 48px));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--th-586450) transparent
}

@media(max-width:760px) {
    .post-dialog.owner-post-editor {
        width: calc(100vw - 16px)
    }
}

/* Drafts in the "Kelola post" tab */
.owner-post-flag.is-draft {
    background: #6b5a1a55;
    color: #f2c94c
}

.owner-post.is-draft {
    border-style: dashed;
    border-color: #6b5a1a
}

.owner-post-button.is-primary {
    border-color: var(--accent);
    background: var(--th-344626);
    color: var(--text)
}

.owner-post-notice {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #6b5a1a;
    border-radius: 10px;
    background: #6b5a1a22;
    color: #f2c94c;
    font-size: 13px
}

/* Space Invaders */
.si-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.si-select,
.si-button {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.si-select {
    flex: 1 1 140px;
    max-width: 200px
}

.si-button {
    border-color: var(--th-46513f);
    background: #202722
}

.si-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.si-frame.is-over {
    border-color: #a8352c
}

.si-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.si-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: var(--accent);
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.si-stat-lives {
    color: #ff7a8a
}

.si-stat-wave {
    color: #ffd36e
}

.si-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.si-pause:disabled {
    opacity: .4;
    cursor: default
}

.si-stage {
    position: relative;
    display: flex;
    justify-content: center
}

.si-canvas {
    display: block;
    border-radius: 8px;
    image-rendering: pixelated;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.si-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.si-banner {
    position: absolute;
    top: 38%;
    left: 0;
    right: 0;
    margin: 0;
    color: var(--accent);
    font: 800 22px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    pointer-events: none
}

.si-banner[hidden],
.si-overlay[hidden] {
    display: none
}

.si-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ecc;
    border-radius: 8px;
    text-align: center
}

.si-overlay-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800
}

.si-overlay-text {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.si-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.si-select:focus-visible,
.si-button:focus-visible,
.si-pause:focus-visible,
.si-start:focus-visible,
.si-pad button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* On-screen controls: shown on touch screens only. */
.si-pad {
    display: none;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 8px;
    max-width: 320px;
    margin: 12px auto 0
}

.si-pad button {
    height: 56px;
    border: 1px solid var(--th-46513f);
    border-radius: 12px;
    background: #202722;
    color: var(--accent);
    font-size: 22px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

@media (pointer: coarse) {
    .si-pad { display: grid }
}

.si-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .si-frame { padding: 6px }
    .si-select { max-width: none }
}

/* Tetris */
.tt-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.tt-select,
.tt-button {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.tt-select {
    flex: 1 1 160px;
    max-width: 220px
}

.tt-button {
    border-color: var(--th-46513f);
    background: #202722
}

.tt-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.tt-frame.is-over {
    border-color: #a8352c
}

.tt-frame.is-won {
    border-color: var(--accent)
}

.tt-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.tt-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: var(--accent);
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.tt-stat[hidden] {
    display: none
}

.tt-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.tt-pause:disabled {
    opacity: .4;
    cursor: default
}

.tt-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px
}

.tt-well {
    position: relative;
    border: 2px solid var(--th-46513f);
    border-radius: 6px;
    overflow: hidden
}

.tt-canvas {
    display: block;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.tt-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px
}

.tt-side {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.tt-label {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase
}

.tt-preview {
    display: block;
    border: 1px solid #22292d;
    border-radius: 6px
}

.tt-preview + .tt-label {
    margin-top: 6px
}

.tt-callout {
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 8px;
    color: var(--accent);
    font: 800 18px/1.25 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
    text-shadow: 0 2px 6px #000;
    opacity: 0;
    pointer-events: none
}

.tt-callout.is-on {
    animation: tt-callout 1.1s ease-out
}

@keyframes tt-callout {
    0% { opacity: 0; transform: translateY(8px) }
    15% { opacity: 1; transform: none }
    70% { opacity: 1 }
    100% { opacity: 0; transform: translateY(-14px) }
}

.tt-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #0b0d0ed9;
    text-align: center
}

.tt-overlay[hidden] {
    display: none
}

.tt-overlay-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800
}

.tt-overlay-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.tt-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.tt-select:focus-visible,
.tt-button:focus-visible,
.tt-pause:focus-visible,
.tt-start:focus-visible,
.tt-pad button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* On-screen controls: shown on touch screens only. */
.tt-pad {
    display: none;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    max-width: 360px;
    margin: 12px auto 0
}

.tt-pad button {
    grid-column: span 3;
    height: 50px;
    border: 1px solid var(--th-46513f);
    border-radius: 12px;
    background: #202722;
    color: var(--accent);
    font: inherit;
    font-size: 20px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.tt-pad .tt-pad-hold {
    font-size: 14px;
    font-weight: 700
}

.tt-pad .tt-pad-left,
.tt-pad .tt-pad-down,
.tt-pad .tt-pad-right {
    grid-column: span 4;
    height: 56px
}

@media (pointer: coarse) {
    .tt-pad { display: grid }
}

.tt-best {
    margin: 10px 0 0;
    color: var(--accent);
    font-size: 13px
}

.tt-best:empty {
    display: none
}

.tt-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .tt-frame { padding: 6px }
    .tt-select { max-width: none }
    .tt-stage { gap: 6px }
}

/* Sound toggle shared by the minigames (minigames/sfx.js) */
.mg-sound {
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 17px;
    cursor: pointer
}

.mg-sound[aria-pressed="false"] {
    opacity: .7
}

.mg-sound:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* Minesweeper: keep flag mode and the sound switch together on the right */
.ms-toolbar .ms-flag-mode {
    margin-left: auto
}

.ms-toolbar .mg-sound {
    margin-left: 0
}

/* Sudoku: a row, column or box that just got every digit pulses once, cell by cell. */
.su-cell.is-pulse {
    position: relative;
    z-index: 1;
    animation: su-pulse .6s ease-out both
}

@keyframes su-pulse {
    0% { box-shadow: inset 0 0 0 0 transparent; transform: none }
    35% { box-shadow: inset 0 0 0 var(--su-cell) var(--th-ccfa7030), 0 0 10px var(--th-ccfa7030); transform: scale(1.12) }
    100% { box-shadow: inset 0 0 0 0 transparent; transform: none }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes su-pulse {
        0%, 100% { box-shadow: inset 0 0 0 0 transparent }
        35% { box-shadow: inset 0 0 0 var(--su-cell) var(--th-ccfa7030) }
    }
}

/* Nonogram: a row or column that just matched its clue pulses once (cells one by one, plus the clue). */
.nn-toolbar .mg-sound {
    margin-left: 0
}

.nn-cell.is-pulse {
    position: relative;
    z-index: 1;
    animation: nn-pulse .6s ease-out both
}

.nn-clue.is-pulse {
    animation: nn-clue-pulse .6s ease-out both
}

@keyframes nn-pulse {
    0% { box-shadow: inset 0 0 0 0 transparent; transform: none }
    35% { box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .28), 0 0 10px var(--th-ccfa7030); transform: scale(1.15) }
    100% { box-shadow: inset 0 0 0 0 transparent; transform: none }
}

@keyframes nn-clue-pulse {
    0%, 100% { color: inherit; text-shadow: none }
    35% { color: var(--accent); opacity: 1; text-shadow: 0 0 8px var(--accent) }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes nn-pulse {
        0%, 100% { box-shadow: inset 0 0 0 0 transparent }
        35% { box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .28) }
    }
}

/* Pac-Man */
.pm-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.pm-button {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.pm-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.pm-frame.is-over {
    border-color: #a8352c
}

.pm-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.pm-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ffd400;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.pm-stat-lives {
    color: #ff7a8a
}

.pm-stat-level {
    color: var(--accent)
}

.pm-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.pm-pause:disabled {
    opacity: .4;
    cursor: default
}

.pm-stage {
    position: relative;
    display: flex;
    justify-content: center
}

.pm-canvas {
    display: block;
    border-radius: 6px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.pm-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.pm-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ecc;
    border-radius: 8px;
    text-align: center
}

.pm-overlay[hidden] {
    display: none
}

.pm-overlay-title {
    margin: 0;
    color: #ffd400;
    font-size: 24px;
    font-weight: 800
}

.pm-overlay-text {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.pm-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.pm-button:focus-visible,
.pm-pause:focus-visible,
.pm-start:focus-visible,
.pm-pad button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* On-screen arrows: shown on touch screens only. */
.pm-pad {
    display: none;
    grid-template-areas: ". up ." "left down right";
    grid-template-columns: repeat(3, 64px);
    gap: 8px;
    justify-content: center;
    margin-top: 12px
}

.pm-pad button {
    height: 52px;
    border: 1px solid var(--th-46513f);
    border-radius: 12px;
    background: #202722;
    color: var(--accent);
    font-size: 20px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none
}

.pm-pad-up { grid-area: up }
.pm-pad-left { grid-area: left }
.pm-pad-down { grid-area: down }
.pm-pad-right { grid-area: right }

@media (pointer: coarse) {
    .pm-pad { display: grid }
}

.pm-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .pm-frame { padding: 6px }
}

/* Minesweeper: an always-visible horizontal scrollbar for wide boards on touch screens. */
.ms-scrollbar {
    display: none;
    position: relative;
    height: 14px;
    margin: 8px 6px 2px;
    border-radius: 7px;
    background: #050607;
    touch-action: none;
    cursor: pointer
}

.ms-scrollbar-thumb {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    border-radius: 5px;
    background: var(--accent);
    opacity: .75
}

@media (pointer: coarse) {
    .ms-scrollbar { display: block }
    .ms-scrollbar[hidden] { display: none }
}

/* Fast Typing */
.ty-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.ty-select,
.ty-button {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.ty-select {
    flex: 1 1 150px;
    max-width: 210px
}

.ty-button {
    border-color: var(--th-46513f);
    background: #202722
}

.ty-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.ty-frame.is-over {
    border-color: #a8352c
}

.ty-frame.is-done {
    border-color: var(--accent)
}

.ty-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.ty-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: var(--accent);
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.ty-stat[hidden] {
    display: none
}

.ty-stat-lives {
    color: #ff7a8a
}

.ty-stat-best {
    margin-left: auto;
    color: #f2c94c
}

.ty-body {
    position: relative;
    border-radius: 10px;
    background: #0a0c0d;
    cursor: text
}

/* Speed test: three lines of words; the line in progress stays second from the top. */
.ty-text {
    height: calc(3 * 1.5em + 2 * 8px + 28px);
    padding: 14px 16px;
    overflow: hidden;
    /* Hide lines that slide into the top and bottom padding. */
    clip-path: inset(14px 0);
    font: 500 22px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace
}

.ty-text[hidden],
.ty-rain[hidden],
.ty-overlay[hidden],
.ty-banner[hidden] {
    display: none
}

.ty-words {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #59625f;
    transition: transform .15s
}

.ty-word.is-ok {
    color: var(--th-c0cab6)
}

.ty-word.is-bad {
    color: #ff7a6b;
    text-decoration: underline wavy #ff7a6b80;
    text-underline-offset: 5px
}

.ty-word.is-current {
    color: #8e9894
}

.ty-word .is-ok {
    color: var(--accent)
}

.ty-word .is-bad {
    color: #ff7a6b;
    background: #ff7a6b22
}

.ty-word .is-extra {
    color: #c95a4f;
    opacity: .8
}

.ty-word .is-caret {
    box-shadow: -2px 0 0 var(--accent)
}

.ty-word.is-caret-end {
    box-shadow: 2px 0 0 var(--accent)
}

/* Word rain */
.ty-rain {
    position: relative;
    height: min(380px, 55vh);
    overflow: hidden;
    border-bottom: 3px solid var(--th-46513f);
    border-radius: 10px 10px 4px 4px;
    font: 700 18px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace
}

.ty-rain.is-hit {
    animation: ty-hit .35s ease-out
}

@keyframes ty-hit {
    0% { box-shadow: inset 0 -40px 40px -20px #ff3b3080 }
    100% { box-shadow: none }
}

.ty-drop {
    position: absolute;
    top: 0;
    padding: 3px 8px;
    border-radius: 6px;
    background: #1b2022;
    color: var(--th-c0cab6);
    white-space: nowrap;
    will-change: transform
}

.ty-drop.is-target {
    background: var(--th-2f3f22);
    box-shadow: 0 0 0 1px var(--accent)
}

.ty-drop b {
    color: var(--accent)
}

.ty-drop.is-pop {
    animation: ty-pop .25s ease-out forwards
}

@keyframes ty-pop {
    to { opacity: 0; scale: 1.6 }
}

.ty-banner {
    position: absolute;
    top: 38%;
    left: 0;
    right: 0;
    margin: 0;
    color: var(--accent);
    font: 800 24px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
    opacity: 0;
    pointer-events: none
}

.ty-banner.is-on {
    animation: ty-banner 1.2s ease-out
}

@keyframes ty-banner {
    0% { opacity: 0; transform: translateY(8px) }
    20%, 70% { opacity: 1; transform: none }
    100% { opacity: 0 }
}

.ty-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ee0;
    border-radius: 10px;
    text-align: center;
    cursor: default
}

.ty-overlay-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800
}

.ty-overlay-text {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.ty-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.ty-input {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    margin-top: 10px;
    padding: 0 14px;
    border: 1px solid var(--th-46513f);
    border-radius: 10px;
    background: #111416;
    color: var(--text);
    font: 500 18px ui-monospace, SFMono-Regular, Consolas, monospace
}

.ty-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px
}

.ty-input.is-wrong {
    border-color: #ff7a6b;
    color: #ff7a6b
}

.ty-input:disabled {
    opacity: .5
}

.ty-select:focus-visible,
.ty-button:focus-visible,
.ty-start:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.ty-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .ty-frame { padding: 6px }
    .ty-select { max-width: none }
    .ty-text { font-size: 18px; padding: 14px 12px }
}

/* Minigame side panel: top 10 above, comments below. The panel scrolls as one, the comment feed keeps its own
   scroll and the composer sticks to the bottom (as on phones), so the send button is always reachable even when
   the window is short. */
.post-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: #171c19;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--th-586450) transparent
}

.post-side > .post-comments {
    flex: none;
    min-height: auto;
    overflow: visible;
    border-left: 0
}

.post-side .comment-feed {
    flex: none;
    max-height: 55dvh;
    min-height: 100px
}

.post-side .comment-composer {
    position: sticky;
    bottom: 0;
    z-index: 1
}

.post-leaderboard {
    flex: none;
    padding: 16px 24px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--th-191f1b)
}

.leaderboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.leaderboard-head h3 {
    margin: 0;
    font-size: 18px
}

.leaderboard-board {
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--th-222b25);
    color: var(--text);
    color-scheme: dark;
    font: inherit;
    font-size: 13px;
    text-overflow: ellipsis;
    cursor: pointer
}

.leaderboard-board[hidden] {
    display: none
}

.leaderboard-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #0e1112;
    font-size: 14px
}

.leaderboard-entry.is-you {
    box-shadow: inset 0 0 0 1px var(--accent);
    background: var(--th-2f3f22)
}

.leaderboard-rank {
    color: var(--muted);
    font: 700 13px ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center
}

.leaderboard-entry.is-top .leaderboard-rank {
    font-size: 18px
}

.leaderboard-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

.leaderboard-name small {
    margin-left: 3px;
    color: var(--accent);
    font-size: 11px
}

.leaderboard-score {
    color: var(--accent);
    font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.leaderboard-empty {
    padding: 10px 0;
    color: var(--muted);
    font-size: 13px
}

.leaderboard-you {
    margin: 8px 0 0;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600
}

.leaderboard-you[hidden] {
    display: none
}

.leaderboard-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line)
}

.leaderboard-best {
    margin: 0 0 8px;
    font-size: 13px
}

.leaderboard-form-row {
    display: flex;
    gap: 8px
}

.leaderboard-form-row input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--th-43503a);
    border-radius: 8px;
    background: var(--th-131813);
    color: var(--text);
    font: inherit
}

.leaderboard-form-row input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px
}

.leaderboard-form-row .post-open-button {
    margin: 0;
    white-space: nowrap
}

.leaderboard-form-row .post-open-button:disabled {
    opacity: .5;
    cursor: not-allowed
}

.leaderboard-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5
}

.leaderboard-status {
    margin: 8px 0 0;
    color: var(--accent);
    font-size: 12px
}

.leaderboard-status:empty {
    display: none
}

@media(max-width:760px) {
    .post-side {
        display: block;
        overflow: visible;
        border-left: 0;
        border-top: 1px solid var(--line)
    }

    .post-leaderboard {
        padding: 18px 20px
    }

    .post-side > .post-comments {
        border-top: 0
    }
}

/* Flappy Bird */
.fb-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.fb-select {
    flex: 1 1 140px;
    max-width: 200px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.fb-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.fb-frame.is-over {
    border-color: #a8352c
}

.fb-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.fb-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ffcc33;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.fb-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.fb-pause:disabled {
    opacity: .4;
    cursor: default
}

.fb-stage {
    position: relative;
    display: flex;
    justify-content: center
}

.fb-canvas {
    display: block;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer
}

.fb-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.fb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ec4;
    border-radius: 8px;
    text-align: center
}

.fb-overlay[hidden] {
    display: none
}

.fb-overlay-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800
}

.fb-overlay-text {
    max-width: 300px;
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.fb-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.fb-select:focus-visible,
.fb-pause:focus-visible,
.fb-start:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.fb-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .fb-frame { padding: 6px }
    .fb-select { max-width: none }
}

/* Duel Fighter */
.fg-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.fg-select {
    flex: 1 1 140px;
    max-width: 200px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #393e3e;
    border-radius: 8px;
    background: #111416;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer
}

.fg-frame {
    padding: 10px;
    border: 1px solid #2c3330;
    border-radius: 12px;
    background: #0e1112;
    transition: border-color .2s
}

.fg-frame.is-over {
    border-color: #a8352c
}

.fg-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.fg-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #050607;
    color: #ffd23f;
    font: 700 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums
}

.fg-pause {
    width: 38px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--th-46513f);
    border-radius: 8px;
    background: #202722;
    color: var(--text);
    font-size: 15px;
    cursor: pointer
}

.fg-pause:disabled {
    opacity: .4;
    cursor: default
}

.fg-stage {
    position: relative;
    display: flex;
    justify-content: center
}

.fg-canvas {
    display: block;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer
}

.fg-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.fg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #0b0d0ec4;
    border-radius: 8px;
    text-align: center
}

.fg-overlay[hidden] {
    display: none
}

.fg-overlay-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800
}

.fg-overlay-text {
    max-width: 300px;
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.fg-start {
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--th-121611);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.fg-select:focus-visible,
.fg-pause:focus-visible,
.fg-start:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.fg-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

@media(max-width:560px) {
    .fg-frame { padding: 6px }
    .fg-select { max-width: none }
}

/* On-screen controls: shown on touch screens only. */
.fg-pad {
    display: none;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px
}

.fg-pad-group {
    flex: 0 1 172px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px
}

.fg-key {
    height: 52px;
    border: 1px solid var(--th-46513f);
    border-radius: 12px;
    background: #202722;
    color: var(--accent);
    font-size: 20px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none
}

.fg-key:active {
    background: #2c362f
}

@media (pointer: coarse) {
    .fg-pad { display: flex }
}
