:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #667085;
    --line: #e6eaf2;
    --soft: #f8fafc;
    --primary: #2563eb;
    --success: #0f9f6e;
    --danger: #d92d20;
    --warning: #f59e0b;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #e8efff 0, transparent 32rem), var(--bg);
    color: var(--ink);
}

.app-navbar {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.toast-zone {
    position: fixed;
    top: 5rem;
    right: 1.25rem;
    z-index: 1080;
    max-width: min(420px, calc(100vw - 2rem));
}

.hero-panel,
.app-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.hero-panel {
    padding: clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
}

.hero-panel h1,
.page-head h1,
.public-top h1,
.player-bar h1 {
    font-weight: 750;
    letter-spacing: -0.04em;
}

.hero-panel h1 {
    font-size: clamp(2.25rem, 5vw, 4.6rem);
    line-height: 0.95;
    margin-bottom: 1rem;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.rules-card,
.empty-box,
.question-box,
.total-pool,
.my-bet-box {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
}

.rule-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.rule-line:last-child {
    border-bottom: 0;
}

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

.session-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1rem;
    background: #fff;
}

.session-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.status-badge,
.sector-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #eef2ff;
    color: #3730a3;
}

.status-running { background: #dcfce7; color: #166534; }
.status-waiting { background: #fef3c7; color: #92400e; }
.status-finished { background: #e5e7eb; color: #374151; }

.mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mini-stats span {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.join-form,
.head-actions,
.resolve-form,
.host-control-panel {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.join-form .form-control {
    min-width: 0;
    flex: 1;
}

.page-head,
.public-top,
.player-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-bar {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.player-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.player-stats div {
    min-width: 150px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.7rem 0.85rem;
}

.player-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.player-stats strong {
    font-size: 1.05rem;
}

.round-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.round-head h2 {
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}

.round-status {
    min-width: 160px;
    border-radius: 20px;
    padding: 0.85rem 1rem;
    text-align: center;
    border: 1px solid var(--line);
    background: var(--soft);
}

.round-status span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.round-status strong,
.public-timer {
    font-variant-numeric: tabular-nums;
    font-size: 2rem;
    line-height: 1;
}

.round-status.is-open {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.round-status.is-closed {
    border-color: #fed7aa;
    background: #fff7ed;
}

.question-label,
.news-meta {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.news-list {
    display: grid;
    gap: 0.75rem;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.news-item {
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: #fff;
}

.news-item.signal-yes { border-left-color: var(--success); }
.news-item.signal-no { border-left-color: var(--danger); }
.news-item.signal-neutral { border-left-color: #94a3b8; }

.pool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.pool-card {
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid var(--line);
    background: var(--soft);
}

.pool-card span,
.total-pool span,
.total-pool small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.pool-card strong,
.total-pool strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
    margin: 0.25rem 0;
}

.pool-card.yes { background: #f0fdf4; border-color: #bbf7d0; }
.pool-card.no { background: #fef2f2; border-color: #fecaca; }

.leader-row,
.recent-round {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.leader-row:last-child,
.recent-round:last-child {
    border-bottom: 0;
}

.place {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 800;
}

.name {
    font-weight: 650;
}

.recent-round {
    grid-template-columns: auto 1fr auto;
}

.recent-round span,
.recent-round em {
    color: var(--muted);
    font-size: 0.85rem;
    font-style: normal;
}

.side-select {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.side-option {
    cursor: pointer;
}

.side-option input {
    display: none;
}

.side-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--soft);
    font-size: 1.3rem;
    font-weight: 800;
    transition: 0.15s ease;
}

.side-option.yes input:checked + span {
    background: #dcfce7;
    border-color: var(--success);
    color: #166534;
}

.side-option.no input:checked + span {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.bet-form {
    display: grid;
    gap: 1rem;
}

.public-screen {
    min-height: calc(100vh - 8rem);
}

.public-timer {
    min-width: 160px;
    border-radius: 22px;
    padding: 1rem 1.25rem;
    background: #111827;
    color: white;
    text-align: center;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.timer-danger {
    color: var(--danger) !important;
}

.top-card {
    top: 5.5rem;
}

@media (max-width: 768px) {
    .toast-zone {
        left: 1rem;
        right: 1rem;
    }

    .join-form,
    .head-actions,
    .resolve-form,
    .host-control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .pool-grid,
    .side-select {
        grid-template-columns: 1fr;
    }

    .player-stats {
        width: 100%;
    }

    .player-stats div {
        flex: 1 1 100%;
    }
}
