
/* ========================================
   RESET
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #10251f;
    --bg-green: #173b2b;
    --green: #1c6245;
    --green-light: #a8d7b8;
    --red: #d93643;
    --red-dark: #a91f30;
    --gold: #f3ca70;
    --white: #ffffff;
    --text-light: #dcebe2;
    --text-muted: #9ab5a5;
}

html {
    min-height: 100%;
}

body {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--white);
    background:
        radial-gradient(
            ellipse at 50% 0%,
            #28543c 0%,
            transparent 55%
        ),
        linear-gradient(
            160deg,
            #10251f 0%,
            #173b2b 50%,
            #0b1d19 100%
        );
}

button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   SNOW ANIMATION
======================================== */

body::before,
body::after {
    content: "";
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 300%;
    pointer-events: none;
    z-index: 20;
    background-repeat: repeat;
}

body::before {
    opacity: 0.55;
    background-image:
        radial-gradient(2px 2px at 40px 60px, #fff 99%, transparent),
        radial-gradient(3px 3px at 120px 180px, #fff 99%, transparent),
        radial-gradient(2px 2px at 200px 100px, #fff 99%, transparent),
        radial-gradient(3px 3px at 280px 260px, #fff 99%, transparent),
        radial-gradient(2px 2px at 350px 150px, #fff 99%, transparent);
    background-size: 400px 350px;
    animation: snowfall 18s linear infinite;
}

body::after {
    opacity: 0.3;
    background-image:
        radial-gradient(4px 4px at 80px 80px, #fff 99%, transparent),
        radial-gradient(3px 3px at 230px 200px, #fff 99%, transparent),
        radial-gradient(4px 4px at 330px 40px, #fff 99%, transparent);
    background-size: 450px 400px;
    animation: snowfall 28s linear infinite;
}

@keyframes snowfall {
    from {
        transform: translateY(0) translateX(0);
    }

    to {
        transform: translateY(100%) translateX(35px);
    }
}

/* ========================================
   MAIN CONTAINER
======================================== */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 16px 30px;
}

/* ========================================
   HEADER
======================================== */

.header {
    text-align: center;
    margin-bottom: 24px;
}

.header-icon {
    font-size: 42px;
    margin-bottom: 5px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.header h1 {
    font-size: 36px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -1.5px;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.25);
}

.header h1 span {
    color: var(--red);
}

.subtitle {
    margin-top: 6px;
    color: var(--text-light);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-decoration {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    color: var(--gold);
    font-size: 13px;
}

.header-decoration span:nth-child(2) {
    font-size: 19px;
}

/* ========================================
   GAME PANEL
======================================== */

.game-panel {
    position: relative;
    padding: 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ========================================
   STATUS BAR
======================================== */

.status-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-bottom: 16px;
}

.status-item {
    position: relative;
    overflow: hidden;
    padding: 12px 5px;
    text-align: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 28, 22, 0.65);
}

.status-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 15%;
    width: 70%;
    height: 2px;
    background: var(--green-light);
    opacity: 0.8;
}

.score-item::after {
    background: var(--gold);
}

.best-item::after {
    background: #e58b9a;
}

.status-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.status-value {
    display: block;
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.score-item .status-value {
    color: var(--gold);
}

.best-item .status-value {
    color: #f2a7b2;
}

/* ========================================
   RUSH TIME
======================================== */

.rush-message {
    display: none;
    margin: 0 0 8px;
    padding: 10px;
    text-align: center;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 2px;
    border-radius: 12px;
    background: linear-gradient(90deg, #a91f30, #ed4b4b, #a91f30);
    box-shadow: 0 0 20px rgba(237, 75, 75, 0.3);
    animation: rushBlink 0.45s infinite alternate;
}

.rush-message.active {
    display: block;
}

@keyframes rushBlink {
    from {
        opacity: 0.8;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.025);
    }
}

/* ========================================
   CHIMNEY GRID
======================================== */

.chimney-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px 0;
}

.chimney {
    position: relative;
    height: 115px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            #a95d3b 0%,
            #80432f 55%,
            #633326 100%
        );
    cursor: pointer;
    touch-action: manipulation;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -7px 0 rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.1s ease,
        filter 0.1s ease;
}

.chimney::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 22px,
            rgba(35, 15, 10, 0.7) 23px,
            transparent 25px
        );
    pointer-events: none;
}

.chimney:active {
    transform: scale(0.95);
    filter: brightness(1.15);
}

.chimney-hole {
    position: absolute;
    bottom: 8px;
    left: 10%;
    width: 80%;
    height: 24px;
    border-radius: 50%;
    background: #1b100d;
    box-shadow:
        inset 0 4px 7px rgba(0, 0, 0, 0.9),
        0 2px 3px rgba(255, 255, 255, 0.1);
    z-index: 2;
}

/* ========================================
   CHARACTER CONTAINER
======================================== */

.character {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(55px);
    transition:
        transform 0.12s ease-out,
        opacity 0.12s ease-out;
    z-index: 1;
    pointer-events: none;
}

.chimney.show .character {
    opacity: 1;
    transform: translateY(0);
}

.chimney.hit {
    filter: brightness(1.4);
}

/* ========================================
   SANTA CHARACTER
======================================== */

.santa {
    position: relative;
    display: block;
    width: 68px;
    height: 90px;
    flex-shrink: 0;
}

/* FACE */

.santa-face {
    position: absolute;
    top: 22px;
    left: 17px;
    width: 34px;
    height: 34px;
    background: #f3c69f;
    border-radius: 50%;
    z-index: 3;
}

/* EYES */

.santa-face::before {
    content: "•  •";
    position: absolute;
    top: 8px;
    left: 7px;
    color: #38271e;
    font-size: 11px;
    letter-spacing: 3px;
}

/* MOUTH */

.santa-face::after {
    content: "";
    position: absolute;
    bottom: 7px;
    left: 13px;
    width: 8px;
    height: 4px;
    border-bottom: 2px solid #9d5140;
    border-radius: 50%;
}

/* HAT */

.santa-hat {
    position: absolute;
    top: 5px;
    left: 16px;
    width: 36px;
    height: 23px;
    background: #111827;
    border-radius: 18px 18px 2px 2px;
    transform: rotate(-8deg);
    z-index: 4;
}

.santa-hat::before {
    content: "";
    position: absolute;
    bottom: -5px;
    left: -3px;
    width: 42px;
    height: 8px;
    background: #ffffff;
    border-radius: 5px;
}

.santa-hat::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
}

/* NORMAL SANTA HAT */

.santa.normal .santa-hat {
    background: #dc2626;
}

/* BEARD */

.santa-beard {
    position: absolute;
    top: 43px;
    left: 19px;
    width: 30px;
    height: 23px;
    background: #ffffff;
    border-radius: 5px 5px 15px 15px;
    z-index: 4;
}

/* BODY */

.santa-body {
    position: absolute;
    bottom: 0;
    left: 8px;
    width: 52px;
    height: 35px;
    background: #111827;
    border-radius: 20px 20px 5px 5px;
    z-index: 2;
}

.santa-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 7px;
    background: #ffffff;
    border-radius: 10px;
}

/* NORMAL SANTA BODY */

.santa.normal .santa-body {
    background: #dc2626;
}

/* ========================================
   MESSAGE
======================================== */

.message {
    min-height: 32px;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

/* ========================================
   START BUTTON
======================================== */

.start-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        #e64b50,
        #c52738
    );
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow:
        0 5px 0 #861d2b,
        0 8px 18px rgba(0, 0, 0, 0.25);
    transition: all 0.12s ease;
}

