:root {
    font-family: 'Proxima Nova', 'Avenir Next', Avenir, Montserrat, Arial, sans-serif;
    color: #202020;
    background: #fffefa;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --yellow: #ffc907;
    --blue: #2e9df7;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 89% 4%, rgb(255 201 7 / 12%), transparent 26rem),
        #fffefa;
}

button,
select {
    font: inherit;
}

.site-header {
    display: flex;
    width: min(1160px, calc(100% - 64px));
    height: 92px;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    border-bottom: 1px solid #eceae4;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    width: 218px;
    height: auto;
}

.header-note {
    color: #686868;
    font-size: 13px;
    font-weight: 600;
}

.game-layout {
    display: grid;
    width: min(1100px, calc(100% - 64px));
    grid-template-columns: minmax(240px, 0.75fr) minmax(460px, 1.4fr);
    align-items: center;
    gap: clamp(34px, 5vw, 72px);
    margin: 56px auto 58px;
}

.intro {
    padding-bottom: 16px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 19px;
    color: #4e4e4e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.eyebrow-dot,
.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
}

h1 {
    margin: 0;
    font-size: clamp(43px, 5vw, 64px);
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

h1 span {
    color: #e3ad00;
}

.intro-copy {
    max-width: 360px;
    margin: 20px 0 27px;
    color: #626262;
    font-size: 15px;
    line-height: 1.75;
}

.score-card {
    display: flex;
    max-width: 370px;
    min-height: 95px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border: 1px solid #efede6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(40 35 10 / 4.5%);
}

.milestone-card {
    max-width: 370px;
    margin-top: 15px;
    padding: 14px 15px 13px;
    border: 1px solid #efede6;
    border-radius: 12px;
    background: #fff;
}

.milestone-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.milestone-heading h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
}

.milestone-heading p {
    margin: 0;
    color: #777;
    font-size: 9px;
    text-align: right;
}

.milestone-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.milestone-step {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 8px;
    background: #f7f6f1;
    color: #777;
    transition: background-color 160ms ease, color 160ms ease;
}

.milestone-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 2px;
    border: 1.5px solid #c9c6bb;
    border-radius: 50%;
}

.milestone-step strong,
.milestone-step small {
    display: block;
    font-size: 9px;
    line-height: 1.35;
}

.milestone-step strong {
    font-weight: 700;
}

.milestone-step small {
    margin-top: 2px;
    color: #929087;
}

.milestone-step.current {
    background: #fff5cb;
    color: #574600;
}

.milestone-step.current .milestone-dot,
.milestone-step.completed .milestone-dot {
    border-color: #dfa900;
    background: var(--yellow);
}

.milestone-step.completed {
    background: #edf8ec;
    color: #345b34;
}

.milestone-step.completed .milestone-dot {
    border-color: #4f9a4c;
    background: #68bd62;
}

.score-label {
    margin: 0 0 4px;
    color: #777;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.11em;
}

.score-number {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
}

.score-total {
    color: #858585;
    font-size: 14px;
    font-weight: 500;
}

.score-meta {
    display: flex;
    align-items: center;
    gap: 11px;
}

.score-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: #fff5cb;
    font-size: 20px;
}

.timer-label,
.tries-label {
    color: #777;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.timer-label strong,
.tries-label strong {
    display: block;
    margin-top: 2px;
    color: #202020;
    font-size: 19px;
    letter-spacing: 0;
    text-align: center;
}

.tries-label strong {
    color: #775f00;
}

.how-to {
    margin-top: 29px;
}

.how-to h2 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 800;
}

.how-to p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: #5b5b5b;
    font-size: 12px;
    line-height: 1.5;
}

.instruction-icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 50%;
    background: #fff5cb;
    font-size: 13px;
}

.water-icon {
    background: #eff8ff;
}

.rock-icon {
    background: #eee8e0;
    color: #775a42;
}

.game-card {
    overflow: hidden;
    border: 1px solid #eae8e1;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 18px 48px rgb(40 35 10 / 9%);
}

.game-topbar {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 19px;
}

.level-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.level-dot {
    width: 7px;
    height: 7px;
    background: #4fcb53;
    box-shadow: 0 0 0 3px #e8f8e9;
}

.level-divider {
    color: #b5b5b5;
}

.game-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.game-actions select {
    max-width: 95px;
    padding: 7px 22px 7px 8px;
    border: 1px solid #e9e7e0;
    border-radius: 8px;
    color: #555;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.game-actions select:hover {
    border-color: #d7b429;
}

.reset-button {
    padding: 7px 11px;
    border: 1px solid #e9e7e0;
    border-radius: 8px;
    color: #555;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.reset-button:hover {
    border-color: #d7b429;
    background: #fff9e3;
}

.reset-button:focus-visible,
.game-actions select:focus-visible,
a:focus-visible {
    outline: 3px solid #202020;
    outline-offset: 3px;
}

.reset-button span {
    margin-right: 4px;
    font-size: 16px;
    vertical-align: -1px;
}

