/* ============================================
   分形噪波的游戏厅 — BilibiliToy Arcade
   ============================================ */

@import url("assets/fonts.css");

:root {
    --bg: #0c0b12;
    --bg-2: #13121c;
    --surface: #1a1826;
    --surface-2: #232033;
    --ink: #f5f1e6;
    --muted: #a7a2b8;
    --line: #2e2b40;
    --edge: #f5f1e6;
    --shadow: #000;

    --acid: #c8ff3d;
    --hot: #ff5a36;
    --pink: #ff4fb4;
    --cyan: #3ddcff;
    --sun: #ffd23d;
    --violet: #9b7bff;
    --on-accent: #0c0b12;

    /* Shader palette: dark to light bands */
    --n0: #0c0b12;
    --n1: #1d1840;
    --n2: #3a2a8c;
    --n3: #ff4fb4;
    --n4: #c8ff3d;

    --radius: 14px;
    --radius-sm: 8px;
    --bw: 2px;
    --hard: 6px 6px 0 var(--shadow);
    --hard-sm: 4px 4px 0 var(--shadow);

    --font-display: 'Unbounded', 'ZCOOL QingKe HuangYou', 'Noto Sans SC', sans-serif;
    --font-cn-display: 'ZCOOL QingKe HuangYou', 'Noto Sans SC', sans-serif;
    --font-body: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    --font-pixel: 'Silkscreen', 'Noto Sans SC', monospace;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --header-h: 72px;
    --header-top: 12px;
    --gutter: clamp(16px, 4vw, 56px);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f2ecdd;
    --bg-2: #ebe3cf;
    --surface: #fffaef;
    --surface-2: #f6efdf;
    --ink: #15131d;
    --muted: #5e596b;
    --line: #d6ccb4;
    --edge: #15131d;
    --shadow: #15131d;

    --acid: #b6f02a;
    --hot: #ff5a36;
    --pink: #ff3fa8;
    --cyan: #22c8f0;
    --sun: #ffc61a;
    --violet: #7b5cff;
    --on-accent: #15131d;

    --n0: #f2ecdd;
    --n1: #e4d8bb;
    --n2: #ffb3d9;
    --n3: #ff5a36;
    --n4: #15131d;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

html.roll-following {
    scroll-behavior: auto;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    background: var(--acid);
    color: var(--on-accent);
}

:focus-visible {
    outline: 3px solid var(--acid);
    outline-offset: 3px;
    border-radius: 6px;
}

.pixel {
    font-family: var(--font-pixel);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Film grain overlay for a printed, noisy texture */
.grain {
    position: fixed;
    inset: -50%;
    z-index: 90;
    pointer-events: none;
    opacity: .07;
    background-image: url("assets/noise.svg");
    animation: grain 1.2s steps(6) infinite;
}

:root[data-theme="light"] .grain {
    opacity: .12;
    mix-blend-mode: multiply;
}

@keyframes grain {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -3%); }
    60% { transform: translate(-2%, -1%); }
    80% { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 120;
    background: linear-gradient(90deg, var(--acid), var(--cyan), var(--pink), var(--hot));
    transform-origin: 0 50%;
    transform: scaleX(0);
}

/* ============ Cursor ============ */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--acid);
    pointer-events: none;
    mix-blend-mode: difference;
    display: grid;
    place-items: center;
    transition: width .3s var(--spring), height .3s var(--spring), margin .3s var(--spring), background .3s;
    opacity: 0;
}

.cursor.visible { opacity: 1; }

.cursor.labeled {
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    mix-blend-mode: normal;
    background: var(--acid);
}

.cursor-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--on-accent);
    opacity: 0;
    transition: opacity .2s;
}

.cursor.labeled .cursor-label { opacity: 1; }

@media (hover: none), (pointer: coarse) {
    .cursor { display: none; }
}

/* ============ Header ============ */
.header {
    position: fixed;
    top: var(--header-top);
    left: var(--gutter);
    right: var(--gutter);
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 8px 0 16px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border: var(--bw) solid var(--edge);
    border-radius: 999px;
    box-shadow: var(--hard-sm);
    transition: transform .4s var(--ease);
}

.header.hidden { transform: translateY(calc(-100% - var(--header-top) - 12px)); }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-mark {
    width: 32px;
    height: 32px;
    display: block;
    flex: 0 0 32px;
    overflow: visible;
    transition: transform .6s var(--spring), filter .3s var(--ease);
}

.logo:hover .logo-mark {
    transform: rotate(180deg);
    filter: drop-shadow(3px 3px 0 var(--pink));
}

