/* Panic Buy — shared styles. v1.0 "Deadline Day": floodlit navy, transfer-ticker yellow, siren red for anything urgent. */
:root {
  --bg: #0F1A3A;           /* floodlit night */
  --bg-deep: #0A1330;
  --card: #17255A;
  --card-hi: #1E2F6E;      /* raised surface (hover, selected rows) */
  --line: #2D3F80;
  --hair: rgba(245, 243, 238, 0.09);   /* hairline borders */
  --tint: rgba(245, 243, 238, 0.07);   /* tonal fills for ghost controls */
  --text: #F5F3EE;
  --muted: #A3AED6;
  --accent: #FFD60A;       /* deadline-day yellow */
  --ink: #0F1A3A;          /* text on accent / light chips */
  --danger: #FF5A4E;       /* siren red: clocks running out, vetoes */
  --turf: #12452F;         /* the pitch behind formations stays green */
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.22);
  /* Pitch markings (portrait, own goal at the bottom) + mowing stripes, used behind formation grids. */
  --pitch-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='rgba(245,243,238,0.10)' stroke-width='1' vector-effect='non-scaling-stroke'%3E%3Crect x='1' y='1' width='98' height='138' rx='2' vector-effect='non-scaling-stroke'/%3E%3Cline x1='1' y1='70' x2='99' y2='70' vector-effect='non-scaling-stroke'/%3E%3Cellipse cx='50' cy='70' rx='13' ry='10' vector-effect='non-scaling-stroke'/%3E%3Crect x='24' y='1' width='52' height='20' vector-effect='non-scaling-stroke'/%3E%3Crect x='24' y='119' width='52' height='20' vector-effect='non-scaling-stroke'/%3E%3Crect x='38' y='1' width='24' height='7' vector-effect='non-scaling-stroke'/%3E%3Crect x='38' y='132' width='24' height='7' vector-effect='non-scaling-stroke'/%3E%3C/g%3E%3C/svg%3E");
  --stripes: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 10%, transparent 10% 20%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 214, 10, 0.07), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 120px, transparent 120px 240px);
  background-attachment: fixed;
}
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input {
  font: inherit; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--hair);
  background: var(--bg-deep); color: var(--text); outline: none; transition: border-color .15s;
}
input::placeholder { color: rgba(163, 174, 214, 0.6); }
input:focus { border-color: var(--accent); }
.hidden { display: none !important; }

.display { font-family: var(--display); letter-spacing: 0.02em; font-weight: 400; line-height: 1.05; }
.label { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.card { background: var(--card); border-radius: 18px; border: 1px solid var(--hair); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 0; min-width: 0; min-height: 0; }
.between { display: flex; justify-content: space-between; align-items: baseline; }

/* Pitch surface behind formation grids */
.turf { background-image: var(--pitch-lines), var(--stripes); background-size: 100% 100%, 100% 100%; background-repeat: no-repeat; background-color: var(--turf); }

/* Buttons */
.btn-primary {
  height: 76px; border-radius: 16px; background: var(--accent); color: var(--ink);
  font-family: var(--display); font-size: 32px; letter-spacing: 0.04em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 24px rgba(255, 214, 10, 0.18);
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { background: var(--tint); color: var(--muted); box-shadow: none; border: 1px dashed var(--line); }
.btn-ghost {
  height: 52px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--hair); background: var(--tint);
  color: var(--text); font-size: 18px; font-weight: 700; transition: background .15s, border-color .15s;
}
.btn-ghost:hover:not(:disabled) { background: rgba(245, 243, 238, 0.1); }
.btn-ghost:disabled { opacity: .45; }
.btn-small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; white-space: nowrap; }

