﻿:root {
    --sky-top: #86d7ff;
    --sky-bottom: #f5fdff;
    --field-top: #7fd16e;
    --field-bottom: #3e8c3a;
    --mountain-sky-top: #0f1b35;
    --mountain-sky-bottom: #8aa1bb;
    --snow-field-top: #eff7ff;
    --snow-field-bottom: #bed1e7;
    --tropical-sky-top: #f58b5d;
    --tropical-sky-bottom: #ffd9a3;
    --sea-top: #62d9eb;
    --sea-bottom: #1478a4;
    --sand-top: #f8d89a;
    --sand-bottom: #e4bb6d;
    --panel: rgba(16, 34, 26, 0.8);
    --accent: #ffcb45;
    --danger: #ff735a;
    --text: #fffdf6;
    --shadow: rgba(8, 20, 14, 0.24);
    --muted: rgba(255, 253, 246, 0.8);
    --screen-gutter: clamp(18px, 2vw, 32px);
    --panel-gap: clamp(12px, 1.5vw, 18px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.75), transparent 38%),
        linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 52%, var(--field-top) 52%, var(--field-bottom) 100%);
    color: var(--text);
    overflow: hidden;
    cursor: crosshair;
    touch-action: manipulation;
}

body.level-two {
    background:
        radial-gradient(circle at 18% 16%, rgba(188, 214, 255, 0.34), transparent 22%),
        radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.2), transparent 18%),
        linear-gradient(180deg, var(--mountain-sky-top) 0%, #203354 26%, var(--mountain-sky-bottom) 52%, var(--snow-field-top) 52%, var(--snow-field-bottom) 100%);
}

body.level-three {
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 244, 177, 0.46), transparent 18%),
        radial-gradient(circle at 82% 12%, rgba(255, 218, 167, 0.22), transparent 16%),
        linear-gradient(180deg, var(--tropical-sky-top) 0%, var(--tropical-sky-bottom) 40%, #70dced 40%, var(--sea-bottom) 68%, var(--sand-top) 68%, var(--sand-bottom) 100%);
}

.game-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    contain: layout paint style;
}

.hud {
    position: absolute;
    top: var(--screen-gutter);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(11, minmax(72px, 1fr));
    gap: 12px;
    align-items: stretch;
    width: min(1360px, calc(100vw - (var(--screen-gutter) * 2)));
    pointer-events: none;
}

.panel {
    min-width: 0;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 12px 28px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.panel-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.78;
    margin-bottom: 6px;
}

.panel-value {
    font-size: clamp(1rem, 1.7vw, 2rem);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.game-area {
    position: absolute;
    inset: 0;
    contain: strict;
}

.sun {
    position: absolute;
    top: 52px;
    right: 8vw;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff8c7 0%, #ffd559 58%, rgba(255, 213, 89, 0.18) 72%, transparent 74%);
}

.cloud,
.cloud::before,
.cloud::after {
    background: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    position: absolute;
    content: "";
}

.cloud {
    width: 150px;
    height: 44px;
    top: 15%;
    animation: drift 24s linear infinite;
    will-change: transform;
}

.cloud::before {
    width: 68px;
    height: 68px;
    top: -26px;
    left: 24px;
}

.cloud::after {
    width: 76px;
    height: 76px;
    top: -30px;
    right: 20px;
}

.cloud.two {
    top: 25%;
    width: 170px;
    left: -240px;
    animation-duration: 30s;
    animation-delay: -12s;
}

.cloud.three {
    top: 10%;
    width: 120px;
    left: -200px;
    animation-duration: 20s;
    animation-delay: -4s;
}

.mountain-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    transition: opacity 0.9s ease, transform 0.9s ease;
    pointer-events: none;
    z-index: 2;
}

body.level-two .mountain-scene {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.tropical-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    transition: opacity 0.9s ease, transform 0.9s ease;
    pointer-events: none;
    z-index: 2;
}

body.level-three .tropical-scene {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.sea-horizon {
    position: absolute;
    inset-inline: 0;
    bottom: 19vh;
    height: 20vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 22%),
        linear-gradient(180deg, rgba(120, 233, 245, 0.82) 0%, rgba(42, 170, 201, 0.94) 42%, rgba(13, 107, 149, 0.98) 100%);
}

.island {
    position: absolute;
    background: linear-gradient(180deg, #174d31 0%, #245a34 42%, #4d7c39 74%, #947243 100%);
    filter: drop-shadow(0 14px 20px rgba(24, 46, 44, 0.22));
}

.island-back {
    left: 12%;
    bottom: 23vh;
    width: 34vw;
    min-width: 220px;
    height: 16vh;
    clip-path: polygon(0 100%, 0 70%, 14% 58%, 22% 36%, 34% 52%, 48% 22%, 58% 38%, 71% 12%, 83% 44%, 100% 56%, 100% 100%);
    opacity: 0.68;
}

.island-front {
    right: 8%;
    bottom: 19vh;
    width: 42vw;
    min-width: 260px;
    height: 21vh;
    background: linear-gradient(180deg, #24613d 0%, #2f7a47 38%, #517f3d 70%, #aa8550 100%);
    clip-path: polygon(0 100%, 0 72%, 10% 61%, 18% 42%, 29% 56%, 42% 18%, 54% 37%, 66% 10%, 79% 32%, 89% 54%, 100% 64%, 100% 100%);
}

.lagoon-shine {
    position: absolute;
    left: 50%;
    bottom: 18vh;
    width: min(46vw, 460px);
    height: 14vh;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.42) 0%, rgba(137, 233, 248, 0.22) 42%, transparent 70%);
    mix-blend-mode: screen;
}

