/* ==========================================================================
   Klappstuhlverein – design system (dark only)
   ========================================================================== */

@font-face {
    font-family: "Poppins";
    src: url("/fonts/Poppins-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("/fonts/Poppins-Bold.ttf") format("truetype");
    font-weight: 600 700;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #0c0d10;
    --surface: #14161a;
    --surface-2: #1b1e23;
    --border: #262a31;
    --border-strong: #353a43;
    --text: #e8eaed;
    --muted: #979ca5;
    --accent: #f5a524;
    --accent-hover: #ffb73d;
    --accent-contrast: #16110a;
    --success: #3fb950;
    --danger: #f85149;
    --steam: #1b2838;
    --discord: #5865f2;

    --radius: 10px;
    --radius-sm: 6px;
    --container: 1120px;
    --container-narrow: 720px;
    --gutter: 16px;

    --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

/* Base ------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

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

img { max-width: 100%; }

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

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .85em; }
.center { text-align: center; }
.link { color: var(--accent); font-weight: 600; font-size: .9rem; }

.eyebrow {
    margin-bottom: .75rem;
    color: var(--accent);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* Layout ----------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container.narrow { max-width: var(--container-narrow); }

.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 640px; margin: 0 auto 32px; text-align: center; }
.section-head-left { margin-left: 0; text-align: left; }

/* Nav -------------------------------------------------------------------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 13, 16, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.nav-brand img { image-rendering: pixelated; }

.nav-links { display: flex; gap: 4px; flex: 1; }

.nav-links a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: .9rem;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; }

@media (max-width: 767px) {
    .nav-inner { gap: 12px; }
    .nav-brand span { display: none; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 8px var(--gutter) 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 12px; }
}

/* Dropdown --------------------------------------------------------------- */

.dropdown { position: relative; }

.dropdown-trigger {
    display: flex;
    padding: 2px;
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
}

.dropdown-trigger:hover,
.dropdown.open .dropdown-trigger { border-color: var(--border-strong); }

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-header {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }

.dropdown-menu form { margin: 0; }
.dropdown-menu form button { color: var(--danger); }

/* Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.btn-sm { padding: 7px 12px; font-size: .85rem; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-steam { background: var(--steam); border-color: #2a475e; color: #fff; }
.btn-steam:hover { background: #2a475e; color: #fff; }

.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 480px) {
    .nav-actions .btn-steam span { display: none; }
}

/* Cards, badges, alerts -------------------------------------------------- */

.card {
    padding: 20px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card-title { margin-bottom: 16px; font-size: 1rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.badge-success { color: var(--success); border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .08); }

.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }

.dot { width: 8px; height: 8px; border-radius: 50%; }

.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

.alert-success { color: var(--success); border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .08); }
.alert-danger { color: var(--danger); border-color: rgba(248, 81, 73, .35); background: rgba(248, 81, 73, .08); }

.avatar { display: block; border-radius: 50%; background: var(--surface-2); flex-shrink: 0; }

/* Rows (settings) -------------------------------------------------------- */

.row { display: flex; align-items: center; gap: 14px; }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-main span { font-size: .85rem; }

.row-divided { padding: 14px 0; }
.row-divided + .row-divided { border-top: 1px solid var(--border); }
.row-divided:last-child { padding-bottom: 0; }
.card-title + .row-divided { padding-top: 0; }

.link-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1.1rem;
}

.link-icon-steam { background: var(--steam); }
.link-icon-discord { background: var(--discord); }

@media (max-width: 480px) {
    .row { flex-wrap: wrap; }
}

/* FAQ -------------------------------------------------------------------- */

.faq { border-top: 1px solid var(--border); }
.faq:first-of-type { border-top: 0; }

.faq summary {
    padding: 12px 0;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--muted); font-size: .9rem; }

/* Stats ------------------------------------------------------------------ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-grid-compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-label { color: var(--muted); font-size: .8rem; }
.stat-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-grid-compact .stat-value { font-size: 1.1rem; }

.trend { font-size: .8rem; font-weight: 600; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: inherit; }

/* Table ------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; margin: 0 -4px; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }

.table th,
.table td { padding: 10px 12px; text-align: left; white-space: nowrap; }

.table th {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}

.table td { border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }

.player { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

/* Inputs ----------------------------------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.input {
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
}

.input:focus { outline: none; border-color: var(--accent); }
.toolbar input { flex: 1; min-width: 200px; }

/* Home ------------------------------------------------------------------- */