.logo-curve {
    fill: none;
    stroke: var(--acid);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-text {
    font-family: var(--font-cn-display);
    font-size: 20px;
    letter-spacing: .02em;
    white-space: nowrap;
}

.logo-text em {
    font-style: normal;
    color: var(--muted);
}

.nav {
    display: flex;
    gap: 4px;
    margin: 0 auto;
}

.nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    transition: color .25s, background .25s;
}

.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav-short-label { display: none; }

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--line);
    transition: background .25s, transform .4s var(--spring);
}

.nav a.active {
    color: var(--on-accent);
    background: var(--acid);
}

.nav a.active .nav-dot {
    background: var(--on-accent);
    transform: rotate(45deg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-random {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: var(--bw) solid var(--edge);
    font-size: 14px;
    font-weight: 700;
    background: var(--sun);
    color: var(--on-accent);
    transition: transform .3s var(--spring);
}

.btn-random:hover { transform: rotate(-4deg) scale(1.05); }

.theme-toggle {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: var(--bw) solid var(--edge);
    overflow: hidden;
    font-size: 18px;
}

.theme-toggle span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: transform .5s var(--spring);
}

.theme-toggle .sun { transform: translateY(120%); }
:root[data-theme="light"] .theme-toggle .sun { transform: none; }
:root[data-theme="light"] .theme-toggle .moon { transform: translateY(-120%); }

.sound-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: var(--bw) solid var(--edge);
    border-radius: 50%;
    background: var(--surface);
    color: var(--acid);
    transition: color .18s, background .18s;
}

.sound-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-off { opacity: 0; transition: opacity .18s; }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }
.sound-toggle[aria-pressed="false"] .sound-off { opacity: 1; }
.sound-toggle[aria-pressed="false"] .sound-bars { opacity: 0; }

.sound-bars {
    position: absolute;
    left: 20px;
    top: 12px;
    height: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: opacity .18s;
}

.sound-bars i {
    display: block;
    width: 2px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
}

.sound-bars i:nth-child(2) { height: 10px; }
.sound-bars i:nth-child(3) { height: 4px; }
.sound-toggle.sounding .sound-bars i { animation: soundMeter .32s ease-in-out 2 alternate; }
.sound-toggle.sounding .sound-bars i:nth-child(2) { animation-delay: -.12s; }
.sound-toggle.sounding .sound-bars i:nth-child(3) { animation-delay: -.2s; }

@keyframes soundMeter {
    0%, 100% { transform: scaleY(.4); }
    50% { transform: scaleY(1); }
}

