:root {
  --night: #0B0D11;
  --panel: rgba(16, 18, 23, .9);
  --line: rgba(255, 255, 255, .09);
  --text: #F2F4F7;
  --muted: #9AA3AF;
  --accent: #FFB224;
  --accent-hi: #FFD27A;
  --ticket: #FFFFFF;
  --ink: #0B0D11;
  --sale-bg: #12141A;
  --sale-fg: #F2F4F7;
  --sale-accent: #FFB224;
  --share-bg: rgba(255, 255, 255, .06);
  --share-fg: #F2F4F7;
  --share-border: rgba(255, 255, 255, .12);
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--night); color: var(--text); overflow: hidden;
  font: 16px/1.5 "Inter", system-ui, sans-serif; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#map { position: fixed; inset: 0; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 60% 45%, transparent 60%, rgba(5,6,9,.6)); }

/* Map chrome */
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); box-shadow: none !important; backdrop-filter: blur(12px); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(.9); }
.maplibregl-ctrl-attrib { background: rgba(11,13,17,.75) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* Picked-pub marker */
.pick-marker { position: relative; width: 56px; height: 56px; display: grid; place-items: center; pointer-events: none; }
.pm-core { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: var(--accent); border: 3px solid var(--night);
  box-shadow: 0 0 0 2px var(--accent), 0 0 30px 8px rgba(255,178,36,.55); }
.pm-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pm-ring { animation: ring 1.8s ease-out infinite; }
  .pm-core { animation: bob 2.4s ease-in-out infinite; }
}
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* Panel */
.panel {
  position: fixed; z-index: 3; display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 900px) {
  .panel { left: 20px; top: 20px; bottom: 20px; width: 400px; border-radius: 22px; }
  .handle { display: none; }
}
@media (max-width: 899px) {
  .panel { left: 0; right: 0; bottom: 0; max-height: 74dvh; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .panel.collapsed { transform: translateY(calc(100% - 118px - env(safe-area-inset-bottom))); }
}
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
.handle { display: block; width: 100%; height: 24px; background: none; border: 0; cursor: pointer; padding: 10px 0 0; flex: none; }
.handle span { display: block; width: 40px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.25); margin: 0 auto; }

.sign { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 14px; border-bottom: 1px solid var(--line); flex: none; }
@media (min-width: 900px) { .sign { padding: 26px 22px 20px; align-items: flex-start; flex-direction: column; gap: 14px; } }
.sign h1 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: .95; font-size: clamp(26px, 7.4vw, 34px); }
@media (min-width: 900px) { .sign h1 { font-size: 52px; } }
.sign h1 em { font-style: normal; color: var(--accent); }
.what { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600; }
.what:hover { background: rgba(255,255,255,.1); }

.panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 20px; display: grid; gap: 18px; align-content: start; flex: 1; }
.panel-body section { display: grid; gap: 14px; }

.where { font-size: 15px; color: var(--muted); }
.where strong { color: var(--text); font-weight: 600; }

.spin {
  position: relative; width: 100%; min-height: 60px; border: 0; border-radius: 14px; cursor: pointer; overflow: hidden;
  font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: var(--ink);
  background: var(--accent);
  box-shadow: 0 10px 30px -8px rgba(255,178,36,.55);
  display: grid; place-items: center; padding: 10px 16px;
  transition: transform .1s ease, filter .2s;
}
.spin:hover:not([disabled]) { filter: brightness(1.07); }
.spin:active:not([disabled]) { transform: translateY(1px) scale(.99); }
.spin[disabled] { filter: grayscale(.8) brightness(.6); cursor: default; }
.spin.small { width: auto; min-height: 46px; font-size: 17px; padding: 0 22px; }
.spin-reel { display: none; font-family: "Inter", sans-serif; font-weight: 600; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spin.spinning .spin-label { display: none; }
.spin.spinning .spin-reel { display: block; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 500; }
.chip:hover { background: rgba(255,255,255,.09); }
.locate { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 1.5px solid var(--accent); border-radius: 999px; background: rgba(255,178,36,.08); color: var(--accent-hi); font-size: 16px; font-weight: 600; cursor: pointer; }
.locate:hover { background: rgba(255,178,36,.16); }
.locate span { font-size: 18px; line-height: 1; }
.hint { font-size: 14px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list button { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); padding: 12px 2px; cursor: pointer; min-height: 48px; }
.list button:hover .ln { color: var(--accent-hi); }
.ln { font-weight: 600; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld { font-size: 13px; color: var(--muted); flex: none; }

/* The invite: a white ticket with punched edges */
.mat {
  position: relative; background: var(--ticket); color: var(--ink); border-radius: 18px; padding: 20px 20px 18px;
  -webkit-mask: radial-gradient(circle 11px at 0 62%, transparent 10px, #000 11px) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 62%, transparent 10px, #000 11px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 62%, transparent 10px, #000 11px) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 62%, transparent 10px, #000 11px) right / 51% 100% no-repeat;
  box-shadow: 0 20px 40px -14px rgba(0,0,0,.7);
}
@media (prefers-reduced-motion: no-preference) { .mat.drop { animation: drop .5s cubic-bezier(.2,1.3,.4,1); } }
@keyframes drop { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.mat-top { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6B7280; }
.mat-name { margin: 6px 0 4px; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 7vw, 34px); line-height: 1.02; letter-spacing: -.035em; overflow-wrap: anywhere; }
.mat-when { font-weight: 700; font-size: 18px; color: #B45309; }
.mat-walk { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; background: #F3F4F6; color: var(--ink); border-radius: 99px; padding: 3px 10px; }
.mat-agenda { font-style: italic; font-weight: 500; font-size: 15px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed #E5E7EB; color: #374151; line-height: 1.4; }

.when { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.when legend { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; padding: 0; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; min-height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); cursor: pointer; font-size: 14px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--ink); border-color: var(--accent); }

.from { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.from input { font: 16px "Inter", sans-serif; text-transform: none; letter-spacing: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); }
.send-label { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ghost { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; font-weight: 600; font-size: 15px; }
.ghost:hover { background: rgba(255,255,255,.07); }

.summoned { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -.03em; line-height: 1.05; }
.reply { font-size: 15px; min-height: 1.5em; }
.make { font-weight: 600; text-decoration: none; }

.foot { border-top: 1px solid var(--line); padding-top: 14px; font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.foot-link { color: inherit; text-underline-offset: 3px; }
.foot-link:hover { color: var(--accent); }

/* "What is this?" */
.explain { width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 20px; padding: 26px 24px 22px; background: #12141A; color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.explain::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.explain h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.explain ol { margin: 0 0 16px; padding-left: 1.2em; display: grid; gap: 10px; color: var(--muted); font-size: 15px; }
.explain ol b { color: var(--text); }
.explain ol li::marker { color: var(--accent); font-weight: 700; }
.explain-foot { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
