/* Name Drop — design tokens are the source of truth for brand colours & fonts. */

:root {
    --primary: #c41230;
    --primary-deep: #8b0000;
    --primary-soft: #e23d55;
    --accent: #f5d76e;
    --nav-bg: #0e0e10;
    --ink: #f2f2f3;
    --ink-muted: #a0a0ab;
    --bg: #121214;
    --surface: #1c1c21;
    --surface-raised: #25252c;
    --border: rgba(255, 255, 255, 0.08);
    --success: #3dd68c;
    --danger: #ff6b81;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Stardos Stencil", "Stencil", Impact, sans-serif;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(ellipse 70% 40% at 10% 0%, rgba(196, 18, 48, 0.14), transparent 55%),
        radial-gradient(ellipse 50% 35% at 100% 10%, rgba(139, 0, 0, 0.12), transparent 50%),
        var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

/* --- nav ------------------------------------------------------------- */
header.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(14, 14, 16, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 28px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

header.nav .brand {
    font-weight: 700;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}

header.nav .brand img {
    max-height: 42px;
    width: auto;
    display: block;
}

header.nav .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
header.nav .bt {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
header.nav .bs {
    font-size: .68rem;
    opacity: .7;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

header.nav .links { display: flex; gap: 4px; flex-wrap: wrap; }
header.nav .item { position: relative; }

header.nav .item > a {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    opacity: .78;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 999px;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

header.nav .item > a:hover {
    opacity: 1;
    background: rgba(196, 18, 48, 0.18);
    color: #fff;
}

header.nav .sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--nav-bg);
    padding: 8px;
    border-radius: 0 0 8px 8px;
    min-width: 170px;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .4);
    z-index: 20;
    border: 1px solid var(--border);
}

header.nav .item:hover .sub,
header.nav .item:focus-within .sub { display: flex; }

header.nav .sub a {
    color: #fff;
    opacity: .85;
    text-decoration: none;
    font-size: .9rem;
    padding: 4px 6px;
}

header.nav .sub a:hover { opacity: 1; }

.nt { display: none; }

.hamb {
    display: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}

@media (max-width: 768px) {
    .hamb { display: block; }
    header.nav .links { display: none; flex-basis: 100%; flex-direction: column; gap: 6px; }
    .nt:checked ~ .links { display: flex; }
    header.nav .sub { position: static; display: flex; padding: 2px 0 2px 16px; box-shadow: none; background: transparent; border: 0; }
}

/* --- page head (inner pages) ------------------------------------------ */
.page-head {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(196, 18, 48, 0.18) 0%, transparent 70%),
        linear-gradient(145deg, #1a0a0c 0%, #121214 55%, #0e0e10 100%);
    color: #fff;
    padding: 48px 24px 40px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.page-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-deep), var(--primary), transparent 70%);
}

.page-head-inner {
    max-width: var(--max);
    margin: 0 auto;
}

.page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.8vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-head-sub {
    margin: 0.65rem 0 0;
    opacity: 0.78;
    font-size: 1rem;
    max-width: 48ch;
    color: var(--ink-muted);
}

.page-kicker {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(245, 215, 110, 0.08);
    border: 1px solid rgba(245, 215, 110, 0.28);
    border-radius: 999px;
}

/* --- content sections ------------------------------------------------- */
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 40px 24px 72px;
}

.prose {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px;
}

.prose h2 { margin-top: 0; }
.prose a { color: var(--primary-soft); }

/* --- footer ------------------------------------------------------------ */
footer.foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 22px 28px;
    margin-top: auto;
    font-size: .82rem;
    flex-wrap: wrap;
    color: var(--ink-muted);
    border-top: 1px solid var(--border);
    background: var(--nav-bg);
}

footer.foot .tag {
    opacity: 0.75;
}