/* ============ Buttons & chips ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 26px;
    border-radius: 999px;
    border: var(--bw) solid var(--edge);
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: var(--hard-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--shadow);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--shadow);
}

.btn-primary {
    background: var(--acid);
    color: var(--on-accent);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink);
}

.btn-sm {
    height: 42px;
    padding: 0 18px;
    font-size: 14px;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: var(--bw) solid var(--line);
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    background: var(--surface);
    transition: all .25s var(--ease);
}

.chip:hover {
    color: var(--ink);
    border-color: var(--edge);
}

.chip.active {
    color: var(--on-accent);
    background: var(--ink);
    border-color: var(--edge);
}

.chip .count {
    margin-left: 6px;
    font-family: var(--font-pixel);
    font-size: 11px;
    opacity: .6;
}

.joy {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: var(--bw) solid var(--edge);
    background: var(--surface);
    font-size: 14px;
    box-shadow: var(--hard-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}

.joy:hover { background: var(--acid); color: var(--on-accent); }

.joy:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--shadow);
}

/* ============ Hero ============ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) var(--gutter) 80px;
    overflow: hidden;
    isolation: isolate;
}

.hero-noise {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    image-rendering: pixelated;
    background:
        radial-gradient(60% 50% at 70% 40%, var(--n2), transparent 70%),
        radial-gradient(40% 40% at 20% 80%, var(--n3), transparent 70%),
        var(--n0);
}

.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 38%, transparent 70%),
        linear-gradient(0deg, var(--bg) 0%, transparent 28%);
}

.hero-robot {
    position: absolute;
    inset: auto 0 0;
    width: 100%;
    height: var(--arm-height, 600px);
    z-index: 0;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: clamp(32px, 5vw, 80px);
    align-items: center;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border: var(--bw) solid var(--edge);
    border-radius: 999px;
    background: var(--bg);
    font-size: 12px;
    margin-bottom: 28px;
}

.blink {
    color: var(--hot);
    animation: blink 1s steps(2) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-title {
    font-family: var(--font-cn-display);
    font-weight: 400;
    font-size: clamp(56px, 10.5vw, 168px);
    line-height: .92;
    letter-spacing: -.01em;
    margin-bottom: 28px;
}

.hero-title .line { display: block; }

.hero-title .line-2 {
    display: flex;
    align-items: baseline;
    gap: .08em;
    padding-left: .6em;
}

.hero-title .line-2 .scramble {
    color: var(--acid);
    -webkit-text-stroke: 0;
    text-shadow: .05em .05em 0 var(--pink);
}

.hero-title .small {
    font-size: .38em;
    color: var(--muted);
}

.scramble {
    display: inline-block;
    cursor: default;
    white-space: nowrap;
    word-break: keep-all;
}

.scramble-char {
    display: inline-block;
    text-align: center;
    white-space: pre;
}

.hero-role {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 700;
    margin-bottom: 16px;
    min-height: 1.6em;
}

.role-prefix { color: var(--muted); font-weight: 500; }

.role-typed {
    padding: 0 .2em;
    background: var(--ink);
    color: var(--bg);
}

.caret {
    color: var(--acid);
    animation: blink .9s steps(2) infinite;
}

.hero-desc {
    max-width: 34em;
    color: var(--muted);
    font-size: clamp(15px, 1.2vw, 18px);
    margin-bottom: 32px;
}

.hero-desc mark {
    background: none;
    color: var(--ink);
    font-weight: 700;
    background-image: linear-gradient(transparent 62%, color-mix(in srgb, var(--pink) 55%, transparent) 62%);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 44px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat {
    min-width: 120px;
    padding: 12px 16px;
    border: var(--bw) solid var(--edge);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.stat dt {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 30px;
    line-height: 1.1;
}

.stat:nth-child(1) dt { color: var(--acid); }
.stat:nth-child(2) dt { color: var(--cyan); }
.stat:nth-child(3) dt { color: var(--pink); }

.stat dd {
    font-size: 13px;
    color: var(--muted);
}

.hero-hint {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

/* Arcade cabinet preview */
.cabinet {
    position: relative;
    padding: 16px;
    border: var(--bw) solid var(--edge);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 10px 10px 0 var(--shadow);
    transform: rotate(1.5deg);
    transition: transform .6s var(--spring);
}

.cabinet:hover { transform: rotate(0) scale(1.01); }

.cabinet-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 12px;
    font-size: 12px;
    color: var(--muted);
}

.cabinet-leds { display: flex; gap: 6px; }

.cabinet-leds i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hot);
    animation: led 1.4s infinite;
}

.cabinet-leds i:nth-child(2) { background: var(--sun); animation-delay: .2s; }
.cabinet-leds i:nth-child(3) { background: var(--acid); animation-delay: .4s; }

@keyframes led {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.cabinet-screen {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    border: var(--bw) solid var(--edge);
    background: #0c0b12;
}

.cabinet-screen canvas,
.game-screen canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
    mix-blend-mode: multiply;
}

.cabinet-press {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: #0c0b12;
    color: #c8ff3d;
    font-size: 12px;
    border-radius: 4px;
    animation: blink 1.1s steps(2) infinite;
}

.cabinet-screen.switching canvas {
    animation: channel .35s steps(4);
}

@keyframes channel {
    0% { filter: brightness(3) contrast(4) hue-rotate(90deg); transform: scaleY(.02); }
    60% { transform: scaleY(1.05); }
    100% { filter: none; transform: none; }
}

.cabinet-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 4px 12px;
}

.cabinet-genre {
    font-size: 11px;
    color: var(--muted);
}

.cabinet-title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.25;
}

.cabinet-count {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

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

.cabinet-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.cabinet-dots button {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--line);
    transition: all .3s var(--spring);
}

.cabinet-dots button.active {
    width: 26px;
    background: var(--acid);
}

/* ============ Ticker ============ */
.ticker {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-block: var(--bw) solid var(--edge);
    background: var(--acid);
    color: var(--on-accent);
    transform: rotate(-1.2deg) scale(1.02);
    margin: -10px 0 0;
}

.ticker-track {
    display: flex;
    width: max-content;
    padding: 14px 0;
    will-change: transform;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-right: 22px;
    font-family: var(--font-cn-display);
    font-size: clamp(20px, 2.4vw, 30px);
    white-space: nowrap;
}

.ticker-item i {
    font-style: normal;
    font-size: .7em;
}

/* ============ Sections ============ */
.section {
    --section-gap: clamp(80px, 10vw, 140px);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--section-gap) var(--gutter) 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 36px;
}

