:root {
    --ink: #12212f;
    --paper: #f5f1e8;
    --paper-strong: #fffaf2;
    --accent: #0c7c59;
    --accent-dark: #08563f;
    --accent-soft: #d6f0e7;
    --line: #d8d0c2;
    --warning: #8a2d1c;
    --shadow: 0 18px 40px rgba(18, 33, 47, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(12, 124, 89, 0.08), transparent 30%),
        linear-gradient(180deg, #f9f5ec 0%, #efe6d7 100%);
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    padding: 0.18rem 0.38rem;
    border-radius: 0.4rem;
    background: rgba(12, 124, 89, 0.08);
    font-size: 0.94rem;
}

.copy-code-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.45rem;
    border: 1px solid rgba(12, 124, 89, 0.16);
    border-radius: 0.45rem;
    background: rgba(12, 124, 89, 0.08);
    color: var(--accent-dark);
    font: inherit;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.94rem;
    line-height: 1.2;
    cursor: pointer;
}

.copy-code-button:hover,
.copy-code-button:focus-visible {
    background: rgba(12, 124, 89, 0.14);
    text-decoration: none;
}

.copy-code-button:focus-visible {
    outline: 2px solid rgba(12, 124, 89, 0.35);
    outline-offset: 2px;
}

.wrap {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(249, 245, 236, 0.82);
    border-bottom: 1px solid rgba(18, 33, 47, 0.08);
}

.header-row,
.page-heading,
.panel-header,
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 1rem 0;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page-shell {
    padding: 2rem 0 4rem;
}

.hero-card,
.panel,
.stat-card {
    background: rgba(255, 250, 242, 0.88);
    border: 1px solid rgba(18, 33, 47, 0.08);
    border-radius: 1.3rem;
    box-shadow: var(--shadow);
}

.hero-card,
.panel {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.accent-panel {
    border-color: rgba(12, 124, 89, 0.25);
    background: var(--accent-soft);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.two-up {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}

.game-layout {
    grid-template-columns: 1.1fr 1fr;
}

.stat-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.stat-card span {
    color: rgba(18, 33, 47, 0.7);
}

.stat-card strong {
    font-size: 1.45rem;
}

.stat-card small {
    color: rgba(18, 33, 47, 0.72);
}

.eyebrow {
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--accent-dark);
}

h1,
h2,
h3 {
    margin-top: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.8rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.button-secondary {
    background: #d97b21;
}

.button-secondary:hover {
    background: #bb6518;
}

.button-small {
    padding: 0.55rem 0.95rem;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field span {
    font-size: 0.95rem;
    font-weight: 700;
}

.field small {
    color: rgba(18, 33, 47, 0.72);
}

input,
textarea,
select {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: #fff;
    font: inherit;
    color: var(--ink);
}

.small-link {
    margin: 0;
}

.plain-list {
    margin: 0;
    padding-left: 1.25rem;
}

.plain-list li + li {
    margin-top: 0.45rem;
}

.narrow-panel {
    width: min(620px, 100%);
    margin: 0 auto 1.5rem;
}

.messages {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.message {
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
}

.message-success {
    background: rgba(12, 124, 89, 0.12);
    color: var(--accent-dark);
}

.message-error {
    background: rgba(138, 45, 28, 0.12);
    color: var(--warning);
}

.error-text {
    color: var(--warning);
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.8rem 0.65rem;
    border-bottom: 1px solid rgba(18, 33, 47, 0.08);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(18, 33, 47, 0.7);
}

.row-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: end;
}

.inline-form label {
    display: grid;
    gap: 0.25rem;
}

.inline-form label span {
    font-size: 0.95rem;
    font-weight: 700;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.game-card {
    padding: 1.2rem;
    border-radius: 1rem;
    background: rgba(12, 124, 89, 0.05);
    border: 1px solid rgba(12, 124, 89, 0.12);
}

.guess-buttons {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.result-box {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(12, 124, 89, 0.06);
}

.round-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 0;
}

.round-stats div {
    padding: 0.85rem;
    border-radius: 0.9rem;
    background: var(--paper-strong);
}

.round-stats dt {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(18, 33, 47, 0.7);
}

.round-stats dd {
    margin: 0.45rem 0 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.broadcast-list {
    margin: 0;
    padding-left: 1.25rem;
}

.toast-layer {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    display: grid;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    min-width: min(24rem, calc(100vw - 2rem));
    padding: 0.95rem 1rem;
    border-radius: 0.95rem;
    box-shadow: var(--shadow);
    color: #fff;
    background: var(--accent-dark);
    animation: toast-in 0.18s ease, toast-out 0.22s ease 2.15s forwards;
}

.toast.warning {
    background: #a34a1d;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(0.5rem);
    }
}

.panel-subtitle {
    margin: 0;
    color: rgba(18, 33, 47, 0.72);
}

.panel-nested {
    margin-bottom: 1.25rem;
}

.score-total-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.score-meta {
    color: rgba(18, 33, 47, 0.72);
    font-size: 0.95rem;
}

.pagination-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.flag-badge {
    display: inline-flex;
    margin-left: 0.55rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(217, 123, 33, 0.16);
    color: #8f4b11;
    font-size: 0.8rem;
    font-weight: 700;
    vertical-align: middle;
}

.table-meta {
    margin-top: 0.25rem;
    color: rgba(18, 33, 47, 0.72);
    font-size: 0.9rem;
}

@media (max-width: 800px) {
    .page-heading,
    .panel-header,
    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-wrap: wrap;
        padding-bottom: 1rem;
    }
}
