/* =========================================================
   Omiga — offline mini games
   A small, dependency-free design system.
   ========================================================= */

@font-face {
    font-family: 'VT323';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/vt323-latin-400-normal.woff2') format('woff2');
}

:root {
    --font-display: 'VT323', 'Courier New', ui-monospace, monospace;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --bg: #f4eddd;
    --bg-deep: #eadfc7;
    --surface: #fffaf0;
    --surface-2: #efe4cf;
    --ink: #171225;
    --muted: #62596f;
    --border: #171225;
    --shadow-color: #171225;
    --dot: rgba(23, 18, 37, 0.13);

    --lime: #c9f45b;
    --purple: #7a5cff;
    --coral: #ff7a6b;
    --cyan: #20c7dd;
    --yellow: #ffd84d;
    --focus: #7a5cff;

    --board-bg: #e9e1d1;
    --board-grid: rgba(23, 18, 37, 0.14);
    --board-ghost: rgba(23, 18, 37, 0.18);

    --radius: 20px;
    --shadow: 6px 6px 0 var(--shadow-color);
    --shadow-sm: 3px 3px 0 var(--shadow-color);
    --header-height: 76px;
}

[data-theme='dark'] {
    --bg: #0f0d1a;
    --bg-deep: #090811;
    --surface: #191527;
    --surface-2: #221c36;
    --ink: #f6f1ff;
    --muted: #b3a9c9;
    --border: #463b66;
    --shadow-color: #2e2546;
    --dot: rgba(255, 255, 255, 0.07);

    --lime: #c9f45b;
    --purple: #9b84ff;
    --coral: #ff8b7d;
    --cyan: #3bdfee;
    --yellow: #ffdf67;
    --focus: #c9f45b;

    --board-bg: #07060d;
    --board-grid: rgba(201, 244, 91, 0.1);
    --board-ghost: rgba(246, 241, 255, 0.16);
}

html[data-theme='light'] { color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    content: '';
    pointer-events: none;
}

body.game-open { overflow: hidden; }

[hidden] { display: none !important; }

::selection {
    background: var(--lime);
    color: #12101f;
}

img,
svg,
canvas { max-width: 100%; }

button,
input,
select,
textarea { font: inherit; }

button { color: inherit; }

a { color: inherit; }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 0.95;
    text-transform: uppercase;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.shell {
    width: min(1180px, calc(100% - 3rem));
    margin-inline: auto;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    flex: 0 0 auto;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.15em;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 300;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--lime);
    color: #12101f;
    font-family: var(--font-display);
    font-size: 1.15rem;
    text-decoration: none;
    text-transform: uppercase;
    transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink);
    text-decoration: none;
}

.brand__mark {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    width: 25px;
    height: 25px;
    transform: rotate(-4deg);
}

.brand__mark i {
    border-radius: 2px;
    background: var(--lime);
    box-shadow: inset 0 0 0 1px rgba(18, 16, 31, 0.28);
}

.brand__mark i:nth-child(2) { background: var(--purple); }
.brand__mark i:nth-child(3) { background: var(--cyan); }

.brand__word {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.06em;
    line-height: 1;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    margin-left: auto;
}

.site-nav a {
    position: relative;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 3px;
    background: var(--lime);
    content: '';
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 160ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

.header-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.55rem;
}

.lang-switch {
    display: inline-flex;
    overflow: hidden;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

.lang-switch button {
    min-width: 34px;
    padding: 0.25rem 0.5rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.lang-switch button[aria-pressed='true'] {
    background: var(--ink);
    color: var(--bg);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.icon-button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-color); }
.icon-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.icon-button:disabled { opacity: 0.4; cursor: default; }
.icon-button:disabled:hover { transform: none; box-shadow: var(--shadow-sm); }

.icon-button .icon { width: 1.2rem; height: 1.2rem; }

.icon-button--tiny {
    width: 30px;
    height: 30px;
    border-width: 1.5px;
    box-shadow: none;
}

.theme-icon--sun { display: none; }
[data-theme='dark'] .theme-icon--moon { display: none; }
[data-theme='dark'] .theme-icon--sun { display: block; }

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 50px;
    padding: 0.65rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--shadow-color);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow-color); }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow-color); }

