:root {
    --teal-700: #2e6e7a;
    --teal-600: #3a7f8b;
    --teal-400: #8fc2c8;
    --sky-50: #eef6f7;
    --cream-50: #fbfaf6;
    --cream-100: #f6f1e5;
    --sand-200: #f2dfb5;
    --card: #ffffff;
    --ink: #1f2a2e;
    --muted: #5b6b72;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius-xl: 18px;
    --radius-lg: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--cream-50);
}

a {
    color: inherit;
}

.site-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
}

.container {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
}

.brandbar {
    background: #6f9dac;
    border-bottom: 4px solid rgba(255, 255, 255, 0.5);
}

.brandbar__inner {
    min-height: 10vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f3d48b;
    letter-spacing: 1px;
    font-weight: 800;
}

.brand__mark {
    width: auto;
    height: 20vh;
    display: block;
    object-fit: contain;
}

.brand__text {
    font-size: 22px;
}

.pagetitle {
    background: #f8f7f2;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.pagetitle h1 {
    margin: 0;
    padding: 18px 0 16px;
    font-size: 40px;
    letter-spacing: 1px;
    color: var(--teal-700);
}

.page-main {
    width: 100%;
    padding: 42px 0 52px;
    background: linear-gradient(180deg, #dbecef 0%, #eaf2f4 40%, #ddebed 100%);
}

.page-stack {
    display: grid;
    gap: 22px;
}

.card {
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 22px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

.hero__headline {
    margin: 0 0 8px;
    font-size: 42px;
    letter-spacing: 1px;
    color: var(--teal-700);
}

.hero__sub {
    color: var(--teal-700);
    font-size: 18px;
    margin: 0 0 18px;
}

.section-title {
    margin: 0 0 10px;
    font-size: 24px;
    letter-spacing: 0.5px;
    color: var(--teal-700);
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.room-code {
    font-size: 38px;
    letter-spacing: 4px;
    font-weight: 800;
    color: var(--teal-700);
}

.row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.between {
    justify-content: space-between;
}

.stack {
    display: grid;
    gap: 12px;
}

.actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--teal-700);
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

.field-help {
    font-size: 13px;
    color: var(--muted);
    margin-top: -8px;
    margin-bottom: 10px;
}

.btn,
button {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 750;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: filter 120ms ease;
}

.btn:hover,
button:hover {
    filter: brightness(0.98);
}

.btn,
button:not(.secondary):not(.answer-btn) {
    background: #f0cf7a;
    color: #2b5c65;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.secondary {
    background: #7ba7b2;
    color: #f8fffe;
}

.status-ok {
    color: #2c6f3d;
    font-weight: 700;
}

.status-error {
    color: #8a2b2b;
    font-weight: 700;
}

.question-title {
    font-size: 22px;
    font-weight: 750;
    color: #2b3b41;
    margin: 0 0 10px;
}

.progress {
    height: 14px;
    border-radius: 999px;
    background: #d7e6e8;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 12px 0 16px;
}

.progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #f0cf7a, #6fb3bd);
}

.progress--thin {
    height: 10px;
    margin: 10px 0 14px;
}

.answers {
    display: grid;
    gap: 10px;
}

.answer-btn,
.answer {
    min-height: 52px;
    border-radius: 14px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    background: #fbf2d9;
    color: #2a3a40;
    font-size: 18px;
    font-weight: 650;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
}

.answer-selected,
.answer-btn[disabled] {
    background: #8dc1c6;
    border-color: rgba(0, 0, 0, 0.1);
    color: #22444a;
}

.list-rows,
.leaderboard,
.players {
    display: grid;
    gap: 10px;
}

.lb-row,
.player-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
}

.pack-row {
    grid-template-columns: 32px 1fr auto;
}

.pack-row__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form {
    margin: 0;
}

.btn-small {
    width: auto;
    min-width: 84px;
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 10px;
}

.question-editor {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin: 0;
}

.question-editor legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--teal-700);
}

.pack-editor-toolbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.label-inline {
    margin: 0;
}

.pack-choice-row {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 8px;
    align-items: center;
}

.pack-choice-row input {
    margin-bottom: 0;
}

.pack-choice-label {
    margin-bottom: 0;
}

.lb-rank,
.player-rank {
    font-weight: 800;
    color: #2b5c65;
    opacity: 0.7;
}

.lb-name,
.player-name {
    font-weight: 700;
    color: #2b5c65;
}

.lb-pts,
.player-score {
    font-weight: 800;
    color: #2b5c65;
    opacity: 0.9;
}

.room-sidebar {
    background: #fbf4e0;
}

.footer {
    background: #f0d895;
    padding: 34px 0 40px;
}

.footer__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.footer__title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--teal-700);
    margin-bottom: 14px;
}

.footer__links {
    display: grid;
    grid-template-columns: auto auto;
    gap: 10px 28px;
    max-width: 340px;
}

.footer__link,
.footer__text {
    color: #2b5c65;
    text-decoration: underline;
    font-size: 13px;
    opacity: 0.85;
}

.footer__col--right {
    text-align: right;
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

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

    .footer__col--right {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1100px, calc(100% - 28px));
    }

    .pagetitle h1 {
        font-size: 30px;
        padding: 14px 0;
    }

    .hero__headline {
        font-size: 32px;
    }

    .room-code {
        font-size: 30px;
        letter-spacing: 2px;
    }
}