/* --- admin / winners -------------------------------------------------- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding-top: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 22px;
    position: relative;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--primary-deep), var(--primary-soft), transparent);
    opacity: 0.85;
}

.panel-wide {
    grid-column: 1 / -1;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.panel-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(160, 160, 171, 0.12);
    color: var(--ink-muted);
    border: 1px solid var(--border);
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-muted);
}

.badge[data-on="true"] {
    background: rgba(61, 214, 140, 0.1);
    color: var(--success);
    border-color: rgba(61, 214, 140, 0.28);
}

.badge[data-on="true"]::before {
    background: var(--success);
    box-shadow: 0 0 8px rgba(61, 214, 140, 0.7);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-stack label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.form-stack label span { font-weight: 600; }

.form-stack small,
.manual-add small,
.muted {
    font-weight: 400;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.form-stack input[type="text"],
.form-stack input[type="password"],
.form-stack input[type="color"],
.inline-form input[type="text"] {
    appearance: none;
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

.form-stack input::placeholder,
.inline-form input::placeholder {
    color: rgba(160, 160, 171, 0.7);
}

.form-stack input:focus,
.inline-form input:focus {
    outline: 2px solid rgba(196, 18, 48, 0.4);
    border-color: var(--primary-soft);
}

.form-fieldset {
    margin: 6px 0 0;
    padding: 16px 14px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-fieldset legend {
    padding: 0 8px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.fieldset-lede {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-muted);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-field input[type="color"] {
    width: 48px;
    min-width: 48px;
    height: 42px;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-field input[type="text"] {
    flex: 1;
    min-width: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

@media (max-width: 560px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

.status {
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.lede {
    margin: 0 0 1rem;
    color: var(--ink-muted);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0.5rem 0 1rem;
}

.btn-row.wrap { margin-bottom: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease, filter .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(145deg, var(--primary), var(--primary-soft));
    color: #fff;
    box-shadow: 0 8px 22px rgba(196, 18, 48, 0.32);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-danger {
    background: rgba(255, 107, 129, 0.08);
    color: var(--danger);
    border-color: rgba(255, 107, 129, 0.32);
}

.btn-danger:hover {
    background: rgba(255, 107, 129, 0.16);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.16);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 1rem 0 1.25rem;
}

.stat {
    background: linear-gradient(160deg, rgba(196, 18, 48, 0.14), rgba(37, 37, 44, 0.9));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.85rem;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.manual-add {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.manual-add h3 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inline-form {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.inline-form input { flex: 1; }

.name-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.name-list li {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(196, 18, 48, 0.12);
    border: 1px solid rgba(196, 18, 48, 0.28);
    font-size: 0.92rem;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.empty-hint {
    margin: 0.75rem 0 0;
    color: var(--ink-muted);
    font-size: 0.95rem;
}

.winner-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.winner-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
}

.winner-rank {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.winner-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.winner-time {
    font-size: 0.82rem;
    color: var(--ink-muted);
}

@media (max-width: 860px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* --- wiki ------------------------------------------------------------- */
.wiki {
    max-width: var(--max);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 0;
}

.wiki .panel h2 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wiki .panel > p {
    margin: 0.75rem 0 0;
    color: var(--ink-muted);
}

.wiki-steps {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--ink-muted);
}

.wiki-steps li {
    margin-bottom: 0.55rem;
}

.wiki-steps li:last-child {
    margin-bottom: 0;
}

.wiki-steps strong {
    color: var(--ink);
}

.wiki-defs {
    margin: 0;
}

.wiki-defs dt {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.wiki-defs dt:first-child {
    margin-top: 0;
}

.wiki-defs dd {
    margin: 0.25rem 0 0;
    color: var(--ink-muted);
}

.wiki-defs code {
    font-size: 0.9em;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(245, 215, 110, 0.08);
    border: 1px solid rgba(245, 215, 110, 0.2);
    color: var(--accent);
}

.wiki-back {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 !important;
}

.wiki a.btn { color: inherit; }