.button--primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
}

[data-theme='dark'] .button--primary {
    border-color: var(--lime);
    background: var(--lime);
    color: #12101f;
}

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

.button--small {
    min-height: 42px;
    padding: 0.45rem 0.9rem;
    font-size: 1.08rem;
}

.button .icon { width: 1.05em; height: 1.05em; }

/* ---------- Labels and shared bits ---------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
}

.eyebrow__dot {
    width: 9px;
    height: 9px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--lime);
    animation: blink 3.2s steps(1, end) infinite;
}

@keyframes blink {
    0%, 92%, 100% { opacity: 1; }
    94%, 98% { opacity: 0.35; }
}

.section {
    padding-block: clamp(4rem, 8vw, 7rem);
    border-top: 2px dashed var(--border);
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.section__head { max-width: 780px; }

.section__title {
    margin-bottom: 1rem;
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    letter-spacing: 0.01em;
}

.section__lede {
    max-width: 62ch;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.06rem;
}

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    padding-block: clamp(3rem, 7vw, 6rem);
}

.hero__copy { max-width: 660px; }

.hero__title {
    margin-bottom: 1.4rem;
    font-size: clamp(4.2rem, 10.5vw, 8.6rem);
    letter-spacing: 0.005em;
    line-height: 0.8;
}

.hero__title-accent {
    display: inline-block;
    padding-inline: 0.04em;
    background-image: linear-gradient(180deg, transparent 62%, var(--lime) 62%, var(--lime) 93%, transparent 93%);
    color: var(--purple);
}

[data-theme='dark'] .hero__title-accent {
    background-image: none;
    color: var(--lime);
    text-shadow: 0 0 28px rgba(201, 244, 91, 0.25);
}

.hero__lede {
    max-width: 52ch;
    margin-bottom: 1.8rem;
    color: var(--muted);
    font-size: 1.1rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.hero__micro {
    margin-bottom: 0;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero__art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.2rem 1.4rem;
}

.arcade-card {
    position: relative;
    width: min(330px, 100%);
    padding: 0.8rem;
    border: 3px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 10px 10px 0 var(--shadow-color);
    transform: rotate(2.5deg);
}

.arcade-card__bar,
.arcade-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.arcade-card__bar {
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.45rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
}

.arcade-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 8px var(--lime);
}

.arcade-card__screen {
    position: relative;
    overflow: hidden;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #0b0914;
}

.arcade-board {
    display: block;
    width: 100%;
    height: auto;
    color: var(--lime);
    background: #0b0914;
}

.arcade-glare {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 42%);
    pointer-events: none;
}

.arcade-card__foot {
    margin-top: 0.55rem;
    color: var(--muted);
}

.arcade-card__foot span:last-child { color: var(--ink); }

.arcade-card__insert {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

.block--lime { fill: #c9f45b; }
.block--purple { fill: #9b84ff; }
.block--cyan { fill: #3bdfee; }
.block--orange { fill: #ff9a4d; }
.block--yellow { fill: #ffd84d; }

.block { stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.6; }

.arcade-fall {
    animation: piece-drop 5.4s cubic-bezier(0.5, 0, 0.75, 1) infinite;
    will-change: transform, opacity;
}

.arcade-ghost { opacity: 0.22; }

@keyframes piece-drop {
    0%, 5% { opacity: 0; transform: translateY(0); }
    9% { opacity: 1; }
    60% { opacity: 1; transform: translateY(120px); }
    67%, 100% { opacity: 0; transform: translateY(120px); }
}

.sticker {
    position: absolute;
    z-index: 2;
    padding: 0.3rem 0.7rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--lime);
    color: #12101f;
    box-shadow: 3px 3px 0 var(--shadow-color);
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-transform: uppercase;
}

.sticker--offline {
    top: 0.3rem;
    right: -0.3rem;
    transform: rotate(7deg);
}

.sticker--est {
    bottom: 0.2rem;
    left: -0.4rem;
    background: var(--surface);
    color: var(--ink);
    transform: rotate(-6deg);
}

/* ---------- Featured game ---------- */

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.game-feature {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 10px 10px 0 var(--shadow-color);
}

