:root {
    --sky-top: #2b3a67;
    --sky-mid: #ff8c5a;
    --sky-bottom: #ffd166;
    --cream: #f4efe1;
    --charcoal: #242038;
    --teal: #2ec4b6;
    --red: #e63946;
    --gold: #ffc857;
    --star-opacity: 0;
    --sun-glow: rgba(255, 200, 110, 0.55)
}

* {
    box-sizing: border-box
}

.display {
    font-family: anton, sans-serif;
    letter-spacing: .04em
}

#sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
    transition: background 2.2s ease;
    overflow: hidden
}

#stars {
    position: absolute;
    inset: 0;
    opacity: var(--star-opacity);
    transition: opacity 2.2s ease;
    background-image: radial-gradient(1.5px 1.5px at 10% 20%, #fff 100%, transparent 100%), radial-gradient(1.5px 1.5px at 25% 60%, #fff 100%, transparent 100%), radial-gradient(1px 1px at 40% 15%, #fff 100%, transparent 100%), radial-gradient(1.5px 1.5px at 55% 45%, #fff 100%, transparent 100%), radial-gradient(1px 1px at 70% 25%, #fff 100%, transparent 100%), radial-gradient(1.5px 1.5px at 85% 55%, #fff 100%, transparent 100%), radial-gradient(1px 1px at 92% 10%, #fff 100%, transparent 100%), radial-gradient(1.5px 1.5px at 15% 80%, #fff 100%, transparent 100%), radial-gradient(1px 1px at 65% 75%, #fff 100%, transparent 100%), radial-gradient(1.5px 1.5px at 33% 33%, #fff 100%, transparent 100%)
}

#sun {
    position: absolute;
    top: 8%;
    right: 12%;
    width: clamp(60px, 9vw, 120px);
    height: clamp(60px, 9vw, 120px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--cream), var(--gold) 60%);
    box-shadow: 0 0 80px 30px var(--sun-glow);
    transition: box-shadow 2.2s ease, background 2.2s ease, transform 2.2s ease
}

.cloud {
    position: absolute;
    opacity: 1;
    animation-name: drift;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 800 800'%3E%3Cg fill='hsla(0, 0%25, 100%25, 0.86)' id='cloud'%3E%3Cpath d='M 145.81151832460728 346.85863874345546 A 50 50 0 1 1 200 200 A 50 50 0 1 1 346.858642578125 219.89529418945312 A 50 50 0 1 1 545.8115426108475 221.46597417861378 A 50 50 0 1 1 672.2513287129827 250.26178601649426 A 50 50 0 1 1 585.6020904061681 367.0157088833954 A 50 50 0 1 1 381.4136125654451 351.57068062827227 A 50 50 0 1 1 145.81151832460728 346.85863874345546 Z' stroke-linecap='round' stroke-linejoin='round'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover
}

.cloud::before, .cloud::after {
    content: "";
    position: absolute;
    background: inherit;
    border-radius: 100px
}

@keyframes drift {
    from {
        transform: translateX(0)
    }
    to {
        transform: translateX(-130vw)
    }
}

.ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6%;
    background: linear-gradient(to bottom, transparent, rgba(20, 15, 10, .35));
    z-index: 4
}

#hud {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: clamp(12px, 2.5vw, 28px);
    pointer-events: none;
    z-index: 20
}

.hud-panel {
    background: rgba(20, 16, 30, .35);
    border: 1.5px solid rgba(244, 239, 225, .5);
    padding: 8px 16px;
    color: var(--cream);
    text-align: left;
    backdrop-filter: blur(3px)
}

.hud-label {
    font-size: clamp(9px, 1vw, 11px);
    letter-spacing: .18em;
    opacity: .75;
    display: block
}

.hud-value {
    font-family: anton, sans-serif;
    font-size: clamp(20px, 3vw, 32px);
    line-height: 1.1;
    letter-spacing: .03em
}

#hud-right {
    text-align: right
}