/* Option buttons sit in a recessed track, like a segmented control */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-deep); border: 1px solid var(--hair); }
.opt {
  flex: 1 1 0; height: 56px; border-radius: 10px; background: transparent;
  color: var(--text); font-family: var(--display); font-size: 24px; letter-spacing: 0.04em; transition: background .15s, color .15s;
}
.opt:hover:not(:disabled):not(.on) { background: var(--tint); }
.opt.on { background: var(--accent); color: var(--ink); box-shadow: 0 2px 10px rgba(255, 214, 10, 0.25); }
.opt:disabled { font-family: var(--body); font-size: 15px; font-weight: 700; color: var(--muted); opacity: .6; }
/* Opts used as big tiles (phone formation picker) */
.tiles .opt:not(.on) { background: var(--card); border: 1px solid var(--hair); }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; background: var(--tint); font-weight: 700; font-size: 18px; white-space: nowrap; }
.chip.solid { background: var(--text); color: var(--ink); }
.chip.outline { background: transparent; box-shadow: 0 0 0 1.5px rgba(245, 243, 238, 0.45) inset; }
.chip.accent { background: var(--accent); color: var(--ink); }

/* Code boxes */
.code { display: flex; gap: 8px; }
.code span {
  display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: var(--bg-deep); box-shadow: 0 0 0 2px var(--accent) inset;
  font-family: var(--display); color: var(--accent);
}

