:root {
    --bg: #f4f8ee;
    --card: #ffffff;
    --ink: #142614;
    --muted: #496349;
    --primary: #2f7d32;
    --primary-strong: #1f5c24;
    --accent: #f28c28;
    --line: #d9e7d3;
    --error: #a72b2b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 15%, rgba(47, 125, 50, 0.2), transparent 30%),
        radial-gradient(circle at 85% 80%, rgba(242, 140, 40, 0.18), transparent 28%),
        var(--bg);
}

.background-shape {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(2px);
}

.shape-one {
    width: 240px;
    height: 240px;
    left: -80px;
    top: 70px;
    background: rgba(47, 125, 50, 0.14);
}

.shape-two {
    width: 280px;
    height: 280px;
    right: -90px;
    bottom: -80px;
    background: rgba(242, 140, 40, 0.17);
}

.site-header {
    max-width: 1060px;
    margin: 0 auto;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.45rem;
    text-decoration: none;
    color: var(--primary-strong);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav a,
.text-button {
    color: var(--ink);
    text-decoration: none;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.inline-form {
    margin: 0;
}

.page-shell {
    max-width: 1060px;
    margin: 0 auto;
    padding: 20px 18px 44px;
}

.hero h1,
.panel h1,
.action-card h2 {
    font-family: "Fraunces", Georgia, serif;
    margin-top: 0;
}

.hero {
    margin: 18px 0 34px;
    animation: reveal 500ms ease;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary-strong);
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: clamp(1.95rem, 5vw, 3.1rem);
    margin: 0;
    max-width: 18ch;
}

.lead {
    color: var(--muted);
    max-width: 60ch;
}

.grid-two {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.action-card,
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(20, 38, 20, 0.08);
    animation: reveal 600ms ease;
}

.action-card p {
    color: var(--muted);
}

.button {
    display: inline-block;
    border: 0;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.button:hover {
    background: var(--primary-strong);
}

.button-alt {
    background: var(--accent);
    color: #1e1407;
}

.button-alt:hover {
    background: #dc7e23;
}

.panel {
    max-width: 650px;
}

.form-stack {
    margin-top: 14px;
    display: grid;
    gap: 14px;
}

.form-row {
    display: grid;
    gap: 8px;
}

.form-row span {
    font-weight: 600;
}

.choice-group {
    border: 0;
    margin: 0;
    padding: 0;
}

.choice-group legend {
    font-weight: 600;
    margin-bottom: 6px;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.choice-row input[type="radio"],
.choice-input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.readonly-row strong {
    font-size: 1.05rem;
}

.form-input {
    width: 100%;
    border: 1px solid #b8ccb1;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row select,
.form-row textarea {
    width: 100%;
    border: 1px solid #b8ccb1;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.form-row input[type="date"] {
    width: auto;
    max-width: 100%;
}

.form-input:focus {
    outline: 2px solid rgba(47, 125, 50, 0.23);
    border-color: var(--primary);
}

.form-row input:not([type="checkbox"]):not([type="radio"]):focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: 2px solid rgba(47, 125, 50, 0.23);
    border-color: var(--primary);
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-checkbox {
    width: 18px;
    height: 18px;
}

.error {
    color: var(--error);
}

.error-box {
    background: #fff4f4;
    color: var(--error);
    border: 1px solid #f2caca;
    border-radius: 10px;
    padding: 10px 12px;
}

.success-panel {
    text-align: center;
}

.ladder-panel {
    max-width: 760px;
}

.matches-panel {
    max-width: 920px;
}

.match-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.matches-scroll {
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 4px;
}

.match-list {
    display: grid;
    gap: 10px;
}

.match-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fbfef9;
}

.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: var(--muted);
}

.winner-row,
.loser-row {
    margin: 4px 0;
}

.winner-row {
    font-weight: 700;
}

.standings-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.standing-row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #fbfef9;
}

.rank-pill {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.standing-row h2 {
    margin: 0;
    font-size: 1.02rem;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.standing-row p {
    margin: 2px 0 0;
    color: var(--muted);
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 680px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        gap: 12px;
        flex-wrap: wrap;
    }
}
