:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --accent: #00c48c;
    --accent-dim: rgba(0, 196, 140, 0.12);
    --text: #e8eaf0;
    --muted: #7a7f96;
    --loss: #ff5c7a;
    --win: #00c48c;
    --tab-h: 44px;
    --radius: 10px;
}
:root.light {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --border: #dde1e9;
    --accent: #007f5f;
    --accent-dim: rgba(0, 127, 95, 0.08);
    --text: #111318;
    --muted: #6b7280;
    --loss: #dc2626;
    --win: #007f5f;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    min-height: 100vh;
    padding-bottom: 48px;
    transition:
        background 0.2s,
        color 0.2s;
}
.shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

header {
    padding: 20px 20px 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
header h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}
header span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    flex: 1;
}

.theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition:
        color 0.15s,
        border-color 0.15s;
    white-space: nowrap;
}
.theme-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    padding: 14px 20px 0;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    flex: 1;
    height: var(--tab-h);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition:
        color 0.15s,
        border-color 0.15s;
    padding: 0 4px;
    white-space: nowrap;
}
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab:hover:not(.active) {
    color: var(--text);
}

/* ── Panels ── */
.panel {
    display: none;
    padding: 20px;
}
.panel.active {
    display: block;
}
.panel-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.inputs-col,
.results-col {
    width: 100%;
}

/* ── Form ── */
.field {
    margin-bottom: 14px;
}
.field:last-child {
    margin-bottom: 0;
}
.field label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}
.field input,
.field select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    padding: 10px 12px;
    border-radius: var(--radius);
    outline: none;
    transition:
        border-color 0.15s,
        background 0.2s,
        color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.field input:focus,
.field select:focus {
    border-color: var(--accent);
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}
.row {
    display: flex;
    gap: 10px;
}
.row .field {
    flex: 1;
    margin-bottom: 14px;
}

.inputs-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition:
        background 0.2s,
        border-color 0.2s;
}
.inputs-card-title {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

/* ── Results ── */
.results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition:
        background 0.2s,
        border-color 0.2s;
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.res-item {
    background: var(--bg);
    border-radius: 8px;
    padding: 10px 12px;
    transition: background 0.2s;
}
.res-item .label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.res-item .value {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.value.pos {
    color: var(--win);
}
.value.neg {
    color: var(--loss);
}
.value.neu {
    color: var(--text);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.highlight-row {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 127, 95, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
}
.highlight-row:hover {
    border-color: rgba(0, 127, 95, 0.5);
}
.highlight-row .label {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.highlight-row .value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.value-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.copy-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--accent);
    opacity: 0.4;
    transition:
        opacity 0.15s,
        background 0.15s;
    flex-shrink: 0;
}
.highlight-row:hover .copy-hint {
    opacity: 1;
    background: var(--accent-dim);
}
.copy-hint.copied {
    opacity: 1;
    background: var(--accent-dim);
}
.copy-hint svg {
    width: 15px;
    height: 15px;
}

.section-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.empty-state {
    text-align: center;
    padding: 32px 0;
    color: var(--muted);
    font-size: 13px;
}
.empty-state .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.info-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.info-pill {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--muted);
    transition: background 0.2s;
}
.info-pill span {
    color: var(--text);
    font-weight: 600;
}

/* ── Boost presets ── */
.boost-presets {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.boost-btn {
    flex: 1;
    padding: 8px 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.boost-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}
.boost-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.boosted-odds-display {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.boosted-odds-display .bod-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.boosted-odds-display .bod-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* ── Mode toggle ── */
.mode-toggle {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 14px;
    transition: background 0.2s;
}
.mode-btn {
    flex: 1;
    padding: 7px 4px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    transition:
        background 0.15s,
        color 0.15s;
    letter-spacing: 0.2px;
}
.mode-btn.active {
    background: var(--surface);
    color: var(--text);
}
.mode-btn.active.mode-under {
    color: #d97706;
}
.mode-btn.active.mode-over {
    color: #2563eb;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.mode-badge.under {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.3);
}
.mode-badge.over {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ── One-liners ── */
.one-liner {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}
.liner-bad {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.liner-ok {
    background: rgba(107, 114, 128, 0.08);
    color: var(--muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}
.liner-good {
    background: rgba(0, 127, 95, 0.08);
    color: #007f5f;
    border: 1px solid rgba(0, 127, 95, 0.2);
}
.liner-great {
    background: rgba(217, 119, 6, 0.08);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
}
.liner-legendary {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* ── Desktop ── */
@media (min-width: 680px) {
    header {
        padding: 28px 24px 0;
    }
    header h1 {
        font-size: 20px;
    }
    .tabs {
        padding: 16px 24px 0;
    }
    .tab {
        font-size: 14px;
        max-width: 160px;
        flex: none;
    }
    .panel {
        padding: 24px;
    }
    .panel-inner {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }
    .inputs-col {
        width: 340px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
    }
    .results-col {
        flex: 1;
        min-width: 0;
    }
    .res-item .value {
        font-size: 20px;
    }
    .highlight-row .value {
        font-size: 26px;
    }
}

@media (hover: none) {
    .copy-hint {
        opacity: 1;
    }
}