.game-feature__art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 320px;
    padding: 1.8rem;
    border-bottom: 3px solid var(--border);
    background-color: var(--purple);
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1.2px, transparent 1.2px);
    background-size: 14px 14px;
}

.game-feature__art--order { background-color: var(--cyan); }

.game-feature__art--order .game-feature__no { color: rgba(18, 16, 31, 0.22); }
.game-feature--order .game-feature__screen { width: min(220px, 72%); }

.game-feature__art--shooter { background-color: #221a4d; }
.game-feature__art--shooter .game-feature__no { color: rgba(255, 255, 255, 0.22); }
.game-feature--shooter .game-feature__screen { width: min(180px, 62%); }

.pixel-shooter-art {
    display: block;
    width: 100%;
    height: auto;
    background: #05040c;
    border-radius: 10px;
}

.game-feature__no {
    position: absolute;
    top: 0.6rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.34);
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 1;
}

.game-feature__screen {
    position: relative;
    width: min(180px, 66%);
    padding: 7px;
    border: 3px solid var(--border);
    border-radius: 16px;
    background: #0b0914;
    box-shadow: 7px 7px 0 rgba(18, 16, 31, 0.38);
    transform: rotate(-2.5deg);
}

.arcade-board--card {
    border-radius: 10px;
}

.game-feature__screen .arcade-fall {
    animation: none;
    opacity: 1;
    transform: translateY(120px);
}

.game-feature__sticker {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.35rem 0.8rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--lime);
    color: #12101f;
    box-shadow: 3px 3px 0 rgba(18, 16, 31, 0.38);
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1;
    text-transform: uppercase;
    transform: rotate(5deg);
}

.game-feature__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.85rem;
    padding: clamp(1.4rem, 2.6vw, 2rem);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.badge {
    padding: 0.18rem 0.62rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
}

.badge--lime { background: var(--lime); color: #12101f; }

.game-feature__title {
    margin: 0;
    font-size: clamp(2rem, 3.2vw, 2.7rem);
}

.game-feature__tagline {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.42rem;
    line-height: 1.15;
}

.game-feature__description {
    max-width: 54ch;
    margin: 0;
    color: var(--muted);
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.2rem;
    margin: 0.2rem 0 0.4rem;
    padding: 0;
    list-style: none;
}

.game-meta li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.game-meta__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--purple);
}

.coming-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    margin-top: 1.4rem;
}

