/* VLTA Panic Buy — shared styles. v0.5 "fresh look": same brand colours, softer surfaces, pitch textures. */
:root {
  --bg: #0E2A1F;
  --bg-deep: #0A2018;
  --card: #153828;
  --card-hi: #1A4230;      /* raised surface (hover, selected rows) */
  --line: #2C5C43;
  --hair: rgba(243, 240, 230, 0.08);   /* hairline borders */
  --tint: rgba(243, 240, 230, 0.06);   /* tonal fills for ghost controls */
  --text: #F3F0E6;
  --muted: #A9C2B4;
  --accent: #FFB400;
  --ink: #0E2A1F;          /* text on accent / light chips */
  --danger: #FF7A6B;
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'DM Sans', 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(243,240,230,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, 180, 0, 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(169, 194, 180, 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(--card); }

/* 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, 180, 0, 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(243, 240, 230, 0.1); }
.btn-ghost:disabled { opacity: .45; }
.btn-small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

/* 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, 180, 0, 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(243, 240, 230, 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(10, 32, 24, 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, 180, 0, 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, 180, 0, 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,180,0,0); } 50% { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 0 5px rgba(255,180,0,.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; } }

/* VLTA kicker in the header brand */
.brand { display: inline-flex; align-items: baseline; }
.brand .vlta { color: var(--accent); font-size: .62em; letter-spacing: .2em; margin-right: .35em; }

/* Phone ad bar (see ads.js) */
#adbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(10, 32, 24, 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; }
