html.product-root {
    color-scheme: only light;
}

.game-body {
    margin: 0;
    background: #e7f2e4;
    color: #142033;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.45;
}

.game-body nav {
    background: transparent;
    box-shadow: none;
    height: auto;
    line-height: normal;
    width: auto;
    color: inherit;
}

.game-body .lang-menu {
    position: relative;
}

.game-body nav .lang-menu-list {
    top: calc(100% + 6px);
}

.game-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: #10283f;
    position: relative;
}

.game-nav .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.game-nav .brand img {
    background: #10283f;
    border-radius: 8px;
}

.game-head {
    padding: 8px 16px 4px;
}

.play {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.game-title h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.game-title p {
    margin: 4px 0 0;
    color: #3d5166;
}

.hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.stat {
    background: #10283f;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 0;
}

.stat span {
    display: block;
    font-size: 12px;
    opacity: 0.75;
}

.stat strong {
    display: block;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.map-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #b7d98a;
    aspect-ratio: 960 / 540;
    box-shadow: 0 8px 24px rgba(16, 40, 63, 0.12);
}

.actions-dock {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(16, 40, 63, 0.12);
}

.actions-dock p {
    margin: 0 0 8px;
}

.actions-dock p:last-child {
    margin-bottom: 0;
}

#valley {
    width: 100%;
    height: 100%;
    display: block;
}

#valley .is-off {
    display: none;
}

.place {
    font-size: 22px;
    font-weight: 700;
    fill: #1c3a4e;
}

.place.down {
    text-anchor: end;
}

.current {
    stroke-dasharray: 10 16;
    animation: flow 1.1s linear infinite;
}

.current.slow {
    animation-duration: 1.6s;
    opacity: 0.7;
}

.glow {
    fill: #ffe082;
}

.lit .glow {
    animation: lamp 1.6s ease-in-out infinite;
}

.smoke {
    animation: smoke 2.2s ease-in-out infinite;
}

.fish.run {
    animation: swim 5.5s linear infinite;
}

.fish.run.late {
    animation-duration: 7s;
    animation-delay: -2s;
}

.fish.lake {
    animation: drift 4.5s ease-in-out infinite;
}

.fish.lake.late {
    animation-duration: 6s;
    animation-delay: -1.5s;
}

#map-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

#map-actions .spot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: min(210px, 54%);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: left;
    border: 0;
    background: #0e8c6a;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px 9px;
    font: inherit;
    font-weight: 700;
    line-height: 1.15;
    box-shadow: 0 4px 0 #08684c;
    cursor: pointer;
    touch-action: manipulation;
}

#map-actions .spot .kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

#map-actions .spot strong {
    font-size: 14px;
}

#map-actions .spot .detail {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

#map-actions .spot b {
    color: #ffe082;
    font-size: 13px;
}

#map-actions .spot:disabled {
    background: #78909c;
    color: #eceff1;
    box-shadow: 0 4px 0 #546e7a;
    cursor: default;
}

#map-actions .spot:disabled b {
    color: #cfd8dc;
}

#map-actions .spot.can-buy::before {
    content: "👇";
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 1;
    font-size: 28px;
    line-height: 1;
    transform: translate(-50%, -120%);
    animation: point 0.7s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 2px 0 rgba(16, 40, 63, 0.35));
}

.music {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #10283f;
    color: #fff;
    font-size: 20px;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 3px 0 #0a1a2b;
}

.music[aria-pressed="false"] {
    background: #78909c;
    box-shadow: 0 3px 0 #546e7a;
}

#raid-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.raider {
    position: absolute;
    width: 92px;
    height: 96px;
    margin: 0;
    padding: 2px 2px 4px;
    border: 2px solid #fff;
    border-radius: 14px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.raider.beaver,
.raider.beggar,
.raider.eco,
.raider.savage {
    background: rgba(255, 255, 255, 0.94);
}

.raider svg {
    width: 72px;
    height: 58px;
    display: block;
}

.raider .tag {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.raider.at-dam {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.45);
}

.raider.chew {
    animation: chew 0.35s linear infinite;
}

.story-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 8px;
    padding: 0 4px;
    color: #1c3a4e;
}

.stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 80px;
    align-items: start;
}

.story-bar p {
    margin: 0;
}

#raid-line {
    font-weight: 700;
}

#actions-list button.can-buy {
    border-color: #128a9a;
    background: #e7f6f8;
}

#actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#actions-list button {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name price" "about price";
    gap: 2px 12px;
    text-align: left;
    border: 1px solid #d5e0ea;
    background: #f7fbfd;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

#actions-list button strong {
    grid-area: name;
}

#actions-list button span {
    grid-area: about;
    color: #3d5166;
    font-size: 14px;
}

#actions-list button b {
    grid-area: price;
    align-self: center;
    color: #0f7482;
    font-weight: 700;
}

#actions-list button:disabled {
    opacity: 0.45;
    cursor: default;
}

#stop-run {
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 24px;
    height: 44px;
    background: #c62828;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

#stop-run[hidden] {
    display: none;
}

.board {
    width: min(1180px, calc(100% - 32px));
    margin: 8px auto 88px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(16, 40, 63, 0.12);
}

.board h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.board ol {
    margin: 0;
    padding-left: 1.3rem;
}

.board li {
    margin: 4px 0;
}

#score-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

#score-form input {
    height: 40px;
    border: 1px solid #b0bec5;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    width: 180px;
}

#score-form button {
    height: 40px;
    border: 0;
    border-radius: 20px;
    padding: 0 14px;
    background: #0f7482;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

#score-note {
    flex-basis: 100%;
}

#end {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(8, 20, 32, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#end[hidden] {
    display: none;
}

.end-card {
    width: min(440px, 100%);
    background: #fff;
    color: #142033;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.end-card h2 {
    margin: 0 0 8px;
    font-size: 1.7rem;
}

.end-card p {
    margin: 0 0 8px;
}

#again {
    margin-top: 12px;
    background: #128a9a;
    color: #fff;
    border: 0;
    border-radius: 24px;
    height: 48px;
    padding: 0 20px;
    font: inherit;
    cursor: pointer;
}

.game-footer {
    padding-bottom: 24px;
}

@keyframes flow {
    to { stroke-dashoffset: -52; }
}

@keyframes lamp {
    50% { fill: #fff4c2; }
}

@keyframes smoke {
    50% { opacity: 0.2; transform: translateY(-8px); }
}

@keyframes swim {
    from { transform: translateX(0); }
    to { transform: translateX(280px); }
}

@keyframes drift {
    50% { transform: translate(14px, -8px); }
}

@keyframes chew {
    50% { transform: translate(-50%, -50%) rotate(-8deg) scale(1.06); }
}

@keyframes pulse {
    50% { transform: scale(1.05); }
}

@keyframes point {
    50% { transform: translate(-50%, -78%); }
}

@media (max-width: 720px) {
    .game-head {
        flex-direction: column;
        align-items: stretch;
    }

    .hud {
        width: 100%;
    }

    .stat strong {
        font-size: 0.95rem;
    }

    .stage {
        grid-template-columns: 1fr;
        width: calc(100% - 16px);
    }

    .map-wrap {
        aspect-ratio: auto;
        height: 62vh;
        min-height: 320px;
    }

    .actions-dock {
        margin-bottom: 72px;
    }

    .place {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .current,
    .lit .glow,
    .smoke,
    .fish.run,
    .fish.lake,
    #map-actions .spot.can-buy::before {
        animation: none;
    }
}
