/* Theme: dark is the default; system light mode applies automatically via
   prefers-color-scheme; data-theme="light"/"dark" (set by the header toggle,
   persisted in localStorage) overrides the system preference. */

:root {
    --bg: #0f1420;
    --bg-card: #181f30;
    --border: #2a3550;
    --text: #e6e9f0;
    --text-dim: #9aa3b8;
    --accent: #4f8cff;
    --accent-hover: #6ea1ff;
    --radius: 10px;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f4f6fb;
        --bg-card: #ffffff;
        --border: #d7dde9;
        --text: #1b2436;
        --text-dim: #5a6478;
        --accent: #2f6fe4;
        --accent-hover: #1d5bd0;
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-card: #ffffff;
    --border: #d7dde9;
    --text: #1b2436;
    --text-dim: #5a6478;
    --accent: #2f6fe4;
    --accent-hover: #1d5bd0;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0f1420;
    --bg-card: #181f30;
    --border: #2a3550;
    --text: #e6e9f0;
    --text-dim: #9aa3b8;
    --accent: #4f8cff;
    --accent-hover: #6ea1ff;
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Links inside prose need a non-color affordance (accessibility: "links
   rely on color"); navigation and card links keep the clean look. */
.content a,
.result-facts a,
.page-intro a,
main p a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.brand-tld { color: var(--accent); }

.site-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.site-nav a { color: var(--text-dim); }
.site-nav a:hover { color: var(--text); }

.lang-select,
.theme-toggle {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.4;
    min-width: 2.2rem;
}

.theme-toggle:hover { border-color: var(--accent); }

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
.hero p { color: var(--text-dim); max-width: 40rem; margin: 0 auto; }

.hero-search {
    justify-content: center;
    margin: 1.4rem auto 0.25rem;
    max-width: 34rem;
}

.hero-count { font-size: 0.9rem; margin-top: 0.9rem; }
.hero-count strong { color: var(--text); }

.content-links { font-weight: 600; }

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    padding: 1.5rem 0;
}

.tool-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.tool-card:hover { border-color: var(--accent); color: var(--text); }
.tool-card h2 { margin: 0 0 0.35rem; font-size: 1.1rem; color: var(--accent); }
.tool-card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

.wasted-headline { font-size: 1.15rem; margin: 0.2rem 0 0.4rem; }

.lookup-echo { color: var(--text-dim); font-size: 1.05rem; }
.placeholder-note { color: var(--text-dim); font-style: italic; }
.page-intro { color: var(--text-dim); max-width: 44rem; }

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}

.search-form select,
.search-form input,
.search-form button {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

.search-form input { flex: 1; min-width: 12rem; }

.search-form button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.search-form button:hover { background: var(--accent-hover); }

.result-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin: 1rem 0;
}

