/* Treasure Hunt #1: dark club room, walnut and gilt. One committed dark look. */
:root {
  --walnut: #1a110b;
  --panel: #261910;
  --panel-2: #33231a;
  --line: #3b2a1e;
  --line-2: #5a4330;
  --gold: #e9c46f;
  --gold-dim: #8a6d35;
  --cream: #f2e6cf;
  --muted: #b8a284;
  --ember: #e59a6b;
  --display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--walnut); color: var(--cream);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--gold); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); color: var(--gold); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.75rem); color: var(--gold); }
h3 { font-size: 1.1rem; color: var(--cream); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
code { font-size: .9em; color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1000px; margin: 0 auto; }
.read { max-width: 42rem; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; }
.lede { font-size: 1.15rem; }

/* prize strip on every page */
.pool-strip { background: linear-gradient(90deg, #3a2812, #5b4217 50%, #3a2812); border-bottom: 1px solid var(--gold-dim); text-align: center; font-size: .95rem; }
.pool-strip a { display: block; padding: 7px 0; color: var(--cream); text-decoration: none; letter-spacing: .02em; }
.pool-strip strong { color: var(--gold); font-family: var(--display); font-size: 1.05rem; }

header.site { background: var(--walnut); border-bottom: 1px solid var(--line); padding-block: 10px; position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; }
.brand { font-family: var(--display); font-size: 1.1rem; color: var(--cream); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--gold); }
nav.main { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
nav.main ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
nav.main a, .linkish { display: block; padding: 6px 9px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; font: inherit; font-size: .97rem; }
nav.main a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
nav.main a:hover, .linkish:hover { color: var(--cream); }
.linkish { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
nav.main .nav-cta { color: var(--gold); }
@media (max-width: 720px) {
  header.site { position: static; }
  nav.main { overflow: visible; }
  nav.main ul { flex-wrap: wrap; gap: 0 2px; }
  nav.main a, .linkish { padding: 5px 7px; font-size: .93rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
nav.main form { margin: 0; }

main { padding-block: 28px 64px; }
main > .wrap { display: grid; gap: 28px; }
footer { border-top: 1px solid var(--line); padding-block: 22px; color: var(--muted); font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-row a { color: var(--muted); }

/* prize banner */
.pool-banner { text-align: center; padding: 26px 16px 22px; background: radial-gradient(ellipse at 50% 0%, rgba(233,196,111,.18), transparent 70%), var(--panel); border: 1px solid var(--gold-dim); display: grid; gap: 4px; }
.pool-label { font-family: var(--display); color: var(--muted); font-size: 1rem; letter-spacing: .04em; }
.pool-amount { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: clamp(2.6rem, 9vw, 4.4rem); line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.pool-meta { color: var(--muted); font-size: .95rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; }
.pool-meta .gain { color: var(--gold); }
.pool-formula { color: var(--muted); font-size: .88rem; max-width: 40rem; margin: 6px auto 0; }

.split-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.split-list li { background: var(--panel); padding: 12px 10px; display: grid; gap: 2px; text-align: center; min-width: 0; }
.split-list li:first-child { background: radial-gradient(circle at 50% 0%, rgba(233,196,111,.22), transparent 70%), var(--panel); }
.split-list .place { font-family: var(--display); color: var(--muted); font-size: .92rem; }
.split-list .pct { font-family: var(--display); color: var(--gold); font-size: 1.35rem; font-weight: 700; }
.split-list .amt { color: var(--cream); font-variant-numeric: tabular-nums; font-size: .95rem; }
@media (max-width: 560px) {
  .split-list { grid-template-columns: repeat(20, minmax(0, 1fr)); }
  .split-list li { grid-column: span 4; padding: 10px 2px; }
  .split-list li:first-child { grid-column: span 20; }
  .split-list li:nth-child(n+2):nth-child(-n+5) { grid-column: span 10; }
  .split-list li:nth-child(n+6) .pct { font-size: 1.05rem; }
  .split-list li:nth-child(n+6) .amt, .split-list li:nth-child(n+6) .place { font-size: .8rem; }
}
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: center; }
.hero .cover { width: 100%; border: 1px solid var(--gold-dim); box-shadow: 0 18px 40px rgba(0,0,0,.55); }
.state { color: var(--gold); }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } .hero .cover { max-width: 210px; justify-self: center; order: -1; } }

.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btnrow form { margin: 0; }
.btn { font: 600 1rem var(--body); padding: 11px 20px; border-radius: 3px; border: 1px solid var(--gold); background: var(--gold); color: var(--walnut); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.quiet { background: transparent; border-color: var(--gold-dim); color: var(--cream); font-weight: 400; }
.btn:hover { filter: brightness(1.08); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0; }
.facts div { background: var(--panel); padding: 14px 16px; min-width: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 2px 0 0; font-family: var(--display); overflow-wrap: anywhere; }

ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 2.2rem minmax(0,1fr); gap: 12px; }
ol.steps li::before { content: counter(s); font-family: var(--display); color: var(--gold); font-size: 1.4rem; line-height: 1.2; text-align: right; }

.motto { text-align: center; font-family: var(--display); font-style: italic; color: var(--muted); font-size: 1.15rem; }

/* the Wall */
.wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 2.4vw, 22px); padding: clamp(12px, 3vw, 28px);
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 120px), linear-gradient(180deg, #2b1a10, #1f140d); border: 1px solid var(--line); }
.slot { display: grid; gap: 6px; justify-items: center; align-content: start; min-width: 0; }
.frame { width: 100%; aspect-ratio: 3 / 4; position: relative; border: clamp(4px, 1.3vw, 10px) solid transparent;
  border-image: linear-gradient(135deg, #f6dc92, #a87d33 35%, #f0cf7a 55%, #7a5a24) 1;
  background: linear-gradient(180deg, #2a1a10, #1b110a); box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), 0 6px 14px rgba(0,0,0,.5);
  display: grid; place-items: center; transition: box-shadow .6s ease, background .6s ease; }
.frame .num { font-family: var(--display); color: #5d4528; font-size: clamp(.95rem, 3.2vw, 1.8rem); }
.frame.found { background: radial-gradient(circle at 50% 42%, #fff1c4 0%, #f0c96e 30%, #8a5a22 75%, #4a2f14 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.3), 0 0 26px 6px rgba(240,200,110,.55); }
.frame.found .num { color: #3a240c; }
.frame.found .num::after { content: " \2713"; }
.plaque { font-size: clamp(.62rem, 1.8vw, .82rem); line-height: 1.25; text-align: center; color: var(--muted); overflow-wrap: anywhere; }
.plaque b { display: block; color: var(--cream); font-weight: 600; }
.slot.found .plaque b { color: var(--gold); }
.wall-count { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.wall-count .big { font-family: var(--display); font-size: 1.6rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 30% { box-shadow: 0 0 50px 18px rgba(255,235,170,.9); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } .frame { transition: none; } }
@media (max-width: 480px) { .wall { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; padding: 10px; } .plaque span { display: none; } }

/* panels and forms */
.panel { background: var(--panel); border: 1px solid var(--line); padding: clamp(16px, 3vw, 26px); display: grid; gap: 16px; min-width: 0; }
.panel.gilt { border-color: var(--gold-dim); }
form { margin: 0; }
form.panel, .panel form.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
label, .label { font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=datetime-local], select, textarea {
  font: 1rem var(--body); color: var(--cream); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(233,196,111,.3); }
input[type=file] { font: .95rem var(--body); color: var(--muted); max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 6px; width: 18px; height: 18px; flex: none; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.warn { color: var(--muted); font-size: .93rem; border-left: 3px solid var(--gold-dim); padding-left: 10px; }
.status-line { font-size: 1.05rem; }
.until { color: var(--gold); font-variant-numeric: tabular-nums; }
.searchrow { display: flex; gap: 10px; flex-wrap: wrap; }
.searchrow input { flex: 1 1 220px; }

.msg { padding: 12px 14px; border-radius: 3px; display: flex; gap: 10px; align-items: flex-start; }
.msg::before { flex: none; font-weight: 700; }
.msg.ok { background: rgba(233,196,111,.12); border: 1px solid var(--gold); }
.msg.ok::before { content: "\2713"; color: var(--gold); }
.msg.bad { background: rgba(229,154,107,.1); border: 1px solid var(--ember); }
.msg.bad::before { content: "\2715"; color: var(--ember); }
.msg.info { background: var(--panel-2); border: 1px solid var(--line-2); }
.msg.info::before { content: "i"; font-family: var(--display); font-style: italic; color: var(--gold); }

.recovery { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(1.05rem, 4.4vw, 1.5rem); letter-spacing: .06em; color: var(--gold); background: var(--panel-2); border: 1px dashed var(--gold-dim); padding: 14px; text-align: center; overflow-wrap: anywhere; }
.share-link { overflow-wrap: anywhere; }
.confirm-box { background: var(--panel-2); }
.confirm-box:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.confirm-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(1.3rem, 6vw, 2rem); letter-spacing: .12em; color: var(--gold); text-align: center; padding: 10px; border: 1px dashed var(--gold-dim); overflow-wrap: anywhere; }
input[readonly] { opacity: .7; }
.win { border-color: var(--gold); box-shadow: 0 0 30px rgba(240,200,110,.25); }

/* text pages */
.doc h2 { margin-top: 14px; }
.doc ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }

/* catalog */
.books { display: grid; gap: 22px; }
.book { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: start; background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.book img, .cover-ph { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border: 1px solid var(--gold-dim); }
.cover-ph { display: grid; place-items: center; background: linear-gradient(180deg, #2a1a10, #1b110a); color: var(--muted); font-family: var(--display); text-align: center; padding: 10px; }
.series { color: var(--muted); font-size: .9rem; }
@media (max-width: 520px) { .book { grid-template-columns: 100px minmax(0, 1fr); gap: 14px; padding: 14px; } }

/* tables */
.tablewrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .88rem; }
td.wrapcell { overflow-wrap: anywhere; min-width: 200px; }
.pill { display: inline-block; font-size: .8rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--gold-dim); color: var(--muted); white-space: nowrap; }
.pill.ok { border-color: var(--gold); color: var(--gold); }
.pill.bad { border-color: var(--ember); color: var(--ember); }
.bars { display: flex; height: 10px; }
.bar { display: inline-block; height: 10px; background: var(--gold); }
.bar.wrong { background: repeating-linear-gradient(45deg, var(--ember) 0 4px, #8f5a3c 4px 8px); }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); }
.legend i { width: 14px; margin-right: 6px; vertical-align: middle; }
th.barcol { min-width: 140px; }

/* admin */
.is-admin header.site { background: #140d08; }
.admin-body { gap: 22px; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-tabs a { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--muted); text-decoration: none; }
.admin-tabs a[aria-current="page"] { background: var(--gold); color: var(--walnut); border-color: var(--gold); }
.help-card h3 { font-size: 1rem; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); }

/* Hunt progress: anonymous counts per number of treasures found */
.progress-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.progress-list li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 7.5rem; gap: 12px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.progress-list li:first-child { border-top: 0; }
.progress-list li.top { background: radial-gradient(circle at 0% 50%, rgba(233,196,111,.16), transparent 60%), var(--panel); }
.progress-list li.top .pk { color: var(--gold); font-weight: 700; }
.progress-list .pk { font-family: var(--display); }
.progress-list .pn { text-align: right; font-variant-numeric: tabular-nums; }
.progress-list .bar { height: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.progress-list .bar i { display: block; height: 100%; background: var(--gold-dim); }
.progress-list li.top .bar i { background: var(--gold); }
@media (max-width: 560px) {
  .progress-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 12px; }
  .progress-list .bar { grid-column: 1 / -1; grid-row: 2; }
}
/* Optional news opt-in sits apart from the required confirmations */
.check.optional { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; color: var(--muted); }
/* Radio group on the prize claim form */
.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
/* Admin menu: number of help requests waiting */
nav.main .count { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: 4px; border-radius: 999px; background: var(--ember); color: var(--walnut); font-weight: 700; font-size: .8em; line-height: 1.5; text-align: center; }

/* Contact form trap field: hidden from people, left for bots */
.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}

/* Live standings */
table.standings td:first-child, table.standings td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.standings tr.me td { background: rgba(233,196,111,.14); color: var(--gold); font-weight: 700; }
.pager { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.you-line, .standing-line { margin: 0; }
#me, #standings-title { scroll-margin-top: 110px; }

.note-times { border-left: 3px solid var(--gold); padding: 8px 14px; background: var(--panel); margin: 0; }

td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
