/* Pub-at-night palette from the mockup: one dark, high-contrast theme for dim pubs. */
:root {
  --night: #0f2019;
  --panel: #173126;
  --line: #2a4a3b;
  --brass: #e8b04b;
  --berry: #d9434f;
  --snow: #f3efe6;
  --mist: #9fb5a9;
  --stale: #6b7a73;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night); color: var(--snow); font-family: var(--body); font-size: 15px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
a { color: var(--brass); }
[hidden] { display: none !important; }

.app { max-width: 420px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; position: relative; }
.app.admin { max-width: 720px; }
.loading { flex: 1; display: grid; place-items: center; font-size: 56px; animation: twinkle 1s infinite alternate; min-height: 100vh; }

/* header + timeline */
header { display: flex; flex-direction: column; gap: 10px; padding-block: 10px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--night); z-index: 1000; }
header.on { animation: drop .5s ease both; }
.hdr-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hdr-title { font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--brass); }
.hdr-me { font: 500 13px var(--body); color: var(--mist); white-space: nowrap; background: none; border: 0; padding: 4px 0;
  display: inline-flex; gap: 6px; align-items: center; cursor: pointer; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.timeline { display: flex; gap: 6px; align-items: center; }
.tl { flex: 1; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--mist);
  font: 700 15px var(--body); cursor: pointer; display: grid; place-items: center; font-variant-numeric: tabular-nums; padding: 0; }
.tl.done { background: color-mix(in srgb, var(--brass) 22%, var(--panel)); color: var(--snow); border-color: var(--brass); }
.tl.now { background: var(--brass); color: var(--night); border-color: var(--brass); }
.tl.locked { opacity: .45; cursor: not-allowed; }
.tl.map { flex: 0 0 48px; font-size: 17px; }
.tl:focus-visible, .btn:focus-visible { outline: 2px solid var(--snow); outline-offset: 2px; }

main.pc-main { flex: 1; position: relative; }
.screen { display: none; flex-direction: column; gap: 16px; padding-block: 18px calc(28px + env(safe-area-inset-bottom, 0px)); min-height: 100%; }
.screen.on { display: flex; animation: fadeUp .45s ease both; }
.screen.centre { text-align: center; justify-content: center; min-height: 70vh; }

/* greeting */
.greet { justify-content: center; text-align: center; gap: 10px; cursor: pointer; min-height: 100vh; }
.hi { font-size: 18px; color: var(--mist); margin: 0; }
.hi b { color: var(--snow); }
.big { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 13vw, 58px); line-height: .95; color: var(--brass); text-wrap: balance; }
.big span { color: var(--berry); }
.hint { font-size: 12px; color: var(--mist); margin-top: 18px; }
.lights { display: flex; justify-content: center; gap: 14px; margin-bottom: 8px; }
.lights i { width: 10px; height: 14px; border-radius: 50% 50% 45% 45%; display: block; animation: twinkle 1.6s infinite alternate; }
.lights i:nth-child(odd) { background: var(--berry); }
.lights i:nth-child(even) { background: var(--brass); animation-delay: .8s; }
.code-card { margin-top: 18px; background: var(--panel); border: 1px dashed var(--brass); border-radius: 14px; padding: 14px; display: grid; gap: 4px; text-align: center; cursor: default; }
.code-card span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.code-card strong { font-family: var(--display); font-size: 40px; letter-spacing: .2em; color: var(--brass); }
.code-card small { color: var(--mist); line-height: 1.4; }

