/* ─── Переменные темы ───────────────────────────────────────────────────────── */
:root {
    --bg:          #0d1117;
    --bg-2:        #161b22;
    --bg-3:        #21262d;
    --border:      #30363d;
    --accent:      #7c3aed;
    --accent-2:    #9f67fa;
    --text:        #e6edf3;
    --text-muted:  #8b949e;
    --green:       #22c55e;
    --green-dim:   #16532433;
    --yellow:      #eab308;
    --yellow-dim:  #42360a44;
    --red:         #ef4444;
    --red-dim:     #3b0f0f44;
    --live-red:    #ff4444;
    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 4px 24px #0005;
    --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }
code { font-family: var(--font-mono); font-size: .85em; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    flex-wrap: wrap;
}
.room-name-chip {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .2rem .75rem;
    font-size: .85rem;
    color: var(--text-muted);
}
.user-chip {
    font-size: .9rem;
    font-weight: 600;
}

/* ─── Кнопки ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--accent);  color: #fff;  border-color: var(--accent); }
.btn-secondary{ background: var(--bg-3);    color: var(--text); border-color: var(--border); }
.btn-ghost    { background: transparent;    color: var(--text-muted); border-color: var(--border); }
.btn-success  { background: #16a34a;        color: #fff; }
.btn-danger   { background: #b91c1c;        color: #fff; }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm  { padding: .35rem .8rem;  font-size: .82rem; }
.btn-xs  { padding: .2rem .55rem;  font-size: .78rem; }

/* ─── Формы ─────────────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.form-group label {
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: .55rem .75rem;
    outline: none;
    transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}
.alert-error   { background: var(--red-dim);    border: 1px solid var(--red);    color: #fca5a5; }
.alert-success { background: var(--green-dim);  border: 1px solid var(--green);  color: #86efac; }
.alert-info    { background: #1e3a5f;           border: 1px solid #3b82f6;       color: #93c5fd; }
.alert-bar, .conditions-bar, .invite-bar {
    padding: .6rem 0;
    font-size: .88rem;
}
.alert-warning { background: var(--yellow-dim); border-bottom: 1px solid var(--yellow); color: #fde68a; }
.alert-bar.alert-info { background: #1e3a5f; color: #93c5fd; border-bottom: 1px solid #3b82f6; }

.conditions-bar {
    background: #1a1040;
    border-bottom: 1px solid #4c1d95;
    color: #c4b5fd;
}
.conditions-icon { margin-right: .4rem; }

.tz-bar {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: .4rem 0;
    font-size: .8rem;
    color: var(--text-muted);
}
.invite-bar {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .83rem;
}
.invite-bar code {
    background: var(--bg-3);
    padding: .1rem .4rem;
    border-radius: 4px;
    margin: 0 .5rem;
    user-select: all;
}

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
    background: var(--red);
    color: #fff;
    border-radius: 20px;
    font-size: .7rem;
    padding: .1rem .4rem;
    font-weight: 700;
    vertical-align: top;
    margin-left: .2rem;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs-bar {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.tab {
    padding: .75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    text-decoration: none;
    display: inline-block;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Landing Page ──────────────────────────────────────────────────────────── */
.page-index { display: flex; flex-direction: column; min-height: 100vh; }
.landing { flex: 1; }
.landing-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.logo-big { font-size: 4rem; }
.landing-hero h1 { font-size: 2.5rem; font-weight: 800; margin: .5rem 0; }
.tagline { color: var(--text-muted); font-size: 1.1rem; }

.landing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}
@media (max-width: 700px) {
    .landing-cards { grid-template-columns: 1fr; }
    .landing-hero h1 { font-size: 1.8rem; }
}

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.card h2 { font-size: 1.2rem; }
.card-desc { color: var(--text-muted); font-size: .9rem; }
.divider {
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    position: relative;
    margin: .5rem 0;
}
.demo-box {
    background: var(--bg-3);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
}
.demo-box p { font-size: .9rem; margin-bottom: .5rem; }