.palm {
    position: absolute;
    bottom: 20vh;
    width: 140px;
    height: 170px;
}

.palm::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 48px;
    width: 18px;
    height: 118px;
    border-radius: 18px;
    background: linear-gradient(180deg, #7d5632 0%, #4d2e1d 100%);
    transform-origin: bottom center;
    animation: palm-sway 4.8s ease-in-out infinite alternate;
}

.palm::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 140px;
    height: 92px;
    background:
        radial-gradient(ellipse at 16% 60%, rgba(32, 109, 60, 0.96) 0 24%, transparent 26%),
        radial-gradient(ellipse at 34% 18%, rgba(48, 133, 74, 0.94) 0 22%, transparent 24%),
        radial-gradient(ellipse at 52% 6%, rgba(42, 128, 71, 0.94) 0 21%, transparent 23%),
        radial-gradient(ellipse at 70% 18%, rgba(47, 137, 79, 0.94) 0 22%, transparent 24%),
        radial-gradient(ellipse at 88% 54%, rgba(35, 113, 64, 0.96) 0 24%, transparent 26%);
    filter: drop-shadow(0 6px 8px rgba(16, 52, 32, 0.18));
    transform-origin: 50% 100%;
    animation: palm-sway 4.8s ease-in-out infinite alternate;
}

.palm-left {
    left: 12%;
}

.palm-left::before {
    transform: rotate(-14deg);
}

.palm-left::after {
    transform: rotate(-10deg);
}

.palm-right {
    right: 10%;
}

.palm-right::before {
    transform: rotate(16deg);
}

.palm-right::after {
    transform: rotate(12deg);
}

.wave {
    position: absolute;
    left: -8%;
    width: 116%;
    border-top: 2px solid rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    opacity: 0.58;
    animation: wave-slide 6.5s ease-in-out infinite;
}

.wave-one {
    bottom: 18vh;
    height: 28px;
}

.wave-two {
    bottom: 15.5vh;
    height: 22px;
    animation-delay: -2.4s;
}

.wave-three {
    bottom: 13vh;
    height: 18px;
    animation-delay: -4.2s;
}

.mountain-range {
    position: absolute;
    inset-inline: -6%;
    background-repeat: no-repeat;
    background-size: cover;
}

.mountain-far {
    bottom: 24vh;
    height: 28vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0 20%, rgba(153, 181, 209, 0.8) 20% 40%, rgba(74, 96, 126, 0.94) 40% 100%);
    clip-path: polygon(0 100%, 0 72%, 8% 68%, 18% 36%, 26% 58%, 37% 24%, 44% 48%, 56% 14%, 67% 54%, 78% 26%, 88% 62%, 100% 40%, 100% 100%);
    opacity: 0.54;
}

.mountain-mid {
    bottom: 18vh;
    height: 34vh;
    background:
        linear-gradient(180deg, #f7fbff 0 18%, #d9e7f5 18% 34%, #8ea8c4 34% 58%, #425877 58% 100%);
    clip-path: polygon(0 100%, 0 64%, 11% 56%, 23% 18%, 32% 44%, 45% 12%, 52% 38%, 65% 10%, 74% 46%, 84% 22%, 92% 50%, 100% 34%, 100% 100%);
    opacity: 0.88;
}

.mountain-near {
    bottom: 14vh;
    height: 30vh;
    background:
        linear-gradient(180deg, #fcffff 0 16%, #d9e4ef 16% 30%, #7f95ad 30% 50%, #30435c 50% 100%);
    clip-path: polygon(0 100%, 0 62%, 10% 44%, 18% 60%, 30% 18%, 40% 42%, 49% 8%, 59% 44%, 71% 18%, 81% 48%, 92% 30%, 100% 52%, 100% 100%);
    filter: drop-shadow(0 18px 20px rgba(10, 18, 34, 0.26));
}

.pine-line {
    position: absolute;
    inset-inline: 0;
    bottom: 17vh;
    height: 10vh;
    background:
        linear-gradient(180deg, transparent 0 28%, rgba(16, 35, 44, 0.25) 28% 100%),
        repeating-linear-gradient(90deg,
            transparent 0 2.5%,
            rgba(13, 37, 47, 0.9) 2.5% 3.4%,
            transparent 3.4% 7.2%,
            rgba(8, 26, 33, 0.92) 7.2% 8.1%,
            transparent 8.1% 12%);
    clip-path: polygon(0 100%, 0 65%, 4% 52%, 7% 72%, 10% 45%, 14% 78%, 20% 42%, 24% 70%, 28% 46%, 34% 80%, 40% 40%, 46% 72%, 53% 46%, 58% 82%, 64% 44%, 69% 74%, 76% 40%, 82% 76%, 88% 45%, 94% 70%, 100% 48%, 100% 100%);
    opacity: 0.72;
}

.snowfall {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -8%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(218, 238, 255, 0.92) 68%, transparent 70%);
    opacity: 0;
    animation: snowfall 10s linear infinite;
}

.snowflake:nth-child(1) {
    left: 6%;
    animation-delay: -1s;
    animation-duration: 9s;
    transform: scale(0.8);
}

.snowflake:nth-child(2) {
    left: 14%;
    animation-delay: -5s;
    animation-duration: 11s;
    transform: scale(1.1);
}

.snowflake:nth-child(3) {
    left: 24%;
    animation-delay: -2.5s;
    animation-duration: 8.8s;
    transform: scale(0.72);
}

.snowflake:nth-child(4) {
    left: 37%;
    animation-delay: -7s;
    animation-duration: 10.4s;
    transform: scale(1.06);
}

.snowflake:nth-child(5) {
    left: 51%;
    animation-delay: -3.4s;
    animation-duration: 9.4s;
    transform: scale(0.66);
}

.snowflake:nth-child(6) {
    left: 63%;
    animation-delay: -6.8s;
    animation-duration: 12s;
    transform: scale(1);
}

.snowflake:nth-child(7) {
    left: 74%;
    animation-delay: -4.2s;
    animation-duration: 8.6s;
    transform: scale(0.76);
}

.snowflake:nth-child(8) {
    left: 84%;
    animation-delay: -8.6s;
    animation-duration: 10.8s;
    transform: scale(1.18);
}

.snowflake:nth-child(9) {
    left: 91%;
    animation-delay: -1.8s;
    animation-duration: 9.7s;
    transform: scale(0.68);
}

.snowflake:nth-child(10) {
    left: 96%;
    animation-delay: -5.5s;
    animation-duration: 11.5s;
    transform: scale(1.12);
}

.ground {
    position: absolute;
    inset: auto 0 0;
    height: 26vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%),
        repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.1) 0 14px, rgba(0, 0, 0, 0.03) 14px 28px);
    border-top: 3px solid rgba(255, 255, 255, 0.16);
}

