:root {
    color-scheme: dark;
    --page: #111717;
    --surface: #192121;
    --surface-raised: #202a29;
    --ink: #f0f3e8;
    --muted: #9daaa1;
    --line: rgba(235, 243, 230, 0.12);
    --lime: #d6f36a;
    --orange: #ff916b;
    --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 5%, rgba(116, 145, 84, 0.11), transparent 42rem),
        var(--page);
    color: var(--ink);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.site-header {
    min-height: 76px;
    padding: 0 max(24px, calc((100vw - 1120px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--lime);
    color: var(--page);
    font-size: 1rem;
    font-weight: 900;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--muted);
    font-size: 0.87rem;
    text-decoration: none;
    transition: color 160ms ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--lime);
}

main {
    width: min(100% - 48px, 920px);
    margin: 0 auto;
    flex: 1;
}

.hero {
    min-height: 270px;
    padding: 62px 0 42px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.eyebrow {
    margin: 0 0 13px;
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero .eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 12px rgba(255, 145, 107, 0.6);
}

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

h1 {
    margin-bottom: 16px;
    font-size: clamp(2.9rem, 7vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.075em;
}

h1 span {
    color: var(--lime);
}

.hero-description {
    max-width: 445px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.hero-note {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.77rem;
    line-height: 1.5;
}

.note-number {
    color: var(--orange);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.note-divider {
    width: 1px;
    height: 36px;
    background: var(--line);
}

.game-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(33, 44, 42, 0.96), rgba(24, 32, 32, 0.98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

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

.game-heading .eyebrow {
    margin-bottom: 5px;
    font-size: 0.64rem;
}

.game-heading h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.key-hint {
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
}

kbd {
    min-width: 24px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.7rem;
    text-align: center;
}

.key-hint span {
    margin-left: 5px;
}

.scoreboard {
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(8, 14, 14, 0.24);
}

.score-item {
    min-height: 63px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.score-item + .score-item {
    border-left: 1px solid var(--line);
}

.score-label {
    color: var(--muted);
    font-size: 0.72rem;
}

.score-value {
    color: var(--ink);
    font-size: 1.08rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.score-best {
    color: var(--lime);
}

.lives-limit {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.game-stage {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(214, 243, 106, 0.15);
    border-radius: 12px;
    background-color: #121b1a;
    background-image:
        linear-gradient(rgba(220, 240, 218, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 240, 218, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    cursor: grab;
    touch-action: none;
}

.game-stage:active {
    cursor: grabbing;
}

.game-stage:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.game-stage::after {
    position: absolute;
    z-index: -1;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
    content: "";
}

.stage-decoration {
    position: absolute;
    top: 13px;
    right: 13px;
    color: rgba(221, 231, 210, 0.26);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.game-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(14, 21, 20, 0.76);
    text-align: center;
    backdrop-filter: blur(3px);
}

.game-overlay[hidden] {
    display: none;
}

.catcher {
    position: absolute;
    z-index: 1;
    bottom: 15px;
    left: 50%;
    width: 60px;
    height: 10px;
    border-radius: 5px;
    background: var(--lime);
    box-shadow: 0 0 18px rgba(214, 243, 106, 0.2);
    pointer-events: none;
    transform: translateX(-50%);
}

.overlay-content {
    max-width: 340px;
}

.overlay-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 13px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(214, 243, 106, 0.3);
    border-radius: 14px;
    color: var(--lime);
    font-size: 1.5rem;
}

.overlay-content h3 {
    margin-bottom: 8px;
    font-size: 1.32rem;
    letter-spacing: -0.04em;
}

.overlay-content p {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.5;
}

.button {
    min-height: 42px;
    padding: 0 17px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 750;
    transition: transform 140ms ease, background-color 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.button-primary {
    background: var(--lime);
    color: #172012;
}

.button-primary:hover {
    background: #e2ff83;
}

.button-primary span {
    margin-left: 7px;
}

.game-controls {
    padding-top: 15px;
}

.word-panel {
    margin-top: 13px;
    padding: 15px 16px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(8, 14, 14, 0.24);
}

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

.word-heading .eyebrow {
    margin-bottom: 4px;
    font-size: 0.62rem;
}

.word-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.73rem;
}

.word-progress {
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.word-slots {
    min-height: 39px;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.word-letter {
    width: 30px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #829087;
    font-size: 0.95rem;
    font-weight: 800;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.word-letter.is-caught {
    border-color: rgba(214, 243, 106, 0.58);
    background: rgba(214, 243, 106, 0.12);
    color: var(--lime);
}

.how-to-play {
    padding: 67px 0 75px;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 55px;
}

.how-to-heading .eyebrow {
    margin-bottom: 10px;
}

.how-to-heading h2 {
    max-width: 260px;
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.065em;
}

.how-to-heading h2 span {
    color: var(--lime);
}

.rule-list {
    display: grid;
    gap: 20px;
}

.rule {
    display: grid;
    grid-template-columns: 35px 1fr;
    gap: 13px;
}

.rule-number {
    padding-top: 2px;
    color: var(--orange);
    font-size: 0.7rem;
    font-weight: 800;
}

.rule h3 {
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.rule p {
    max-width: 340px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.site-footer {
    min-height: 82px;
    padding: 18px max(24px, calc((100vw - 1120px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
}

.footer-brand {
    font-size: 0.8rem;
}

.footer-brand .brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 0.82rem;
}

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

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

.falling-letter {
    position: absolute;
    z-index: 1;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(214, 243, 106, 0.72);
    border-radius: 10px;
    background: linear-gradient(145deg, #29362a, #1d2925);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.08);
    color: var(--lime);
    font-size: 1rem;
    font-weight: 850;
    pointer-events: none;
    transform: translate(-50%, -50%);
    user-select: none;
}

@media (max-width: 680px) {
    .site-header {
        min-height: 66px;
        padding: 0 20px;
    }

    nav {
        gap: 17px;
    }

    nav a {
        font-size: 0.78rem;
    }

    main {
        width: min(100% - 32px, 500px);
    }

    .hero {
        min-height: auto;
        padding: 45px 0 29px;
    }

    .hero-note {
        display: none;
    }

    h1 {
        font-size: clamp(2.8rem, 13vw, 4rem);
    }

    .hero-description {
        max-width: 370px;
        font-size: 0.91rem;
    }

    .game-card {
        padding: 17px;
        border-radius: 14px;
    }

    .score-item {
        min-height: 57px;
        padding: 9px;
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .score-label {
        font-size: 0.65rem;
    }

    .score-value {
        font-size: 0.98rem;
    }

    .game-stage {
        min-height: 420px;
    }

    .game-controls {
        padding-top: 12px;
    }

    .word-panel {
        padding: 13px;
    }

    .word-slots {
        gap: 6px;
    }

    .word-letter {
        width: 28px;
        height: 32px;
    }

    .how-to-play {
        padding: 50px 0 55px;
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .how-to-heading h2 {
        max-width: none;
    }

    .site-footer {
        padding: 18px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 390px) {
    .brand {
        gap: 7px;
        font-size: 0.84rem;
    }

    nav {
        gap: 12px;
    }

    nav a {
        font-size: 0.73rem;
    }

    .key-hint {
        gap: 3px;
        font-size: 0.68rem;
    }

    .game-heading h2 {
        font-size: 1.28rem;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
