:root {
    --ink: #14304c;
    --muted: #5f7490;
    --line: #b9e3d8;
    --line-strong: #8fd5c2;
    --paper: #f4fbf8;
    --card: #eef8f3;
    --panel: #ffffff;
    --mint: #dff6ec;
    --mint-strong: #149a72;
    --blue: #1d4f9f;
    --blue-soft: #e9f0ff;
    --yellow: #f2c75c;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(31, 141, 111, 0.12), transparent 360px),
        linear-gradient(180deg, #f9fdfb, #eef8f3);
}

button,
input {
    font: inherit;
}

input {
    width: 100%;
    min-height: 54px;
    border: 1px solid #b7d8ee;
    border-radius: 18px;
    padding: 10px 16px;
    background: #fff;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

input:focus {
    outline: none;
    border-color: #78c8b0;
    box-shadow: 0 0 0 3px rgba(20, 154, 114, 0.14);
}

button,
.sync-link {
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    padding: 0 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ghost-button {
    background: var(--blue-soft);
    color: var(--blue);
}

.app-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 60px;
}

.hero {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border-radius: 20px;
    background: #0f7c58;
    box-shadow: 0 18px 52px rgba(20, 53, 42, 0.14);
    display: flex;
    align-items: end;
    padding: 30px;
}

.hero__media {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 22%, rgba(242, 199, 92, 0.95) 0 60px, transparent 62px),
        linear-gradient(140deg, rgba(15, 124, 88, 0.94), rgba(8, 87, 61, 0.96));
}

.field-lines {
    position: absolute;
    inset: 18px;
    border: 2px solid rgba(255, 255, 255, 0.16);
}

.flag-shape {
    position: absolute;
    right: 72px;
    top: 60px;
    width: 150px;
    aspect-ratio: 1;
    transform: rotate(45deg);
    background: rgba(242, 199, 92, 0.82);
}

.flag-shape::after {
    content: "";
    position: absolute;
    inset: 38px;
    border-radius: 999px;
    background: var(--blue);
}

.hero__content {
    position: relative;
    max-width: 680px;
    color: #fff;
}

.hero__content h1 {
    margin: 0;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 0.95;
}

.hero__content p:last-child {
    max-width: 600px;
    font-size: 18px;
    line-height: 1.55;
}

.eyebrow,
.muted {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
}

.hero .eyebrow {
    color: rgba(255, 255, 255, 0.8);
}

.notice,
.login-panel,
.section-title,
.rules-card,
.match-card,
.ranking-row {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.notice {
    margin: 18px 0;
    padding: 14px 16px;
    background: #fff7d8;
    border-color: #f2d77a;
    font-weight: 800;
}

.login-panel {
    margin: 18px 0;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.login-panel div,
.ranking-row div {
    display: grid;
    gap: 4px;
}

.login-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
}

.tabs a {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tabs a.active {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.section-title {
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.section-title h2,
.rules-card__head h3 {
    margin: 4px 0 0;
    font-size: clamp(24px, 4vw, 34px);
}

.points-pill,
.meta-pill,
.score-badge,
.summary-pill strong {
    border-radius: 999px;
    font-weight: 900;
}

.points-pill {
    background: var(--blue-soft);
    color: var(--blue);
    padding: 10px 14px;
}

.matches,
.scoreboard {
    display: grid;
    gap: 16px;
}

.rules-card {
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #f4fbf8);
}

.rules-table {
    display: grid;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.rules-table__row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.rules-table__row:first-child {
    border-top: 0;
}

.rules-table__row--head {
    background: #eff8f3;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.rules-table__row strong {
    justify-self: end;
}

.match-card {
    padding: 18px;
    background: linear-gradient(180deg, #eef8f3, #f7fcfa);
}

.match-card.is-saved {
    border-color: var(--line-strong);
    box-shadow: 0 16px 40px rgba(20, 154, 114, 0.12);
}

.match-card.is-slot {
    border-style: dashed;
}

.match-card__header {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-pill {
    min-height: 36px;
    padding: 8px 14px;
    background: #edf0f8;
    color: #3d5675;
    display: inline-flex;
    align-items: center;
}

.meta-pill--saved {
    background: var(--mint);
    color: var(--mint-strong);
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
}

.match-teams strong:last-child {
    text-align: right;
}

.match-teams span {
    color: var(--ink);
}

.prediction-form {
    display: grid;
    gap: 16px;
}

.score-section {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.score-section__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.score-section__title h3 {
    margin: 0;
    font-size: 22px;
    color: var(--ink);
}

.score-section__title span {
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--mint);
    color: var(--mint-strong);
    font-weight: 900;
}

.display-board {
    min-height: 94px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 16px 22px;
}

.display-board--official {
    border-color: #b5d3ef;
    background: #fbfefd;
}

.display-board strong {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.big-score {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    font-size: clamp(34px, 6vw, 52px);
    line-height: 1;
    font-weight: 950;
    color: #071d38;
}

.big-score span:last-child {
    text-align: right;
}

.big-score b {
    font-size: 0.75em;
}

.waiting-score {
    text-align: center;
    color: var(--blue);
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 950;
}

.edit-score-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}

.edit-score-row span {
    color: var(--ink);
    font-size: 24px;
    font-weight: 950;
}

.official-editor {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
}

.official-editor summary {
    cursor: pointer;
    padding: 12px 14px;
    color: var(--blue);
    font-weight: 900;
    text-align: center;
}

.official-editor .edit-score-row {
    padding: 0 14px 14px;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-pill {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 16px;
    display: grid;
    gap: 8px;
}

.summary-pill span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
}

.summary-pill strong {
    justify-self: start;
    background: var(--blue-soft);
    color: var(--blue);
    padding: 8px 12px;
}

.summary-pill--total {
    background: #e7f8f0;
    border-color: var(--line-strong);
}

.summary-pill--total strong {
    background: var(--mint);
    color: var(--mint-strong);
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-actions button {
    min-height: 56px;
    font-size: 20px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.ranking-row span,
.ranking-row small,
.empty {
    color: var(--muted);
}

.ranking-row b {
    font-size: 24px;
    color: var(--mint-strong);
}

.rank {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--yellow);
    display: grid;
    place-items: center;
    font-weight: 900;
}

@media (max-width: 860px) {
    .app-shell {
        width: min(100% - 18px, 1120px);
    }

    .hero {
        min-height: 340px;
        padding: 22px;
    }

    .flag-shape {
        width: 120px;
        right: 30px;
        top: 48px;
    }

    .login-panel,
    .section-title,
    .score-section__title {
        align-items: stretch;
        flex-direction: column;
    }

    .login-form,
    .summary-strip,
    .rules-table__row,
    .match-teams,
    .form-actions {
        grid-template-columns: 1fr;
    }

    .match-teams strong:last-child {
        text-align: left;
    }

    .rules-table__row strong {
        justify-self: start;
    }
}

@media (max-width: 520px) {
    .tabs,
    .login-form {
        grid-template-columns: 1fr;
    }

    .score-section__title h3,
    .rules-card__head h3 {
        font-size: 24px;
    }

    .edit-score-row {
        gap: 8px;
    }

    .display-board {
        padding: 14px;
    }
}