/* type */
h2 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; margin: 0; text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 12px 0 0; color: var(--brass); }
.sub { color: var(--mist); margin: 4px 0 0; line-height: 1.45; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.tiny { font-size: 12px; color: var(--mist); text-align: center; margin: 0; }

/* avatars: round cartoon bubbles */
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex: none; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .em { font-size: 18px; line-height: 1; }
.avatar.big-av { width: 56px; height: 56px; background: var(--panel); border: 2px solid var(--brass); }
.avatar.big-av .em { font-size: 34px; }

/* map */
.map { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; border: 1px solid var(--line); background: #13281f; display: block; z-index: 0; overflow: hidden; }
.map .leaflet-tile-pane { filter: brightness(.72) contrast(1.05) saturate(.6) hue-rotate(-10deg); }
.leaflet-container { font-family: var(--body); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--snow); border: 1px solid var(--brass); }
.leaflet-popup-content { margin: 10px 14px; font-size: 14px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--mist); }
.leaflet-control-attribution { background: rgba(15, 32, 25, .7) !important; color: var(--mist) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--mist) !important; }
.pc-pub { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--body);
  background: var(--panel); color: var(--snow); border: 2px solid var(--brass); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pc-pub.done { background: var(--brass); color: var(--night); }
.pc-pub.next { background: var(--berry); }
.pc-pin { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fffaf0, #f3e2c0);
  border: 3px solid var(--snow); box-shadow: 0 3px 8px rgba(0,0,0,.55); display: grid; place-items: center; overflow: hidden; position: relative;
  transition: filter .3s, opacity .3s; }
.pc-pin span { font-size: 24px; line-height: 1; transform: translateY(1px); }
/* Leaflet's ".leaflet-container .leaflet-marker-pane img" sets width:auto/max-width:none !important; out-rank it so photos fit the pin. */
.leaflet-container .pc-pin img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: cover; }
.pc-pin.me { border-color: var(--brass); animation: bob 1.8s ease-in-out infinite alternate; }
.pc-pin.stale { filter: grayscale(1); opacity: .5; }

/* who */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.who div { display: flex; gap: 6px; align-items: center; min-width: 0; }
.who .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .at { color: var(--brass); font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; }
.who .ago { color: var(--mist); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 28px; text-align: right; }
.who .grey { color: var(--stale); }
.who .grey .avatar { filter: grayscale(1); opacity: .55; }

.plan, .late, .hint-box { border-radius: 12px; padding: 10px 14px; line-height: 1.4; font-size: 14px; }
.plan { background: var(--panel); color: var(--mist); }
.late { background: color-mix(in srgb, var(--brass) 18%, var(--panel)); border: 1px solid var(--brass); }
.hint-box { background: var(--panel); border: 1px solid var(--line); color: var(--mist); }

/* feed */
.feed-h { margin-top: 8px; }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shot { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--panel); text-decoration: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot > span { position: absolute; inset: auto 0 0 0; padding: 14px 6px 4px; font-size: 11px; color: var(--snow);
  background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; align-items: center; gap: 4px; }
.shot .avatar { width: 18px; height: 18px; }
.shot .avatar .em { font-size: 14px; }

/* buttons */
.btn { appearance: none; border: 0; border-radius: 14px; min-height: 56px; padding: 0 20px; font: 700 18px var(--body); cursor: pointer;
  background: var(--brass); color: var(--night); width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; user-select: none; -webkit-user-select: none; }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.ghost { background: transparent; color: var(--snow); border: 1px solid var(--line); font-weight: 500; font-size: 16px; }
.btn.berry { background: var(--berry); color: var(--snow); }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 14px; width: auto; border-radius: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.spin { display: inline-block; animation: bob .5s ease-in-out infinite alternate; }