#flight-row {
    position: absolute;
    left: 0;
    right: 0;
    top: 48%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2.4vw, 28px);
    z-index: 10;
    padding: 0 4vw
}

#plane-wrap {
    flex: none;
    width: clamp(120px, 16vw, 200px);
    animation: bob 2.6s ease-in-out infinite;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35))
}

@keyframes bob {
    0%, 100% {
        transform: translateY(0) rotate(-1.5deg)
    }
    50% {
        transform: translateY(-30px) rotate(1.5deg)
    }
}

#plane-wrap.grounded {
    animation: none;
    transform: translateY(150px) rotate(0) scale(.94)
}

#plane-wrap.taking-off {
    animation: none;
    transition: transform 1.6s cubic-bezier(.22, .61, .36, 1);
    transform: translateY(0) rotate(-1.5deg)
}

#plane-wrap.fleeing {
    animation: planeFlee 1.5s cubic-bezier(.45, 0, .65, 1) forwards !important
}

@keyframes planeFlee {
    0% {
        transform: translateX(0) translateY(0) rotate(-1.5deg);
        opacity: 1
    }
    20% {
        transform: translateX(5vw) translateY(-5px) rotate(-2deg);
        opacity: 1
    }
    100% {
        transform: translateX(130vw) translateY(-18px) rotate(-3deg);
        opacity: 0
    }
}

.propeller {
    transform-origin: 172px 50px;
    animation: spin .12s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

#rope {
    flex: none;
    width: clamp(30px, 7vw, 90px);
    height: 2px;
    background: repeating-linear-gradient(to right, var(--cream) 0 6px, transparent 6px 11px);
    opacity: .8;
    transition: opacity .5s ease
}

#banner {
    flex: none;
    position: relative;
    background: var(--cream);
    color: var(--charcoal);
    padding: clamp(10px, 2vw, 20px) clamp(16px, 3vw, 32px);
    min-width: clamp(160px, 26vw, 420px);
    max-width: 80vw;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
    transform: skewX(-2deg);
    animation: flutter 3.4s ease-in-out infinite;
    border-left: 6px solid var(--charcoal);
    transition: opacity .5s ease
}

@keyframes flutter {
    0%, 100% {
        transform: skewX(-2deg) rotate(-.6deg)
    }
    50% {
        transform: skewX(1.5deg) rotate(.6deg)
    }
}

#banner.urgent {
    animation: flutter-urgent .45s ease-in-out infinite;
    border-left-color: var(--red)
}

@keyframes flutter-urgent {
    0%, 100% {
        transform: skewX(-3deg) rotate(-1.4deg)
    }
    50% {
        transform: skewX(3deg) rotate(1.4deg)
    }
}

#banner.pop {
    animation: pop .28s ease
}

@keyframes pop {
    0% {
        transform: scale(1)
    }
    40% {
        transform: scale(1.08) skewX(-2deg)
    }
    100% {
        transform: scale(1) skewX(-2deg)
    }
}

#word-display {
    font-family: space mono, monospace;
    font-weight: 700;
    font-size: clamp(20px, 4vw, 40px);
    letter-spacing: .06em;
    white-space: nowrap;
    text-align: center
}

#word-display .ch {
    display: inline-block;
    opacity: .4;
    border-bottom: 3px solid transparent;
    transition: opacity .1s, color .1s, border-color .1s
}

#word-display .ch.correct {
    opacity: 1;
    color: var(--teal)
}

#word-display .ch.incorrect {
    opacity: 1;
    color: var(--red);
    text-decoration: underline wavy var(--red)
}

#word-display .ch.current {
    opacity: 1;
    border-bottom-color: var(--charcoal)
}

#timer-track {
    margin-top: 10px;
    height: 6px;
    background: rgba(36, 32, 56, .18);
    width: 100%
}

#timer-fill {
    height: 100%;
    width: 100%;
    background: var(--teal)
}

#timer-fill.low {
    background: var(--red)
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 20, .55);
    backdrop-filter: blur(4px);
    z-index: 30;
    opacity: 1;
    transition: opacity .4s ease
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none
}