.hero { padding: 96px 0 72px; border-bottom: 1px solid var(--border); }

.hero-title { max-width: 720px; font-size: clamp(2.2rem, 6vw, 3.5rem); }
.hero-lead { max-width: 600px; font-size: 1.05rem; margin-bottom: 28px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 40px; margin: 48px 0 0; }
.hero-stats dt { color: var(--muted); font-size: .8rem; }
.hero-stats dd { margin: 0; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.feature { display: flex; flex-direction: column; margin: 0; }
.feature .badge { align-self: flex-start; margin-bottom: 14px; }
.feature .link { margin-top: auto; padding-top: 12px; }
.feature p { font-size: .9rem; }

/* Plugins page */
.plugin-group { margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--border); }
.section-head + .plugin-group { margin-top: 0; padding-top: 0; border-top: 0; }
.plugin-group .eyebrow { margin-bottom: .25rem; }
.plugin-group .muted { margin: 0; font-size: .9rem; }
.plugin { gap: 10px; scroll-margin-top: 80px; }
.plugin > * { margin: 0; }
.plugin .badge { margin-bottom: 2px; }
.plugin .link { padding-top: 4px; }
.plugin-usage { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.plugin-usage-label { margin-right: 6px; color: var(--accent); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.plugin-details summary { color: var(--muted); font-size: .85rem; cursor: pointer; list-style: none; }
.plugin-details summary::-webkit-details-marker { display: none; }
.plugin-details summary::after { content: " +"; }
.plugin-details[open] summary::after { content: " –"; }
.plugin-details summary:hover { color: var(--text); }
.plugin-details .check-list { margin-top: 8px; }
.plugin-details .check-list li { font-size: .85rem; color: var(--muted); }
.plugin-footnote { margin-top: 40px; }

/* Rules page */
.rules-group { scroll-margin-top: 80px; }
.rules { margin: 0; padding: 0; list-style: none; }
.rule { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.rule:last-child { border-bottom: 0; }
.rule:target, .rule-sub li:target { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; }
.rule-number { flex-shrink: 0; width: 28px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rule-number:hover { text-decoration: underline; }
.rule-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rule-text { margin: 0; font-weight: 600; }
.rule-text .muted { font-weight: 400; font-size: .9rem; }
.rule-sub { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.rule-sub li { padding: 2px 0; scroll-margin-top: 80px; }
.rule-sub-number { margin-right: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rule-sub-number:hover { color: var(--accent); }

/* Teaming: pairings as cards with a versus banner */
.teaming {
    --t-ok: var(--success);
    --t-part: #b4b0e6;
    --t-no: var(--danger);
}
.teaming-group + .teaming-group { margin-top: 28px; }
.teaming-group h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1rem; font-weight: 600; }
.teaming-group h3 small { font-size: .75rem; font-weight: 500; color: var(--muted); }
.teaming-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.s-allowed { --glow: var(--t-ok); }
.s-partly { --glow: var(--t-part); }
.s-forbidden { --glow: var(--t-no); }

.teaming-mark { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; color: var(--glow); background: color-mix(in srgb, var(--glow) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--glow) 55%, transparent); }
.teaming-mark .icon { width: 13px; height: 13px; }

.teaming-card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s; }
.teaming-card:hover { border-color: color-mix(in srgb, var(--glow) 40%, var(--border)); }
.teaming-card:target { border-color: var(--glow); }

/* Versus banner: --ca / --cb = faction colors left / right */
.teaming-vs { position: relative; height: 128px; margin: -18px -18px 0; overflow: hidden; border-bottom: 1px solid var(--border);
    background:
        radial-gradient(60% 120% at 0% 100%, color-mix(in srgb, var(--ca) 28%, transparent), transparent 70%),
        radial-gradient(60% 120% at 100% 100%, color-mix(in srgb, var(--cb) 28%, transparent), transparent 70%),
        var(--surface-2); }
.teaming-vs::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .18) 3px 4px); pointer-events: none; }
.teaming-vs .teaming-mark { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 38px; height: 38px; z-index: 2; background-color: var(--surface); }
.teaming-vs .teaming-mark .icon { width: 20px; height: 20px; }