.section-no {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--ink);
    color: var(--bg);
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-cn-display);
    font-weight: 400;
    font-size: clamp(44px, 6vw, 88px);
    line-height: 1;
    margin-bottom: 12px;
}

.section-title .en {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: .45em;
    vertical-align: middle;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ink);
    letter-spacing: .04em;
}

.section-desc {
    color: var(--muted);
    font-size: 16px;
}

/* ============ Arcade game grid ============ */
.arcade-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

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

.game-card {
    --accent: var(--acid);
    position: relative;
    display: flex;
    flex-direction: column;
    border: var(--bw) solid var(--edge);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--hard);
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
    transition: transform .5s var(--ease), box-shadow .3s var(--ease), opacity .4s, filter .4s;
    will-change: transform;
}

.game-card:hover {
    --lift: -6px;
    box-shadow: 10px 12px 0 var(--accent);
    transition: transform .12s linear, box-shadow .3s var(--ease);
}

.game-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

@media (min-width: 1025px) {
    .game-grid:has(.featured) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .game-grid:has(.featured) > .game-card { grid-column: span 2; }
    .game-grid:has(.featured) > .game-card.featured { grid-column: span 3; grid-row: auto; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .game-card.featured { grid-column: auto; grid-row: auto; }
}

.game-card.dimmed {
    opacity: .25;
    filter: grayscale(1);
    pointer-events: none;
}

.game-card.hidden { display: none; }

.game-card.rolling {
    box-shadow: 10px 10px 0 var(--sun);
    --lift: -8px;
}

.game-card.chosen {
    animation: chosen .9s var(--spring);
    box-shadow: 0 0 0 6px var(--sun), 12px 14px 0 var(--sun);
}

@keyframes chosen {
    0% { transform: perspective(900px) scale(1); }
    30% { transform: perspective(900px) scale(1.06) rotate(-1.5deg); }
    60% { transform: perspective(900px) scale(.98) rotate(1deg); }
    100% { transform: perspective(900px) scale(1); }
}

.game-screen {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    margin: 10px 10px 0;
    border-radius: 10px;
    overflow: hidden;
    border: var(--bw) solid var(--edge);
    background: #0c0b12;
}

.game-card.featured .game-screen { aspect-ratio: auto; flex: 1; min-height: 320px; }

.game-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .22), transparent 45%);
    opacity: 0;
    transition: opacity .3s;
}

.game-card:hover .game-screen::after { opacity: 1; }

.game-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 11px;
    background: #0c0b12;
    color: #f5f1e6;
    border: 1.5px solid #f5f1e6;
}

.badge.new {
    background: var(--hot);
    color: #fff;
    border-color: #0c0b12;
    animation: wobble 2.4s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg) scale(1.08); }
}

.game-start {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, #0c0b12 45%, transparent);
    opacity: 0;
    transition: opacity .25s;
}

.game-start span {
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--accent);
    color: #0c0b12;
    font-family: var(--font-pixel);
    font-size: 15px;
    border: 2px solid #0c0b12;
    box-shadow: 4px 4px 0 #0c0b12;
    transform: scale(.7);
    transition: transform .4s var(--spring);
}

.game-card:hover .game-start,
.game-card:focus-within .game-start { opacity: 1; }

.game-card:hover .game-start span,
.game-card:focus-within .game-start span { transform: scale(1); }

.game-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px 18px;
}

.game-exploration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid #777180;
    border-radius: 999px;
    color: #c4becd;
    background: rgba(12, 11, 18, .92);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    pointer-events: none;
}

.game-exploration::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .65;
}

.game-exploration[data-explored="true"] {
    color: #ffe5a1;
    border-color: var(--sun);
    background: rgba(42, 32, 13, .94);
}

.game-exploration[data-explored="true"]::before {
    content: '✓';
    width: auto;
    height: auto;
    background: none;
    opacity: 1;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
}

.game-meta .genre {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game-meta .genre::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
}

.online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--acid);
}

:root[data-theme="light"] .online { color: #3d7a00; }

.online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
    animation: led 1.6s infinite;
}

.game-title {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.3;
}

.game-title small {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--muted);
    margin-top: 2px;
}

.game-card.featured .game-title { font-size: 34px; }

.game-desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.game-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.game-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.game-facts span {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.game-play {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: var(--bw) solid var(--edge);
    background: var(--accent);
    color: #0c0b12;
    font-weight: 900;
    font-size: 14px;
    transition: transform .3s var(--spring);
}

.game-card:hover .game-play { transform: scale(1.06) rotate(-2deg); }

.game-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: var(--radius);
}

