/* =====================================================================================================================
   rustplayers.com - design system (plain CSS, no framework needed)
   Taken from the ReRust panel's look (resources/css/app.css). Dark only, rust-red accent, Roboto.
   Use the variables everywhere; never hard-code a colour in a page.
   ===================================================================================================================== */

/* Fonts: self-host Roboto + Roboto Mono for production (privacy - no Google request): npm @fontsource-variable/roboto
   and @fontsource-variable/roboto-mono, or download the woff2 files. The style guide loads them from Google Fonts only
   so it opens without a build step. */

:root {
    color-scheme: dark;

    /* ---- Surfaces (darkest -> lightest) ---- */
    --rp-base: #111317;          /* page background */
    --rp-panel: #171a1f;         /* cards, sidebar, header */
    --rp-card: #1c2027;          /* inputs, stat tiles, rows inside a card */
    --rp-raised: #232831;        /* hover, table header, code */
    --rp-line: #2a2f39;          /* borders, dividers */
    --rp-line-strong: #363c48;   /* hover borders, switch track */

    /* ---- Text ---- */
    --rp-white: #ffffff;         /* headings, big numbers */
    --rp-ink: #e7e9ee;           /* body text */
    --rp-ink-muted: #9aa1ad;     /* secondary text, inactive nav */
    --rp-ink-faint: #6b7280;     /* labels, hints, meta */

    /* ---- Accent (rust red) ---- */
    --rp-accent: #e5483b;
    --rp-accent-hover: #f05a4d;
    --rp-accent-soft: #e5483b1f; /* ~12 % - active nav / tab background, text selection */

    /* ---- Status (always with a text label, never colour alone) ---- */
    --rp-ok: #22c55e;
    --rp-warn: #f59e0b;
    --rp-info: #3b82f6;
    --rp-danger: #ef4444;
    /* light versions for text on dark tinted backgrounds */
    --rp-ok-text: #86efac;
    --rp-warn-text: #fcd34d;
    --rp-info-text: #7dd3fc;
    --rp-danger-text: #f87171;

    /* ---- Ranks (leaderboard podium) ---- */
    --rp-gold: #fbbf24;
    --rp-gold-text: #fcd34d;
    --rp-silver: #e2e8f0;
    --rp-bronze: #fb923c;
    --rp-bronze-text: #fdba74;

    /* ---- Stat colours (numbers in stat grids) ---- */
    --rp-stat-kills: #fca5a5;
    --rp-stat-gather: #86efac;
    --rp-stat-scrap: #fcd34d;
    --rp-stat-map: #7dd3fc;

    /* ---- Type ---- */
    --rp-font: 'Roboto Variable', 'Roboto', ui-sans-serif, system-ui, sans-serif;
    --rp-font-mono: 'Roboto Mono Variable', 'Roboto Mono', ui-monospace, 'Cascadia Code', monospace;

    /* ---- Shape ---- */
    --rp-radius-sm: 6px;   /* pills */
    --rp-radius: 8px;      /* buttons, inputs, tiles, nav links */
    --rp-radius-lg: 12px;  /* cards */
    --rp-radius-logo: 9px; /* on a 40 px logo */

    /* ---- Card top line (colour per card: .rp-line-ok etc.) ---- */
    --rp-card-line: var(--rp-accent);

    --rp-focus: 0 0 0 3px #e5483b40;
    --rp-ease: 150ms cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--rp-base);
    color: var(--rp-ink);
    font-family: var(--rp-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--rp-accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--rp-line-strong) transparent; }
a { color: var(--rp-accent); text-decoration: none; }
a:hover { color: var(--rp-accent-hover); }
h1, h2, h3, h4 { margin: 0; color: var(--rp-white); line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 1em; }
code, kbd, .rp-mono { font-family: var(--rp-font-mono); }
img { max-width: 100%; }