/* Figures slide in on load, fade out towards the center and move together on hover */
.teaming-art { position: absolute; bottom: -2px; width: auto; height: 118px; max-width: none; image-rendering: pixelated; opacity: .92;
    -webkit-mask-image: linear-gradient(var(--dir), #000 35%, transparent 92%); mask-image: linear-gradient(var(--dir), #000 35%, transparent 92%);
    transition: transform .6s cubic-bezier(.22, 1, .36, 1), opacity .6s ease; will-change: transform; }
.teaming-art.l { left: 10px; --dir: to right; animation: teaming-in-l .9s cubic-bezier(.2, .7, .2, 1) backwards; }
.teaming-art.r { right: 10px; --dir: to left; animation: teaming-in-r .9s cubic-bezier(.2, .7, .2, 1) backwards; }
/* Second / third figure of one side (Guard / MTF, Alle): smaller and further inside */
.teaming-art.l.n2 { left: 56px; height: 104px; }
.teaming-art.r.n2 { right: 46px; height: 104px; }
.teaming-art.r.n3 { right: 84px; height: 92px; }
@keyframes teaming-in-l { from { opacity: 0; transform: translateX(-36px); } }
@keyframes teaming-in-r { from { opacity: 0; transform: translateX(36px); } }
.teaming-card:hover .teaming-art { opacity: 1; }
.teaming-card:hover .teaming-art.l { transform: translateX(8px); }
.teaming-card:hover .teaming-art.r { transform: translateX(-8px); }
/* Inner figures follow a bit later, so the group moves in a soft wave */
.teaming-art.n2 { transition-delay: .04s; }
.teaming-art.n3 { transition-delay: .08s; }

.teaming-names { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.teaming-names .plus { margin: 0 4px; font-weight: 400; color: var(--muted); }
.teaming-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.teaming-cond { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; font-size: .75rem; font-weight: 500; color: var(--t-part); background: color-mix(in srgb, var(--t-part) 10%, transparent); border: 1px solid color-mix(in srgb, var(--t-part) 30%, transparent); border-radius: 999px; }
.teaming-cond .icon { width: 14px; height: 14px; }
.teaming-why { margin: 0; font-size: .85rem; line-height: 1.6; color: var(--muted); }
.teaming-why strong { font-weight: 500; color: var(--text); }

@media (max-width: 520px) { .teaming-cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .teaming-art { animation: none; transition: none; } }

.legacy { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }

.check-list { padding: 0; margin: 0; list-style: none; }
.check-list li { padding: 4px 0 4px 26px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; display: flex; flex-direction: column; padding: 0 0 28px 24px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-strong);
}
.timeline-current::before { background: var(--accent) !important; }
.timeline strong { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.timeline img { image-rendering: pixelated; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; margin: 0; }
.cta p { margin: 0; }

@media (max-width: 767px) {
    .section { padding: 48px 0; }
    .hero { padding: 56px 0 48px; }
    .hero-stats { gap: 24px; }
    .legacy { grid-template-columns: 1fr; gap: 32px; }
    .cta { flex-direction: column; align-items: flex-start; padding: 24px; }
}

/* Profile ---------------------------------------------------------------- */

.profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.profile-meta { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.profile-meta h1 { margin: 0; overflow-wrap: anywhere; }
.profile-links { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); }

.level-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    font-size: .9rem;
}

@media (max-width: 480px) {
    .profile-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .profile-header .avatar { width: 80px; height: 80px; }
}

/* Rounds ----------------------------------------------------------------- */

.round-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.round-card {
    display: block;
    width: 100%;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s;
}

.round-card:hover { border-color: var(--border-strong); }
.round-card[hidden] { display: none; }

.round-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: .9rem; }

.round-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.round-card-stats dt { color: var(--muted); font-size: .75rem; }
.round-card-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.empty { padding: 48px 0; text-align: center; }

@media (max-width: 400px) {
    .round-list { grid-template-columns: 1fr; }
}

/* Footer ----------------------------------------------------------------- */

.footer { margin-top: 48px; padding: 48px 0 24px; border-top: 1px solid var(--border); font-size: .875rem; }

.footer-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }

.footer-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.footer-logo:hover { color: var(--text); }
.footer-brand p { max-width: 320px; margin: 12px 0 16px; line-height: 1.6; }

