* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ink: #1a1a1a;
    --cream: #f4efe6;
    --sand: #e0d2bd;
    --accent: #c42026;
    --accent-deep: #7a1021;
    --blue: #0b3a6a;
    --card: #ffffff;
}

@font-face {
    font-family: "Oswald";
    src: url("/fonts/Oswald-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Oswald";
    src: url("/fonts/Oswald-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Oswald";
    src: url("/fonts/Oswald-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

body.games-body {
    font-family: "Oswald", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    min-height: 100vh;
    background: radial-gradient(circle at 85% 10%, rgba(196,32,38,0.16), transparent 45%),
        radial-gradient(circle at 12% 18%, rgba(11,58,106,0.12), transparent 40%),
        linear-gradient(180deg, #fbf8f3 0%, #f4efe6 60%, #e7d9c4 100%);
}

body.solo-game .games-main {
    max-width: 960px;
    min-height: calc(100vh - 96px);
    display: grid;
    align-items: center;
}

body.solo-game .puzzle-card,
body.solo-game .checkers-card {
    width: min(720px, 100%);
    margin: 0 auto;
}

body.solo-game .puzzle-board {
    justify-content: center;
}

body.solo-game .checkers-board {
    max-width: 640px;
}

.games-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 4vw;
    background: rgba(251,248,243,0.92);
    backdrop-filter: blur(6px);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.back-link {
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    background: #fff;
    border-radius: 999px;
    padding: 0.4rem 1rem;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.games-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 4vw 4rem;
}

.primary-button,
.secondary-button {
    font-family: inherit;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.primary-button {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 18px rgba(196,32,38,0.2);
}

.secondary-button {
    background: transparent;
    color: var(--accent-deep);
    border: 1px solid rgba(0,0,0,0.15);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    background: var(--card);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 24px 50px rgba(0,0,0,0.12);
    overflow: hidden;
}

.hero-kicker {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 0.6rem;
    font-weight: 300;
}

.hero h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    margin-bottom: 0.8rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 46ch;
    font-weight: 300;
}

.hero-progress {
    margin-top: 1.5rem;
    font-weight: 600;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, auto);
    align-items: center;
}

.hero-timer {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.2em;
    color: var(--blue);
}

.hero-start {
    padding: 0.45rem 1.2rem;
}

.progress-track {
    height: 6px;
    margin-top: 0.2rem;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    overflow: hidden;
    grid-column: 1 / -1;
}

.progress-track span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    transition: width 0.6s ease;
}

.hero-actions {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.hero-actions .secondary-button {
    text-decoration: none;
}

.hero-ornament {
    position: relative;
    min-height: 160px;
}

.orb {
    position: absolute;
    border-radius: 999px;
    opacity: 0.8;
    filter: blur(0.5px);
}

.orb-one {
    width: 140px;
    height: 140px;
    right: 10%;
    top: 0;
    background: radial-gradient(circle, rgba(196,32,38,0.55), rgba(196,32,38,0.05));
}

.orb-two {
    width: 120px;
    height: 120px;
    right: 40%;
    bottom: -30px;
    background: radial-gradient(circle, rgba(11,58,106,0.4), rgba(11,58,106,0.05));
}

.orb-three {
    width: 90px;
    height: 90px;
    left: 5%;
    top: 40%;
    background: radial-gradient(circle, rgba(224,210,189,0.9), rgba(224,210,189,0.05));
}

.quiz-shell {
    margin-top: 2.5rem;
}

.quiz-card {
    background: var(--card);
    border-radius: 26px;
    padding: 2rem 2.4rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
    display: grid;
    gap: 1.2rem;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.quiz-tag {
    background: rgba(11,58,106,0.12);
    color: var(--blue);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 300;
}

.quiz-question {
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 500;
}

.quiz-options {
    display: grid;
    gap: 0.8rem;
}

.quiz-option {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 300;
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.quiz-option:disabled {
    cursor: default;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.quiz-option.correct {
    border-color: #0f6a3b;
    background: rgba(27,127,75,0.18);
    color: #0b3a22;
    font-weight: 500;
}

.quiz-option.wrong {
    border-color: #8f1b1b;
    background: rgba(155,28,28,0.18);
    color: #6f0f0f;
    font-weight: 500;
}

.quiz-feedback {
    background: rgba(11,58,106,0.08);
    border-radius: 18px;
    padding: 1rem 1.2rem;
    display: grid;
    gap: 0.4rem;
}

.quiz-feedback-title {
    font-weight: 700;
}

.quiz-next {
    justify-self: flex-end;
}

.puzzle-shell {
    margin-top: 2.5rem;
}

.puzzle-card {
    background: var(--card);
    border-radius: 26px;
    padding: 2rem 2.4rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
    display: grid;
    gap: 1.2rem;
}

.puzzle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.puzzle-icon {
    font-size: 2rem;
}

.puzzle-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.puzzle-controls select {
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.2);
    padding: 0.5rem 0.9rem;
    font-family: inherit;
}

.puzzle-board {
    --grid-size: 3;
    --tile-size: 72px;
    display: grid;
    grid-template-columns: repeat(var(--grid-size), var(--tile-size));
    gap: 6px;
    margin-bottom: 0.6rem;
}

.checkers-shell {
    margin-top: 2.5rem;
}

.checkers-card {
    background: var(--card);
    border-radius: 26px;
    padding: 2rem 2.4rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
    display: grid;
    gap: 1.2rem;
}

.checkers-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.checkers-icon {
    font-size: 2rem;
}

.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(28px, 1fr));
    gap: 4px;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 1;
}

.checkers-cell {
    border: none;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.checkers-cell.light {
    background: #f1e8db;
}

.checkers-cell.dark {
    background: #2c2c2c;
}

.checkers-cell.selected {
    outline: 3px solid rgba(196,32,38,0.7);
    outline-offset: 2px;
}

.checkers-piece {
    width: 70%;
    height: 70%;
    border-radius: 999px;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 6px 10px rgba(255,255,255,0.3), inset 0 -6px 10px rgba(0,0,0,0.35);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.checkers-piece.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c42026);
}

.checkers-piece.blue {
    background: radial-gradient(circle at 30% 30%, #4d7dbf, #0b3a6a);
}

.checkers-piece::after {
    content: "🥟";
}

.checkers-hint {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(0,0,0,0.6);
    font-weight: 300;
}

.tile {
    width: var(--tile-size);
    height: var(--tile-size);
    border-radius: 12px;
    border: none;
    background: linear-gradient(140deg, var(--blue), #0f4a82);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.tile.empty {
    background: #f1e8db;
    cursor: default;
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.games-locked .quiz-card,
.games-locked .puzzle-card,
.games-locked .checkers-card,
.games-locked .quiz-actions {
    pointer-events: none;
    opacity: 0.6;
}

.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16,16,16,0.7);
    display: grid;
    place-items: center;
    z-index: 20;
}

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

.result-card {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 24px;
    text-align: center;
    display: grid;
    gap: 0.8rem;
    width: min(560px, 92vw);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    animation: pop-in 0.4s ease;
}

.result-emoji {
    font-size: 3rem;
}

.result-honor {
    font-size: 1.4rem;
    font-weight: 700;
}

.result-medal {
    font-weight: 600;
    color: rgba(0,0,0,0.7);
}

.result-text {
    font-size: 1.6rem;
    font-weight: 700;
}

.result-sub {
    color: rgba(0,0,0,0.7);
}

.result-score {
    font-weight: 700;
}

.program-grid {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.6rem;
    grid-template-columns: 1fr;
}

.program-card {
    border-radius: 16px;
    padding: 1.1rem 1.4rem;
    color: #fff;
    display: grid;
    gap: 0.4rem;
    text-align: left;
    box-shadow: 0 14px 24px rgba(0,0,0,0.16);
}

.program-card.red {
    background: #b5151f;
}

.program-card.blue {
    background: #0b3a6a;
}

.program-brand {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.7rem;
    font-weight: 300;
}

.program-title {
    font-weight: 700;
    font-size: 1rem;
}

.rules-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16,16,16,0.7);
    display: grid;
    place-items: center;
    z-index: 25;
}

.rules-overlay.hidden {
    display: none;
}

.rules-card {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 24px;
    text-align: center;
    display: grid;
    gap: 0.8rem;
    width: min(560px, 92vw);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    font-weight: 300;
}

.rules-emoji {
    font-size: 2.2rem;
}

.rules-card ul {
    list-style: none;
    display: grid;
    gap: 0.4rem;
    padding: 0;
}

.rules-card li::before {
    content: "• ";
    color: var(--accent);
    font-weight: 700;
}

.celebration {
    position: fixed;
    font-size: 2rem;
    opacity: 0.8;
}

.celebration-one {
    right: 1.5rem;
    bottom: 1.5rem;
}

.celebration-two {
    left: 1.5rem;
    bottom: 1.5rem;
}

.celebration-three {
    right: 1.5rem;
    top: calc(1.5rem + 64px);
}

.celebration-four {
    left: 1.5rem;
    top: calc(1.5rem + 64px);
}

.lock-screen {
    position: fixed;
    inset: 0;
    background: rgba(244,239,230,0.92);
    display: grid;
    place-items: center;
    z-index: 30;
}

.preview-unlocked .lock-screen {
    display: none;
}

.lock-card {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 22px 40px rgba(0,0,0,0.2);
    display: grid;
    gap: 0.6rem;
}

.unlock-form {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.unlock-input {
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-family: inherit;
    text-align: center;
}

.unlock-error {
    color: #8a1d1d;
    font-weight: 600;
    min-height: 1.2rem;
}

@keyframes pop-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .games-header {
        padding: 1rem 5vw;
    }

    .hero {
        padding: 2rem;
    }

    .hero-progress {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .quiz-card,
    .puzzle-card,
    .rules-card,
    .result-card {
        padding: 1.6rem;
    }

    .puzzle-board {
        gap: 4px;
        --tile-size: 60px;
    }

    .checkers-board {
        max-width: 360px;
    }


    .celebration {
        display: none;
    }
}