/* Small uppercase label above values ("WIPED", "PLAYERS", "CATEGORY") */
.rp-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rp-ink-faint); }
.rp-muted { color: var(--rp-ink-muted); }
.rp-faint { color: var(--rp-ink-faint); }
.rp-num { font-family: var(--rp-font-mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ card
   Every card has a thin line along its top edge that fades out to the right. It's a background (no extra markup),
   so the rounded corners clip it. */
.rp-card {
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius-lg);
    background-color: var(--rp-panel);
    background-image: linear-gradient(to right,
        color-mix(in srgb, var(--rp-card-line) 80%, transparent),
        color-mix(in srgb, var(--rp-card-line) 30%, transparent) 50%,
        transparent);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    overflow: hidden;
}
.rp-line-ok { --rp-card-line: var(--rp-ok); }
.rp-line-warn { --rp-card-line: var(--rp-warn); }
.rp-line-info { --rp-card-line: var(--rp-info); }
.rp-line-danger { --rp-card-line: var(--rp-danger); }
.rp-line-none { --rp-card-line: transparent; }
.rp-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--rp-line);
    font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--rp-ink);
}
.rp-card-header svg { width: 16px; height: 16px; color: var(--rp-accent); flex-shrink: 0; }
.rp-card-header .rp-aside { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; }
.rp-card-body { padding: 20px; }

/* ------------------------------------------------------------------ buttons */
.rp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent; border-radius: var(--rp-radius);
    font: 500 14px/1.4 var(--rp-font);
    cursor: pointer;
    transition: background-color var(--rp-ease), border-color var(--rp-ease), color var(--rp-ease);
    text-decoration: none;
}
.rp-btn:focus-visible { outline: none; box-shadow: var(--rp-focus); }
.rp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rp-btn svg { width: 16px; height: 16px; }
.rp-btn-primary { background: var(--rp-accent); border-color: var(--rp-accent); color: #fff; }
.rp-btn-primary:hover { background: var(--rp-accent-hover); border-color: var(--rp-accent-hover); color: #fff; }
.rp-btn-secondary { background: var(--rp-card); border-color: var(--rp-line); color: var(--rp-ink); }
.rp-btn-secondary:hover { background: var(--rp-raised); border-color: var(--rp-line-strong); color: var(--rp-ink); }
.rp-btn-ghost { background: transparent; color: var(--rp-ink-muted); }
.rp-btn-ghost:hover { background: var(--rp-raised); color: var(--rp-ink); }
.rp-btn-danger { background: #ef44441a; border-color: #ef444466; color: var(--rp-danger-text); }
.rp-btn-danger:hover { background: #ef444433; color: var(--rp-danger-text); }
.rp-btn-lg { padding: 12px 22px; font-size: 15px; font-weight: 600; }

/* ------------------------------------------------------------------ forms */
.rp-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--rp-ink); }
.rp-help { margin-top: 6px; font-size: 12px; color: var(--rp-ink-faint); }
.rp-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--rp-line); border-radius: var(--rp-radius);
    background: var(--rp-card); color: var(--rp-ink);
    font: 14px var(--rp-font);
    outline: none;
    transition: border-color var(--rp-ease), box-shadow var(--rp-ease);
}
.rp-input::placeholder { color: var(--rp-ink-faint); }
.rp-input:focus { border-color: var(--rp-accent); box-shadow: 0 0 0 3px #e5483b40; }

/* Toggle switch: <label class="rp-switch"><input type="checkbox"><span></span></label> */
.rp-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.rp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rp-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--rp-line-strong); transition: background var(--rp-ease); cursor: pointer; }
.rp-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--rp-ease); }
.rp-switch input:checked + span { background: var(--rp-accent); }
.rp-switch input:checked + span::after { transform: translateX(20px); }
.rp-switch input:focus-visible + span { box-shadow: var(--rp-focus); }

/* ------------------------------------------------------------------ small pieces */
.rp-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px;
    border: 1px solid var(--rp-line); border-radius: var(--rp-radius-sm);
    background: var(--rp-card);
    font: 12px var(--rp-font-mono); color: var(--rp-ink-muted);
}
.rp-pill-strong { border-color: var(--rp-line-strong); color: var(--rp-ink); font-size: 11px; }
.rp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rp-dot-ok { background: var(--rp-ok); }
.rp-dot-warn { background: var(--rp-warn); }
.rp-dot-danger { background: var(--rp-danger); }
.rp-dot-off { background: var(--rp-ink-faint); }
/* Live status text: dot + uppercase label, e.g. ONLINE */
.rp-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.rp-status-ok { color: var(--rp-ok-text); }
.rp-status-warn { color: var(--rp-warn-text); }
.rp-status-danger { color: var(--rp-danger-text); }
.rp-status-off { color: var(--rp-ink-faint); }