/* ============ Vibe rail ============ */
.rail-controls { display: flex; gap: 10px; }

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(260px, 28vw, 360px);
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 12px 28px 4px;
    margin: 0 -12px 0 -4px;
    scrollbar-width: none;
    cursor: grab;
}

.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.dragging * { pointer-events: none; }
.rail > * { scroll-snap-align: start; }

/* ============ Video cards ============ */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.video-card {
    --accent: var(--cyan);
    display: flex;
    flex-direction: column;
    border: var(--bw) solid var(--edge);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--hard-sm);
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.video-card:hover {
    transform: translate(-3px, -4px) rotate(-.4deg);
    box-shadow: 8px 8px 0 var(--accent);
}

.video-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: var(--bw) solid var(--edge);
    background: var(--surface-2);
}

.video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease), filter .6s;
}

.video-card:hover .video-cover img {
    transform: scale(1.07);
}

.play-btn {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #0c0b12;
    border: 2px solid #0c0b12;
    box-shadow: 3px 3px 0 #0c0b12;
    font-size: 16px;
    transform: scale(.8) rotate(-20deg);
    transition: transform .4s var(--spring);
}

.video-card:hover .play-btn { transform: scale(1.1); }

.video-cat {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
}

.video-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
    flex: 1;
}

.video-date {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: var(--muted);
}

.video-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.video-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
    padding-top: 6px;
}

.tags span {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--muted);
}

/* ============ Notes ============ */
.note-list {
    list-style: none;
    border-top: var(--bw) solid var(--edge);
}

.note {
    border-bottom: var(--bw) solid var(--edge);
}

.note a {
    position: relative;
    display: grid;
    grid-template-columns: 64px 56px minmax(0, 1fr) auto 48px;
    align-items: center;
    gap: 16px;
    padding: 22px 12px;
    overflow: hidden;
    isolation: isolate;
    transition: color .3s, padding .4s var(--ease);
}

.note a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--note-c, var(--acid));
    transform: scaleY(0);
    transform-origin: 50% 100%;
    transition: transform .45s var(--ease);
}

.note a:hover {
    color: var(--on-accent);
    padding-left: 28px;
}

.note a:hover::before { transform: scaleY(1); }

.note-no {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 18px;
    color: var(--muted);
    transition: color .3s;
}

.note a:hover .note-no,
.note a:hover .note-desc,
.note a:hover .note-host { color: var(--on-accent); }

.note-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 12px;
    border: var(--bw) solid var(--edge);
    background: var(--surface);
    transition: transform .5s var(--spring);
}

.note a:hover .note-icon { transform: rotate(-12deg) scale(1.1); }

.note-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
}

.note-desc {
    font-size: 13px;
    color: var(--muted);
    transition: color .3s;
}

.note-host {
    font-size: 11px;
    color: var(--muted);
}

.note-arrow {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: var(--bw) solid currentColor;
    font-size: 18px;
    transition: transform .4s var(--spring);
}

.note a:hover .note-arrow { transform: rotate(-45deg); }

/* ============ Contact ============ */
.contact {
    margin-top: clamp(100px, 12vw, 160px);
    border-top: var(--bw) solid var(--edge);
    background: var(--bg-2);
    overflow: hidden;
}

.contact-marquee {
    overflow: hidden;
    border-bottom: var(--bw) solid var(--edge);
    padding: 22px 0;
}

.contact-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.contact-track span {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(40px, 7vw, 96px);
    line-height: 1;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
}

.contact:hover .contact-track span {
    color: var(--pink);
    -webkit-text-stroke-color: var(--edge);
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

.contact-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px var(--gutter);
}

.social {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 540px;
    margin: 10px auto 0;
}

.social-link, .social-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px;
    border: var(--bw) solid var(--edge);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--hard-sm);
    text-align: left;
    transition: background .3s, color .3s, box-shadow .3s, transform .3s var(--ease);
}

.social-link:hover {
    background: var(--c);
    color: #0c0b12;
    box-shadow: 8px 8px 0 var(--shadow);
}

.social-plat {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--c);
    color: #0c0b12;
}