.game-scene {
    position: relative;
    padding: 23px 18px 17px;
    background: #dceef0;
}

.scene-caption {
    position: absolute;
    z-index: 3;
    top: 8px;
    left: 19px;
    color: #51737a;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    pointer-events: none;
}

.game-board {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 720 / 500;
    border: 2px solid rgb(68 119 126 / 45%);
    border-radius: 12px;
    background: #e4f3ec;
    box-shadow: 0 5px 15px rgb(43 73 62 / 16%), inset 0 0 10px rgb(255 255 255 / 55%);
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.landscape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.soil-pattern {
    opacity: 0.62;
}

.dug-path,
.water-path,
.active-path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.dug-path {
    stroke: #d4e9eb;
    stroke-width: 29px;
    filter: drop-shadow(0 2px 2px rgb(75 51 34 / 40%));
}

.water-path {
    stroke: url("#water-gradient");
    stroke-width: 15px;
    stroke-dasharray: 20 6 4 6;
    opacity: 0;
}

.water-path.flowing {
    opacity: 1;
    animation: water-flow 0.65s linear infinite;
}

.active-path {
    stroke: #d4e9eb;
    stroke-width: 29px;
    stroke-dasharray: 3 5;
    opacity: 0.92;
}

.jerry-can {
    position: absolute;
    z-index: 2;
    top: 54%;
    left: 72%;
    width: 18%;
    aspect-ratio: 125 / 160;
    filter: drop-shadow(2px 6px 5px rgb(67 55 29 / 30%));
    pointer-events: none;
}

.can-body {
    position: absolute;
    right: 4%;
    bottom: 0;
    left: 4%;
    overflow: hidden;
    height: 78%;
    border: 3px solid #d39e00;
    border-radius: 15% 15% 19% 19% / 13% 13% 16% 16%;
    background: linear-gradient(105deg, #e8ad00 0%, #ffd526 18%, #ffc907 48%, #f3ba05 81%, #dca500 100%);
    clip-path: polygon(0 13%, 9% 4%, 28% 0, 83% 0, 97% 8%, 100% 20%, 100% 91%, 94% 100%, 8% 100%, 0 92%);
    box-shadow: inset 5px 0 7px rgb(255 242 157 / 45%), inset -6px 0 8px rgb(155 107 0 / 22%), 0 3px 4px rgb(97 79 23 / 23%);
}

.can-body::before,
.can-body::after {
    position: absolute;
    z-index: 2;
    top: 26%;
    bottom: 12%;
    width: 5%;
    border-right: 1px solid rgb(153 111 0 / 25%);
    border-left: 1px solid rgb(255 243 155 / 42%);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.can-body::before {
    left: 12%;
}

.can-body::after {
    right: 12%;
}

.can-handle {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 25%;
    width: 48%;
    height: 35%;
    border: 5px solid #d39e00;
    border-bottom: 0;
    border-radius: 24% 24% 0 0;
    background: linear-gradient(90deg, #e6ad00, #ffd526 30%, #f3ba05);
    box-shadow: inset 3px 0 4px rgb(255 244 166 / 52%);
}

.can-handle::after {
    position: absolute;
    top: 22%;
    right: 19%;
    bottom: 0;
    left: 19%;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, #daf2fc, #b8e1ed);
    content: "";
}

.can-spout {
    position: absolute;
    z-index: 4;
    top: 14%;
    right: 0;
    width: 24%;
    height: 16%;
    border: 3px solid #d39e00;
    border-bottom: 0;
    border-radius: 7px 8px 0 0;
    background: linear-gradient(90deg, #f3ba05, #ffd526);
    rotate: 18deg;
}

.spout-opening {
    position: absolute;
    top: -4px;
    right: -2px;
    left: -2px;
    height: 5px;
    border-radius: 50%;
    background: #715719;
    box-shadow: inset 0 1px 1px rgb(255 255 255 / 50%);
}

.can-water {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 0;
    background:
        radial-gradient(ellipse at 22% 7%, rgb(255 255 255 / 50%) 0 2px, transparent 3px),
        linear-gradient(180deg, #72d0ff, #2e9df7 30%, #1984da);
    background-size: 35px 24px, auto;
    box-shadow: inset 0 3px 4px rgb(255 255 255 / 40%);
    transition: height 450ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.can-water::before {
    position: absolute;
    top: -5px;
    right: -10%;
    left: -10%;
    height: 10px;
    border-radius: 50%;
    background: rgb(183 235 255 / 70%);
    content: "";
}

.can-mark {
    position: absolute;
    z-index: 3;
    top: 39%;
    left: 31%;
    width: 38%;
    height: 37%;
    opacity: 0.8;
}

.mark-line {
    position: absolute;
    display: block;
    width: 10%;
    height: 49%;
    border-radius: 8px;
    background: #28251c;
}

.mark-one {
    top: 0;
    left: 18%;
    transform: rotate(-30deg);
}

.mark-two {
    top: 0;
    right: 18%;
    transform: rotate(30deg);
}

.mark-three {
    bottom: 0;
    left: 18%;
    transform: rotate(30deg);
}

.mark-four {
    right: 18%;
    bottom: 0;
    transform: rotate(-30deg);
}

.mark-center {
    position: absolute;
    top: 43%;
    left: 39%;
    width: 22%;
    height: 15%;
    border-radius: 2px;
    background: #28251c;
}

.can-highlight {
    position: absolute;
    top: 19%;
    bottom: 11%;
    left: 8%;
    width: 8%;
    border-radius: 50%;
    background: rgb(255 246 175 / 25%);
    pointer-events: none;
}

.can-base {
    position: absolute;
    right: 1%;
    bottom: -2%;
    left: 1%;
    height: 8%;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(90deg, #c29100, #eab800 35%, #d39e00);
}

.source-label,
.can-label {
    position: absolute;
    z-index: 2;
    color: #384f46;
    font-size: clamp(6px, 0.75vw, 9px);
    font-weight: 700;
    letter-spacing: 0.1em;
    pointer-events: none;
}

.source-label {
    top: 44%;
    left: 9%;
}

.can-label {
    top: 78%;
    left: 72%;
}

.game-footer {
    padding: 12px 19px 16px;
}

.game-message {
    min-height: 19px;
    margin: 0 0 10px;
    color: #626262;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.game-message.win-message {
    color: #168543;
}

.game-message.mud-message {
    color: #975c32;
}

.progress-track {
    overflow: hidden;
    height: 7px;
    border-radius: 10px;
    background: #efeee9;
}

.progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 350ms ease;
}

.confetti {
    position: absolute;
    z-index: 5;
    top: -12px;
    width: 8px;
    height: 13px;
    border-radius: 2px;
    animation: confetti-fall 2.2s ease-in forwards;
    pointer-events: none;
}

.site-footer {
    display: flex;
    width: min(1160px, calc(100% - 64px));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 auto;
    padding: 19px 0 25px;
    border-top: 1px solid #eceae4;
    color: #777;
    font-size: 11px;
}

.site-footer p {
    margin: 0;
}

.site-footer nav {
    display: flex;
    gap: 14px;
}

.site-footer a {
    color: #666;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer a:hover {
    color: #202020;
}

.site-footer span {
    color: #525252;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

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

@keyframes water-flow {
    to {
        stroke-dashoffset: -36;
    }
}

@keyframes confetti-fall {
    to {
        translate: 18px 450px;
        rotate: var(--confetti-tilt);
        opacity: 0;
    }
}

@media (max-width: 820px) {
    .game-layout {
        width: min(620px, calc(100% - 40px));
        grid-template-columns: 1fr;
        gap: 30px;
        margin-top: 40px;
        margin-bottom: 43px;
    }

    .intro {
        padding: 0;
    }

    .intro-copy {
        max-width: 490px;
        margin-bottom: 20px;
    }

    .score-card {
        max-width: 490px;
        min-height: 78px;
    }

    .milestone-card {
        max-width: 490px;
    }

    .how-to {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 20px;
        margin-top: 21px;
    }

    .how-to h2 {
        width: 100%;
        margin-bottom: 6px;
    }

    .site-footer {
        width: min(620px, calc(100% - 40px));
    }
}

@media (max-width: 520px) {
    .site-header {
        width: calc(100% - 36px);
        height: 72px;
    }

    .brand img {
        width: 174px;
    }

    .header-note {
        max-width: 110px;
        font-size: 10px;
        text-align: right;
    }

    .game-layout {
        width: calc(100% - 32px);
        gap: 24px;
        margin-top: 31px;
        margin-bottom: 35px;
    }

    .eyebrow {
        font-size: 9px;
    }

    h1 {
        font-size: 51px;
    }

    .intro-copy {
        margin-top: 14px;
        font-size: 14px;
    }

    .how-to {
        column-gap: 12px;
    }

    .milestone-card {
        padding: 12px 10px;
    }

    .milestone-heading h2 {
        font-size: 12px;
    }

    .milestone-heading p {
        font-size: 8px;
    }

    .milestone-step {
        gap: 4px;
        padding: 7px 4px;
    }

    .milestone-step strong,
    .milestone-step small {
        font-size: 8px;
    }

    .how-to p {
        font-size: 11px;
    }

    .game-topbar {
        padding-right: 10px;
        padding-left: 12px;
    }

    .level-label {
        gap: 6px;
        font-size: 8px;
        letter-spacing: 0.07em;
    }

    .game-actions {
        gap: 5px;
    }

    .game-actions select {
        max-width: 80px;
        padding: 7px 14px 7px 6px;
        font-size: 10px;
    }

    .reset-button {
        padding: 7px 8px;
        font-size: 11px;
    }

    .game-scene {
        padding: 23px 10px 12px;
    }

    .scene-caption {
        left: 12px;
    }

    .game-footer {
        padding-right: 12px;
        padding-left: 12px;
    }

    .site-footer {
        width: calc(100% - 36px);
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        line-height: 1.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