/* Formation pitch (slot grid) */
.pitch { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.pitch .line { display: flex; justify-content: space-around; gap: 4px; }
.slot {
  width: 48px; height: 30px; border-radius: 8px; color: var(--muted);
  background: rgba(9, 17, 42, 0.75); box-shadow: 0 0 0 1px var(--line) inset;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none;
}
.slot.filled, .slot.new { background: var(--accent); color: var(--ink); box-shadow: 0 2px 8px rgba(255, 214, 10, 0.3); }
.slot.fits { box-shadow: 0 0 0 2px var(--accent) inset; color: var(--text); animation: pulse 1.6s infinite; }
.slot.done { background: var(--line); color: var(--text); box-shadow: none; }
.slot.plain { box-shadow: 0 0 0 1.5px rgba(255, 214, 10, 0.7) inset; color: var(--text); }

/* Timer bar (phone) */
.bar { height: 8px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.bar > div { height: 8px; border-radius: 999px; background: var(--accent); transition: width .1s linear; }
.bar.urgent > div { background: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--danger); color: var(--ink);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 99; max-width: 90vw; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 0 0 rgba(255,214,10,0); } 50% { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 0 5px rgba(255,214,10,.18); } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { animation: pop .4s ease-out both; }
.rise { animation: rise .3s ease-out both; }
@media (prefers-reduced-motion: reduce) { .pop, .rise, .slot.fits { animation: none; } }

/* The wordmark: a slanted deadline-day caption bar */
.brand { display: inline-block; background: var(--accent); color: var(--ink); padding: .06em .34em .02em; transform: skewX(-10deg); line-height: 1; letter-spacing: .03em; }

/* Phone ad bar (see ads.js) */
#adbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(9, 17, 42, 0.96); backdrop-filter: blur(8px); border-top: 1px solid var(--hair); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); min-height: 72px; display: flex; flex-direction: column; justify-content: center; }
#adbar[hidden] { display: none; }
#adbar .ad-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
#adbar .house { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); max-width: 430px; margin: 0 auto; width: 100%; }
#adbar .house-k { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--muted); color: var(--muted); border-radius: 4px; padding: 1px 5px; flex: none; }
#adbar .house-t { font-size: 13px; line-height: 1.3; flex: 1; }
#adbar .house-c { flex: none; background: var(--accent); color: var(--ink); font-family: var(--display); letter-spacing: .04em; padding: 8px 14px; border-radius: 10px; font-size: 16px; }
body.has-ad main { padding-bottom: 96px; }

/* ---------- celebrations (shared) ---------- */
.celeb { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 60% at 50% 50%, rgba(15,26,58,.55), rgba(4,8,24,.15)); animation: celebFade 2.6s ease both; overflow: hidden; }
.celeb-in { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.celeb-in img { height: 34vmin; filter: drop-shadow(0 14px 24px rgba(0,0,0,.45)); }
.celeb-t { font-family: var(--display); font-size: 13vmin; line-height: .95; color: var(--accent); text-shadow: 0 6px 0 rgba(0,0,0,.35); letter-spacing: .02em; }
.celeb-s { font-size: 3.4vmin; font-weight: 700; color: var(--text); }
.fx-pulse .celeb-in { animation: celebPulse .5s ease-in-out 4 alternate; }
.fx-slide .celeb-in { animation: celebSlide 1.1s cubic-bezier(.2,.8,.2,1) both; }
.fx-shake .celeb-in { animation: celebShake .12s linear 12; }
.fx-fly .celeb-in img { animation: celebFly 1.6s ease-in-out both; }
.fx-robot .celeb-in img { animation: celebRobot .4s steps(2) 6; }
.fx-beer i { position: absolute; top: -10vh; font-size: 7vmin; font-style: normal; animation: celebDrop 1.6s ease-in both; }
.fx-confetti b { position: absolute; top: -5vh; width: 1.4vmin; height: 2.6vmin; border-radius: 2px; animation: celebDrop 1.8s ease-in both; }
@keyframes celebFade { 0% { opacity: 0 } 8% { opacity: 1 } 85% { opacity: 1 } 100% { opacity: 0 } }
@keyframes celebPulse { from { transform: scale(.94) } to { transform: scale(1.06) } }
@keyframes celebSlide { from { transform: translateX(-70vw) rotate(-8deg) } to { transform: none } }
@keyframes celebShake { 0%,100% { transform: translateX(0) } 50% { transform: translateX(1.2vmin) } }
@keyframes celebFly { 0% { transform: translateX(-30vw) rotate(-14deg) } 50% { transform: translateX(10vw) rotate(14deg) } 100% { transform: none } }
@keyframes celebRobot { from { transform: rotate(-6deg) } to { transform: rotate(6deg) } }
@keyframes celebDrop { from { transform: translateY(0) rotate(0) } to { transform: translateY(120vh) rotate(260deg) } }
@media (prefers-reduced-motion: reduce) { .celeb, .celeb * { animation-duration: .01s !important; animation-iteration-count: 1 !important; } .celeb { animation: celebFade 2.6s linear both !important; } }

/* ---------- quick chat bubbles (shared) ---------- */
.chatfeed { position: fixed; z-index: 70; top: 64px; right: 12px; left: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-width: 406px; margin-left: auto; }
.chatfeed.big { top: auto; bottom: 84px; right: 24px; left: auto; width: 290px; }
.bubble { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(9,17,42,.94); box-shadow: 0 0 0 1px var(--line) inset, 0 8px 18px rgba(0,0,0,.3); animation: rise .25s ease-out both; font-size: 15px; max-width: 100%; }
.bubble img { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); flex: none; }
.bubble b { margin-right: 6px; color: var(--accent); }
.bubble.emoji > span > span { font-size: 22px; line-height: 1; }
.chatfeed.big .bubble { font-size: 20px; padding: 8px 16px 8px 8px; }
.chatfeed.big .bubble img { width: 38px; height: 38px; }
.chatfeed.big .bubble.emoji > span > span { font-size: 30px; }
.flash { position: fixed; z-index: 80; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 18%; padding: 14px 26px; border-radius: 18px; background: var(--danger); color: var(--ink); font-family: var(--display); font-size: 30px; letter-spacing: .03em; text-align: center; box-shadow: 0 16px 30px rgba(0,0,0,.4); animation: rise .25s ease-out both; max-width: 92vw; }
.flash.freeze { background: #7CC6FE; }
.lock-tag { font-size: .62em; margin-left: 4px; opacity: .8; }
.opt.paid:not(.on) { opacity: .55; }

/* ---------- in-form walkout (walkout.js) ---------- */
.walkout { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 45%, #1E2F6E 0%, #070D24 75%); animation: woIn .25s ease-out both; cursor: pointer; }
.walkout.out { animation: woOut .4s ease-in both; }
.wo-beams { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,214,10,.16) 0 6deg, transparent 6deg 30deg); animation: woSpin 3.2s linear both; }
.wo-stamp { position: relative; font-family: var(--display); font-weight: 800; font-size: 12vmin; line-height: 1; color: var(--ink); background: var(--accent); padding: .05em .3em; transform: skewX(-10deg) rotate(-4deg);
  animation: woStamp .5s cubic-bezier(.2,1.6,.4,1) .2s both; box-shadow: 0 1vmin 0 rgba(0,0,0,.35); }
