:root {
    --bg: #0f1115;
    --panel: #151923;
    --muted: #a9b0c0;
    --ink: #e9ecf1;
    --accent: #7a5cff;
    --accent-2: #b794ff;
    --line: #262c3a;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    padding: 20px;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px
}

/* Header */
.header {
    display: grid;
    grid-template-columns:160px 1fr 160px auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--panel);
}

.team-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    color: var(--muted);
}

.scoreboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px
}

.minute-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
    color: var(--muted);
}

.score {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 1px
}

.teams {
    color: var(--muted)
}

/* Ticker */
.ticker {
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--muted);
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

button {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    background: #1d2230;
    color: var(--ink);
    transition: transform .06s ease, filter .15s ease;
}

button:hover {
    filter: brightness(1.08)
}

button:active {
    transform: translateY(1px)
}

.hidden {
    display: none !important
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px
}

.tab-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
}

.tab-btn.active {
    border-color: var(--accent);
    color: var(--ink)
}

.tab-btn:disabled {
    opacity: .4;
    cursor: not-allowed
}

/* Panels */
.tab-panels {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 16px
}

.tab-panel {
    display: none
}

.tab-panel.active {
    display: block
}

.box {
    background: #0e121a;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    max-height: 420px;
    overflow: auto;
}

/* светлая тема: светлый трек */
body[data-theme="light"] .stat-bar {
    background: #eef1f8;
    border-color: #d9deea;
}

body[data-theme="light"] .stat-bar::after {
    background: rgba(0, 0, 0, .08);
}

/* Details bottom */
.details {
    display: flex;
    flex-direction: column;
    gap: 10px
}

/* светлая тема */
body[data-theme="light"] {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --ink: #161a22;
    --muted: #5a6377;
    --line: #e7e9f0;
    --accent: #5b6cff;
    --accent-2: #9aa6ff;
}

body[data-theme="light"] .tab-panels,
body[data-theme="light"] .header,
body[data-theme="light"] .ticker {
    background: #ffffff;
    border-color: #e7e9f0;
}

body[data-theme="light"] .box {
    background: #ffffff;
    color: #161a22;
    border-color: #e7e9f0;
}

body[data-theme="light"] button {
    background: #eef1f8;
    color: #161a22;
}

body[data-theme="light"] .bar {
    background: #eef1f8;
    border-color: #d9deea;
}

body[data-theme="light"] .stat-num {
    color: #1a2130;
    opacity: 1;
}

.theme-toggle {
    margin-left: auto;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    justify-self: end;
}