.start-button:active {
    transform: translateY(4px);
    box-shadow:
        0 1px 0 #861d2b,
        0 3px 8px rgba(0, 0, 0, 0.2);
}

.start-button:disabled {
    background: #64746c;
    box-shadow: 0 4px 0 #3d5147;
    cursor: default;
    opacity: 0.8;
}

.start-icon {
    font-size: 13px;
    opacity: 0.85;
}

/* ========================================
   RULES
======================================== */

.rules {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 22px;
}

.rule {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(7, 25, 19, 0.45);
}

.rule-character {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 38px;
    overflow: hidden;
}

.rule-character .santa {
    transform: scale(0.43);
    transform-origin: center center;
}

.rule-name {
    color: var(--text-light);
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.plus {
    color: #72e2a0;
    font-size: 16px;
    font-weight: 900;
    margin-left: 2px;
}

.minus {
    color: #ff7d86;
    font-size: 16px;
    font-weight: 900;
    margin-left: 2px;
}

/* ========================================
   HISTORY
======================================== */

.history-section {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: 18px;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.clear-button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.15s;
}

.clear-button:active {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0.96);
}

.history-list {
    display: flex;
    flex-direction: column;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    font-size: 12px;
    color: var(--text-light);
}

.history-number {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.history-score {
    font-size: 22px;
    font-weight: 900;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.empty-history {
    text-align: center;
    padding: 22px 5px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ========================================
   FOOTER
======================================== */

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    margin-top: 24px;
    color: #789889;
    font-size: 10px;
    letter-spacing: 1px;
}

footer span {
    color: var(--gold);
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 380px) {

    .container {
        padding: 18px 10px 24px;
    }

    .header {
        margin-bottom: 18px;
    }

    .header h1 {
        font-size: 31px;
    }

    .game-panel {
        padding: 15px 11px;
        border-radius: 20px;
    }

    .chimney-grid {
        gap: 8px;
    }

    .chimney {
        height: 100px;
    }

    .character {
        height: 80px;
    }

    .santa {
        transform: scale(0.9);
    }

    .status-value {
        font-size: 24px;
    }

    .rules {
        gap: 8px;
    }

    .rule {
        gap: 5px;
        padding: 5px 7px;
    }

    .rule-name {
        font-size: 10px;
    }

    .history-section {
        padding: 15px;
    }
}

/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    .rush-message {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}


/* SANTA IMAGES */

/* SANTA IMAGE */

.character img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
    user-select: none;
}

/* RULE CHARACTER */

.rule-character {
    display: block;
    width: 38px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