.wo-card { position: relative; width: min(78vw, 58vmin); padding: 4vmin 4.5vmin; border-radius: 3vmin; color: var(--ink);
  background: linear-gradient(150deg, #FFF3A6 0%, var(--accent) 38%, #F2A900 70%, #FFE45C 100%);
  box-shadow: 0 0 0 .6vmin rgba(255,255,255,.5) inset, 0 3vmin 8vmin rgba(0,0,0,.55), 0 0 12vmin rgba(255,214,10,.45);
  animation: woCard .7s cubic-bezier(.2,.9,.25,1.15) .85s both; overflow: hidden; }
.wo-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%); transform: translateX(-120%); animation: woShine 1s ease-in-out 1.6s both; }
.wo-top { display: flex; justify-content: space-between; align-items: baseline; }
.wo-r { font-family: var(--display); font-weight: 800; font-size: 16vmin; line-height: .85; }
.wo-pos { font-family: var(--display); font-weight: 800; font-size: 6vmin; }
.wo-first { font-family: var(--display); font-weight: 800; font-size: 4.5vmin; text-transform: uppercase; margin-top: 2vmin; opacity: .75; }
.wo-name { font-family: var(--display); font-weight: 800; font-size: 11vmin; line-height: .9; text-transform: uppercase; overflow-wrap: anywhere; }
.wo-tag { display: inline-block; margin-top: 2vmin; background: var(--ink); color: var(--accent); font-family: var(--display); font-weight: 800; font-size: 4.6vmin; padding: .1em .4em; transform: skewX(-10deg); }
.wo-feat { margin-top: 1.6vmin; font-weight: 700; font-size: 3.3vmin; line-height: 1.25; }
.wo-base { margin-top: 1.2vmin; font-size: 2.6vmin; font-weight: 700; opacity: .7; }
.walkout:not(.big) .wo-feat { font-size: max(14px, 3.3vmin); } .walkout:not(.big) .wo-base { font-size: max(12px, 2.6vmin); }
@keyframes woIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes woOut { to { opacity: 0; transform: scale(1.04) } }
@keyframes woSpin { from { transform: rotate(0) scale(.6); opacity: 0 } 20% { opacity: 1 } to { transform: rotate(70deg) scale(1.1); opacity: 1 } }
@keyframes woStamp { from { transform: skewX(-10deg) rotate(-4deg) scale(3); opacity: 0 } to { transform: skewX(-10deg) rotate(-4deg) scale(1); opacity: 1 } }
@keyframes woCard { from { transform: translateY(40vh) rotateY(80deg) scale(.6); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes woShine { to { transform: translateX(120%) } }
@media (prefers-reduced-motion: reduce) { .walkout, .walkout * { animation-duration: .01s !important; animation-delay: 0s !important; } }
/* the in-form tag on the auction screens */
.inform-tag { display: inline-block; background: var(--accent); color: var(--ink); font-family: var(--display); font-weight: 800; padding: .05em .4em; transform: skewX(-10deg); letter-spacing: .02em; }

/* ---------- bottom nav (nav.js) ---------- */
.pb-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(10, 17, 40, .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--hair);
  padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right)); }
.pb-nav[hidden] { display: none; }
.pb-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; text-decoration: none;
  color: var(--muted); font: 700 12px/1 var(--body, inherit); letter-spacing: .02em; border-radius: 12px; }
.pb-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pb-nav a[data-tab="more"] svg { fill: currentColor; stroke: none; }
.pb-nav a.on { color: var(--accent); }
.pb-nav a.on span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pb-nav a:active { background: var(--tint); }
body.has-nav main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
html:has(body.has-nav) { scroll-padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
body.has-nav #adbar { bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .pb-nav { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 14px; border: 1px solid var(--hair); border-radius: 18px; padding-bottom: 4px; } }
.pb-more { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 30, .6); display: flex; align-items: flex-end; justify-content: center; }
.pb-more > div { width: min(520px, 100%); background: var(--card); border-radius: 22px 22px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.pb-more__head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; }
.pb-more__head b { font-family: var(--display); font-size: 28px; text-transform: uppercase; }
.pb-more__head button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hair); background: none; color: var(--text); font-weight: 700; }
.pb-more a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--bg-deep); text-decoration: none; color: var(--text); min-height: 56px; justify-content: center; }
.pb-more a b { font-size: 17px; } .pb-more a span { font-size: 13px; color: var(--muted); }