.coming-card {
    position: relative;
    padding: 1.6rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.coming-card__no {
    position: absolute;
    top: 0.9rem;
    right: 1.1rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.coming-card__icon {
    width: 1.6rem;
    height: 1.6rem;
    margin-bottom: 0.6rem;
}

.coming-card h3 {
    margin-bottom: 0.4rem;
    font-size: 1.75rem;
}

.coming-card p {
    max-width: 38ch;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.coming-card__badge {
    display: inline-block;
    padding: 0.12rem 0.6rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.coming-card--dark {
    border-style: solid;
    background: var(--purple);
    color: #ffffff;
}

.coming-card--dark p { color: rgba(255, 255, 255, 0.82); }
.coming-card--dark .coming-card__no { color: rgba(255, 255, 255, 0.7); }
.coming-card--dark .coming-card__badge { background: var(--lime); color: #12101f; }

/* ---------- About ---------- */

.about__head { max-width: 760px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
    margin-top: 2.5rem;
}

.feature {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--lime);
    color: #12101f;
}

.feature__icon .icon { width: 1.5rem; height: 1.5rem; }

.feature h3 {
    margin-bottom: 0.45rem;
    font-size: 1.8rem;
}

.feature p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.offline-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.6rem;
    padding: 1rem 1.2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.offline-banner p {
    flex: 1;
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
    text-transform: uppercase;
}

.offline-banner__signal {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 38px;
    height: 28px;
}

.offline-banner__signal i {
    display: block;
    flex: 1;
    border: 2px solid var(--border);
    border-radius: 2px;
    background: var(--purple);
}

.offline-banner__signal i:nth-child(1) { height: 30%; }
.offline-banner__signal i:nth-child(2) { height: 50%; background: var(--cyan); }
.offline-banner__signal i:nth-child(3) { height: 70%; background: var(--lime); }
.offline-banner__signal i:nth-child(4) { height: 92%; background: var(--coral); }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 2px solid var(--border);
    padding-block: 2.2rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand--footer .brand__word { font-size: 1.6rem; }

.site-footer__brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer__meta {
    margin: 0;
    margin-left: auto;
    color: var(--muted);
    font-size: 0.85rem;
}

.connection {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.2rem 0.65rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.connection__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 2px rgba(201, 244, 91, 0.2);
}

.connection.is-offline .connection__dot {
    background: var(--coral);
    box-shadow: 0 0 0 2px rgba(255, 122, 107, 0.2);
}

/* ---------- Game ---------- */

.game {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
}

.game:focus { outline: none; }

.game::before {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    content: '';
    pointer-events: none;
}

.game__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(980px, 100%);
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto;
    padding:
        max(1rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
}

.game__header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border);
}

.game__back { flex: 0 0 auto; }

.game__heading {
    flex: 1;
    min-width: 0;
}

.game__eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
    letter-spacing: 0.12em;
}

.game__title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: 0.02em;
    line-height: 0.9;
}

.game__tools {
    display: flex;
    gap: 0.5rem;
}

.game__tools .icon-play { display: none; }
.game.is-paused .game__tools .icon-pause { display: none; }
.game.is-paused .game__tools .icon-play { display: block; }

.game__layout {
    display: grid;
    grid-template-columns: 106px auto;
    align-content: center;
    align-items: start;
    justify-content: center;
    gap: 1rem;
    flex: 1;
}

.game__rail {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.game__stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.55rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.game__stat-label {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.game__stat-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-variant-numeric: tabular-nums;
    line-height: 0.95;
}

.game__stat-value--small { font-size: 1.3rem; }

.game__stat-value.is-pop {
    animation: score-pop 220ms ease;
}

.game__stage.is-shaking {
    animation: board-shake 200ms linear;
}

@keyframes score-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); color: var(--purple); }
    100% { transform: scale(1); }
}