body.level-two .sun {
    top: 74px;
    right: 9vw;
    width: 96px;
    height: 96px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(228, 239, 255, 0.95) 42%, rgba(207, 226, 255, 0.42) 60%, transparent 70%);
    box-shadow: 0 0 34px rgba(231, 242, 255, 0.2);
}

body.level-two .cloud,
body.level-two .cloud::before,
body.level-two .cloud::after {
    background: rgba(228, 239, 255, 0.5);
}

body.level-two .ground {
    height: 28vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(222, 236, 249, 0.08) 20%, transparent 24%),
        repeating-linear-gradient(102deg, rgba(255, 255, 255, 0.42) 0 18px, rgba(170, 192, 214, 0.22) 18px 36px, rgba(87, 111, 132, 0.18) 36px 54px);
    border-top: 2px solid rgba(244, 249, 255, 0.72);
}

body.level-three .sun {
    top: 78px;
    right: 10vw;
    width: 104px;
    height: 104px;
    background: radial-gradient(circle, rgba(255, 250, 217, 0.98) 0%, rgba(255, 215, 112, 0.96) 40%, rgba(255, 166, 88, 0.38) 62%, transparent 70%);
    box-shadow: 0 0 34px rgba(255, 176, 89, 0.24);
}

body.level-three .cloud,
body.level-three .cloud::before,
body.level-three .cloud::after {
    background: rgba(255, 245, 231, 0.72);
}

body.level-three .ground {
    height: 28vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 14%),
        linear-gradient(180deg, rgba(252, 236, 191, 0.88) 0%, rgba(243, 215, 144, 0.94) 42%, rgba(222, 180, 102, 0.98) 100%);
    border-top: 2px solid rgba(255, 248, 225, 0.74);
}

body.level-three .level-banner {
    background: linear-gradient(135deg, rgba(124, 61, 33, 0.9), rgba(207, 119, 63, 0.9));
    border-color: rgba(255, 219, 173, 0.42);
    box-shadow: 0 18px 34px rgba(76, 38, 19, 0.3);
}

.instructions {
    position: absolute;
    bottom: var(--screen-gutter);
    left: var(--screen-gutter);
    z-index: 20;
    max-width: min(400px, calc(100vw - (var(--screen-gutter) * 2)));
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(22, 41, 30, 0.68);
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 10px 24px var(--shadow);
    pointer-events: none;
}

.tutorial-banner {
    position: absolute;
    top: 118px;
    left: 50%;
    z-index: 21;
    width: min(720px, calc(100vw - (var(--screen-gutter) * 2)));
    transform: translateX(-50%);
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(10, 28, 22, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 28px rgba(8, 20, 14, 0.24);
    text-align: center;
    pointer-events: none;
}

.tutorial-banner.hidden {
    display: none;
}

.tutorial-banner-title {
    display: block;
    margin-bottom: 4px;
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff1a8;
}

.tutorial-banner-copy {
    margin: 0;
    color: var(--text);
    font-size: clamp(0.96rem, 2vw, 1.08rem);
    line-height: 1.45;
}

.level-banner {
    position: absolute;
    top: 132px;
    left: 50%;
    z-index: 23;
    width: min(580px, calc(100vw - (var(--screen-gutter) * 2)));
    padding: 14px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 28, 52, 0.88), rgba(38, 58, 92, 0.9));
    border: 1px solid rgba(196, 222, 255, 0.24);
    box-shadow: 0 18px 34px rgba(5, 15, 34, 0.28);
    text-align: center;
    transform: translate3d(-50%, -16px, 0);
    opacity: 0;
    pointer-events: none;
}