/* pub */
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--mist); align-items: baseline; }
.meta a { font-weight: 700; white-space: nowrap; font-size: 15px; padding: 6px 0; }
.sign-wrap { display: grid; place-items: center; padding-block: 22px 4px; }
.sign { width: 200px; max-width: 100%; aspect-ratio: 4/5; border-radius: 12px; border: 6px solid var(--brass);
  background: radial-gradient(circle at 50% 35%, #2d5a45, #12261d 75%); display: grid; place-items: center; text-align: center;
  box-shadow: inset 0 0 0 2px #0b1812; position: relative; }
.sign::before, .sign::after { content: ""; position: absolute; top: -26px; width: 2px; height: 22px; background: var(--brass); }
.sign::before { left: 40px; } .sign::after { right: 40px; }
.sign .glyph { font-size: 72px; line-height: 1; }
.sign .pname { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--brass); padding: 0 10px; text-wrap: balance; }
.pub-pic { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.here { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--mist); }
.faces { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.task { background: var(--panel); border: 1px dashed var(--brass); border-radius: 12px; padding: 14px; font-weight: 500; line-height: 1.4; }
.reject { background: color-mix(in srgb, var(--berry) 22%, var(--panel)); border: 1px solid var(--berry); border-radius: 12px; padding: 12px 14px; line-height: 1.4; }
.reject b { display: block; font-family: var(--display); font-size: 17px; margin-bottom: 2px; }
.reject small { display: block; color: var(--mist); margin-top: 6px; font-size: 12px; }
.photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; background: var(--panel); }
.done-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--night); background: var(--brass); border-radius: 99px; padding: 4px 10px; font-weight: 700; align-self: flex-start; }

/* finish + prize */
.trophy { font-size: 96px; line-height: 1; }
.gif, .gif-img { width: 100%; aspect-ratio: 1; border-radius: 14px; }
.gif { border: 2px dashed var(--berry); display: grid; place-items: center; padding: 20px; color: var(--mist); background: var(--panel); }
.gif strong { display: block; font-size: 64px; }
.gif-img { object-fit: contain; background: #000; }
.strip { display: grid; gap: 6px; width: 100%; }
.strip > * { min-width: 0; }
.strip img, .strip span { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--panel); display: grid; place-items: center; font-size: 18px; }

/* picker */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--snow); font: 500 14px var(--body); text-align: left; cursor: pointer; }
.pick.on { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 18%, var(--panel)); }
.pick .avatar { width: 30px; height: 30px; }
.pick .avatar .em { font-size: 24px; }
.code-form { display: flex; flex-direction: column; gap: 10px; }
.code { width: 100%; min-height: 64px; border-radius: 14px; border: 1px solid var(--brass); background: var(--panel); color: var(--snow);
  font: 800 32px var(--display); letter-spacing: .4em; text-align: center; }

/* profile sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 440px; background: var(--night); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; animation: fadeUp .3s ease both; }
.sheet-head { display: flex; align-items: center; gap: 12px; }

/* admin */
.rejects { display: grid; gap: 10px; }
.rej-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: var(--panel); border: 1px solid var(--berry); border-radius: 12px; padding: 10px; }
.rej-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.rej-card > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rej-card small { color: var(--mist); }
.rej-card .tags { font-size: 11px; }
.grid-wrap { overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.grid .who-cell { text-align: left; font-weight: 500; }
.grid td.ok a { color: var(--brass); font-weight: 700; text-decoration: none; }
.grid td.bad a { color: var(--berry); font-weight: 700; text-decoration: none; }
.grid td.seen { color: var(--mist); }
.grid .totals th, .grid .totals td { color: var(--mist); border-bottom: 0; }
.links { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--panel); border-radius: 12px; padding: 10px; }
.link-text { min-width: 0; }
.link-text code { display: block; font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-chip { font-size: 11px; background: var(--night); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--brass); margin-left: 4px; }

/* framework error bar */
#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 3000; background: var(--berry); color: var(--snow);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
#blazor-error-ui a { color: var(--snow); font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* full-size avatar viewer */
.av-btn { appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: zoom-in; display: inline-flex; border-radius: 50%; }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); cursor: zoom-out; animation: lbIn .2s ease both; }
.lightbox img { max-width: 100%; max-height: calc(100% - 80px); object-fit: contain; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lb-name { font: 800 22px var(--display); color: var(--snow); text-align: center; }
.lb-hint { font-size: 12px; color: var(--mist); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