@keyframes board-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.game__mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.game__mini-stats > div {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.35rem 0.4rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.game__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.game__panel--next {
    flex: 1;
    min-height: 0;
}

.game__panel--hold {
    cursor: pointer;
    color: inherit;
}

.game__panel-label {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.game__preview {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
}

.game__panel--next .game__preview { height: 96px; }
.game__panel--hold .game__preview { height: 54px; }

.game__stage-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.game__stage {
    position: relative;
    width: auto;
    height: min(64vh, 600px);
    height: min(64dvh, 600px);
    aspect-ratio: 1 / 2;
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 12px;
    background: var(--board-bg);
    box-shadow: 8px 8px 0 var(--shadow-color);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.game__board {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.game__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem;
    background: rgba(18, 16, 31, 0.82);
    color: #f6f1ff;
    text-align: center;
}

[data-theme='light'] .game__overlay {
    background: rgba(255, 250, 240, 0.9);
    color: var(--ink);
}

[data-theme='dark'] .game__overlay-kicker { color: var(--lime); }

.game__overlay-kicker {
    margin: 0;
    color: var(--purple);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.game__overlay-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 0.9;
    text-transform: uppercase;
}

.game__overlay-score {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.game__overlay .button { margin-top: 0.4rem; }

.game__touch {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
}

.game__touch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 90ms ease, background 90ms ease;
}

.game__touch-button:hover { background: var(--surface-2); }
.game__touch-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.game__touch-button .icon { width: 1.25rem; height: 1.25rem; }

.game__touch-button--accent {
    background: var(--lime);
    color: #12101f;
}

.game__touch-button--drop {
    background: var(--purple);
    color: #ffffff;
}

.game__hint {
    margin: 0;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
}

.game__keys {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.82rem;
    opacity: 0.8;
}

/* ---------- Order Blocks ---------- */

.game--order-blocks { --order-size: min(88vw, 50vh, 520px); }
.game--order-blocks .game__inner { max-width: 680px; }

.order {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 0;
}

.order__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: var(--order-size);
}

.order__stats .game__stat {
    align-items: center;
    text-align: center;
}

.order__stats .game__stat-value {
    font-size: 2.45rem;
}

.order__stats .game__stat-value--small {
    font-size: 1.7rem;
}

.order__stage {
    position: relative;
    width: var(--order-size);
    height: var(--order-size);
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 14px;
    background: var(--board-bg);
    box-shadow: 8px 8px 0 var(--shadow-color);
}


.order__board {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--board-bg);
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: filter 350ms ease;
}

.order__stage.is-game-over {
    animation: order-end 500ms ease-out;
}

.order__stage.is-game-over .order__board {
    filter: saturate(0.25) brightness(0.82);
}

.order__float-score {
    position: absolute;
    top: 14%;
    left: 50%;
    z-index: 1;
    padding: 0.18rem 0.8rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--lime);
    color: #12101f;
    box-shadow: 3px 3px 0 var(--shadow-color);
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: 0.02em;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 0);
    will-change: transform, opacity;
}

.order__float-score.is-showing {
    animation: order-score-gain 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.game--order-blocks .game__overlay:not([hidden]) {
    animation: order-overlay-in 320ms ease-out both;
}

.game--order-blocks .game__overlay:not([hidden]) .game__overlay-title {
    animation: order-title-in 460ms cubic-bezier(0.2, 0.8, 0.2, 1.1) both;
}

.game--order-blocks .game__overlay:not([hidden]) .game__overlay-score {
    animation: order-score-in 460ms 60ms ease-out both;
}

.game--order-blocks .game__overlay:not([hidden]) .button {
    animation: order-button-in 460ms 100ms ease-out both;
}

@keyframes order-score-gain {
    0% { opacity: 0; transform: translate(-50%, 14px) scale(0.75); }
    15% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
    32% { transform: translate(-50%, 0) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -56px) scale(1); }
}

@keyframes order-end {
    0% { transform: scale(1); }
    35% { transform: scale(0.985); }
    100% { transform: scale(1); }
}

@keyframes order-overlay-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes order-title-in {
    from { opacity: 0; transform: translateY(12px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes order-score-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes order-button-in {
    from { opacity: 0; transform: translateY(10px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.order__tray {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    width: var(--order-size);
}

.order__slot {
    position: relative;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 6px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 100ms ease, box-shadow 100ms ease, opacity 100ms ease;
}

.order__slot canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.order__slot:hover:not(:disabled) {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.order__slot:active:not(:disabled) { cursor: grabbing; }

.order__slot.is-empty {
    border-style: dashed;
    background: transparent;
    box-shadow: none;
    opacity: 0.45;
}

.order__slot.is-blocked { opacity: 0.4; }

.order__slot.is-selected {
    border-color: var(--focus);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px var(--focus), 3px 3px 0 var(--shadow-color);
    transform: translateY(-2px);
}

.order__slot.is-dragging { opacity: 0.28; }

.order__slot:disabled { cursor: default; }

.order__hint {
    width: var(--order-size);
    max-width: 100%;
    margin: 0;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.96rem;
    line-height: 1.2;
    text-align: center;
}

.order__hint--keys {
    font-size: 0.82rem;
    opacity: 0.82;
}

.order__drag {
    position: fixed;
    z-index: 220;
    pointer-events: none;
    opacity: 0.96;
    filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.35));
}

/* ---------- Pixel Shooter ---------- */

.game--pixel-shooter { --shooter-width: min(92vw, 52vh, 500px); }
.game--pixel-shooter .game__inner { max-width: 620px; }

.shooter {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 0;
}

.shooter__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    width: var(--shooter-width);
}

.shooter__stats .game__stat {
    align-items: center;
    padding: 0.4rem 0.3rem;
    text-align: center;
}

.shooter__stage {
    position: relative;
    width: var(--shooter-width);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 14px;
    background: #05040c;
    box-shadow: 8px 8px 0 var(--shadow-color);
    touch-action: none;
}

.shooter__stage::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.028) 0,
        rgba(255, 255, 255, 0.028) 1px,
        transparent 1px,
        transparent 3px
    );
    content: '';
    pointer-events: none;
}

.shooter__canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #05040c;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.game--pixel-shooter .game__overlay {
    z-index: 2;
    background: rgba(5, 4, 12, 0.88);
    color: #f6f1ff;
}

