/* Realm Mega Challenge List — HUD theme shared with homeweb (homeweb/src/index.css tokens) */

:root {
    --bg-void: #0c100e;
    --bg-deep: #121a16;
    --bg-panel: rgba(18, 28, 24, 0.78);
    --bg-input: #0e1512;
    --border-dim: rgba(180, 200, 180, 0.12);
    --border-hot: rgba(255, 140, 0, 0.45);
    --text: #e8ebe9;
    --text-dim: #96a89a;
    --accent: #ff7a00;
    --accent-dim: rgba(255, 122, 0, 0.15);
    --tactical: #c4f031;
    --tactical-dim: rgba(196, 240, 49, 0.12);
    --bad: #ff6b6b;
    --font-display: "Rajdhani", system-ui, sans-serif;
    --font-mono: "Share Tech Mono", ui-monospace, monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --max: 980px;
    --header-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
/* Filters hide rows with the hidden attribute; rows set display: grid, which would otherwise override it. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg-deep);
    background-image:
        linear-gradient(rgba(196, 240, 49, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(196, 240, 49, 0.045) 1px, transparent 1px),
        radial-gradient(ellipse 100% 80% at 50% -20%, rgba(255, 122, 0, 0.1), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 50%, rgba(196, 240, 49, 0.06), transparent 45%);
    background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
    background-attachment: fixed;
    overflow-x: hidden;
}

a { color: var(--accent); }
a:hover { color: #ffa24d; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-dim);
    background: rgba(12, 18, 15, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header__inner {
    max-width: var(--max);
    margin: 0 auto;
    min-height: var(--header-h);
    padding: 0.5rem 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 1rem;
}
.brand:hover { color: var(--text); }
.brand__mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: var(--tactical-dim);
    border: 1px solid rgba(196, 240, 49, 0.35);
    color: var(--tactical);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.brand__sub { color: var(--text-dim); font-weight: 500; letter-spacing: 0.08em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.nav a {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-dim);
    padding: 0.4rem 0.65rem;
    border: 1px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); border-color: var(--border-hot); background: var(--accent-dim); }
.nav .who { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.35rem; color: var(--text-dim); font-size: 0.85rem; }
.nav .who img { width: 24px; height: 24px; border-radius: 50%; }

/* ---------- Layout ---------- */
.page { max-width: var(--max); margin: 0 auto; padding: 1.5rem 16px 4rem; }
.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tactical);
    margin: 0 0 0.35rem;
}
h1, h2, h3 { line-height: 1.15; margin: 0; }
.page-title { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.lead { color: var(--text-dim); max-width: 42rem; margin: 0.5rem 0 0; }

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
}
.panel + .panel { margin-top: 1rem; }

/* ---------- Buttons & inputs ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.btn--primary { color: #0c100e; background: linear-gradient(135deg, rgba(255, 122, 0, 0.95), #c45a00); border-color: var(--border-hot); }
.btn--primary:hover { color: #0c100e; background: linear-gradient(135deg, rgba(255, 122, 0, 0.95), #c45a00); filter: brightness(1.08); }
.btn--discord { color: #fff; background: #5865f2; border-color: #5865f2; }
.btn--discord:hover { color: #fff; background: #4752c4; border-color: #4752c4; }
.btn--danger { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.06); }
.btn--sm { padding: 0.32rem 0.7rem; font-size: 0.76rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field + .field { margin-top: 1rem; }
.field__label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.field__hint { font-size: 0.82rem; color: var(--text-dim); }
input[type="text"], input[type="url"], input[type="search"], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
}
textarea { min-height: 5rem; resize: vertical; }
input[type="file"] { font-family: inherit; color: var(--text-dim); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-hot); box-shadow: 0 0 0 3px var(--accent-dim); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.55rem;
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text-dim);
    white-space: nowrap;
}
.chip--done, .chip--approved { color: var(--tactical); border-color: rgba(196, 240, 49, 0.4); background: var(--tactical-dim); }
.chip--pending { color: #ffc48a; border-color: var(--border-hot); background: var(--accent-dim); }
.chip--rejected { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); }

.banner {
    border: 1px solid var(--border-hot);
    background: var(--accent-dim);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin: 0 0 1.25rem;
    color: #ffd2a6;
}
.banner strong { color: #fff; }

.status { min-height: 1.4em; font-size: 0.9rem; margin: 0.75rem 0 0; }
.status.is-ok { color: var(--tactical); }
.status.is-err { color: var(--bad); }

/* ---------- Progress ---------- */
.bar { height: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-dim); overflow: hidden; }
.bar__fill { height: 100%; background: linear-gradient(90deg, var(--accent), #c45a00); transition: width 0.4s; }
.bar__fill.is-full { background: var(--tactical); }

.hero {
    display: grid;
    gap: 1.25rem;
    align-items: end;
    margin-bottom: 1.5rem;
}
@media (min-width: 720px) { .hero { grid-template-columns: minmax(0, 1fr) 18rem; } }
.counter { text-align: left; }
@media (min-width: 720px) { .counter { text-align: right; } }
.counter__num { font-family: var(--font-mono); font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); color: var(--accent); line-height: 1; }
.counter__num small { font-size: 0.45em; color: var(--text-dim); }
.counter__label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-top: 0.35rem; }
.counter .bar { margin-top: 0.6rem; }

