:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --ink: #172033;
    --muted: #64748b;
    --line: #d8dee8;
    --panel: #ffffff;
    --green: #148044;
    --blue: #1f5fbf;
    --red: #b42318;
    --amber: #b7791f;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
}

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

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

button, input, select {
    font: inherit;
}

.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.topbar > a {
    font-weight: 800;
}

.topbar nav {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-weight: 650;
}

.layout {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
}

.layout.single {
    grid-template-columns: 1fr;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .06);
}

.wide {
    min-width: 0;
}

.section-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.status {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--blue);
    font-weight: 800;
    background: #eef5ff;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 16px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.button:disabled {
    cursor: default;
    opacity: .55;
}

.button.primary {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.button.danger {
    border-color: #fee2e2;
    color: var(--red);
    background: #fff5f5;
}

.entry {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(120deg, rgba(20, 128, 68, .92), rgba(31, 95, 191, .86)),
        url("../img/placeholder-person.svg") center/cover;
    color: #fff;
}

.entry section {
    width: min(760px, 100%);
}

.entry h1 {
    margin-bottom: 12px;
    font-size: clamp(46px, 9vw, 92px);
    line-height: .95;
}

.entry p:not(.eyebrow) {
    max-width: 620px;
    color: rgba(255, 255, 255, .9);
    font-size: 20px;
}

.entry .eyebrow {
    color: #c8f7dc;
}

.entry-actions, .actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

select, input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

.current-question {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 18px;
    align-items: center;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.current-question img {
    width: 130px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 7px;
}

.presenter-live {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.presenter-live div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.presenter-live span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.presenter-live strong {
    font-size: 34px;
    line-height: 1;
}

.presenter-live strong.is-finished {
    color: var(--red);
}

.danger-zone {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.ranking {
    display: grid;
    gap: 10px;
    padding-left: 0;
    list-style: none;
}

.ranking li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

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

.list {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.list li, .question-table article {
    display: grid;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.question-table article {
    grid-template-columns: 52px 180px 1fr;
    align-items: center;
}

.question-table span {
    color: var(--green);
    font-weight: 900;
}

.question-table p {
    margin: 0;
    color: var(--muted);
}

.notice {
    padding: 10px 12px;
    border-radius: 7px;
    background: #ecfdf3;
    color: var(--green);
    font-weight: 750;
}

.projector {
    overflow: hidden;
    background: #09111f;
    color: #fff;
}

.screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 42px;
}

.waiting {
    width: min(1080px, 100%);
}

.waiting h1 {
    max-width: 900px;
    font-size: clamp(60px, 10vw, 150px);
    line-height: .92;
}

.game-view {
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(320px, .65fr);
    gap: 38px;
    align-items: center;
}

.game-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
}

.game-copy h1 {
    margin-bottom: 16px;
    font-size: clamp(42px, 6vw, 92px);
    line-height: 1;
}

.timer {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    margin: 28px 0;
    border: 8px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff;
    font-size: 52px;
    font-weight: 950;
}

.projector-ranking {
    width: min(900px, 100%);
}

.projector-ranking h1 {
    font-size: clamp(48px, 8vw, 108px);
}

.projector-ranking li {
    display: grid;
    grid-template-columns: 80px 1fr 110px;
    gap: 22px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
    font-size: clamp(22px, 3vw, 36px);
}

.mobile-view {
    background: #edf2f7;
}

.phone {
    width: min(520px, 100%);
    margin: 0 auto;
    padding: 16px;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 850;
}

.answer-panel h1 {
    font-size: 30px;
    line-height: 1.05;
}

.options {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.mobile-timer {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin: 16px 0;
    border: 6px solid #dbeafe;
    border-radius: 50%;
    color: var(--blue);
    font-size: 34px;
    font-weight: 950;
}

.option-button {
    min-height: 58px;
    justify-content: flex-start;
    border-color: #cbd5e1;
}

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

.feedback {
    margin-top: 14px;
    color: var(--blue);
    font-weight: 850;
}

@media (max-width: 820px) {
    .layout, .game-view {
        grid-template-columns: 1fr;
    }

    .control-grid, .question-table article {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .screen {
        padding: 18px;
    }
}
