/* Sunset RP website: the same paper, ink and brass as the game menus. The dusk scene from the loading screen
   heads every page; below it the content is set on paper like a frontier newspaper. */
:root {
    --ink: #2b1d12;
    --ink-soft: #5c4632;
    --rule: rgba(43, 29, 18, 0.55);
    --rule-soft: rgba(43, 29, 18, 0.2);
    --paper: #e9dcbc;
    --paper-light: #f3e9d1;
    --paper-dark: #d4c19a;
    --red: #8b2f24;
    --brass: #b8873c;
    --brass-light: #ecd08a;
    --night: #17100b;
    --print: 'IM Fell English', Georgia, serif;
    --caps: 'IM Fell English SC', Georgia, serif;
    --title: 'Rye', Georgia, serif;
    --type: 'Special Elite', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    font-family: var(--print);
    font-size: 18px;
    line-height: 1.55;
    background: var(--night);
    /* the paper always reaches the bottom of the window, however short the page */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body > main.paper { flex: 1; }
a { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 2px dashed var(--brass); outline-offset: 3px; }
img { max-width: 100%; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px max(16px, calc((100vw - 1120px) / 2));
    background: rgba(23, 16, 11, 0.92);
    border-bottom: 1px solid rgba(184, 135, 60, 0.45);
    backdrop-filter: blur(4px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper-light); text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--title); font-size: 1.35rem; letter-spacing: 0.02em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.nav a { font-family: var(--caps); letter-spacing: 0.08em; color: var(--paper); text-decoration: none; font-size: 1.02rem; }
.nav a:hover, .nav a[aria-current] { color: var(--brass-light); }
.btn-login {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
    font-family: var(--caps); letter-spacing: 0.06em; font-size: 0.98rem; color: var(--paper-light) !important;
    border: 1px solid var(--brass); border-radius: 2px;
}
.btn-login:hover { background: rgba(184, 135, 60, 0.18); }

/* ---------- the dusk header ---------- */
.hero {
    position: relative;
    display: grid; place-items: center; text-align: center;
    min-height: 520px; padding: 56px 16px 72px;
    background: linear-gradient(180deg, rgba(23, 16, 11, 0.15), rgba(23, 16, 11, 0.55) 70%, var(--night)),
                url('/img/hero.jpg') center 35% / cover no-repeat;
    color: var(--paper-light);
}
.hero img.badge { width: min(240px, 52vw); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6)); }
.hero h1 { font-family: var(--title); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 14px 0 4px; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7); }
.hero p { font-style: italic; font-size: 1.25rem; margin: 0 auto; max-width: 34ch; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.hero .actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* letterpress buttons */
.btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 11px 22px;
    font-family: var(--caps); font-size: 1.1rem; letter-spacing: 0.1em; text-decoration: none;
    border: 2px solid currentColor; outline: 1px solid currentColor; outline-offset: -6px; border-radius: 1px;
    cursor: pointer; background: none; transition: background 0.15s, color 0.15s;
}
.btn.primary { color: var(--night); background: var(--brass-light); border-color: var(--brass-light); outline-color: var(--night); }
.btn.primary:hover { background: #f5dfa3; }
.btn.light { color: var(--paper-light); }
.btn.light:hover { background: rgba(243, 233, 209, 0.12); }
.btn.ink { color: var(--ink); }
.btn.ink:hover { background: rgba(43, 29, 18, 0.08); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- the paper ---------- */
.paper {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 250, 232, 0.6), transparent 60%),
        linear-gradient(180deg, var(--paper-light), var(--paper) 40%, var(--paper-dark));
    box-shadow: inset 0 0 80px rgba(120, 82, 34, 0.35);
}
.paper::before {   /* a torn top edge where the paper meets the night */
    content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 15px;
    background: var(--paper-light);
    clip-path: polygon(0 60%, 4% 30%, 9% 55%, 15% 20%, 22% 50%, 30% 25%, 37% 60%, 45% 30%, 52% 55%, 60% 20%, 67% 50%, 75% 30%, 82% 60%, 90% 25%, 96% 50%, 100% 35%, 100% 100%, 0 100%);
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* a printed masthead line under each section title */
.section { padding: 56px 0 24px; }
.kicker { font-family: var(--caps); letter-spacing: 0.25em; color: var(--ink-soft); font-size: 0.95rem; text-align: center; }
.section h2 {
    font-family: var(--title); font-weight: 400; text-align: center; font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 4px 0 18px;
    text-wrap: balance;
}
.section h2::after { content: '\2766'; display: block; font-family: var(--print); font-size: 1.1rem; color: var(--red); margin-top: 4px; }
.lede { max-width: 62ch; margin: 0 auto; text-align: center; font-size: 1.15rem; }

/* three columns like a newspaper page, ruled between */
.columns { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 34px; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.columns > div { padding: 22px 22px 24px; }
.columns > div + div { border-left: 1px solid var(--rule-soft); }
.columns h3 { font-family: var(--caps); font-weight: 400; letter-spacing: 0.06em; font-size: 1.3rem; margin: 0 0 6px; }
.columns p { margin: 0; }
.columns .num { font-family: var(--title); font-size: 2rem; line-height: 1; color: var(--red); }

/* how to join: numbered steps (the order matters) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 26px auto 0; max-width: 760px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px dotted var(--rule); }
.steps li::before {
    content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    font-family: var(--title); font-size: 1.3rem; color: var(--red); border: 1.5px solid var(--red);
    box-shadow: inset 0 0 0 3px var(--paper-light), inset 0 0 0 4px var(--red); transform: rotate(-6deg);
}
.steps b { font-family: var(--caps); font-weight: 400; letter-spacing: 0.05em; font-size: 1.15rem; }
.steps code { font-family: var(--type); background: rgba(43, 29, 18, 0.08); padding: 1px 6px; }

/* the telegram book teaser: a ledger with dotted leaders */
.ledger { max-width: 640px; margin: 22px auto 0; }
.ledger .row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); }
.ledger .row .name { font-size: 1.1rem; }
.ledger .row .town { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }
.ledger .row .dots { flex: 1; border-bottom: 1.5px dotted var(--rule); transform: translateY(-5px); }
.ledger .row .po { font-family: var(--type); font-size: 1.05rem; }
.center { text-align: center; }

