/* ScratchHunt — site-specific styles on top of /ui/ui.css (Tailwind + Basecoat).
   Colors are the shadcn variables set from site.ts `theme` (--primary is foil gold, --header midnight).
   Signature element: the carousel ticket (.ticket) — artwork, perforation, silver latex panel.
   Bump ?v= in APP_HEAD (src/ui.tsx) whenever this file changes. */

:root {
  --font-ticket: "Big Shoulders Display", "Arial Narrow", ui-sans-serif, sans-serif;
  --midnight: #1B1F3B;
  --silver: #C9CED8;
  --jackpot: #E4322B;
  --spark: var(--link);
  --spark-fill: color-mix(in oklab, var(--link) 12%, transparent);
  --glow: color-mix(in oklab, var(--primary) 30%, transparent);
}

.brand-mark { font-family: var(--font-ticket); font-size: 1.05rem; font-weight: 900; }
.site-header { border-bottom-color: rgb(255 255 255 / 0.08); }
.site-header .btn[data-variant="ghost"] { color: inherit; }
.site-header .btn[data-variant="ghost"]:hover { background: rgb(255 255 255 / 0.1); }

/* ---- Home hero: one midnight band from the header down through the carousel ---- */
.hero { --notch: var(--header); position: relative; isolation: isolate; overflow: hidden; background: var(--header); color: #fff; padding: 2.5rem 0 1.5rem; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; aspect-ratio: 1; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 26%, transparent), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgb(255 255 255 / 0.12) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%); }
@media (min-width: 640px) { .hero { padding-top: 4rem; } }
.hero-kicker { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .75rem .25rem .3rem; border-radius: 999px; font-size: .8rem; font-weight: 500;
  background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.14); color: #E6E8F2; }
.hero-kicker b { background: var(--primary); color: var(--primary-foreground); border-radius: 999px; padding: .05rem .5rem; font-weight: 700; }
.hero-copy h1 { font-family: var(--font-ticket); font-weight: 900; letter-spacing: 0; font-size: clamp(2.8rem, 2rem + 4.5vw, 5.4rem); line-height: .92; max-width: 13ch; margin: 1rem 0; color: #fff; }
.hero-copy h1 em { font-style: normal; color: var(--primary); }
.hero .lede { color: #C9CED8; max-width: 44ch; }
.hero-rail { margin-top: 2.5rem; }
.rail-head h2 { color: #fff; font-size: 1.25rem; margin: 0; }
.rail-head a { color: #fff; font-size: .875rem; font-weight: 500; display: inline-flex; align-items: center; gap: .25rem; }
@media (min-width: 1152px) { .hero .rail-track { padding-inline: calc((100vw - 72rem) / 2 + 1.5rem); scroll-padding-inline: calc((100vw - 72rem) / 2 + 1.5rem); } }

.state-form { display: flex; gap: .5rem; max-width: 30rem; }
.state-form select { flex: 1 1 auto; min-width: 0; }
.hero .state-form select { background-color: rgb(255 255 255 / 0.08); color: #fff; border-color: rgb(255 255 255 / 0.22); height: 2.5rem; }
.hero .state-form select option { color: #1B1F3B; }

/* ---- Ticket card ---- */
.ticket { display: flex; flex-direction: column; background: var(--card); color: var(--card-foreground); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 24px 48px -24px rgb(0 0 0 / .85); transition: transform .2s ease, box-shadow .2s ease; }
.ticket:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 30px 60px -24px rgb(0 0 0 / .9), 0 0 0 1px color-mix(in oklab, var(--primary) 60%, transparent); }
.ticket-face { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; color: #fff; text-decoration: none; background: #2A3058; }
.ticket-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ticket:hover .ticket-img { transform: scale(1.04); }
.ticket-art-fallback, .thumb-fallback { display: grid; place-items: center; background:
  repeating-linear-gradient(135deg, transparent 0 14px, hsl(var(--h) 90% 70% / .18) 14px 16px),
  linear-gradient(160deg, hsl(var(--h) 72% 46%), hsl(calc(var(--h) + 40) 70% 28%)); }
.ticket-art-fallback span { font-family: var(--font-ticket); font-weight: 900; font-size: 6rem; line-height: 1; color: rgb(255 255 255 / .92); transform: rotate(-8deg) translateY(-30%); text-shadow: 0 4px 0 rgb(0 0 0 / .18); }
.ticket-price { position: absolute; top: 12px; left: 12px; padding: 2px 10px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); font-family: var(--font-ticket); font-weight: 900; font-size: 1.5rem; line-height: 1.2; box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
.ticket-hunt { position: absolute; top: 14px; right: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--jackpot); color: #fff; font-size: .75rem; font-weight: 600; box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
.ticket-hunt svg { width: 12px; height: 12px; }
.ticket-overlay { position: absolute; inset: auto 0 0 0; padding: 80px 16px 14px; background: linear-gradient(to top, rgb(14 17 36 / .96) 0 50%, rgb(14 17 36 / 0)); }
.ticket-name { font-weight: 600; font-size: .9rem; line-height: 1.25; color: #E6E8F2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-prize { font-family: var(--font-ticket); font-weight: 900; font-size: 3.4rem; line-height: .95; color: var(--primary); margin: 4px 0 2px; text-shadow: 0 2px 12px rgb(0 0 0 / .4); }
.ticket-left { font-size: .9rem; color: #E6E8F2; }
.ticket-left strong { color: #fff; font-size: 1.05rem; }
.ticket-odds { font-size: .78rem; color: #B5BAD0; margin-top: 2px; }
.ticket-stub { position: relative; padding: 14px; border-top: 2px dashed var(--border); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--notch, var(--background)); }
.ticket-stub::before { left: -10px; } .ticket-stub::after { right: -10px; }

/* The latex panel. Covered: silver foil with one shimmer when the page loads. Scratched: the number underneath. */
.latex { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 .5rem; min-height: 56px; padding: 8px 14px; border-radius: 10px; text-decoration: none; color: #333A5C;
  background: linear-gradient(115deg, #B4BAC8 0%, #E9EBF0 20%, #AAB0BF 38%, #DCDFE6 56%, #B0B6C4 78%, #D3D7DF 100%); background-size: 260% 100%; background-position: 0 0;
  animation: foil 2.2s cubic-bezier(.2,.7,.2,1) .5s 1 both; }
.latex-label { font-size: .75rem; font-weight: 600; white-space: nowrap; }
.latex-cover { flex-basis: 100%; display: inline-flex; align-items: center; gap: .35rem; font-family: var(--font-ticket); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.latex-cover svg { width: 16px; height: 16px; }
.latex.scratched { animation: none; color: var(--foreground); background:
  radial-gradient(circle at 8% 20%, var(--silver) 0 5px, transparent 6px), radial-gradient(circle at 94% 85%, var(--silver) 0 7px, transparent 8px), var(--muted); }
.latex-value { font-family: var(--font-ticket); font-weight: 900; font-size: 1.7rem; line-height: 1; }
.latex-sub { font-size: .78rem; color: var(--muted-foreground); }
@keyframes foil { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .latex { animation: none; } .ticket, .ticket-img { transition: none; } }

/* ---- Small pieces used across pages ---- */
.locked { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; border: 1px dashed color-mix(in oklab, var(--muted-foreground) 50%, transparent);
  color: var(--muted-foreground); font-size: .75rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s; }
.locked:hover { color: var(--foreground); border-color: var(--primary); border-style: solid; }
.hunt-badge { background: color-mix(in oklab, var(--jackpot) 14%, transparent); color: var(--jackpot); border-color: transparent; }
.dark .hunt-badge { color: #FF7A72; }
.price-tag { display: inline-block; min-width: 2.5rem; padding: .05rem .45rem; border-radius: 6px; background: var(--primary); color: var(--primary-foreground); font-family: var(--font-ticket); font-weight: 800; font-size: 1rem; text-align: center; }
.thumb { display: inline-grid; width: 34px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.thumb-fallback { font-family: var(--font-ticket); font-weight: 900; font-size: .8rem; color: #fff; }
.game-cell { display: flex; align-items: center; gap: .75rem; }
.soldbar { display: inline-block; width: 64px; height: 6px; border-radius: 999px; background: var(--muted); vertical-align: middle; overflow: hidden; }
.soldbar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in oklab, var(--primary) 60%, var(--jackpot))); }
.spark { display: block; }
.ticket-art.ticket-art-fallback { display: grid; }
.ticket-art.ticket-art-fallback span { transform: rotate(-8deg); }
.ticket-art { display: block; width: 100%; max-width: 280px; border-radius: 14px; box-shadow: 0 20px 40px -20px rgb(0 0 0 / .5); }
.tier-bar { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; min-width: 60px; }
.tier-bar span { display: block; height: 100%; background: var(--success); border-radius: inherit; }

/* Home: tiers + closing band */
.cta-band { position: relative; isolation: isolate; overflow: hidden; background: var(--header); color: #fff; padding: 4rem 0; margin-top: 2rem; border-radius: 0; }
.cta-band::before { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 120%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 28%, transparent), transparent); }
.cta-band h2 { font-family: var(--font-ticket); font-weight: 900; letter-spacing: 0; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); line-height: 1; color: #fff; }
.cta-band p { color: #C9CED8; }
.cta-band a:not(.btn) { color: #fff; }

/* ---- Hunt map ---- */
.hunt-bar { position: sticky; top: 3.5rem; z-index: 500; background: color-mix(in oklab, var(--background) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.hunt-bar .wrap { padding-top: 8px; }
.hunt-meta { font-size: .85rem; color: var(--muted-foreground); padding-bottom: 8px; }
#map { height: calc(100dvh - 3.5rem - 96px); min-height: 360px; width: 100%; }
.map-controls { position: absolute; right: 12px; top: 12px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.map-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; box-shadow: 0 4px 16px rgb(0 0 0 / .18); }
.map-btn svg { width: 20px; height: 20px; }
.map-wrap { position: relative; }
.map-hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 650; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem;
  border-radius: 999px; border: 0; background: var(--midnight); color: #fff; font: 500 .875rem/1.2 var(--font-body); box-shadow: 0 6px 20px rgb(0 0 0 / .25); cursor: pointer; }
.map-hint::before { content: "+"; display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-weight: 700; }
.map-hint[hidden] { display: none; }
.legend { position: absolute; left: 12px; bottom: 24px; z-index: 600; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: .75rem; line-height: 1.7; box-shadow: 0 4px 16px rgb(0 0 0 / .15); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.pin { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .35); display: flex; align-items: center; justify-content: center; color: #fff; font: 700 12px/1 system-ui, sans-serif; }
.pin-prime { background: #27ae60; }
.pin-high { background: #f1c40f; color: #3b2f00; }
.pin-mega { background: #c0392b; }
.pin-small { background: #e67e22; }
.pin-unknown { background: #7f8c8d; }
.pin-empty { background: #bdc3c7; color: #2c3e50; }
.pin-found { background: #d4af37; animation: sonar 1.5s infinite; }
.pin-comm-found { box-shadow: 0 0 0 3px #d4af37; }
.pin-comm-empty { box-shadow: 0 0 0 3px #95a5a6; }
@keyframes sonar { 0% { box-shadow: 0 0 0 0 rgb(241 196 15 / .7); } 70% { box-shadow: 0 0 0 14px rgb(241 196 15 / 0); } 100% { box-shadow: 0 0 0 0 rgb(241 196 15 / 0); } }

.leaflet-popup-content-wrapper { border-radius: 14px; }
.dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.leaflet-container { font-family: var(--font-body); }
.popup h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: #18181b; }
.popup p { margin: 2px 0; font-size: .85rem; color: #52525b; }
.popup .acts { display: grid; gap: 6px; margin-top: 10px; }
.popup button { font: inherit; font-weight: 600; font-size: .875rem; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.popup .b-found { background: #F2B705; color: #1B1F3B; }
.popup .b-empty { background: #1B1F3B; color: #fff; }
.popup .b-clear { background: #fff; color: #18181b; border-color: #e4e4e7; }
.popup .comm { margin-top: 8px; padding: 6px 8px; border-radius: 8px; background: #f4f4f5; font-size: .8rem; }
