:root {
    --brand: #00723d;
    --brand-dark: #005a31;
    --navy: var(--brand);
    --blue: var(--brand);
    --cyan: #3d9b6e;
    --green: #1bb978;
    --red: #ff4d5e;
    --ink: #1c2b24;
    --muted: #5d6b63;
    --paper: #fff;
    --bg: #f3f6f4;
    --shadow: 0 24px 70px rgba(0, 70, 40, .12);
    --logo-height: 180px;
    --logo-height-compact: 100px;
    --brand-gap: 22px;
    --brand-gap-compact: 12px;
    --shell-pad: 28px;
    --shell-pad-compact: 12px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(circle at 8% 0%, #dff3e8, transparent 32%), var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    min-height: 100vh
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: auto;
    padding: 28px 0 52px
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(0, 114, 61, .14);
    border-bottom: 4px solid var(--brand);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: var(--shadow)
}

.brand img {
    display: block;
    height: var(--logo-height);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: height .6s cubic-bezier(.22, 1, .36, 1)
}

.panel {
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(0, 114, 61, .14);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 48px)
}

.hidden {
    display: none !important
}

.welcome {
    max-width: 760px;
    margin: 7vh auto 0
}

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

h1,
h2 {
    color: var(--navy);
    line-height: 1.08;
    margin: 0 0 16px
}

h1 {
    font-size: clamp(2.1rem, 5vw, 4rem)
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.3rem)
}

p {
    line-height: 1.6
}

label {
    display: block;
    font-weight: 750;
    margin: 28px 0 8px
}

.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.name-row label {
    margin-top: 8px
}

.name-row input {
    width: 100%
}

.input-row {
    display: flex;
    gap: 10px
}

input,
button {
    font: inherit;
    border-radius: 12px
}

input {
    flex: 1;
    border: 1px solid #cbd5e1;
    padding: 14px 16px;
    outline: none
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(0, 114, 61, .16)
}

button {
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    padding: 14px 22px;
    cursor: pointer;
    transition: transform .15s, background .15s
}

button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px)
}

button:focus-visible {
    outline: 3px solid #9dcc4a;
    outline-offset: 3px
}

.target-layer:hover,
.target-layer:focus-visible {
    background: transparent;
    transform: none;
    filter: none;
    outline: none
}

.privacy,
.error,
.submit-status {
    font-size: .84rem
}

.privacy {
    color: var(--muted)
}

.error {
    min-height: 1.3em;
    color: #b42318
}

.submit-status {
    min-height: 1.3em;
    font-weight: 700;
    color: var(--muted)
}

.submit-status.ok {
    color: var(--green)
}

.submit-status.bad {
    color: #b42318
}

.game-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end
}

.stats {
    display: flex;
    gap: 10px
}

.stats>div,
.result-grid>div {
    background: #f7f9fc;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 10px 16px;
    min-width: 92px
}

.stats span,
.result-grid span {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 700
}

.stats strong {
    font-size: 1.25rem;
    color: var(--navy)
}

.image-stage {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #0d1730;
    margin-top: 22px;
    aspect-ratio: 16/9
}

.image-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none
}

.target-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    background: transparent;
    padding: 0;
    border-radius: 0;
    cursor: crosshair
}

.markers {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none
}

.marker {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    border: 3px solid white;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
    animation: pop .18s ease-out
}

.marker.hit {
    background: var(--green)
}

.marker.miss {
    background: var(--red)
}

@keyframes pop {
    from {
        scale: .4;
        opacity: .2
    }
}

.progress {
    height: 8px;
    background: #e9eef6;
    border-radius: 999px;
    margin-top: 17px;
    overflow: hidden
}

.progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--brand);
    transform-origin: left
}

.feedback {
    margin: 10px 0 0;
    font-weight: 700;
    color: var(--muted)
}

.result {
    text-align: center;
    max-width: 820px;
    margin: 5vh auto
}

.score-ring {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 24px auto;
    display: grid;
    place-content: center;
    border-radius: 50%;
    background: conic-gradient(var(--brand) var(--score-angle, 0deg), #e4efe8 0)
}

.score-ring::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: #fff
}

.score-ring strong,
.score-ring span {
    position: relative;
    z-index: 1
}

.score-ring strong {
    font-size: 3.6rem;
    color: #143028;
    line-height: 1
}

.score-ring span {
    color: #3d4f46
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: left;
    margin: 24px 0
}

.result-grid strong {
    font-size: 1.2rem;
    color: var(--navy)
}

body.playing {
    --logo-height: var(--logo-height-compact);
    --brand-gap: var(--brand-gap-compact);
    --shell-pad: var(--shell-pad-compact)
}

body.playing .brand {
    position: sticky;
    top: var(--shell-pad);
    z-index: 5
}

.shell {
    padding-top: var(--shell-pad);
    transition: padding-top .6s cubic-bezier(.22, 1, .36, 1)
}

.brand {
    margin-bottom: var(--brand-gap);
    transition: margin-bottom .6s cubic-bezier(.22, 1, .36, 1)
}

body.playing #game {
    animation: scene-in .55s cubic-bezier(.22, 1, .36, 1);
}

@keyframes scene-in {
    from {
        opacity: 0;
        transform: translateY(14px)
    }
}
@media(max-width:1200px) {
    .welcome {
        max-width: 80%;
    }
    .panel {
        padding: clamp(20px, 3vw, 30px)
    }
}
@media(max-width:720px) {
    .welcome {
        max-width: 100%;
    }
    :root {
        --logo-height: 112px;
        --logo-height-compact: 56px;
        --shell-pad: 12px;
        --shell-pad-compact: 12px
    }

    .shell {
        width: min(100% - 16px, 1180px);
        padding-top: var(--shell-pad)
    }

    .panel {
        padding: 18px;
        border-radius: 18px
    }

    .name-row,
    .input-row,
    .game-head {
        align-items: stretch;
        flex-direction: column
    }

    .name-row {
        grid-template-columns: 1fr
    }

    .stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr)
    }

    .stats>div {
        min-width: 0;
        padding: 8px
    }

    .result-grid {
        grid-template-columns: 1fr
    }

    .image-stage {
        margin-inline: -10px;
        border-radius: 12px
    }

    .brand {
        border-radius: 14px
    }
}

.confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20
}

@media(prefers-reduced-motion:reduce) {

    *,
    *:before,
    *:after {
        animation: none !important;
        transition: none !important
    }
}