.footer { padding: 34px 16px 40px; text-align: center; color: var(--ink-soft); font-size: 0.95rem; border-top: 2px solid var(--rule); }
.footer .small { font-size: 0.85rem; margin-top: 6px; }

/* ---------- admin ---------- */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 34px 0 18px; border-bottom: 2px solid var(--rule); }
.admin-head h1 { font-family: var(--title); font-weight: 400; font-size: 2rem; margin: 0; }
.whoami { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--brass); background: #3a2a1a; display: grid; place-items: center; color: var(--brass-light); font-family: var(--title); }
.whoami .role { font-family: var(--caps); letter-spacing: 0.08em; font-size: 0.9rem; color: var(--red); }
.admin-grid { display: grid; grid-template-columns: 260px 1fr; gap: 0 28px; padding: 24px 0 40px; }
.side a { display: block; padding: 9px 4px 9px 12px; border-left: 3px solid transparent; font-family: var(--caps); letter-spacing: 0.06em; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-soft); }
.side a[aria-current] { border-left-color: var(--red); color: var(--red); background: rgba(139, 47, 36, 0.06); }
.side a small { display: block; font-family: var(--print); font-style: italic; letter-spacing: 0; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.stats div { padding: 12px 14px; text-align: center; }
.stats div + div { border-left: 1px solid var(--rule-soft); }
.stats b { display: block; font-family: var(--title); font-weight: 400; font-size: 1.7rem; line-height: 1.2; font-variant-numeric: lining-nums; }
.stats span { font-family: var(--caps); letter-spacing: 0.1em; font-size: 0.85rem; color: var(--ink-soft); }
.panel-title { font-family: var(--caps); letter-spacing: 0.18em; color: var(--ink-soft); margin: 26px 0 8px; font-size: 1rem; }
.search { display: flex; gap: 10px; }
.search input {
    flex: 1; min-width: 0; padding: 9px 12px; font-family: var(--type); font-size: 1rem; color: var(--ink);
    background: rgba(255, 250, 235, 0.5); border: none; border-bottom: 1.5px solid var(--ink);
}
table.ruled { width: 100%; border-collapse: collapse; margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table.ruled th { text-align: left; font-family: var(--caps); font-weight: 400; letter-spacing: 0.08em; color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--rule); white-space: nowrap; }
table.ruled td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); }
table.ruled td.mono { font-family: var(--type); white-space: nowrap; }
.chip { font-family: var(--caps); letter-spacing: 0.06em; font-size: 0.85rem; padding: 1px 8px; border: 1px solid currentColor; border-radius: 2px; }
.chip.on { color: #3f5e36; } .chip.off { color: var(--ink-soft); }
.log li { padding: 6px 0; border-bottom: 1px dotted var(--rule); list-style: none; }
.log { padding: 0; margin: 0; }
.log time { font-family: var(--type); font-size: 0.9rem; color: var(--ink-soft); margin-right: 8px; }

@media (max-width: 860px) {
    .columns { grid-template-columns: 1fr; }
    .columns > div + div { border-left: none; border-top: 1px solid var(--rule-soft); }
    .admin-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats div:nth-child(3) { border-left: none; }
    .nav { gap: 4px 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* phones: the menu goes on its own line under the name */
@media (max-width: 600px) {
    .topbar { flex-wrap: wrap; justify-content: center; position: static; }
    .nav { width: 100%; justify-content: center; }
}