.level-banner.show {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
    animation: banner-rise 0.55s ease;
}

.level-banner.hidden {
    display: none;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--screen-gutter);
    background: rgba(7, 18, 14, 0.5);
}

.overlay.intro-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: rgba(6, 13, 12, 0.24);
}

.overlay.hidden {
    display: none;
}

.reload-overlay {
    position: absolute;
    inset: 0;
    z-index: 24;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 108px var(--screen-gutter) 92px;
    pointer-events: none;
}

.reload-overlay.hidden {
    display: none;
}

.reload-card {
    width: min(460px, 100%);
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(7, 18, 35, 0.92);
    border: 1px solid rgba(163, 203, 255, 0.18);
    box-shadow: 0 20px 42px rgba(4, 10, 24, 0.42);
    pointer-events: auto;
}

.reload-card.shake {
    animation: reload-shake 0.28s ease;
}

.reload-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.reload-copy {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.reload-weapon {
    margin-bottom: 14px;
    padding: 12px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.reload-weapon svg {
    display: block;
    width: 100%;
    height: auto;
}

.reload-sequence {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.reload-step {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f6ff;
}

.reload-step.active {
    border-color: rgba(255, 203, 69, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 203, 69, 0.22);
    background: rgba(255, 203, 69, 0.12);
}

.reload-step.done {
    color: #16250f;
    background: #9fe07b;
    border-color: rgba(159, 224, 123, 0.9);
}

.reload-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.reload-pad {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    gap: 8px;
    justify-content: center;
}

.reload-arrow {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #f3f8ff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
}

.reload-arrow:hover {
    transform: translateY(-1px);
}

.reload-arrow[data-reload-key="ArrowUp"] {
    grid-column: 2;
}

.reload-arrow[data-reload-key="ArrowLeft"] {
    grid-column: 1;
    grid-row: 2;
}

.reload-arrow[data-reload-key="ArrowDown"] {
    grid-column: 2;
    grid-row: 2;
}

.reload-arrow[data-reload-key="ArrowRight"] {
    grid-column: 3;
    grid-row: 2;
}

.overlay-card {
    width: min(1040px, calc(100vw - (var(--screen-gutter) * 2)));
    max-height: min(88vh, 920px);
    max-height: min(88dvh, 920px);
    overflow: auto;
    padding: 28px;
    border-radius: 24px;
    background: rgba(11, 25, 19, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 40px var(--shadow);
}

.overlay-card h1,
.overlay-card h2,
.overlay-card h3 {
    margin-top: 0;
}

.overlay-card p {
    color: var(--muted);
    line-height: 1.55;
}

.overlay-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 22px;
    align-items: start;
}

.level-map {
    margin: 18px 0;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 32, 25, 0.9), rgba(7, 19, 15, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.level-map-header {
    margin-bottom: 16px;
}

.level-map-copy {
    margin: 0;
    font-size: 0.95rem;
}

.world-map-board {
    position: relative;
    min-height: 360px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 28px 54px rgba(0, 0, 0, 0.16),
        inset 0 -26px 58px rgba(0, 0, 0, 0.22),
        0 24px 40px rgba(0, 0, 0, 0.24);
}

.world-map-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.world-map-svg {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.06), transparent 18%),
        linear-gradient(180deg, #40596d 0%, #263847 100%);
}

.world-map-svg .svg-pin-link {
    cursor: pointer;
}

.world-map-svg .svg-pin-base circle {
    fill: #e67e22;
    stroke: #fff;
    stroke-width: 2;
}

.world-map-svg .svg-pin-base text {
    fill: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-anchor: middle;
}

.intro-map-shell {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.intro-layout {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(280px, 1fr) minmax(260px, 320px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "hero spacer status"
        "info spacer auth"
        "info actions actions";
    gap: var(--panel-gap);
    padding: var(--screen-gutter);
    align-items: start;
    pointer-events: none;
}

.intro-map-shell .world-map-board {
    position: absolute;
    inset: 0;
    min-height: 100%;
    border-radius: 0;
}

.intro-panel {
    position: relative;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(7, 17, 19, 0.72);
    border: 1px solid rgba(255, 247, 224, 0.12);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
    width: auto;
    max-width: 100%;
    pointer-events: auto;
}

.intro-hero-panel {
    grid-area: hero;
}

.intro-status-panel {
    grid-area: status;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.intro-info-panel {
    grid-area: info;
    align-self: end;
}

.intro-auth-panel {
    grid-area: auth;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
}

.intro-actions-panel {
    grid-area: actions;
    align-self: end;
    justify-self: center;
    width: min(620px, 100%);
}

.intro-panel h1,
.intro-panel h2,
.intro-panel h3 {
    margin-top: 0;
}

.intro-panel p {
    color: var(--muted);
    line-height: 1.5;
}

.intro-status-panel .intro-stat {
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.intro-stat-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 241, 168, 0.82);
}

.intro-status-panel strong {
    font-size: 0.98rem;
}

.world-map-board::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 48%, transparent 36%, rgba(7, 11, 14, 0.1) 100%),
        linear-gradient(180deg, rgba(255, 236, 191, 0.04), rgba(7, 12, 14, 0.08));
    pointer-events: none;
}

.level-route {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.level-route::before {
    content: "";
    position: absolute;
    top: 38px;
    left: 13%;
    right: 13%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 203, 69, 0.18), rgba(255, 203, 69, 0.58), rgba(255, 203, 69, 0.18));
}

.level-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    color: var(--text);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

.level-node.unlocked:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 203, 69, 0.44);
}