/* Badge (counts, NEW, tags) */
.rp-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
.rp-badge-accent { background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-badge-ok { background: #22c55e1f; color: var(--rp-ok-text); }
.rp-badge-warn { background: #f59e0b1f; color: var(--rp-warn-text); }

/* Alerts */
.rp-alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border: 1px solid; border-radius: var(--rp-radius); font-size: 14px; }
.rp-alert svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.rp-alert-info { border-color: #3b82f666; background: #3b82f61a; color: var(--rp-info-text); }
.rp-alert-ok { border-color: #22c55e66; background: #22c55e1a; color: var(--rp-ok-text); }
.rp-alert-warn { border-color: #f59e0b66; background: #f59e0b1a; color: var(--rp-warn-text); }
.rp-alert-danger { border-color: #ef444466; background: #ef44441a; color: var(--rp-danger-text); }

/* Stat tile: icon + label + value */
.rp-stat { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); background: var(--rp-card); }
.rp-stat svg { width: 16px; height: 16px; color: var(--rp-accent); flex-shrink: 0; }
.rp-stat-label { font-size: 12px; color: var(--rp-ink-faint); }
.rp-stat-value { font-weight: 600; color: var(--rp-ink); }

/* Stat grid: cells separated by 1 px lines (gap on a line-coloured background) */
.rp-statgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--rp-line); border-radius: var(--rp-radius-lg); background: var(--rp-line); }
.rp-statgrid > div { padding: 12px 16px; background: var(--rp-panel); }
.rp-statgrid dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rp-ink-faint); }
.rp-statgrid dd { margin: 2px 0 0; font: 700 20px var(--rp-font-mono); color: var(--rp-white); }
.rp-statgrid dd + dd { margin: 0; font: 11px var(--rp-font); color: var(--rp-ink-faint); }
@media (max-width: 640px) { .rp-statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ tabs */
/* Segmented control: period switch ("This wipe" / "All time") */
.rp-segment { display: inline-flex; padding: 2px; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); background: #11131799; }
.rp-segment button { padding: 6px 12px; border: 0; border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-ink-muted); font: 500 14px var(--rp-font); cursor: pointer; transition: var(--rp-ease); }
.rp-segment button:hover { color: var(--rp-ink); }
.rp-segment button[aria-selected="true"] { background: var(--rp-accent); color: #fff; }
/* Chip tabs: categories ("PvP", "Gathering"...) */
.rp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); background: transparent; color: var(--rp-ink-muted); font: 600 14px var(--rp-font); cursor: pointer; transition: var(--rp-ease); }
.rp-chip:hover { border-color: var(--rp-line-strong); color: var(--rp-ink); }
.rp-chip[aria-selected="true"] { border-color: #e5483b80; background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-chip svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ navigation */
.rp-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--rp-radius); color: var(--rp-ink-muted); font-size: 14px; font-weight: 500; transition: var(--rp-ease); }
.rp-nav-link:hover { background: var(--rp-raised); color: var(--rp-ink); }
.rp-nav-link.is-active, .rp-nav-link[aria-current="page"] { background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Top bar for the public site (the panel uses a sidebar; a community site reads better with a top bar) */
.rp-topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--rp-line); background: #111317e6; backdrop-filter: blur(8px); }
.rp-topbar-inner { display: flex; align-items: center; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 12px 20px; }
.rp-brand { display: flex; align-items: center; gap: 12px; color: var(--rp-white); }
.rp-brand:hover { color: var(--rp-white); }
.rp-brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.1; }
.rp-brand-sub { font-size: 12px; color: var(--rp-ink-faint); }
.rp-topnav { display: flex; gap: 4px; }
.rp-topnav a { padding: 8px 12px; border-radius: var(--rp-radius); color: var(--rp-ink-muted); font-weight: 500; }
.rp-topnav a:hover { background: var(--rp-raised); color: var(--rp-ink); }
.rp-topnav a[aria-current="page"] { background: var(--rp-accent-soft); color: var(--rp-accent); }

/* Phones: the links fold away - add a menu button that shows .rp-topnav as a column (not included here). */
@media (max-width: 760px) { .rp-topnav { display: none; } .rp-brand-sub { display: none; } }

