:root {
    --bg: linear-gradient(135deg, #fff4cc 0%, #ffd27d 45%, #ff8a3d 100%);
    --bg-soft: rgba(255, 255, 255, 0.74);
    --card: rgba(255, 251, 244, 0.94);
    --ink: #2c2342;
    --muted: #5f5677;
    --primary: #ff6b35;
    --primary-dark: #d94e1f;
    --secondary: #00a6a6;
    --accent: #ffd447;
    --good: #1a9c5f;
    --bad: #d34b52;
    --warning: #b67a00;
    --border: rgba(44, 35, 66, 0.12);
    --shadow: 0 24px 48px rgba(96, 57, 20, 0.18);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0, 166, 166, 0.2), transparent 35%),
        var(--bg);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: 4rem;
    right: -4rem;
    background: rgba(255, 212, 71, 0.85);
}

body::after {
    bottom: -5rem;
    left: -4rem;
    background: rgba(0, 166, 166, 0.45);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0 2rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(44, 35, 66, 0.08);
}

.brand {
    font-family: "Segoe Print", "Trebuchet MS", cursive;
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.nav-links a {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.status-badge {
    min-width: 140px;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
    background: #e8f7ff;
    color: #14506a;
}

.status-badge[data-state="offline"] {
    background: #ffe8d8;
    color: #8f4300;
}

.status-badge[data-state="pending"] {
    background: #fff3c6;
    color: #8a6400;
}

.status-badge[data-state="synced"] {
    background: #dff7e8;
    color: #145d34;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-grid,
.leaderboard-layout,
.game-layout,
.content-grid,
.info-band {
    display: grid;
    gap: 1.35rem;
}

.hero-grid {
    grid-template-columns: 1.6fr 1fr;
}

.hero-card,
.mascot-card,
.leaderboard-panel,
.tips-panel,
.game-panel,
.content-card,
.info-card {
    padding: 1.6rem;
}

.eyebrow {
    margin: 0 0 0.8rem;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary);
}

h1,
h2 {
    margin-top: 0;
    line-height: 1.1;
    font-family: "Segoe Print", "Trebuchet MS", cursive;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
}

.lead {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 62ch;
}

.meta-list {
    display: grid;
    gap: 0.7rem;
    margin: 1.25rem 0 0;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
}

.meta-list.compact {
    font-size: 0.97rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.9rem 1.25rem;
    border: 0;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(44, 35, 66, 0.14);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #ff944d);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.85);
    color: var(--ink);
}

.mascot-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: clamp(2rem, 3vw, 2.6rem);
}

.feature-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.6;
}

.info-band {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 1.5rem;
}

.game-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: start;
}

.scoreboard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.score-pill {
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    font-weight: 700;
}

.score-pill.warning {
    background: #fff2c2;
}

.score-pill.accent {
    background: #dff7ff;
}

.question-card {
    padding: 1.3rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 236, 0.96));
    min-height: 215px;
}

.options-grid {
    display: grid;
    gap: 0.95rem;
    margin-top: 1.2rem;
}

.option-button {
    width: 100%;
    min-height: 74px;
    padding: 1rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 22px;
    text-align: left;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.option-button:hover,
.option-button:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 107, 53, 0.4);
}

.option-button:disabled {
    cursor: default;
}

.option-button[data-state="correct"] {
    background: #dcf7e6;
    border-color: rgba(26, 156, 95, 0.6);
}

.option-button[data-state="wrong"] {
    background: #ffe0e2;
    border-color: rgba(211, 75, 82, 0.6);
}

.feedback-box {
    margin-top: 1.1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    line-height: 1.5;
}

.feedback-box[data-tone="success"] {
    background: #ddf6e5;
}

.feedback-box[data-tone="error"] {
    background: #ffe1e5;
}

.feedback-box[data-tone="warning"] {
    background: #fff2c9;
}

.warning-text {
    margin-top: 1rem;
}

.result-line {
    font-size: 1.15rem;
    margin: 0.35rem 0;
}

.score-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.3rem;
}

.score-form label {
    font-weight: 700;
}

.score-form input {
    min-height: 54px;
    padding: 0.85rem 1rem;
    border: 2px solid rgba(44, 35, 66, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.95rem 0.8rem;
    border-bottom: 1px solid rgba(44, 35, 66, 0.1);
    text-align: left;
}

.leaderboard-table th {
    font-family: "Segoe Print", "Trebuchet MS", cursive;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

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

.is-hidden {
    display: none;
}

@media (max-width: 920px) {
    .topbar,
    .hero-grid,
    .game-layout,
    .content-grid,
    .info-band {
        grid-template-columns: 1fr;
    }

    .topbar {
        border-radius: 30px;
    }

    .topbar,
    .nav-links,
    .hero-actions,
    .scoreboard {
        justify-content: center;
    }

    .status-badge {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 1rem, 100%);
    }

    .hero-card,
    .mascot-card,
    .leaderboard-panel,
    .tips-panel,
    .game-panel,
    .content-card,
    .info-card {
        padding: 1.2rem;
    }

    .button,
    .option-button {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }
}