.level-node.selected {
    transform: translateY(-4px);
    border-color: rgba(255, 203, 69, 0.82);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.level-node.locked,
.level-node:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: saturate(0.72);
}

.level-node-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffeaa7 0%, #ffcb45 36%, #7a4d14 100%);
    box-shadow: 0 0 0 8px rgba(255, 203, 69, 0.08);
}

.level-node.selected .level-node-ring {
    box-shadow: 0 0 0 10px rgba(255, 203, 69, 0.14), 0 0 24px rgba(255, 203, 69, 0.24);
}

.level-node.locked .level-node-ring,
.level-node:disabled .level-node-ring {
    background: radial-gradient(circle at 35% 30%, #c4c9cd 0%, #78828d 38%, #46515e 100%);
    box-shadow: none;
}

.level-node-number {
    position: absolute;
    top: 31px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f1406;
}

.level-node-title {
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.98rem;
}

.level-node-copy {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.card-section {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tutorial-list,
.leaderboard-list,
.menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.tutorial-item,
.menu-list li,
.leaderboard-row {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tutorial-title,
.leaderboard-rank {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: #fff7cb;
}

.tutorial-actions,
.button-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tutorial-actions {
    margin-top: 28px;
}

.button-row-spaced {
    margin-top: 18px;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #1c1a10;
    background: linear-gradient(180deg, #ffe388, var(--accent));
    box-shadow: 0 10px 22px rgba(255, 203, 69, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 52px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255, 203, 69, 0.36);
}

.button.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.button.secondary:hover {
    box-shadow: none;
}

.hud-button {
    width: 100%;
    height: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.menu-button {
    color: #eef6ff !important;
    background: linear-gradient(180deg, rgba(21, 45, 80, 0.96) 0%, rgba(8, 19, 39, 0.98) 100%);
    border: 1px solid rgba(180, 214, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 22px rgba(5, 16, 44, 0.34);
}

.menu-button:hover {
    color: #fffdf6;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 14px 28px rgba(5, 16, 44, 0.42);
}

.restart-button {
    color: #1c1a10 !important;
    background: linear-gradient(180deg, #ffe388, var(--accent));
    box-shadow: inset 0 0 0 1px rgba(255, 248, 214, 0.42), 0 10px 22px rgba(255, 203, 69, 0.3);
    border: 1px solid rgba(255, 241, 178, 0.55);
}

.restart-button:hover {
    color: #fff5f1;
    box-shadow: inset 0 0 0 1px rgba(230, 244, 255, 0.34), 0 14px 28px rgba(5, 16, 44, 0.5);
    background:
        linear-gradient(135deg, rgba(191, 229, 255, 1) 0 8%, transparent 8% 100%),
        linear-gradient(215deg, transparent 0 38%, rgba(148, 211, 255, 0.98) 38% 45%, transparent 45% 100%),
        linear-gradient(145deg, transparent 0 56%, rgba(224, 243, 255, 0.98) 56% 62%, transparent 62% 100%),
        linear-gradient(180deg, #1b468f 0%, #0d255c 55%, #081738 100%);
}

.danger-button {
    color: #fff5f1;
    background: linear-gradient(180deg, #ff9988 0%, #e44f39 100%);
    box-shadow: 0 10px 22px rgba(228, 79, 57, 0.28);
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field-group {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.field-group label {
    font-size: 0.9rem;
    color: var(--muted);
}

.field-group input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
}

.field-group input:focus {
    outline: 2px solid rgba(255, 203, 69, 0.55);
    outline-offset: 2px;
}

.auth-note,
.muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.feedback {
    min-height: 24px;
    margin: 6px 0 0;
    font-weight: 700;
    color: #fff7cb;
}

.feedback.error {
    color: #ff8f7e;
}

.feedback.success {
    color: #b8f3bb;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 10px;
    align-items: center;
}

.leaderboard-name {
    font-weight: 700;
}

.leaderboard-score {
    color: #fff7cb;
    font-weight: 700;
}

.analytics-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

.stats-list li {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 180px;
    padding-top: 10px;
}

.chart-bar-wrap {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.chart-bar {
    width: 100%;
    min-height: 8px;
    border-radius: 999px 999px 8px 8px;
    background: linear-gradient(180deg, #ffe388 0%, #ffcb45 100%);
    box-shadow: 0 10px 20px rgba(255, 203, 69, 0.18);
}

.chart-svg {
    width: 100%;
    height: 120px;
    overflow: visible;
    filter: drop-shadow(0 10px 20px rgba(255, 203, 69, 0.18));
}

.chart-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.chart-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff7cb;
}

.empty-state {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--muted);
}

.round-summary {
    margin: 18px 0;
}

.crosshair {
    position: absolute;
    width: 38px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    pointer-events: none;
    z-index: 30;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
    transform: translate3d(-50%, -50%, 0);
    will-change: transform;
}

.crosshair::before,
.crosshair::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.92);
}

.crosshair::before {
    width: 2px;
    height: 46px;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
}

.crosshair::after {
    width: 46px;
    height: 2px;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
}

.chicken {
    position: absolute;
    top: 0;
    left: 0;
    width: 88px;
    height: 88px;
    padding: 0;
    border: 0;
    background: transparent;
    user-select: none;
    transform: translate3d(0, 0, 0);
    transform-origin: center;
    will-change: transform, opacity;
    contain: layout paint style;
    -webkit-tap-highlight-color: transparent;
}

.chicken-sprite {
    width: 100%;
    height: 100%;
    transform-origin: center;
    animation: flap 0.45s ease-in-out infinite alternate;
}

.chicken svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.chicken.winter-chicken .winter-hat {
    transform-origin: 84px 45px;
    animation: hat-bob 1.35s ease-in-out infinite alternate;
}

.chicken.winter-chicken .winter-hat-top {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
}

.chicken.winter-chicken .winter-hat-flap-left,
.chicken.winter-chicken .winter-hat-flap-right {
    animation: hat-flap 1.5s ease-in-out infinite alternate;
}

.chicken.winter-chicken .winter-hat-badge {
    animation: badge-glint 1.9s ease-in-out infinite;
    transform-origin: 84px 31px;
}

.chicken.tropical-chicken .chicken-sprite {
    animation: tropical-hover 1.15s ease-in-out infinite alternate;
}

.chicken.tropical-chicken .tropical-reference-sprite {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chicken.tropical-chicken .tropical-reference-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 8px 10px rgba(17, 74, 92, 0.12));
    pointer-events: none;
}

.chicken.tropical-chicken .tropical-tail {
    fill: rgba(118, 145, 161, 0.28);
}

.chicken.tropical-chicken .tropical-body {
    fill: #eef8ff;
}

.chicken.tropical-chicken .tropical-head {
    fill: #d8eef8;
}

.chicken.tropical-chicken .tropical-neck-shadow {
    fill: rgba(114, 184, 211, 0.22);
}

.chicken.tropical-chicken .tropical-wing {
    fill: rgba(137, 167, 185, 0.25);
}

.chicken.tropical-chicken .tropical-comb {
    fill: none;
    stroke: #db503f;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chicken.tropical-chicken .tropical-eye-white {
    fill: #fffdf7;
}

.chicken.tropical-chicken .tropical-eye-pupil {
    fill: #3d3027;
}

.chicken.tropical-chicken .tropical-beak {
    fill: #f6a623;
}

.chicken.tropical-chicken .tropical-leg,
.chicken.tropical-chicken .tropical-foot {
    fill: none;
    stroke: #bf732d;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chicken.tropical-chicken .lei {
    transform-origin: 75px 69px;
    animation: lei-sway 1.2s ease-in-out infinite alternate;
}

.chicken.tropical-chicken .lei-rope {
    opacity: 0.46;
}

.chicken.tropical-chicken .lei-bloom {
    filter: drop-shadow(0 2px 3px rgba(126, 52, 31, 0.18));
    animation: flower-bloom 1.8s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: center;
}

.chicken.tropical-chicken .bloom-two {
    animation-delay: -0.2s;
}

.chicken.tropical-chicken .bloom-three {
    animation-delay: -0.45s;
}

.chicken.tropical-chicken .bloom-four {
    animation-delay: -0.7s;
}

.chicken.tropical-chicken .bloom-five {
    animation-delay: -0.95s;
}

.chicken.tropical-chicken .bloom-six {
    animation-delay: -1.2s;
}

.chicken.tropical-chicken .bloom-seven {
    animation-delay: -1.4s;
}

.chicken.tropical-chicken .bloom-eight {
    animation-delay: -1.05s;
}

.chicken.tropical-chicken .bloom-nine {
    animation-delay: -0.55s;
}

.chicken.tropical-chicken .bloom-ten {
    animation-delay: -1.55s;
}

.chicken.tropical-chicken .bloom-eleven {
    animation-delay: -0.85s;
}

.chicken.tropical-chicken .lei-petal {
    opacity: 0.96;
}

.chicken.tropical-chicken .lei-center {
    opacity: 0.92;
}

.chicken.hit {
    animation: pop 0.32s ease forwards;
}

.chicken.tutorial-target::after {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 4px solid rgba(255, 244, 159, 0.95);
    box-shadow: 0 0 0 10px rgba(255, 244, 159, 0.18);
    animation: tutorial-ring 1.25s ease-in-out infinite;
    pointer-events: none;
}

.muzzle-flash,
.score-pop {
    position: absolute;
    pointer-events: none;
    z-index: 18;
    will-change: transform, opacity;
}

.muzzle-flash {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, rgba(255, 200, 74, 0.85) 45%, transparent 70%);
    transform: translate3d(-50%, -50%, 0);
    animation: fade-shot 0.28s ease forwards;
}

.score-pop {
    transform: translate3d(-50%, -50%, 0);
    color: #fff5b1;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    animation: float-score 0.7s ease forwards;
}

.warning {
    color: var(--danger);
}

.db-warning {
    position: absolute;
    right: var(--screen-gutter);
    bottom: var(--screen-gutter);
    z-index: 22;
    max-width: min(380px, calc(100vw - (var(--screen-gutter) * 2)));
    padding: 12px 14px;
    border-radius: 14px;
    color: #ffe7e1;
    background: rgba(112, 30, 16, 0.86);
    border: 1px solid rgba(255, 180, 160, 0.3);
}

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: var(--screen-gutter);
    z-index: 40;
    width: min(680px, calc(100vw - (var(--screen-gutter) * 2)));
    transform: translateX(-50%);
}

.cookie-consent.hidden {
    display: none;
}

.cookie-consent-card {
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(10, 22, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 36px rgba(5, 16, 12, 0.34);
    backdrop-filter: blur(10px);
}

.cookie-title {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.cookie-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.cookie-actions .button {
    min-width: 156px;
}

body.cookie-banner-visible .instructions {
    bottom: 170px;
}

body.cookie-banner-visible .db-warning {
    bottom: 170px;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.settings-stack {
    display: grid;
    gap: 16px;
}

.settings-summary {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.settings-chip {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-chip-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 241, 168, 0.82);
}

.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-toggle strong {
    display: block;
    margin-bottom: 4px;
}

.settings-toggle p {
    margin: 0;
}

.settings-toggle input {
    width: 24px;
    height: 24px;
    accent-color: #ffcb45;
    flex-shrink: 0;
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #14311d;
    background: #a8e587;
}

.sun,
.cloud,
.ground {
    pointer-events: none;
}

@keyframes flap {
    from {
        transform: rotate(-5deg) scale(1);
    }

    to {
        transform: rotate(5deg) scale(1.04);
    }
}

@keyframes drift {
    from {
        transform: translate3d(-220px, 0, 0);
    }

    to {
        transform: translate3d(calc(100vw + 280px), 0, 0);
    }
}

@keyframes pop {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.35) rotate(26deg);
    }
}

@keyframes fade-shot {
    from {
        opacity: 1;
        transform: translate3d(-50%, -50%, 0) scale(0.4);
    }

    to {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) scale(2);
    }
}

@keyframes float-score {
    from {
        opacity: 1;
        transform: translate3d(-50%, -50%, 0) translateY(0);
    }

    to {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) translateY(-42px);
    }
}

@keyframes snowfall {
    0% {
        transform: translate3d(0, -6vh, 0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 0.86;
    }

    100% {
        transform: translate3d(-28px, 108vh, 0) scale(1.08);
        opacity: 0;
    }
}

@keyframes banner-rise {
    0% {
        opacity: 0;
        transform: translate3d(-50%, -26px, 0) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translate3d(-50%, 0, 0) scale(1);
    }
}

@keyframes hat-bob {
    0% {
        transform: rotate(-4deg) translateY(1px);
    }

    100% {
        transform: rotate(3deg) translateY(-2px);
    }
}

@keyframes hat-flap {
    0% {
        transform: rotate(-4deg);
    }

    100% {
        transform: rotate(5deg);
    }
}

@keyframes badge-glint {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.92;
    }

    55% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes tropical-hover {
    0% {
        transform: rotate(-1.6deg) translateY(1px) scale(0.995);
    }

    100% {
        transform: rotate(1.2deg) translateY(-2px) scale(1.005);
    }
}

@keyframes palm-sway {
    0% {
        transform: rotate(-3deg);
    }

    100% {
        transform: rotate(5deg);
    }
}

@keyframes wave-slide {

    0%,
    100% {
        transform: translateX(0);
        opacity: 0.54;
    }

    50% {
        transform: translateX(-1.8%);
        opacity: 0.78;
    }
}

@keyframes lei-sway {
    0% {
        transform: rotate(-4deg) translateY(1px);
    }

    100% {
        transform: rotate(4deg) translateY(-1px);
    }
}

@keyframes flower-bloom {
    0% {
        transform: scale(0.96);
    }

    100% {
        transform: scale(1.06);
    }
}

@keyframes tutorial-ring {
    0% {
        transform: scale(0.88);
        opacity: 0.78;
    }

    55% {
        transform: scale(1.06);
        opacity: 1;
    }

    100% {
        transform: scale(1.18);
        opacity: 0.2;
    }
}

@keyframes reload-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    60% {
        transform: translateX(8px);
    }

    100% {
        transform: translateX(0);
    }
}

@media (max-width: 900px) {
    .hud {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: min(860px, calc(100vw - 20px));
        gap: 10px;
    }

    .overlay-grid,
    .auth-grid {
        grid-template-columns: 1fr;
    }

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

    .overlay-card {
        padding: 22px;
    }

    .intro-layout {
        display: block;
        padding: 0;
    }

    .intro-panel {
        position: absolute;
    }

    .intro-hero-panel,
    .intro-status-panel,
    .intro-info-panel,
    .intro-auth-panel,
    .intro-actions-panel {
        width: calc(100vw - 32px);
    }

    .intro-hero-panel {
        top: 16px;
        left: 16px;
    }

    .intro-status-panel {
        top: 176px;
        left: 16px;
        right: auto;
    }

    .intro-auth-panel {
        top: 318px;
        right: 16px;
        width: min(380px, calc(100vw - 32px));
        max-height: calc(100vh - 470px);
    }

    .intro-info-panel {
        left: 16px;
        bottom: 104px;
        width: min(420px, calc(100vw - 32px));
    }

    .intro-actions-panel {
        left: 50%;
        right: auto;
        bottom: 16px;
        transform: translateX(-50%);
    }

    .world-map-board {
        min-height: 320px;
    }

    .level-route {
        grid-template-columns: 1fr;
    }

    .level-route::before {
        display: none;
    }
}

@media (max-width: 700px) {
    body {
        cursor: default;
    }

    .hud {
        grid-template-columns: repeat(4, minmax(56px, 64px));
        justify-content: start;
        left: 8px;
        transform: none;
        top: 8px;
        width: auto;
        max-width: calc(100vw - 16px);
        gap: 6px;
    }

    .panel {
        min-height: 64px;
        padding: 6px;
        border-radius: 14px;
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .panel-label {
        font-size: 0.56rem;
        letter-spacing: 0.08em;
        margin-bottom: 3px;
        line-height: 1.05;
    }

    .panel-value {
        font-size: 0.88rem;
        line-height: 1.05;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .hud-button {
        min-height: 64px;
        width: 64px;
        padding: 6px;
        border-radius: 14px;
        aspect-ratio: 1 / 1;
        font-size: 0.72rem;
        line-height: 1.05;
        text-align: center;
    }

    .overlay {
        align-items: flex-start;
        padding: 10px;
    }

    .overlay.intro-overlay {
        padding: 0;
        align-items: stretch;
    }

    .intro-map-shell {
        overflow: auto;
    }

    .intro-map-shell .world-map-board {
        position: relative;
        min-height: 44vh;
        height: 44vh;
    }

    .intro-layout {
        position: relative;
        inset: auto;
        display: block;
        min-height: 100%;
        padding: 10px 0 14px;
        pointer-events: auto;
    }

    .intro-panel {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: calc(100vw - 20px);
        margin: 10px;
        transform: none;
        border-radius: 18px;
    }

    .intro-status-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .intro-auth-panel {
        max-height: none;
        overflow: visible;
    }

    .intro-actions-panel {
        width: calc(100vw - 20px);
        margin-bottom: 14px;
    }

    .reload-overlay {
        align-items: center;
        padding: 92px 10px 78px;
    }

    .reload-card {
        width: min(360px, 100%);
        padding: 14px;
        border-radius: 18px;
    }

    .reload-copy {
        font-size: 0.82rem;
        margin-bottom: 12px;
    }

    .reload-step {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .reload-pad {
        grid-template-columns: repeat(3, 50px);
        gap: 7px;
    }

    .reload-arrow {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        font-size: 1.1rem;
    }

    .overlay-card {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 16px;
        border-radius: 18px;
    }

    .card-section,
    .tutorial-item,
    .menu-list li,
    .leaderboard-row {
        padding: 12px;
        border-radius: 14px;
    }

    .button-row,
    .tutorial-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .button.secondary,
    .danger-button {
        width: 100%;
    }

    .instructions {
        left: 50%;
        transform: translateX(-50%);
        bottom: 8px;
        width: max-content;
        max-width: calc(100vw - 16px);
        font-size: 0.76rem;
        line-height: 1.35;
        padding: 8px 10px;
        text-align: center;
        border-radius: 12px;
    }

    .cookie-consent {
        bottom: 10px;
        width: calc(100vw - 20px);
    }

    .cookie-consent-card {
        padding: 16px;
        border-radius: 18px;
    }

    .cookie-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-actions .button {
        width: 100%;
        min-width: 0;
    }

    body.cookie-banner-visible .instructions {
        bottom: 228px;
        max-width: calc(100vw - 20px);
    }

    body.cookie-banner-visible .db-warning {
        bottom: 228px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-toggle {
        align-items: flex-start;
        flex-direction: column;
    }

    .tutorial-banner {
        top: 198px;
        width: calc(100vw - 20px);
        padding: 12px 14px;
    }

    .level-banner {
        top: 186px;
        width: calc(100vw - 20px);
        padding: 12px 14px;
    }

    .level-map {
        padding: 14px;
        border-radius: 18px;
    }

    .world-map-board {
        min-height: 250px;
        border-radius: 18px;
    }

    .level-node {
        padding: 16px 12px 12px;
    }

    .sea-horizon {
        bottom: 20vh;
        height: 18vh;
    }

    .island-back {
        left: 6%;
        width: 46vw;
        min-width: 160px;
    }

    .island-front {
        right: 2%;
        width: 56vw;
        min-width: 190px;
        height: 18vh;
    }

    .palm {
        width: 110px;
        height: 138px;
    }

    .palm::before {
        left: 40px;
        height: 94px;
    }

    .palm::after {
        width: 110px;
        height: 72px;
    }

    .chicken {
        width: 68px;
        height: 68px;
    }

    .sun {
        width: 78px;
        height: 78px;
        top: 96px;
        right: 16px;
    }

    .cloud {
        transform: scale(0.85);
        transform-origin: left top;
    }

    .leaderboard-row {
        grid-template-columns: auto 1fr;
        gap: 6px 10px;
    }

    .leaderboard-score,
    .leaderboard-row .muted {
        grid-column: 2;
    }

    .chart {
        min-height: 140px;
    }

    .crosshair {
        display: none;
    }
}

@media (max-width: 420px) {
    .hud {
        grid-template-columns: repeat(4, minmax(50px, 56px));
        gap: 5px;
    }

    .panel {
        min-height: 56px;
    }

    .hud-button {
        width: 56px;
        min-height: 56px;
        font-size: 0.66rem;
    }

    .panel-label {
        font-size: 0.5rem;
    }

    .panel-value {
        font-size: 0.78rem;
    }

    .instructions {
        font-size: 0.72rem;
    }

    .overlay-card h1 {
        font-size: 1.8rem;
    }

    .overlay-card h2 {
        font-size: 1.45rem;
    }
}
