:root {
    --red: #e30613;
    --red-dark: #9f0009;
    --ink: #111111;
    --muted: #666666;
    --line: rgba(17, 17, 17, 0.12);
    --paper: #f7f4f1;
    --white: #ffffff;
    --silver: #d8d8d8;
    --shadow: 0 24px 70px rgba(17, 17, 17, 0.18);
    --radius: 8px;
    font-family: "Arial Narrow", "Roboto Condensed", "Arial", sans-serif;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(227, 6, 19, 0.08) 0 25%, transparent 25% 50%, rgba(227, 6, 19, 0.08) 50% 75%, transparent 75%) 0 0 / 96px 96px,
        var(--paper);
}

button,
input,
textarea {
    font: inherit;
}

.page-screen {
    min-height: 100vh;
    overflow: hidden;
}

.screen-shell {
    position: relative;
    min-height: 100vh;
    padding: 14px 24px 42px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 12px;
}

.screen-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: start;
}

.screen-logo {
    width: min(250px, 22vw);
    display: block;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.screen-copy h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(40px, 4.8vw, 68px);
    line-height: 0.9;
    letter-spacing: 0;
    text-transform: uppercase;
}

.screen-copy p {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.28;
}

.qr-block {
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qr-block img {
    width: 100%;
    display: block;
}

.qr-block span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
    word-break: break-word;
}

.energy-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: stretch;
}

.energy-meter,
.energy-stats article,
.milestones article {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 38px rgba(17, 17, 17, 0.08);
}

.energy-meter {
    padding: 18px 22px;
}

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

.energy-topline span,
.energy-stats span,
.milestones span {
    color: var(--muted);
    font-size: 16px;
    text-transform: uppercase;
}

.energy-topline strong {
    color: var(--red);
    font-size: clamp(48px, 6.8vw, 96px);
    line-height: 0.78;
    letter-spacing: 0;
}

.progress-track {
    height: 34px;
    margin-top: 16px;
    overflow: hidden;
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    background:
        repeating-linear-gradient(90deg, rgba(17, 17, 17, 0.08) 0 2px, transparent 2px 22px),
        var(--white);
}

.progress-fill {
    width: 0;
    height: 100%;
    background:
        linear-gradient(90deg, var(--red-dark), var(--red)),
        var(--red);
    transition: width 220ms ease;
}

.energy-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.energy-stats {
    display: grid;
    gap: 10px;
}

.energy-stats article {
    padding: 12px 16px;
}

.energy-stats strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0;
}

.milestones {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.milestones article {
    padding: 10px 14px 12px;
    min-height: 66px;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.milestones article.is-active {
    color: var(--white);
    background: var(--red);
    border-color: var(--red);
    transform: translateY(-3px);
}

.milestones strong {
    display: block;
    margin-bottom: 4px;
    font-size: 26px;
    line-height: 1;
    letter-spacing: 0;
}

.milestones article.is-active span {
    color: rgba(255, 255, 255, 0.86);
}

.final-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 28px;
    padding: 40px;
    text-align: center;
    background: var(--red);
    color: var(--white);
}

.final-overlay[hidden] {
    display: none;
}

.final-overlay img {
    width: min(360px, 64vw);
    background: var(--white);
    box-shadow: var(--shadow);
}

.final-overlay h2 {
    margin: 0;
    font-size: clamp(54px, 10vw, 140px);
    line-height: 0.9;
    letter-spacing: 0;
}

.final-overlay p {
    margin: 0;
    font-size: 32px;
    text-transform: uppercase;
}

.is-pulsing .screen-logo,
.is-pulsing .progress-fill {
    animation: hit-pulse 220ms ease;
}

.page-mobile {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    padding: 14px 14px 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 25%, transparent 25% 50%, rgba(255, 255, 255, 0.1) 50% 75%, transparent 75%) 0 0 / 54px 54px,
        var(--red);
}

.mobile-shell {
    width: min(100%, 390px);
}

.mobile-logo {
    width: min(100%, 300px);
    display: block;
    margin: 0 auto 12px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.mobile-action {
    padding: 18px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.mobile-action h1 {
    margin: 0;
    font-size: 32px;
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
}

.mobile-action p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.35;
}

.charge-button {
    width: 100%;
    min-height: 190px;
    margin-top: 18px;
    border: 0;
    border-radius: var(--radius);
    color: var(--white);
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.26), transparent 32%),
        linear-gradient(180deg, #ff1421, var(--red-dark));
    box-shadow:
        inset 0 -8px 0 rgba(17, 17, 17, 0.18),
        0 18px 36px rgba(227, 6, 19, 0.34);
    cursor: pointer;
    transition: transform 100ms ease, filter 160ms ease;
}

.charge-button span {
    display: block;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.charge-button:active,
.charge-button.is-hit {
    transform: translateY(4px) scale(0.985);
    filter: brightness(1.08);
}

.charge-button:disabled {
    cursor: wait;
    opacity: 0.8;
}

.mobile-counters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.mobile-counters article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.mobile-counters span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.mobile-counters strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
    line-height: 1;
    letter-spacing: 0;
}

.mobile-status {
    min-height: 24px;
    margin-bottom: 0;
    text-align: center;
    text-transform: uppercase;
}

@keyframes hit-pulse {
    50% {
        filter: brightness(1.16);
        transform: scale(1.015);
    }
}

@media (max-width: 980px) {
    .screen-shell {
        padding: 24px;
        overflow: auto;
    }

    .screen-hero,
    .energy-board {
        grid-template-columns: 1fr;
    }

    .qr-block {
        max-width: 280px;
    }

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

@media (max-width: 560px) {
    .screen-copy h1 {
        font-size: 44px;
    }

    .screen-copy p {
        font-size: 18px;
    }

    .screen-logo {
        width: 100%;
    }

    .energy-topline {
        align-items: start;
        flex-direction: column;
    }

    .energy-topline strong {
        font-size: 86px;
    }

    .energy-stats strong {
        font-size: 38px;
    }

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

    .charge-button {
        min-height: 170px;
    }

    .charge-button span {
        font-size: 34px;
    }
}

@media (max-height: 780px) {
    .page-mobile {
        padding-top: 10px;
    }

    .mobile-logo {
        width: min(100%, 245px);
        margin-bottom: 10px;
    }

    .mobile-action {
        padding: 16px;
    }

    .mobile-action h1 {
        font-size: 29px;
    }

    .mobile-action p {
        font-size: 15px;
    }

    .charge-button {
        min-height: 150px;
        margin-top: 14px;
    }

    .charge-button span {
        font-size: 31px;
    }
}

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