* {
    box-sizing: border-box;
}

:root {
    --ink: #111827;
    --muted: #5b6472;
    --paper: #ffffff;
    --line: #d8dee8;
    --blue: #2563eb;
    --green: #10b981;
    --red: #ef4444;
    --yellow: #facc15;
    --teal: #14b8a6;
    --black: #101820;
}

body {
    margin: 0;
    font-family: Arial, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: var(--ink);
    min-height: 100vh;
}

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

img {
    display: block;
    max-width: 100%;
}

.site-bg {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(20, 184, 166, 0.10) 0 25%, transparent 25% 50%, rgba(250, 204, 21, 0.16) 50% 75%, transparent 75%),
        #f5f7fb;
    background-size: 72px 72px;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 58px;
}

.narrow-shell {
    width: min(760px, calc(100% - 32px));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--black);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    box-shadow: 5px 5px 0 var(--yellow);
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.button,
button {
    appearance: none;
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 900;
    cursor: pointer;
    background: #fff;
    color: var(--black);
    box-shadow: 4px 4px 0 var(--black);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    font: inherit;
}

.button:hover,
button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
}

.button-primary,
button,
.button-accent {
    background: var(--green);
    color: #05251d;
}

.button-secondary {
    background: #fff;
}

.button-danger {
    background: var(--red);
    color: #fff;
}

.hero {
    min-height: calc(100vh - 110px);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    align-items: center;
    gap: 30px;
    padding-bottom: 34px;
}

.hero-copy {
    display: grid;
    gap: 20px;
}

.kicker,
.small {
    color: var(--muted);
    font-size: 0.95rem;
}

.kicker {
    font-weight: 900;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: 5.4rem;
    line-height: 0.9;
    margin-bottom: 4px;
    letter-spacing: 0;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 8px;
}

h3 {
    margin-bottom: 8px;
}

p {
    line-height: 1.55;
}

.hero-copy > p {
    max-width: 680px;
    font-size: 1.12rem;
}

.hero-stage {
    position: relative;
    border: 2px solid var(--black);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 8px 8px 0 var(--black);
}

.hero-stage img {
    width: 100%;
    height: 520px;
    object-fit: cover;
}

.pin-panel {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 18px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: #fff;
    box-shadow: 5px 5px 0 var(--black);
}

.pin-number {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 0.9;
}

.quick-join {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 12px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat,
.panel,
.card,
.quiz-form,
.play-card,
.question-card,
.answer-option {
    background: #fff;
    border: 2px solid var(--black);
    border-radius: 8px;
    box-shadow: 5px 5px 0 var(--black);
}

.stat {
    padding: 14px;
}

.stat strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.panel,
.quiz-form,
.play-card {
    padding: 24px;
    margin-bottom: 24px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    margin: 34px 0 16px;
}

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

.card {
    overflow: hidden;
}

.card-cover {
    min-height: 144px;
    padding: 18px;
    display: flex;
    align-items: end;
    font-weight: 900;
    font-size: 1.35rem;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.card-body {
    padding: 18px;
}

.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.pill {
    padding: 7px 10px;
    border-radius: 8px;
    background: #eef2f7;
    border: 1px solid var(--line);
    font-weight: 800;
}

.page-title {
    margin-bottom: 6px;
    font-size: 3rem;
    line-height: 1;
}

.auth-card {
    margin-top: 58px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 22px;
    align-items: stretch;
}

.auth-poster {
    padding: 24px;
    background: var(--teal);
    color: #042f2e;
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 900;
}

input,
textarea,
select {
    width: 100%;
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 13px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
}

textarea {
    min-height: 118px;
    resize: vertical;
}

.question-builder {
    display: grid;
    gap: 16px;
}

.question-card {
    padding: 18px;
    margin-bottom: 16px;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

.share-box {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 22px;
    align-items: center;
}

.share-link,
.big-pin {
    padding: 14px;
    border: 2px dashed var(--black);
    border-radius: 8px;
    background: #f9fafb;
    word-break: break-all;
    font-weight: 900;
}

.big-pin {
    display: inline-block;
    font-size: 5rem;
    line-height: 0.9;
    letter-spacing: 0;
    background: var(--yellow);
}

.qr-frame {
    background: #fff;
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 5px 5px 0 var(--black);
}

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

.answer-option {
    padding: 18px;
    min-height: 86px;
    display: flex;
    align-items: center;
    font-weight: 900;
}

.answer-option:nth-child(4n + 1) {
    background: #fee2e2;
}

.answer-option:nth-child(4n + 2) {
    background: #dbeafe;
}

.answer-option:nth-child(4n + 3) {
    background: #dcfce7;
}

.answer-option:nth-child(4n + 4) {
    background: #fef3c7;
}

.answer-option input {
    width: auto;
    margin-right: 10px;
}

.live-stage {
    margin: 16px 0 18px;
}

.live-screen {
    min-height: 310px;
    padding: 26px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: #fff;
    box-shadow: 5px 5px 0 var(--black);
    display: grid;
    align-content: center;
    gap: 16px;
}

.live-screen h2 {
    font-size: 3.4rem;
    line-height: 0.95;
    margin-bottom: 0;
}

.live-screen-question {
    background: #dbeafe;
}

.live-screen-result {
    background: #dcfce7;
}

.live-screen-wait {
    background: #fef3c7;
}

.live-screen-finish {
    background: #fee2e2;
}

.host-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.host-answer-tile {
    min-height: 92px;
    padding: 18px;
    border: 2px solid var(--black);
    border-radius: 8px;
    background: #fff;
    box-shadow: 4px 4px 0 var(--black);
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 900;
}

.host-answer-tile:nth-child(4n + 1) {
    background: #fee2e2;
}

.host-answer-tile:nth-child(4n + 2) {
    background: #dbeafe;
}

.host-answer-tile:nth-child(4n + 3) {
    background: #dcfce7;
}

.host-answer-tile:nth-child(4n + 4) {
    background: #fef3c7;
}

.leaderboard-card.is-hot:first-child {
    background: var(--yellow);
}

.player-wait {
    background: #fef3c7;
}

.player-result {
    background: #dcfce7;
}

.play-card {
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
}

.result-score {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 12px;
}

.notice {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    border: 2px solid var(--black);
    font-weight: 800;
}

.notice-error {
    background: #fee2e2;
}

.notice-success {
    background: #dcfce7;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 2px solid var(--line);
    text-align: left;
}

.admin-table th {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .hero,
    .auth-layout,
    .share-box,
    .question-grid,
    .answer-grid,
    .option-list {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .hero-stage img {
        height: 420px;
    }

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

    .quick-join {
        grid-template-columns: 1fr;
    }

    .host-answer-grid {
        grid-template-columns: 1fr;
    }

    .live-screen h2 {
        font-size: 2.1rem;
    }

    h1 {
        font-size: 3.05rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .pin-number,
    .result-score {
        font-size: 3rem;
    }

    .big-pin {
        font-size: 3.4rem;
    }
}