.poster-card {
    position: relative;
    background: var(--charcoal);
    color: var(--cream);
    border: 2px solid var(--cream);
    box-shadow: inset 0 0 0 6px rgba(244, 239, 225, .12);
    padding: clamp(28px, 5vw, 56px) clamp(24px, 6vw, 72px);
    max-width: 90vw;
    text-align: center
}

.poster-card::before, .poster-card::after, .corner-tl, .corner-br {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gold)
}

.poster-card::before {
    top: -8px;
    left: -8px;
    border-right: none;
    border-bottom: none
}

.poster-card::after {
    bottom: -8px;
    right: -8px;
    border-left: none;
    border-top: none
}

.corner-tl {
    top: -8px;
    right: -8px;
    border-left: none;
    border-bottom: none
}

.corner-br {
    bottom: -8px;
    left: -8px;
    border-right: none;
    border-top: none
}

.eyebrow {
    font-size: clamp(10px, 1.4vw, 13px);
    letter-spacing: .32em;
    color: var(--gold);
    margin-bottom: 10px
}

.title {
    font-family: anton, sans-serif;
    font-size: clamp(38px, 8vw, 84px);
    line-height: .95;
    margin: 0 0 14px;
    letter-spacing: .02em
}

.subtitle {
    font-size: clamp(12px, 1.6vw, 16px);
    opacity: .85;
    max-width: 44ch;
    margin: 0 auto 26px;
    line-height: 1.6
}

.btn {
    font-family: anton, sans-serif;
    letter-spacing: .06em;
    font-size: clamp(15px, 2vw, 20px);
    background: var(--gold);
    color: var(--charcoal);
    border: none;
    padding: 14px 36px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--cream)
}

.btn:active {
    transform: translateY(0)
}

.stat-row {
    display: flex;
    gap: clamp(18px, 4vw, 40px);
    justify-content: center;
    margin: 22px 0 30px;
    flex-wrap: wrap
}

.stat {
    text-align: center
}

.stat-num {
    font-family: anton, sans-serif;
    font-size: clamp(26px, 4vw, 40px);
    color: var(--gold)
}

.stat-label {
    font-size: 10px;
    letter-spacing: .18em;
    opacity: .75
}

#level-toast {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.8);
    font-family: anton, sans-serif;
    font-size: clamp(32px, 7vw, 64px);
    color: var(--gold);
    text-shadow: 0 4px 18px rgba(0, 0, 0, .5);
    opacity: 0;
    z-index: 25;
    pointer-events: none;
    letter-spacing: .05em
}

#level-toast.show {
    animation: toast 1.2s ease forwards
}

@keyframes toast {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.7)
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05)
    }
    30% {
        transform: translate(-50%, -50%) scale(1)
    }
    80% {
        opacity: 1
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(1)
    }
}

#typed-input {
    position: fixed;
    opacity: 0;
    height: 1px;
    width: 1px;
    top: 0;
    left: 0;
    font-size: 16px;
    pointer-events: none
}

#hint {
    position: absolute;
    bottom: 84px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--cream);
    opacity: .65;
    font-size: clamp(10px, 1.4vw, 13px);
    letter-spacing: .1em;
    z-index: 15;
    pointer-events: none
}

@media (prefers-reduced-motion: reduce) {
    .propeller, #banner {
        animation: none !important
    }
}

#bg1 {
    position: absolute !important;
    bottom: 0;
    left: 0;
    height: 120px;
    background-repeat: repeat-x
}

#bg1 {
    background-image: url(/static/aviator/mountain-3014f12f7d5f8d27b6b933b8cf38e56b.png);
    z-index: 1;
    width: calc(100% + 1322px)
}

#game-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    height: 80vh;
    overflow: hidden
}

#mountain-bg, #mountain-front, #plane-wrap, #rope, #banner {
    position: relative
}

#sound-toggle {
    position: absolute;
    top: 106px;
    right: 27px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px)
}

#sound-toggle:hover {
    background: rgba(0, 0, 0, .5)
}