.rp-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ hero (sign-in page look) */
/* Background image at 30 %, a red glow from the top, fading to the page colour. */
.rp-hero { position: relative; overflow: hidden; padding: 96px 20px 80px; text-align: center; }
.rp-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; }
.rp-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at top, #e5483b22, transparent 60%); }
.rp-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, #11131766, #111317b3, var(--rp-base)); }
.rp-hero > * { position: relative; z-index: 1; }
.rp-hero h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 800; letter-spacing: -0.03em; }
.rp-hero p { max-width: 560px; margin: 12px auto 28px; font-size: 17px; color: var(--rp-ink-muted); }

/* ------------------------------------------------------------------ tables */
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-card > .rp-table:first-child { margin-top: 2px; } /* keep the card's top line visible above the header */
.rp-table th { padding: 10px 16px; border-bottom: 1px solid var(--rp-line); background: var(--rp-raised); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rp-ink-faint); }
.rp-table td { padding: 10px 16px; border-bottom: 1px solid var(--rp-line); }
.rp-table tr:last-child td { border-bottom: 0; }
.rp-table tbody tr:hover { background: #23283180; }
.rp-table .rp-num { text-align: right; }

/* ------------------------------------------------------------------ podium (top 3) */
.rp-podium { position: relative; overflow: hidden; padding: 20px; }
.rp-podium-mark { position: absolute; top: 12px; right: 24px; font-size: 168px; font-weight: 900; font-style: italic; line-height: 0.8; pointer-events: none; user-select: none; }
.rp-podium-label { position: relative; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.rp-podium-1 { border-color: #fbbf2466; background-image: linear-gradient(to right, #fbbf24cc, #fbbf244d 50%, transparent), linear-gradient(to bottom right, #fbbf241a, transparent); background-size: 100% 2px, 100% 100%; }
.rp-podium-1 .rp-podium-label { color: var(--rp-gold-text); }
.rp-podium-1 .rp-podium-mark { color: #fbbf2413; }
.rp-podium-1 .rp-avatar { box-shadow: 0 0 0 2px #fbbf24b3; }
.rp-podium-2 { border-color: var(--rp-line-strong); }
.rp-podium-2 .rp-podium-label { color: var(--rp-ink); }
.rp-podium-2 .rp-podium-mark { color: #e2e8f00d; }
.rp-podium-2 .rp-avatar { box-shadow: 0 0 0 2px var(--rp-line-strong); }
.rp-podium-3 { border-color: #fb923c4d; background-image: linear-gradient(to right, #fb923ccc, #fb923c4d 50%, transparent), linear-gradient(to bottom right, #fb923c0d, transparent); background-size: 100% 2px, 100% 100%; }
.rp-podium-3 .rp-podium-label { color: var(--rp-bronze-text); }
.rp-podium-3 .rp-podium-mark { color: #fb923c11; }
.rp-podium-3 .rp-avatar { box-shadow: 0 0 0 2px #fb923c99; }
.rp-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--rp-raised); flex-shrink: 0; }

/* ------------------------------------------------------------------ footer */
.rp-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 32px 20px; border-top: 1px solid var(--rp-line); font-size: 12px; color: var(--rp-ink-faint); }
.rp-footer a { color: var(--rp-ink-faint); }
.rp-footer a:hover { color: var(--rp-ink); text-decoration: underline; }

/* ------------------------------------------------------------------ article text (guides, rules, news) */
.rp-prose { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.rp-prose h2 { margin: 1.6em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--rp-line); font-size: 20px; }
.rp-prose h3 { margin: 1.6em 0 0.6em; font-size: 17px; }
.rp-prose strong { color: #fff; font-weight: 600; }
.rp-prose a { text-decoration: underline; text-underline-offset: 2px; }
.rp-prose ul, .rp-prose ol { padding-left: 1.5em; }
.rp-prose code { padding: 0.1em 0.35em; border: 1px solid var(--rp-line); border-radius: 4px; background: var(--rp-raised); font-size: 0.85em; }
.rp-prose pre { padding: 0.9em 1.1em; overflow-x: auto; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); background: var(--rp-base); }
.rp-prose pre code { padding: 0; border: 0; background: none; }
.rp-prose blockquote { margin: 0 0 1em; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--rp-accent); color: var(--rp-ink-muted); }
.rp-prose hr { border: 0; border-top: 1px solid var(--rp-line); margin: 1.5em 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