.social-link:hover .social-plat { background: #0c0b12; color: var(--c); }

.social-name {
    font-size: 18px;
    font-weight: 700;
    word-break: break-all;
}
.social-group .social-name { -webkit-user-select: all; user-select: all; }

.footer {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px var(--gutter) 32px;
    font-size: 12px;
    color: var(--muted);
}

.footer a:hover { color: var(--acid); }

/* ============ Toast ============ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 150;
    padding: 12px 20px;
    border-radius: 999px;
    border: var(--bw) solid var(--edge);
    background: var(--sun);
    color: #0c0b12;
    font-size: 13px;
    box-shadow: var(--hard-sm);
    transform: translate(-50%, 140%);
    transition: transform .5s var(--spring);
    pointer-events: none;
}

.toast.show { transform: translate(-50%, 0); }

/* ============ Modal ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s .22s;
}

.modal.open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #0c0b12 80%, transparent);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .3s;
}

.modal.open .modal-backdrop { opacity: 1; }

.modal-panel {
    position: relative;
    width: min(1100px, 100%);
    border: var(--bw) solid var(--edge);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 10px 10px 0 var(--acid);
    overflow: hidden;
    transform: translateY(40px) scale(.94);
    opacity: 0;
    transition: transform .45s var(--spring), opacity .25s;
}

.modal.open .modal-panel { transform: none; opacity: 1; }

.modal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 10px 18px;
    border-bottom: var(--bw) solid var(--edge);
    font-size: 12px;
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: var(--bw) solid var(--edge);
    transition: background .2s, transform .3s var(--spring);
}

.modal-close:hover { background: var(--hot); transform: rotate(90deg); }

.modal-player {
    aspect-ratio: 16 / 9;
    background: #000;
}

.modal-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.modal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
}

.modal-info h3 { font-size: 20px; line-height: 1.35; }
.modal-info p { font-size: 14px; color: var(--muted); }
.modal-info .btn { height: 44px; flex-shrink: 0; }

/* ============ Tactile feedback ============ */
:where(.feedback-surface) { position: relative; }
.feedback-surface.ui-pressed { scale: .975; }

.ui-ping {
    position: absolute;
    inset: 2px;
    z-index: 6;
    border: 2px solid currentColor;
    border-radius: inherit;
    pointer-events: none;
}

.game-card > .ui-ping,
.video-card > .ui-ping { border-color: var(--accent); }

.nav a:is(:hover, :focus-visible) .nav-dot { transform: rotate(135deg); }

.game-card:focus-within {
    --lift: -6px;
    box-shadow: 10px 12px 0 var(--accent);
}

.video-card:focus-visible {
    transform: translate(-3px, -4px) rotate(-.4deg);
    box-shadow: 8px 8px 0 var(--accent);
}

.video-card:focus-visible .play-btn { transform: scale(1.1) rotate(-2deg); }
.video-card:focus-visible .video-cover img { transform: scale(1.07); }
.tags span { transition: transform .22s var(--ease); }
.social-plat { transition: transform .22s var(--ease), background .2s, color .2s; }
.stat dt { transform-origin: left bottom; transition: transform .24s var(--spring); }
.footer a { position: relative; display: inline-flex; transition: transform .2s var(--ease), color .2s; }

.social-link:is(:focus-visible, .copied) {
    background: var(--c);
    color: #0c0b12;
    box-shadow: 8px 8px 0 var(--shadow);
}

.social-link:is(:focus-visible, .copied) .social-plat { background: #0c0b12; color: var(--c); }
.social-link.copied .social-plat { transform: rotate(-3deg); }

.note a:focus-visible { color: var(--on-accent); }
.note a:focus-visible::before { transform: scaleY(1); }
.note a:focus-visible :is(.note-no, .note-desc, .note-host) { color: var(--on-accent); }
.note a:focus-visible .note-icon { transform: rotate(-12deg) scale(1.1); }
.note a:focus-visible .note-arrow { transform: rotate(-45deg); }

@media (hover: hover) and (pointer: fine) {
    .sound-toggle:hover { background: var(--acid); color: var(--on-accent); }
    .chip:hover { transform: translateY(-2px); }
    .video-card:hover .tags span { transform: translateY(-2px); }
    .video-card:hover .tags span:nth-child(2) { transition-delay: .035s; }
    .video-card:hover .tags span:nth-child(3) { transition-delay: .07s; }
    .social-link:hover .social-plat { transform: translateY(-3px) rotate(-2deg); }
    .stat:hover dt { transform: translateY(-3px) rotate(-4deg); }
    .footer a:hover { transform: translateY(-3px); }
}

/* ============ Reveal ============ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0s);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

.cabinet.reveal.in { transform: rotate(1.5deg); }
.cabinet.reveal.in:hover { transform: rotate(0) scale(1.01); }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
    .btn-random span { display: none; }
    .logo-text em { display: none; }
}

@media (max-width: 1024px) {
    .hero { padding-bottom: 340px; }
    .hero-inner { grid-template-columns: 1fr; }
    .cabinet { max-width: 560px; }
    .hero-vignette {
        background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 60%, color-mix(in srgb, var(--bg) 30%, transparent) 100%);
    }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    :root { --header-h: 116px; }
    html {
        scroll-padding-top: calc(var(--header-top) + var(--header-box-height, 108px) + 14px);
    }

    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 8px 8px 14px;
        border-radius: 20px;
        row-gap: 6px;
    }

    .header-actions { margin-left: auto; }

    .nav {
        order: 3;
        width: 100%;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .nav a { justify-content: center; min-height: 44px; padding: 4px; font-size: 13px; transition: none; -webkit-tap-highlight-color: transparent; }
    .nav-wide-label { display: none; }
    .nav-short-label { display: inline; }

    .note a {
        grid-template-columns: 48px minmax(0, 1fr) 40px;
        gap: 12px;
        padding: 18px 4px;
    }

    .note-no, .note-host { display: none; }
    .note-icon { width: 44px; height: 44px; font-size: 20px; }
    .note-arrow { width: 36px; height: 36px; font-size: 15px; }
    .note-title { font-size: 16px; }
}

@media (max-width: 640px) {
    .hero { padding-bottom: 80px; }
    .hero-robot { display: none; }
    .game-grid { grid-template-columns: 1fr; gap: 20px; }
    .game-card.featured { grid-column: auto; grid-row: auto; }
    .game-card.featured .game-screen { min-height: 0; aspect-ratio: 16 / 10; flex: none; }
    .game-card.featured .game-title { font-size: 24px; }
    .game-foot { flex-wrap: wrap; }
    .hero-title .line-2 { padding-left: 0; }
    .hero-hint { display: none; }
    .stat { min-width: 0; flex: 1; padding: 10px 12px; }
    .stat dt { font-size: 24px; }
    .social { grid-template-columns: 1fr; }
    .rail { grid-auto-columns: 82%; }
    .modal-info { flex-direction: column; align-items: flex-start; }
    .footer { flex-direction: column; }
    .logo-text { font-size: 17px; }
    .header { gap: 10px; }
    .header-actions { gap: 6px; }
    .btn-random { width: 38px; padding: 0; justify-content: center; }
    .sound-toggle, .theme-toggle { flex-shrink: 0; }
    .nav-dot { display: none; }

    #randomGame { position: relative; min-height: 44px; }
    #randomGame .random-roll-label {
        position: absolute;
        inset: 50% 10px auto;
        transform: translateY(-50%);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    #randomGame.rolling .random-button-label { opacity: 0; }
    #randomGame.rolling { background: var(--sun); }
}
.random-roll-label:empty { display: none; }

/* Arcade-specific composition and native Toy container spacing. */
:root {
    --toy-safe-top: 0px;
    --toy-safe-right: 0px;
    --toy-safe-bottom: 0px;
    --toy-safe-left: 0px;
}
.arcade-intro {
    color: var(--muted);
    font-size: clamp(10px, 1.3vw, 14px);
    letter-spacing: .06em;
    line-height: 1.8;
    margin: 0 0 28px;
}
.contact-inner > .section-no { text-align: center; }
.video-watch {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 10px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 10px;
}
.toy-native { --header-top: calc(54px + var(--toy-safe-top)); }
.toy-native .header {
    left: calc(var(--gutter) + var(--toy-safe-left));
    right: calc(var(--gutter) + var(--toy-safe-right));
}
.toy-native .hero { padding-top: calc(196px + var(--toy-safe-top)); }
.toy-native .contact { padding-bottom: calc(40px + var(--toy-safe-bottom)); }
.toy-native .section { scroll-margin-top: calc(130px + var(--toy-safe-top)); }
@media (max-width: 860px) {
    .section, .toy-native .section { scroll-margin-top: calc(-1 * var(--section-gap)); }
}
.more-videos {
    margin-top: 40px;
    border-top: var(--bw) solid var(--line);
}
.more-videos > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}
.more-videos > summary::-webkit-details-marker { display: none; }
.more-videos > summary:focus-visible {
    outline: 2px solid var(--acid);
    outline-offset: 4px;
}
.more-videos-label { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.more-videos-label .count { font-size: 12px; color: var(--muted); }
.more-videos-action { display: flex; align-items: center; gap: 10px; color: var(--acid); font-size: 13px; }
.more-videos-arrow { font-size: 24px; transition: rotate .2s; }
.more-videos[open] .more-videos-arrow { rotate: 45deg; }
.more-videos:not([open]) .when-open, .more-videos[open] .when-closed { display: none; }
.more-videos-desc { margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.collection-total { display: flex; align-items: baseline; gap: 10px; }
.collection-total strong { font-family: var(--font-display); font-size: 60px; color: var(--sun); line-height: 1; }
.collection-total span { color: var(--muted); white-space: nowrap; }
.collection-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.collection-toolbar p { color: var(--ink); font-size: 14px; }
.collection-status { color: var(--muted); font-size: 12px; min-height: 24px; margin-bottom: 28px; }
.achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.achievement-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    border: var(--bw) solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    text-align: center;
    overflow: hidden;
    transition: border-color .3s, box-shadow .3s;
}
.achievement-number { align-self: flex-start; color: var(--muted); font-size: 10px; }
.achievement-coin {
    display: grid;
    place-items: center;
    width: 114px;
    height: 114px;
    margin: 24px 0 18px;
    border: 4px solid #51515a;
    border-radius: 50%;
    background: repeating-conic-gradient(#62626c 0deg 4deg, #3c3c46 4deg 8deg);
    box-shadow: 0 7px 0 #24242d, 0 12px 18px #0003;
    color: #7b7b85;
    transition: color .4s, background .4s, border-color .4s, box-shadow .4s;
}
.coin-rim {
    display: grid;
    place-items: center;
    width: 94px;
    height: 94px;
    border-radius: 50%;
    border: 3px solid #686873;
    background: linear-gradient(135deg, #393943, #23232c);
}
.coin-face { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid currentColor; border-radius: 50%; font-size: 38px; font-weight: 900; line-height: 1; }
.achievement-state { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.achievement-card h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.achievement-card p { color: var(--muted); font-size: 13px; line-height: 1.7; min-height: 44px; }
.achievement-track { height: 4px; width: 100%; margin-top: 16px; background: var(--line); border-radius: 4px; overflow: hidden; }
.achievement-fill { display: block; height: 100%; width: 0; background: var(--sun); transition: width .4s; }
.achievement-action { color: var(--acid); padding: 10px 14px; margin-top: 12px; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; }
.achievement-action:hover, .achievement-action:focus-visible { border-color: var(--acid); }
.achievement-card.unlocked {
    border-color: var(--sun);
    box-shadow: 0 0 24px #ffd23d12;
    background: radial-gradient(ellipse at 50% 30%, #ffd23d15, transparent 70%), var(--surface);
}
.unlocked .achievement-coin {
    color: #88520b;
    border-color: #ffec94;
    background: repeating-conic-gradient(#ffdf65 0deg 4deg, #b47715 4deg 8deg);
    box-shadow: 0 7px 0 #86510d, 0 0 32px #ffd23d55, 0 12px 18px #0003;
}
.unlocked .coin-rim { border-color: #ffeda3; background: linear-gradient(135deg, #fff0a6 0%, #fbc848 40%, #ce8b19 70%, #ffe685 100%); }
.unlocked .coin-face { text-shadow: 0 1px #fff4bf; }
.unlocked .achievement-state { color: var(--sun); }
.just-earned .achievement-coin { animation: coin-unlock .85s cubic-bezier(.2,.7,.25,1); }
@keyframes coin-unlock {
    0% { transform: rotateY(0) scale(.8); filter: brightness(1); }
    45% { transform: rotateY(180deg) scale(1.16); filter: brightness(1.5); }
    100% { transform: rotateY(360deg) scale(1); filter: brightness(1); }
}
.collection-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 24px; }
[data-theme="light"] .achievement-action { color: #4c5900; }
[data-theme="light"] .unlocked .achievement-state,
[data-theme="light"] .collection-total strong { color: #8c5700; }
@media (max-width: 860px) {
    .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .collection-toolbar { flex-wrap: wrap; }
    .collection .section-head { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .more-videos-label { font-size: 17px; gap: 8px; }
    .more-videos-action { font-size: 12px; gap: 6px; }
    .achievement-grid { gap: 12px; }
    .achievement-card { padding: 16px 10px; border-radius: 12px; }
    .achievement-coin { width: 94px; height: 94px; margin: 20px 0 16px; }
    .coin-rim { width: 76px; height: 76px; }
    .coin-face { width: 60px; height: 60px; font-size: 30px; }
    .achievement-card h3 { font-size: 17px; }
    .achievement-card p { font-size: 12px; min-height: 62px; }
    .collection-total strong { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .feedback-surface.ui-pressed { scale: 1; }
    .ui-ping { display: none; }
    .stat:hover dt, .video-card:hover .tags span, .social-link:hover .social-plat,
    .chip:hover, .footer a:hover { transform: none; }
}
