/* SNF Inc. landing page. System font stack, no external requests.
   Palette is taken from banner.jpg: its green, darkened for the background. */
:root {
    --bg: #0c1509;
    --card: #131f10;
    --panel: #1a2b16;
    --line: #2d4426;
    --text: #eef5e8;
    --muted: #a8baa0; /* 7.6:1 on --card */
    --accent: #a4e256; /* 11:1 on --card */
    --accent-ink: #12200c;
    --bad: #ff8f8f;
    --gold: #f2c94c;
    --silver: #d3dbd0;
    --bronze: #e0955c;
    --radius: 16px;
    /* type scale */
    --fs-xs: 0.8125rem;
    --fs-sm: 0.9375rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.375rem;
    --fs-xl: 2.25rem;
    /* spacing scale */
    --s1: 0.5rem;
    --s2: 0.75rem;
    --s3: 1rem;
    --s4: 1.5rem;
    --s5: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: var(--s3);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--fs-md);
    line-height: 1.5;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at top, rgba(90, 138, 41, 0.35), transparent 60%),
        linear-gradient(135deg, transparent 49.5%, rgba(90, 138, 41, 0.12) 50%, transparent 50.5%);
    background-size: auto, 48px 48px;
    -webkit-font-smoothing: antialiased;
}

.card {
    width: 100%;
    max-width: 40rem;
    align-self: flex-start;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.banner { display: block; width: 100%; height: auto; border-bottom: 2px solid var(--line); }
.content { padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.accent { color: var(--accent); }
.muted { margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

h1 { margin: 0; text-align: center; font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.2; }
.lead { margin: calc(var(--s2) * -1) auto 0; max-width: 26rem; text-align: center; color: var(--muted); }
.lead strong { color: var(--text); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.status-head { display: flex; align-items: center; gap: var(--s2); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #6b7a65; flex: none; }
.dot.online { background: var(--accent); box-shadow: 0 0 10px rgba(164, 226, 86, 0.7); }
.dot.offline { background: var(--bad); }
.server-name { margin: var(--s1) 0 0; font-weight: 700; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s2) 0 0; }
.facts dt { color: var(--muted); font-size: var(--fs-xs); }
.facts dd { margin: 0; font-size: var(--fs-lg); font-weight: 700; overflow-wrap: anywhere; }
#updated { margin-top: var(--s2); }
#updated:empty { display: none; }

/* buttons */
.actions { display: flex; flex-direction: column; gap: var(--s3); }
.btn {
    display: flex; align-items: center; justify-content: center; gap: var(--s2);
    padding: var(--s3) var(--s4); border-radius: var(--radius);
    font-size: var(--fs-lg); font-weight: 800; text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn .icon { width: 2rem; height: 2rem; fill: currentColor; flex: none; }
.btn-text { display: flex; flex-direction: column; align-items: center; line-height: 1.2; text-align: center; }
.btn-sub { font-size: var(--fs-xs); font-weight: 600; font-family: ui-monospace, Menlo, Consolas, monospace; margin-top: 2px; }
.btn-join { background: var(--accent); color: var(--accent-ink); }
.btn-join:hover { background: #b7ee73; box-shadow: 0 10px 30px -10px rgba(164, 226, 86, 0.6); }
.btn-discord { background: #4752c4; color: #fff; } /* 7.3:1 with white text */
.btn-discord:hover { background: #3c46ad; box-shadow: 0 10px 30px -10px rgba(88, 101, 242, 0.8); }

/* how-to */
.howto { padding: 0; }
.howto summary { cursor: pointer; padding: var(--s2) var(--s3); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.howto summary:hover { color: var(--text); }
.howto[open] { padding-bottom: var(--s3); }
.steps { list-style: none; margin: 0; padding: 0 var(--s3); display: grid; gap: var(--s2); font-weight: 600; }
.steps li { display: flex; align-items: center; gap: var(--s2); }
.num {
    flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
kbd { padding: 1px 8px; border-radius: 6px; background: #2a3f24; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-sm); }
.shot { position: relative; margin: var(--s3) var(--s3) 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.shot img { display: block; width: 100%; height: auto; }
/* Overlay positions are percentages tied to join-by-id.jpg: re-tune them if the image changes. */
.shot-ring {
    position: absolute; left: 1.8%; top: 93%; width: 13%; height: 6.2%;
    border: 3px solid var(--accent); border-radius: 4px;
    box-shadow: 0 0 14px 3px rgba(164, 226, 86, 0.8); animation: pulse 1.6s ease-in-out infinite;
}
.shot-label {
    position: absolute; left: 1.8%; top: 83%; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
    background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800;
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* leaderboard */
.board { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); }
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.toggle button {
    appearance: none; border: 0; cursor: pointer; padding: 6px 14px; border-radius: 999px;
    background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 600;
}
.toggle button:hover { color: var(--text); }
.toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
#board-note { min-height: 1.25em; }
#board-note.error { color: var(--bad); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap:has(table[hidden]) { display: none; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
th, td { padding: var(--s2) var(--s2); text-align: left; }
th { background: var(--panel); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr + tr td { border-top: 1px solid var(--line); }
.num-col { text-align: right; white-space: nowrap; }
td.player { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank { display: inline-flex; width: 1.75rem; height: 1.75rem; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; }
tr.top td { font-size: var(--fs-md); font-weight: 700; background: rgba(164, 226, 86, 0.06); }
tr.top-1 .rank { background: var(--gold); color: #1c1600; }
tr.top-2 .rank { background: var(--silver); color: #14190f; }
tr.top-3 .rank { background: var(--bronze); color: #1f1008; }
.board.loading #board-table { opacity: 0.5; }

footer { padding: var(--s3) var(--s4); text-align: center; font-size: var(--fs-xs); color: var(--muted); background: rgba(0, 0, 0, 0.35); border-top: 1px solid var(--line); }

@media (max-width: 480px) {
    body { padding: var(--s2); }
    .content { padding: var(--s4) var(--s3); }
    h1 { font-size: 1.875rem; }
    .btn { font-size: var(--fs-md); padding: var(--s3); }
    .board-head { flex-direction: column; align-items: stretch; }
    .toggle { justify-content: stretch; }
    .toggle button { flex: 1; padding: 8px 6px; }
    th, td { padding: var(--s1); }
    .col-matches { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .btn:hover { transition: none; transform: none; }
    .shot-ring { animation: none; }
}