/* ─── Auth Page ─────────────────────────────────────────────────────────────── */
.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}
.auth-container {
    width: 100%;
    max-width: 440px;
}
.auth-back { color: var(--text-muted); font-size: .85rem; display: block; margin-bottom: 1rem; }
.auth-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.auth-room-info { text-align: center; }
.auth-room-icon { font-size: 2.5rem; }
.auth-room-info h2 { font-size: 1.4rem; margin: .3rem 0 0; }
.auth-conditions {
    color: var(--text-muted);
    font-size: .85rem;
    margin-top: .4rem;
}
.auth-hint { color: var(--text-muted); font-size: .85rem; }
.auth-note { color: var(--text-muted); font-size: .8rem; }

/* ─── Room Page ─────────────────────────────────────────────────────────────── */
.main-content { padding: 1.5rem 1rem; }

.group-block { margin-bottom: 2.5rem; }
.group-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: .75rem;
}
.day-today > .group-title {
    color: var(--accent-2);
    border-bottom-color: var(--accent);
}
.day-badge {
    font-size: .75rem;
    font-weight: 600;
    background: #3b1f00;
    color: #fb923c;
    border-radius: 20px;
    padding: .15rem .6rem;
    animation: blink 1.4s infinite;
}
.day-badge-done {
    background: var(--green-dim);
    color: var(--green);
    animation: none;
}
.alert-bar.alert-new-matches {
    background: #1c1a00;
    border-bottom: 2px solid #ca8a04;
    color: #fde68a;
    font-size: .9rem;
    padding: .65rem 0;
}

/* ─── Predictions Table ─────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.preds-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: .88rem;
}
.preds-table th,
.preds-table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}
.preds-table th {
    background: var(--bg-3);
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.preds-table th.col-match { text-align: left; }
.preds-table td.col-match { text-align: left; }
.preds-table tbody tr:last-child td { border-bottom: none; }
.preds-table tbody tr:hover { background: #ffffff08; }

.col-num   { width: 40px; min-width: 40px; }
.col-match { min-width: 180px; }
.col-date  { width: 80px; min-width: 80px; color: var(--text-muted); }
.col-score { width: 70px; min-width: 70px; }
.col-user  { min-width: 110px; }
.user-pts  { color: var(--accent-2); font-weight: 700; font-size: .9rem; }

.team1, .team2 { font-weight: 500; }
.vs { color: var(--text-muted); margin: 0 .3rem; font-size: .8rem; }

/* Статусы строк */
.row-live   { background: #ff00001a; }
.row-live:hover { background: #ff000022 !important; }
.row-finished { }

/* Счёт матча */
.score-badge {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .15rem .45rem;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: .9rem;
}
.score-final .score-badge {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
}
.score-tbd { color: var(--text-muted); }

/* Live dot animation */
.live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--live-red);
    border-radius: 50%;
    margin-right: 4px;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .2; }
}

/* Прогноз ячейка */
.pred-form {
    display: flex;
    align-items: center;
    gap: .3rem;
    justify-content: center;
}
.score-input {
    display: flex;
    align-items: center;
    gap: .15rem;
}
.score-inp {
    width: 36px;
    text-align: center;
    padding: .25rem .1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: .85rem;
    -moz-appearance: textfield;
}
.score-inp::-webkit-outer-spin-button,
.score-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-inp:focus { border-color: var(--accent); outline: none; }

.pred-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
}
.pred-score {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: .92rem;
}
.pred-pts {
    font-size: .7rem;
    font-weight: 700;
    border-radius: 10px;
    padding: .05rem .3rem;
}
.pred-hidden  { color: var(--text-muted); font-size: 1rem; }
.pred-empty   { color: var(--border); }

/* Подсветка очков */
.hl-3 { background: var(--green-dim) !important; }
.hl-3 .pred-score { color: var(--green); }
.hl-1 { background: var(--yellow-dim) !important; }
.hl-1 .pred-score { color: var(--yellow); }
.hl-0 { background: var(--red-dim) !important; }
.hl-0 .pred-score { color: var(--text-muted); }

.pts-3 { background: var(--green-dim); color: var(--green); }
.pts-1 { background: var(--yellow-dim); color: var(--yellow); }
.pts-0 { color: var(--text-muted); }
.pts-live { animation: pulse .8s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .6; }
}

/* CTA box */
.cta-box {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 2rem;
}
.cta-box p { color: var(--text-muted); margin-bottom: 1rem; }