.game--pixel-shooter .game__overlay-kicker { color: var(--lime); }

.game--pixel-shooter .game__overlay .button--primary {
    border-color: var(--lime);
    background: var(--lime);
    color: #12101f;
}

.shooter__hint {
    width: var(--shooter-width);
    max-width: 100%;
    margin: 0;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.96rem;
    line-height: 1.2;
    text-align: center;
}

.shooter__hint--keys {
    font-size: 0.82rem;
    opacity: 0.82;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: min(440px, calc(100% - 2rem));
    padding: 0.75rem 0.8rem 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--ink);
    color: var(--bg);
    box-shadow: 5px 5px 0 var(--shadow-color);
    transform: translateX(-50%);
    animation: toast-in 180ms ease both;
}

[data-theme='dark'] .toast {
    background: var(--surface);
    color: var(--ink);
}

.toast p {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

.toast .icon-button {
    border-color: currentColor;
    background: transparent;
    color: inherit;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Standalone app ---------- */

@media (display-mode: standalone) {
    .js-install { display: none !important; }
}

body.is-standalone .js-install { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .site-nav { display: none; }
    .header-tools { margin-left: auto; }

    .hero {
        grid-template-columns: 1fr;
        min-height: 0;
        text-align: left;
    }

    .hero__copy { max-width: 720px; }
    .hero__art { padding-block: 1rem 2rem; }
    .arcade-card { transform: rotate(1.5deg); }

    .game-feature__art {
        height: 300px;
        border-bottom: 3px solid var(--border);
    }
    .game-feature__screen { width: min(175px, 58%); }

    .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .shell { width: min(100% - 1.5rem, 1180px); }

    :root { --header-height: 66px; }

    .site-header__inner { gap: 0.5rem; }
    .brand__word { font-size: 1.65rem; }
    .brand__mark { width: 21px; height: 21px; }
    .header-tools { gap: 0.4rem; }
    .install-label { display: none; }
    .header-tools .button--small { width: 42px; min-height: 42px; padding: 0; }
    .lang-switch button { min-width: 30px; padding-inline: 0.35rem; }
    .icon-button { width: 42px; height: 42px; }

    .hero { padding-block: 2.6rem 3.2rem; gap: 1rem; }
    .hero__title { font-size: clamp(3.6rem, 17vw, 5.6rem); }
    .hero__lede { font-size: 1rem; }
    .hero__micro { font-size: 0.94rem; letter-spacing: 0.05em; }
    .hero__actions { gap: 0.6rem; }
    .hero__actions .button { width: 100%; }
    .hero__art { padding-inline: 0.7rem; }
    .arcade-card { width: min(300px, 92%); }
    .sticker--offline { right: 0; }
    .sticker--est { left: 0; }

    .section { padding-block: 3.2rem; }
    .section__title { font-size: clamp(2.3rem, 11vw, 3.4rem); }

    .game-feature__art { height: 270px; padding: 1.5rem 1rem; }
    .game-feature__screen { width: min(165px, 60%); }
    .game-feature--order .game-feature__screen { width: min(200px, 68%); }
    .game-feature__no { font-size: 3.6rem; }
    .game-feature__body { padding: 1.4rem; gap: 0.8rem; }
    .game-feature__title { font-size: 2.4rem; }
    .game-feature__tagline { font-size: 1.25rem; }

    .coming-grid { grid-template-columns: 1fr; }
    .coming-card { padding: 1.3rem; }

    .offline-banner { align-items: flex-start; flex-wrap: wrap; }
    .offline-banner p { flex-basis: calc(100% - 60px); font-size: 1.1rem; }
    .offline-banner .button { margin-left: 52px; }

    .site-footer__inner { align-items: flex-start; flex-direction: column; }
    .site-footer__meta { margin-left: 0; }

    .game__inner { gap: 0.7rem; }
    .game__header { gap: 0.6rem; }
    .game__title { font-size: 1.5rem; }
    .game__eyebrow { display: none; }
    .game__layout { grid-template-columns: 82px minmax(0, 1fr); gap: 0.65rem; }
    .game__stage { height: min(60dvh, 540px); box-shadow: 5px 5px 0 var(--shadow-color); }
    .game__stat { padding: 0.35rem 0.4rem; }
    .game__stat-value { font-size: 1.45rem; }
    .game__stat-value--small { font-size: 1.1rem; }
    .game__stat-label { font-size: 0.68rem; }
    .game__mini-stats { gap: 0.3rem; }
    .game__mini-stats > div { padding: 0.25rem 0.3rem; }
    .game__panel-label { font-size: 0.7rem; }
    .game__panel--next .game__preview { height: 72px; }
    .game__panel--hold .game__preview { height: 42px; }
    .game__touch { gap: 0.3rem; }
    .game__touch-button { min-height: 42px; }
    .game__hint { font-size: 0.82rem; }

    .game--order-blocks { --order-size: min(90vw, 50vh, 480px); }
    .order { gap: 0.55rem; }
    .order__stats { gap: 0.35rem; }
    .order__stats .game__stat { padding: 0.4rem 0.3rem; }
    .order__stats .game__stat-value { font-size: 1.8rem; }
    .order__stats .game__stat-value--small { font-size: 1.3rem; }
    .order__float-score { font-size: 1.7rem; }
    .order__tray { gap: 0.4rem; }
    .order__slot { padding: 4px; }
    .order__hint { font-size: 0.82rem; }
    .order__hint--keys { font-size: 0.75rem; }

    .game--pixel-shooter { --shooter-width: min(94vw, 50vh, 480px); }
    .shooter { gap: 0.55rem; }
    .shooter__stats { gap: 0.3rem; }
    .shooter__stats .game__stat { padding: 0.35rem 0.25rem; }
    .shooter__stats .game__stat-value { font-size: 1.35rem; }
    .shooter__stats .game__stat-value--small { font-size: 1.05rem; }
    .shooter__stats .game__stat-label { font-size: 0.66rem; }
    .shooter__hint { font-size: 0.82rem; }
    .shooter__hint--keys { font-size: 0.75rem; }
}

@media (max-width: 380px) {
    .brand__word { font-size: 1.45rem; }
    .header-tools .icon-button { width: 38px; height: 38px; }
    .header-tools .button--small { width: 38px; min-height: 38px; }
    .lang-switch button { min-width: 27px; font-size: 0.95rem; }
    .hero__title { font-size: 3.4rem; }
    .game__layout { grid-template-columns: 74px minmax(0, 1fr); }
    .game__stat-value { font-size: 1.3rem; }
    .game__header { gap: 0.4rem; }
    .game__title { font-size: 1.25rem; }
    .game__tools { gap: 0.3rem; }
    .game__tools .icon-button { width: 38px; height: 38px; }
}

@media (max-height: 680px) and (min-width: 641px) {
    .game__stage { height: min(66vh, 440px); }
    .game__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .arcade-fall {
        animation: none;
        opacity: 1;
        transform: translateY(120px);
    }
}