.result-card h2 { margin: 0 0 0.25rem; }
.result-card.available { border-color: #3d9a5f; }
.result-facts { margin: 0.5rem 0; padding-left: 1.2rem; color: var(--text-dim); }
.normalize-note {
    color: var(--text-dim);
    font-size: 0.9rem;
    border-left: 3px solid var(--accent);
    padding-left: 0.6rem;
    margin: 0.5rem 0;
}
.taken-note { margin: 0; color: var(--text-dim); }
.profile-icon { border-radius: 8px; flex-shrink: 0; }
.tag { color: var(--text-dim); font-weight: 400; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.data-table th { color: var(--text-dim); font-weight: 600; font-size: 0.85rem; }
.data-table tr:last-child td { border-bottom: none; }

.badge {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.lb-name { display: inline-flex; align-items: center; gap: 0.6rem; }
.lb-icon { border-radius: 6px; flex-shrink: 0; }
.lb-name a { color: var(--text); }
.lb-name a:hover { color: var(--accent); }
.lb-name a .tag { font-size: 0.85em; }

.pagination {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.page-current { color: var(--text-dim); font-size: 0.9rem; }

.region-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.region-tabs a {
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

.region-tabs a.active,
.region-tabs a:hover {
    color: var(--text);
    border-color: var(--accent);
}

.ad-banner-top {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Reserve banner space only once NitroPay injects into the slot, so an
   unfilled request doesn't leave a 250px hole at the top of every page.
   NitroPay pre-reserves via an inline height (the createAd "height" option),
   hence the !important; once it injects content, :empty stops matching and
   the reservation comes back on its own. */
.ad-banner-top:empty {
    height: 0 !important;
}

.ad-banner-top:not(:empty) {
    min-height: 250px;
    margin-top: 0.75rem;
}

/* Watchlist. */
.watch-btn {
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 0.6rem;
    vertical-align: middle;
}

.watch-btn:hover { border-color: var(--accent); color: var(--text); }
.watch-btn.watching { color: #e3b341; border-color: #e3b341; }

.watchlist { margin: 0 0 1rem; }
.watchlist ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }

.watchlist li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.95rem;
}

.watchlist li::before { content: "★"; color: #e3b341; font-size: 0.85rem; }
.watchlist li a { color: var(--text); }
.watchlist li a:hover { color: var(--accent); }

/* Player compare. */
.compare-form { align-items: center; }
.compare-form-side { display: flex; gap: 0.5rem; flex: 1; min-width: 240px; }
.compare-form-side input { flex: 1; min-width: 0; }
.compare-vs { color: var(--text-dim); font-weight: 700; }

.compare-heads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.25rem 0 0.75rem;
}

.compare-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.compare-head h2 { font-size: 1.1rem; margin: 0; }
.compare-head .profile-icon { border-radius: 8px; }

.compare-table th { text-align: center; white-space: nowrap; }
.compare-table td { text-align: center; width: 40%; }
.cmp-win { color: #3fb950; font-weight: 700; }

@media (max-width: 700px) {
    .compare-heads { grid-template-columns: 1fr; }
}

/* Recent matches on player pages. */
.match-win { color: #3fb950; font-weight: 600; }
.match-loss { color: #f85149; font-weight: 600; }

/* In-content ad slot (leaderboard tables, rotation): collapses when
   unfilled, centers the creative when NitroPay injects one. */
.ad-incontent {
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

/* Collapse unless a real creative (iframe) is inside — NitroPay may inject
   an empty wrapper before fill, which defeats a plain :empty check. */
.ad-incontent:not(:has(iframe)) { height: 0 !important; overflow: hidden; }
.ad-row td { padding: 0.5rem 0; }

/* Free champion rotation. */
.champ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.champ-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    font-size: 0.85rem;
}

.champ-card img { border-radius: 8px; }
.champ-card:hover { border-color: var(--accent); }

/* Server status page. */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.status-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    border-left: 4px solid var(--border);
}

.status-card .status-region { font-weight: 700; }
.status-card .status-label { font-size: 0.85rem; color: var(--muted); }
.status-ok { border-left-color: #3fb950; }
.status-issues { border-left-color: #f85149; }
.status-maint, .status-maintenance { border-left-color: #d29922; }

.status-banner {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 10px;
    margin: 1rem 0;
}

.status-banner.status-ok { border-left-color: #3fb950; }
.status-banner.status-issues { border-left-color: #f85149; }
.status-banner.status-maint { border-left-color: #d29922; }

.status-entry {
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid var(--border);
}

.status-entry h2 { font-size: 1.05rem; margin: 0.25rem 0; }

/* Keep the footer clickable above the NitroPay bottom anchor slot. */
.has-anchor { padding-bottom: 110px; }

.site-footer {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* NitroPay-injected consent controls (Manage Consent / Do Not Sell links). */
.site-footer #ncmp-consent-link button,
.site-footer [data-ccpa-link] a {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
}

/* Home sections share one heading scale so the page reads as one system. */
.recent-changes h2,
.watchlist h2 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.6rem;
}

.watchlist h2 { margin-top: 0.5rem; }

.change-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.change-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
}

.change-list a {
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.change-list a:hover { color: var(--accent); }
.change-meta { color: var(--text-dim); white-space: nowrap; }

.combo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
}

.combo-chip {
    display: block;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combo-chip:hover { border-color: var(--accent); color: var(--text); }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 1rem 0;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font: inherit;
}

.contact-form button {
    align-self: flex-start;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: 6px;
    padding: 0.5rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
}

.contact-form button:hover { background: var(--accent-hover); }
.form-error { color: #e05c5c; }

.content {
    margin: 2.5rem 0 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* Full-width section, readable-measure text. */
.content p { max-width: 46rem; }

.content h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.content h3 { font-size: 1.02rem; margin: 1.1rem 0 0.3rem; color: var(--accent); }
.content p { margin: 0.4rem 0 0.9rem; color: var(--text-dim); }
.content strong { color: var(--text); }

/* --- Mobile ------------------------------------------------------------- */

@media (max-width: 700px) {
    .site-header {
        gap: 0.6rem;
        padding: 0.6rem 0.9rem;
    }

    /* Row 1: brand left, theme + language right. Row 2: swipeable nav. */
    .brand { margin-right: auto; }

    .site-nav {
        order: 3;
        flex: 0 0 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        gap: 1rem;
        padding-bottom: 0.15rem;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar { display: none; }

    /* Fade hint while more nav items hide off-screen to the right
       (the .nav-more class is toggled by the scroll listener). */
    .site-nav.nav-more {
        -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
        mask-image: linear-gradient(to right, #000 82%, transparent);
    }

    .lang-select { max-width: 9rem; }

    .site-main { padding: 1rem 0.9rem; }
    .hero { padding: 1.25rem 0 0.5rem; }
    .hero h1 { font-size: 1.8rem; }

    .search-form input {
        min-width: 0;
        flex: 1 1 10rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .change-list { grid-template-columns: 1fr; }
}
