/* Nobody Knows: Ravenmoor Hall theme. Storm grey, deep green, candle gold (design doc: Key Art).
   Mobile-first: phones support the party, so large text, one-handed use, two taps to anything. */

:root {
    --bg: #141a18;
    --bg-raised: #1d2522;
    --bg-sunk: #0f1412;
    --line: #2f3b36;
    --text: #ece6d6;
    --muted: #a39d8c;
    --gold: #d8b25a;
    --gold-strong: #f0cd75;
    --green: #2f5d4b;
    --green-strong: #3f7a62;
    --danger: #d9776a;
    --ok: #8fc29d;
    --radius: 14px;
    --tabbar: 64px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(120% 60% at 50% 0%, #22302b 0%, var(--bg) 60%) fixed, var(--bg);
    color: var(--text);
    font-family: "Source Sans 3", system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2rem; color: var(--gold-strong); }
h2 { font-size: 1.4rem; color: var(--gold); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--gold); }

.page { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar) + 24px); min-height: 100vh; }
.center { text-align: center; padding-top: 12vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

/* ---- Buttons and inputs ---- */

.button, button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px;
    border-radius: var(--radius); border: 1px solid var(--gold);
    background: var(--gold); color: #1a1408;
    font: 600 1rem "Source Sans 3", sans-serif; text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { background: var(--gold-strong); }
button:disabled { opacity: .5; cursor: default; }
.button.secondary, button.secondary { background: transparent; color: var(--gold); }
.button.secondary:hover, button.secondary:hover { background: rgba(216, 178, 90, .1); }
button.ghost { background: transparent; border-color: var(--line); color: var(--text); min-height: 40px; padding: 0 12px; }
.block { width: 100%; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
input, select {
    width: 100%; min-height: 48px; padding: 0 14px;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--bg-sunk); color: var(--text); font: inherit;
}
input:focus, select:focus, button:focus-visible, .button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }

/* ---- Cards ---- */

.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.highlight { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(216, 178, 90, .25), 0 8px 30px rgba(0, 0, 0, .35); }
.card + .card { margin-top: 12px; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

.hero { text-align: center; padding: 10vh 0 24px; }
.hero .title { font-family: "Playfair Display", serif; font-size: 2.6rem; color: var(--gold-strong); line-height: 1.1; }
.hero .tagline { color: var(--muted); font-style: italic; margin-top: 8px; }

.alert { border-radius: var(--radius); padding: 12px 14px; background: rgba(217, 119, 106, .12); border: 1px solid var(--danger); color: #f4c7c0; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 16px); max-width: 528px; margin: 0 auto; z-index: 20; }

.join-code { font-family: "Playfair Display", serif; font-size: 2.2rem; letter-spacing: .08em; color: var(--gold-strong); }

/* ---- Lists ---- */

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.gold { border-color: var(--gold); color: var(--gold); }
.pill.ok { border-color: var(--ok); color: var(--ok); }

/* ---- In-game chrome ---- */

.topbar {
    position: sticky; top: 0; z-index: 10; margin: -16px -16px 16px; padding: 12px 16px;
    background: rgba(20, 26, 24, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .mystery { font-family: "Playfair Display", serif; color: var(--gold); }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; font-weight: 600; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(15, 20, 18, .96); border-top: 1px solid var(--line);
}
.tabbar button {
    min-height: var(--tabbar); border: 0; border-radius: 0; background: transparent; color: var(--muted);
    flex-direction: column; gap: 2px; font-size: .8rem; padding: 0; position: relative;
}
.tabbar button .icon { font-size: 1.3rem; line-height: 1; }
.tabbar button.active { color: var(--gold-strong); }
.tabbar button .dot { position: absolute; top: 10px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.clue { border-left: 3px solid var(--line); padding: 10px 12px; background: var(--bg-raised); border-radius: 0 var(--radius) var(--radius) 0; }
.clue + .clue { margin-top: 10px; }
.clue.Private { border-left-color: var(--gold); }
.clue.Public { border-left-color: var(--green-strong); }
.clue.Search { border-left-color: var(--ok); }
.clue .meta { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }

.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.filters button { min-height: 36px; padding: 0 14px; border-color: var(--line); background: transparent; color: var(--muted); }
.filters button.active { border-color: var(--gold); color: var(--gold); }

.secret {
    width: 100%; text-align: left; min-height: 64px; padding: 14px; justify-content: flex-start;
    background: var(--bg-sunk); color: var(--muted); border: 1px dashed var(--line); font-weight: 400;
}
.secret:hover { background: var(--bg-sunk); }
.secret.shown { color: var(--text); border-style: solid; border-color: var(--gold); }

.choice { display: grid; gap: 8px; }
.choice button { justify-content: flex-start; background: var(--bg-raised); color: var(--text); border-color: var(--line); text-align: left; }
.choice button.selected { border-color: var(--gold); background: rgba(216, 178, 90, .12); color: var(--gold-strong); }

.stars button { min-height: 36px; padding: 0 6px; border: 0; background: transparent; color: var(--line); font-size: 1.25rem; }
.stars button.on { color: var(--gold); }

/* ---- Reveal ---- */

.countdown { font-family: "Playfair Display", serif; font-size: 7rem; color: var(--gold-strong); text-align: center; padding-top: 20vh; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }
.verdict { text-align: center; padding: 24px 0 8px; }
.verdict .killer { font-family: "Playfair Display", serif; font-size: 2rem; color: var(--gold-strong); }

/* ---- Blazor error UI ---- */

#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 16px; background: #5b2a24; color: #fff; }
#blazor-error-ui .reload { color: #fff; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .countdown { animation: none; } }
