:root {
    --bg: #f4f7f2;
    --ink: #132017;
    --muted: #627066;
    --line: #dce4dc;
    --panel: #fff;
    --green: #147a4a;
    --green-dark: #0d5736;
    --red: #b3261e;
    --gold: #d4a02a;
    --blue: #2f63a8;
    --shadow: 0 18px 44px rgba(19, 32, 23, .09);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: var(--green-dark); font-weight: 800; text-decoration: none; }
button, input, select { font: inherit; }
input, select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
}
label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    background: var(--green);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
.button.secondary { background: #e9efe9; color: var(--ink); }
.site-header, .site-footer, main {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
}
.site-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 20px;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.nav-button { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; }
.inline-form { margin: 0; }
.link-button { min-height: 0; padding: 0; background: transparent; color: var(--green-dark); }
.flash {
    width: min(1180px, calc(100vw - 32px));
    margin: 8px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff6df;
    color: #6c4a00;
    border: 1px solid #f0d89b;
    font-weight: 800;
}
.flash.error { background: #fdecea; color: #7c1b16; border-color: #f3bbb7; }
.hero {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(300px, .95fr);
    gap: 28px;
    align-items: center;
    padding: 34px 0 54px;
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 900;
    font-size: 12px;
}
h1 { margin: 0 0 16px; font-size: clamp(42px, 7vw, 76px); line-height: .95; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 24px; }
p { color: var(--muted); line-height: 1.65; }
.hero-copy p:not(.eyebrow) { max-width: 640px; font-size: 19px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-media {
    position: relative;
    min-height: 520px;
}
.hero-media img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: block;
}
.hero-board {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    border-radius: 8px;
    background: #10261a;
    color: #fff;
    padding: 16px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}
.scoreline, .rank {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.09);
}
.scoreline strong { color: var(--gold); font-size: 34px; }
.rank { grid-template-columns: 42px 1fr auto; }
.rank span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--green);
}
.rank em { color: #cce7d6; font-style: normal; font-weight: 800; }
.section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.section-grid article, .panel, .content-band, .stat-grid article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
}
.icon { color: var(--green); font-weight: 900; }
.content-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 42px;
}
.auth-shell {
    min-height: 620px;
    display: grid;
    place-items: center;
}
.auth-shell .panel { width: min(440px, 100%); display: grid; gap: 14px; }
.muted { font-size: 14px; }
.app-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 18px;
    align-items: start;
    padding-bottom: 44px;
}
.sidebar { display: grid; gap: 14px; position: sticky; top: 16px; }
.compact { padding: 16px; display: grid; gap: 12px; }
.group-button {
    width: 100%;
    min-height: 62px;
    display: grid;
    gap: 4px;
    justify-items: start;
    margin-bottom: 8px;
    background: #edf4ef;
    color: var(--ink);
    text-align: left;
}
.group-button.active { background: var(--green-dark); color: #fff; }
.group-button small { opacity: .78; }
.workspace { display: grid; gap: 14px; min-width: 0; }
.dashboard-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.stat-grid strong { display: block; font-size: 30px; }
.stat-grid span { color: var(--muted); font-weight: 800; }
.table { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.table-row {
    display: grid;
    grid-template-columns: 70px 1fr 100px 90px;
    gap: 10px;
    padding: 13px 14px;
    border-top: 1px solid var(--line);
    align-items: center;
}
.table-row:first-child { border-top: 0; }
.table-row.head { background: #edf4ef; font-weight: 900; }
.match-list { display: grid; gap: 10px; }
.match-row {
    display: grid;
    grid-template-columns: 92px 1fr 172px 118px;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}
.match-meta { color: var(--muted); font-size: 13px; font-weight: 800; }
.tip-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}
.tip-inputs input { text-align: center; }
.pill {
    justify-self: end;
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--blue);
    background: #eaf0ff;
    font-size: 12px;
    font-weight: 900;
}
.pill.done { color: var(--green-dark); background: #e9f7ef; }
.form-grid { display: grid; gap: 14px; }
.text-page {
    max-width: 840px;
    padding: 80px 0;
}
.text-content {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.site-footer {
    min-height: 120px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
code {
    padding: 2px 6px;
    border-radius: 4px;
    background: #edf4ef;
    color: var(--ink);
}
@media (max-width: 900px) {
    .site-header, .site-footer { flex-direction: column; align-items: flex-start; padding: 16px 0; }
    .hero, .section-grid, .app-layout, .stat-grid { grid-template-columns: 1fr; }
    .hero { min-height: auto; }
    .hero-media, .hero-media img { min-height: 420px; height: 420px; }
    h1 { font-size: 42px; }
    .sidebar { position: static; }
    .dashboard-head, .content-band { flex-direction: column; align-items: flex-start; }
    .match-row { grid-template-columns: 1fr; }
    .pill { justify-self: start; }
    .table-row { grid-template-columns: 48px 1fr 72px 64px; }
}