/* ─── Leaderboard ───────────────────────────────────────────────────────────── */
.leaderboard {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.lb-row {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color .15s;
}
.lb-row:hover { border-color: var(--accent); }
.lb-first { border-color: #c09d0066; background: #2a200a; }
.lb-me { border-color: var(--accent); }
.lb-rank { font-size: 1.5rem; min-width: 2rem; text-align: center; }
.lb-name { flex: 1; font-weight: 600; font-size: 1.05rem; }
.streak-badge {
    background: #7f1d1d;
    color: #fca5a5;
    border-radius: 10px;
    font-size: .75rem;
    padding: .1rem .4rem;
    margin-left: .4rem;
}
.lb-stats { display: flex; align-items: center; gap: 1rem; }
.lb-pts { font-size: 1.4rem; font-weight: 800; color: var(--accent-2); }
.lb-pts small { font-size: .65rem; color: var(--text-muted); font-weight: 400; display: block; }
.lb-exact { color: var(--text-muted); font-size: .85rem; }

/* ─── Stats Grid ────────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.stat-name {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-rank {
    background: var(--bg-3);
    border-radius: var(--radius-sm);
    padding: .1rem .4rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.stat-total {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-2);
    margin: .4rem 0;
}
.stat-rows { display: flex; flex-direction: column; gap: .4rem; }
.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: var(--text-muted);
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { color: var(--text); font-weight: 600; }

/* ─── Admin Page ────────────────────────────────────────────────────────────── */
.page-admin { }
.tabs-admin { gap: .5rem; }
.admin-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.admin-section h3 { font-size: 1rem; margin-bottom: 1rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.admin-table th,
.admin-table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.admin-table th {
    background: var(--bg-3);
    font-weight: 600;
    font-size: .8rem;
    color: var(--text-muted);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: .4rem; }

.form-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: start;
}

/* Статус чип */
.status-chip {
    border-radius: 10px;
    padding: .15rem .5rem;
    font-size: .78rem;
    font-weight: 600;
}
.status-upcoming { background: #1e3a5f; color: #93c5fd; }
.status-live     { background: #3b0f0f; color: #fca5a5; animation: blink 1s infinite; }
.status-finished { background: var(--green-dim); color: var(--green); }

.action-chip {
    border-radius: 10px;
    padding: .1rem .5rem;
    font-size: .78rem;
}
.action-create { background: var(--green-dim); color: var(--green); }
.action-update { background: var(--yellow-dim); color: var(--yellow); }

/* Результаты */
.results-list { display: flex; flex-direction: column; gap: .6rem; }
.result-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .5rem .75rem;
    background: var(--bg-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.result-match { flex: 1; font-weight: 500; min-width: 160px; }
.result-date  { color: var(--text-muted); font-size: .85rem; min-width: 60px; }
.result-row .score-input input {
    width: 42px;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: .3rem;
    font-size: .9rem;
}
.result-row select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: .3rem .5rem;
    font-size: .82rem;
}
.api-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.api-section h3 { margin-bottom: .75rem; }
.hint { color: var(--text-muted); font-size: .85rem; margin-bottom: 1rem; }
.hint code {
    background: var(--bg-3);
    padding: .1rem .3rem;
    border-radius: 3px;
}
.logs-table { font-size: .82rem; }

/* ─── Score Bar ──────────────────────────────────────────────────────────────── */
.score-bar {
    background: linear-gradient(135deg, #13103a 0%, #1a1040 100%);
    border-bottom: 1px solid #4c1d95;
    padding: .6rem 0;
    position: sticky;
    top: 48px;
    z-index: 90;
}
.score-bar-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.sb-left {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}
.sb-score {
    font-size: 1.8rem;
    font-weight: 900;
    color: #a78bfa;
    line-height: 1;
    transition: color .3s;
    display: inline-block;
}
.sb-score.score-pop {
    animation: score-pop .5s ease;
}
@keyframes score-pop {
    0%   { transform: scale(1);    color: #a78bfa; }
    40%  { transform: scale(1.35); color: #22c55e; }
    100% { transform: scale(1);    color: #a78bfa; }
}
.sb-label { color: #7c3aed; font-size: .85rem; font-weight: 600; }
.sb-rank {
    background: #4c1d95;
    color: #c4b5fd;
    border-radius: 20px;
    padding: .1rem .5rem;
    font-size: .78rem;
    font-weight: 700;
}
.sb-leader {
    color: #8b949e;
    font-size: .85rem;
    flex: 1;
}
.sb-leader strong { color: #e6edf3; }

.btn-pulse {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    animation: pulse-btn 2s infinite;
}
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 #7c3aed66; }
    50%       { box-shadow: 0 0 0 7px #7c3aed00; }
}

/* ─── Day Pts Badge ──────────────────────────────────────────────────────────── */
.day-pts-badge {
    font-size: .78rem;
    font-weight: 700;
    border-radius: 20px;
    padding: .15rem .6rem;
    margin-left: auto;
}
.day-pts-great { background: #16532466; color: #4ade80; border: 1px solid #22c55e44; }
.day-pts-ok    { background: #42360a44; color: #facc15; border: 1px solid #eab30844; }
.day-pts-low   { background: #1f2937;   color: #6b7280; border: 1px solid #374151; }
.day-label-text { flex: 0 0 auto; }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: #000000bb;
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in .2s ease;
}
.modal-overlay[hidden] { display: none !important; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: #161b22;
    border: 1px solid #4c1d95;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px #0009;
    animation: slide-up .25s ease;
}
@keyframes slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}
.modal-title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.modal-subtitle { color: var(--text-muted); font-size: .88rem; margin: .2rem 0 0; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.3rem; cursor: pointer; padding: .1rem .4rem;
    border-radius: 6px; line-height: 1;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }

.modal-body {
    overflow-y: auto;
    padding: 1rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    flex-shrink: 0;
}

/* Карточка матча в модале */
.pred-card {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: border-color .2s, opacity .3s;
}
.pred-card.card-done {
    border-color: var(--green);
    opacity: .7;
}
.pred-card.card-done .pred-card-inputs { display: none; }
.pred-card-meta {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: .6rem;
}
.pred-card-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}
.pred-card-team {
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
    text-align: center;
    line-height: 1.3;
}
.pred-card-team:first-child { text-align: right; }
.pred-card-team:last-child  { text-align: left; }
.pred-card-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.score-inp-big {
    width: 52px;
    height: 52px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    -moz-appearance: textfield;
    transition: border-color .2s;
}
.score-inp-big:focus { border-color: var(--accent); outline: none; }
.score-inp-big::-webkit-outer-spin-button,
.score-inp-big::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-sep-big {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-muted);
}
.pred-card-btn {
    margin-top: .65rem;
    width: 100%;
    justify-content: center;
}
.pred-card-status {
    text-align: center;
    font-size: .85rem;
    margin-top: .5rem;
    min-height: 1.2rem;
}

@media (max-width: 480px) {
    .modal-box { border-radius: 16px 16px 0 0; align-self: flex-end; max-height: 95vh; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .score-bar { top: 44px; }
    .sb-leader { display: none; }
}

/* API Search */
.api-search-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.api-search-bar .form-group { flex: 1; min-width: 130px; }
.hint-inline { color: var(--text-muted); font-size: .8rem; font-weight: 400; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: .82rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ─── Utility ───────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ─── Toast notification ────────────────────────────────────────────────────── */
#toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem 1.25rem;
    font-size: .9rem;
    color: var(--text);
    box-shadow: var(--shadow);
    z-index: 9999;
    transition: transform .25s ease;
    pointer-events: none;
    white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.toast-ok  { border-color: var(--green); color: var(--green); }
#toast.toast-err { border-color: var(--red);   color: var(--red);   }

/* ─── Mobile adjustments ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .header-inner { gap: .4rem; }
    .room-name-chip { display: none; }
    .main-content { padding: 1rem .5rem; }
    .lb-stats { gap: .5rem; }
    .lb-pts { font-size: 1.1rem; }
    .preds-table { font-size: .8rem; }
    .score-inp { width: 30px; font-size: .78rem; }
    .col-date { display: none; }
    .stat-card { padding: 1rem; }
    .result-row { flex-direction: column; align-items: flex-start; }
}
