/* ============================================================
   Preds — Main Stylesheet
   Dark pitch theme (A+C blend)
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #0f1e17;
    --bg-deep:      #0a1610;
    --bg-card:      #0a1610;
    --bg-raised:    #132212;
    --border:       #1a3626;
    --border-mid:   #234d35;
    --green:        #22c55e;
    --green-bright: #4ade80;
    --green-muted:  #4a7c5e;
    --green-dim:    #2d5e40;
    --text:         #e2f5ea;
    --text-muted:   #8ab89a;
    --text-dim:     #4a7c5e;
    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Typography ───────────────────────────────────────────── */
h1    { font-size: 22px; font-weight: 500; color: var(--text); }
h2    { font-size: 18px; font-weight: 500; color: var(--text); }
h3    { font-size: 16px; font-weight: 500; color: var(--text); }
p     { color: var(--text-muted); font-size: 15px; }
a     { color: var(--green-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 13px; color: var(--text-dim); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 80px;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 54px;
}

.site-header__row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-header__row2 {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@media (min-width: 500px) {
    .site-header__inner {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .site-header__row1 {
        flex: 1;
        min-width: 0;
    }
    .site-header__row2 {
        flex-shrink: 0;
    }
}

.site-header__back {
    color: var(--green-muted);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}
.site-header__back:hover { color: var(--green-bright); text-decoration: none; }

.site-header__logo {
    font-size: 20px;
    font-weight: 500;
    color: var(--green-bright);
    text-decoration: none;
    flex-shrink: 0;
}
.site-header__logo:hover { text-decoration: none; }

.site-header__title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    display: inline;
}

.site-header__subtitle {
    font-size: 13px;
    color: var(--text-dim);
    display: inline;
}

.site-header__subtitle::before {
    content: ' · ';
    color: var(--border-mid);
}

.site-header__title-block {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-header__nav {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.nav-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--green-muted);
    font-size: 20px;
    text-decoration: none;
}
.nav-icon:hover  { background: var(--bg-raised); color: var(--green-bright); text-decoration: none; }
.nav-icon.active { color: var(--green-bright); }
.nav-icon svg    { width: 20px; height: 20px; min-width: 20px; min-height: 20px; display: block; }

/* ── Page title block ─────────────────────────────────────── */
.page-title        { padding: 20px 0 16px; }
.page-title h1     { margin-bottom: 4px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.card--raised { background: var(--bg-raised); }

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}
.btn:hover  { opacity: .9; text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn--primary   { background: var(--green);      color: var(--bg-deep); }
.btn--secondary { background: var(--bg-raised);  color: var(--text); border: 1px solid var(--border-mid); }
.btn--ghost     { background: transparent;        color: var(--green-bright); border: 1px solid var(--border); }
.btn--danger    { background: #7f1d1d;            color: #fca5a5; }
.btn--full      { width: 100%; }
.btn--sm        { padding: 7px 14px; font-size: 13px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 10px 13px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); }
input::placeholder { color: var(--text-dim); }

/* datetime-local calendar icon colour */
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.6); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert--success { background: #052e16; color: #86efac; border: 1px solid #166534; }
.alert--error   { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert--info    { background: #0a1e2e; color: #7dd3fc; border: 1px solid #0c4a6e; }
.alert--warning { background: #1c1007; color: #fde68a; border: 1px solid #78350f; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
}
.badge--green { background: #052e16;         color: #4ade80; }
.badge--amber { background: #1c1007;         color: #fbbf24; }
.badge--red   { background: #450a0a;         color: #fca5a5; }
.badge--gray  { background: var(--bg-raised); color: var(--text-muted); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Bottom nav ───────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
    z-index: 100;
}
.bottom-nav__inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
}
.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 10px;
    gap: 3px;
}
.bottom-nav__item svg    { width: 22px; height: 22px; }
.bottom-nav__item.active { color: var(--green-bright); }
.bottom-nav__item:hover  { color: var(--green-muted); text-decoration: none; }

/* ── Score input (predictions page) ──────────────────────── */
.score-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.score-input__btn {
    background: var(--bg-raised);
    border: 1px solid var(--border-mid);
    color: var(--green-bright);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .1s;
    flex-shrink: 0;
}
.score-input__btn:hover  { background: var(--border); }
.score-input__btn:active { transform: scale(.94); }
.score-input__num {
    color: var(--text);
    font-size: 22px;
    font-weight: 500;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.score-input__divider {
    background: var(--border-mid);
    width: 1px;
    height: 28px;
    margin: 0 2px;
    flex-shrink: 0;
}

/* ── Fixture card ─────────────────────────────────────────── */
.fixture-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.fixture-card--locked  { opacity: 0.6; }
.fixture-card--special { border-color: var(--border-mid); }
.fixture-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}
.fixture-team {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}
.fixture-team--away { text-align: right; }
.fixture-kickoff {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    flex-shrink: 0;
}

/* ── Leaderboard table ────────────────────────────────────── */
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.leaderboard th {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 4px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.leaderboard th:not(:first-child) { text-align: center; }
.leaderboard td {
    padding: 2px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}
.leaderboard td:not(:first-child)  { text-align: center; }
.leaderboard td:nth-child(2) { text-align: left; white-space: normal; }
.leaderboard tr:last-child td      { border-bottom: none; }
.leaderboard tr.is-me td           { color: var(--text); background: var(--bg-raised); }
.leaderboard__pos  { color: var(--text-dim); font-size: 13px; width: 28px; }
.leaderboard__name { font-weight: 500; color: var(--text); }
.leaderboard__pts  { color: var(--green-bright); font-weight: 500; font-size: 16px; }

/* ── Utility ──────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-green   { color: var(--green-bright); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-2 { gap: 16px; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Flash messages ───────────────────────────────────────── */
.flash           { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin: 12px 0 0; }
.flash--success  { background: #052e16; color: #86efac; }
.flash--error    { background: #450a0a; color: #fca5a5; }

img.emoji {
    height: 1em;
    width: 1em;
    vertical-align: -0.1em;
}