.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    transition: color .15s, border-color .15s;
}
.footer-socials a:hover { color: var(--text); border-color: var(--border-strong); }
.footer-socials .icon { width: 18px; height: 18px; }

.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-col h2 { margin: 4px 0 4px; font-size: .9rem; color: var(--text); }
.footer-col a,
.footer-col button { padding: 0; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.footer-col a:hover,
.footer-col button:hover { color: var(--text); }
.footer-col form { margin: 0; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: .8rem;
}

@media (max-width: 767px) {
    .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
}

/* Leaderboard ------------------------------------------------------------ */

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }

.tab {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
}

.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

.own-rank { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
.own-rank .link { margin-left: auto; }

.leaderboard .rank { width: 48px; color: var(--muted); font-weight: 700; }
.leaderboard .podium-1 .rank { color: #efc01a; }
.leaderboard .podium-2 .rank { color: #c0c4cc; }
.leaderboard .podium-3 .rank { color: #cd7f32; }
.leaderboard tr.is-own td { background: rgba(245, 165, 36, .08); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; font-size: .9rem; }

/* Round page ------------------------------------------------------------- */

.round-card:hover { color: inherit; }
.round-permalink:hover { color: var(--accent); }
.back-link { display: inline-block; margin-bottom: 16px; }

/* Settings: tag + avatar ------------------------------------------------- */

.tag-form { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 12px; }
.tag-options { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-option { cursor: pointer; }
.tag-option input { position: absolute; opacity: 0; pointer-events: none; }
.tag-option .badge { padding: 6px 12px; font-size: .8rem; transition: border-color .15s, color .15s; }
.tag-option:hover .badge { border-color: var(--border-strong); color: var(--text); }
.tag-option input:checked + .badge { border-color: var(--accent); color: var(--text); background: rgba(245, 165, 36, .1); }
.tag-option input:focus-visible + .badge { outline: 2px solid var(--accent); outline-offset: 2px; }

.avatar-editor { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; }

.avatar-preview {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.avatar-fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.field > label, .field-head > label:first-child { font-weight: 600; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; cursor: pointer; }

.range { width: 100%; accent-color: var(--accent); }
.range:disabled { opacity: .35; }
.range-hue {
    height: 8px;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(90deg, hsl(0 70% 60%), hsl(60 70% 60%), hsl(120 70% 60%), hsl(180 70% 60%), hsl(240 70% 60%), hsl(300 70% 60%), hsl(360 70% 60%));
}
.range-hue::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); }
.range-hue::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); }

.row-main .progress { margin-top: 8px; }

@media (max-width: 560px) {
    .avatar-editor { grid-template-columns: 1fr; }
    .avatar-preview { max-width: 160px; }
}

@media (max-width: 600px) {
    .leaderboard .col-tag { display: none; }
    .leaderboard td, .leaderboard th { padding: 10px 8px; }
    .leaderboard .player span { white-space: normal; }
}

/* Round MVP + focus ------------------------------------------------------ */

.round-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 20px 0; }

.highlight-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
}

.highlight-card:hover { color: inherit; border-color: var(--border-strong); }
.highlight-mvp { border-color: rgba(245, 165, 36, .45); background: linear-gradient(135deg, rgba(245, 165, 36, .12), var(--surface-2) 60%); }
.highlight-focus { border-color: rgba(88, 101, 242, .5); background: linear-gradient(135deg, rgba(88, 101, 242, .12), var(--surface-2) 60%); }

.highlight-label { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.highlight-mvp .highlight-label { color: var(--accent); }
.highlight-focus .highlight-label { color: #8b95ff; }

.highlight-main { display: flex; align-items: center; gap: 12px; }
.highlight-main > div { display: flex; flex-direction: column; min-width: 0; }
.highlight-main .muted { font-size: .85rem; }

.highlight-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.highlight-stats dt { color: var(--muted); font-size: .75rem; }
.highlight-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.round-table tr.is-own td { background: rgba(88, 101, 242, .1); }
.round-table tr.is-own td:first-child { box-shadow: inset 3px 0 0 #5865f2; }
.round-table .badge { margin-left: 4px; padding: 1px 7px; font-size: .65rem; }

.round-card-mvp { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .85rem; }
.round-card-mvp .badge { margin-left: auto; }
.round-card.is-own { border-color: rgba(88, 101, 242, .5); }