.sections-strip { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); margin-bottom: 1.5rem; }
.sections-strip a {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
}
.sections-strip a:hover { border-color: var(--border-hot); color: var(--text); }
.sections-strip .top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.88rem; font-weight: 600; }
.sections-strip .top span:last-child { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.8rem; }
.sections-strip .bar { height: 6px; margin-top: 0.4rem; }

/* ---------- Filters ---------- */
.filters {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.65rem 0;
    margin-bottom: 0.5rem;
    background: linear-gradient(var(--bg-deep) 75%, transparent);
}
@media (min-width: 720px) { .filters { grid-template-columns: minmax(0, 1fr) 11rem 13rem; } }
.filters select { min-width: 0; }
.filters .filter-section { grid-column: 1 / -1; }
@media (min-width: 720px) { .filters .filter-section { grid-column: auto; } }
.filter-count { font-size: 0.82rem; color: var(--text-dim); margin: 0 0 1rem; font-family: var(--font-mono); }

/* ---------- Challenge list ---------- */
.cat { margin-bottom: 2rem; scroll-margin-top: calc(var(--header-h) + 5rem); }
.cat__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border-dim); padding-bottom: 0.45rem; margin-bottom: 0.25rem; }
.cat__head h2 { font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; }
.cat__head .mono { color: var(--text-dim); font-size: 0.85rem; }
.cat--legendary .cat__head h2 { color: #ffc48a; }

.ch-list { list-style: none; margin: 0; padding: 0; }
.ch {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
    align-items: start;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
@media (min-width: 720px) { .ch { grid-template-columns: 1.6rem 4.6rem minmax(0, 1fr) auto; align-items: center; } }
.ch__box {
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid rgba(180, 200, 180, 0.35);
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    line-height: 1;
    margin-top: 0.1rem;
}
.ch.is-done .ch__box { border-color: var(--tactical); background: var(--tactical-dim); color: var(--tactical); }
.ch.is-pending .ch__box { border-color: var(--border-hot); color: var(--accent); }
.ch__id { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim); }
.ch__main { min-width: 0; }
.ch__title { color: var(--text); text-decoration: none; font-weight: 600; }
.ch__title:hover { color: var(--accent); }
.ch.is-done .ch__title { color: var(--text-dim); }
.ch__mobile-id { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); margin-right: 0.4rem; }
.ch__side { grid-column: 2 / -1; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-dim); }
@media (min-width: 720px) {
    .ch__mobile-id { display: none; }
    .ch__side { grid-column: auto; justify-content: flex-end; }
}
@media (max-width: 719px) { .ch__id { display: none; } }
.ch__side img { width: 22px; height: 22px; border-radius: 50%; }
.empty { text-align: center; color: var(--text-dim); padding: 2.5rem 1rem; }

/* ---------- Challenge detail ---------- */
.back { display: inline-block; margin-bottom: 1rem; font-size: 0.85rem; text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
.detail-grid { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 820px) { .detail-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.panel h2 { font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75rem; }
.done-by { display: flex; align-items: center; gap: 0.75rem; }
.done-by img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--tactical); }
.proof-media { margin-top: 1rem; }
.proof-media img, .proof-media video { display: block; width: 100%; max-height: 28rem; object-fit: contain; background: #000; border: 1px solid var(--border-dim); border-radius: var(--radius-sm); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.55rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.9rem; }
.history li:last-child { border-bottom: 0; }
.history img { width: 22px; height: 22px; border-radius: 50%; }
.history .when { margin-left: auto; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }
.history .why { flex-basis: 100%; color: var(--text-dim); font-size: 0.82rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th { text-align: left; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border-dim); white-space: nowrap; }
table.data td { padding: 0.6rem 0.7rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.data td.num { font-family: var(--font-mono); }
table.data .who { display: inline-flex; align-items: center; gap: 0.5rem; }
table.data .who img { width: 26px; height: 26px; border-radius: 50%; }
table.data tr.is-me td { background: var(--accent-dim); }
.rank-1 { color: #ffd34d; }
.rank-2 { color: #d9dee2; }
.rank-3 { color: #e0965a; }

/* ---------- Landing ---------- */
.landing { min-height: calc(100vh - var(--header-h)); display: grid; align-content: center; gap: 2rem; padding-top: 2rem; }
.landing .page-title { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }
.landing .counter { text-align: left; max-width: 26rem; }
.rules { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.rules .panel { padding: 0.9rem 1rem; }
.rules h3 { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tactical); margin-bottom: 0.3rem; }
.rules p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

.site-footer { border-top: 1px solid var(--border-dim); padding: 1.25rem 16px; text-align: center; font-size: 0.8rem; color: var(--text-dim); }
