/* Espectral UHC Customizer — Espectrocoins (25july) */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --max: 78rem;
  --bg: #060a14;
  --bg-rgb: 6, 10, 20;
  --surface: rgba(16, 22, 42, 0.72);
  --surface-solid: #101628;
  --surface-up: rgba(25, 32, 64, 0.7);
  --text: #e8ecf4;
  --muted: #7a90b8;
  --accent: #ffd700;
  --accent-rgb: 255, 215, 0;
  --accent-alt: #ff9f1c;
  --accent-alt-rgb: 255, 159, 28;
  --accent-cyan: #00d4e8;
  --accent-cyan-rgb: 0, 212, 232;
  --border: rgba(30, 45, 80, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --success: #34d399;
  --danger: #f87171;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.bg-mesh::before,
.bg-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orb 18s var(--ease) infinite alternate;
}
.bg-mesh::before {
  width: 55vw;
  height: 55vw;
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22), transparent 70%);
}
.bg-mesh::after {
  width: 45vw;
  height: 45vw;
  bottom: -20%;
  right: -5%;
  background: radial-gradient(circle, rgba(var(--accent-cyan-rgb), 0.18), transparent 70%);
  animation-delay: -6s;
}
@keyframes orb {
  to { transform: translate(3%, 4%) scale(1.06); }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem clamp(0.9rem, 3vw, 1.5rem) 2.5rem;
}

.demo-only {
  background: rgba(122, 144, 184, 0.1);
  border: 1px solid rgba(122, 144, 184, 0.28);
  color: var(--muted);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}
.demo-only strong { color: var(--text); }
.demo-only code {
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}
.demo-tag {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.18);
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand h1 { margin: 0; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
}

.auth { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.user-meta { line-height: 1.15; }
.user-meta strong { display: block; font-size: 0.85rem; }
.user-meta span { color: var(--muted); font-size: 0.72rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--discord {
  color: #fff;
  background: #5865f2;
  padding: 0.55rem 1rem;
}
.btn--discord:hover { filter: brightness(1.08); }
.btn--ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--glass-border);
  padding: 0.55rem 1rem;
}
.btn--ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.btn--primary {
  color: #0a0f1a;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  padding: 0.65rem 1.1rem;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.2);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; box-shadow: none; }
.btn--block { width: 100%; }
.btn--sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn--donate { margin-top: 0.55rem; }

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.btn--paypal {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  margin-top: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #003087 0%, #009cde 100%);
  border: 1px solid rgba(0, 156, 222, 0.3);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 48, 135, 0.3);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn--paypal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 156, 222, 0.4);
  color: #fff;
  text-decoration: none;
  filter: none;
}
.btn--paypal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0.12) 45%, transparent 65%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}
.btn--paypal .btn-icon {
  flex-shrink: 0;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}
.btn--paypal .btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
  position: relative;
  z-index: 1;
}
.btn--paypal .btn-label {
  font-size: 0.95rem;
  font-weight: 700;
}
.btn--paypal .btn-hint {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}



.hero { display: grid; gap: 0.4rem; margin: 0.4rem 0 1.3rem; }
.hero h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 0; color: var(--muted); max-width: 54rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  gap: 1.1rem;
  align-items: start;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  main { min-width: 0; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.05rem;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(10px);
}
.panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.panel h3 .hint { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.panel-note { margin: -0.35rem 0 0.8rem; color: var(--muted); font-size: 0.78rem; }
.subhead {
  margin: 0.65rem 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sub-panel {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--glass-border);
}

/* Configurable nerf row: toggle + collapsible slider (plugin NerfDetailScreen mirror) */
.cfg-row, .nerf-row {
  position: relative;
}
.nerf-config {
  display: none;
  margin: 0 0 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--muted);
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.nerf-config.visible {
  display: flex;
}
.nerf-config__main {
  display: contents;
}
.nerf-config__label {
  white-space: nowrap;
}
.nerf-config__label b {
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}
.nerf-config input[type='range'] {
  flex: 1;
  min-width: 8rem;
  accent-color: var(--accent-cyan);
}
.nerf-config__select {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-size: 0.8rem;
}
.nerf-config__bool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.nerf-config__bool input {
  accent-color: var(--accent-cyan);
}

.seg {
  display: grid;
  gap: 0.45rem;
}
.seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .seg--3, .seg--4 { grid-template-columns: 1fr; }
}

.seg-btn, .toggle, .day-card {
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-up);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.seg-btn:hover, .toggle:hover, .day-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}
.seg-btn.active, .day-card.active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.15);
}
.seg-btn .label, .toggle .label, .day-card .label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.88rem;
}
.seg-btn .meta, .toggle .meta, .day-card .meta {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.18rem;
}
.seg-btn .meta.paid, .toggle .meta.paid { color: var(--accent-alt); }

.toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.toggle.on {
  border-color: rgba(var(--accent-cyan-rgb), 0.45);
  background: rgba(var(--accent-cyan-rgb), 0.08);
}
.toggle-text { flex: 1; min-width: 0; }
.switch {
  width: 2.35rem;
  height: 1.25rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.toggle.on .switch { background: rgba(var(--accent-cyan-rgb), 0.5); }
.toggle.on .switch::after { transform: translateX(1.1rem); background: #fff; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; }
.field label { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-cyan-rgb), 0.5);
}

.warn {
  display: none;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #ffbf78;
  background: rgba(166, 92, 0, 0.15);
  border: 1px solid rgba(166, 92, 0, 0.45);
}
.warn.visible { display: block; }


.field textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.45;
}
.field .char-count {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}


#nerfsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-direction: unset;
}
@media (max-width: 700px) {
  #nerfsGrid { grid-template-columns: 1fr; }
}
#nerfsGrid .scen-list { max-height: 18rem; }

.line--notes {
  font-style: italic;
  opacity: 0.9;
}

.scen-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.scen-grid-row {
  display: grid;
  gap: 0.55rem;
}
.scen-grid-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scen-grid-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .scen-grid-row--3,
  .scen-grid-row--2 { grid-template-columns: 1fr; }
}
.scen-col {
  min-width: 0;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.55rem;
}
.scen-col h4 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.scen-list {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
  padding-right: 0.15rem;
}
.scen-list::-webkit-scrollbar { width: 6px; }
.scen-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
}
.scen-list .toggle { padding: 0.5rem 0.55rem; }
.scen-list .toggle .label { font-size: 0.78rem; line-height: 1.25; }
.scen-list .toggle .meta { font-size: 0.66rem; }

.badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.3rem;
  border-radius: var(--radius-sm);
  vertical-align: middle;
  margin-left: 0.2rem;
}
.badge-free { color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.1); }
.badge-paid { color: var(--accent-alt); border: 1px solid rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.1); }
.badge-premium { color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.12); }

.day-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 700px) { .day-cards { grid-template-columns: 1fr; } }
.day-card { width: 100%; }

.cart {
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  backdrop-filter: blur(12px);
}
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.cart-head h3 { margin: 0; font-size: 1rem; }

.cart-user {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid var(--glass-border);
}
.cart-user.visible { display: flex; }
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-cyan-rgb), 0.35));
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.bal {
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  text-align: center;
}
.bal .v { font-weight: 700; color: var(--accent); font-size: 0.98rem; }
.bal .l { color: var(--muted); font-size: 0.68rem; margin-top: 0.1rem; }
.bal.locked { opacity: 0.45; }

.lines {
  display: grid;
  gap: 0.3rem;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.75rem;
  padding-right: 0.15rem;
}
.line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.line .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.line .amt.neg { color: var(--success); }

.totals {
  border-top: 1px solid var(--glass-border);
  padding-top: 0.55rem;
  display: grid;
  gap: 0.25rem;
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}
.total-row.final {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
  margin-top: 0.25rem;
}
.strike { text-decoration: line-through; opacity: 0.65; margin-right: 0.4rem; }

.afford {
  margin: 0.65rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.afford.ok { color: #86efac; background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }
.afford.bad { color: #fda4a4; background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.afford.guest { color: #c4d2ef; background: rgba(122, 144, 184, 0.12); border-color: rgba(122, 144, 184, 0.28); }

.cart-note { color: var(--muted); font-size: 0.72rem; margin-top: 0.7rem; text-align: center; }
.cart-note--donate { margin-top: 0.45rem; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(32rem, 100%);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.modal h3 { margin: 0 0 0.4rem; }
.modal p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.9rem; }
.ticket-preview {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.9rem;
  font-family: ui-monospace, monospace;
}
.modal-actions { display: flex; gap: 0.55rem; justify-content: flex-end; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translate(-50%, 120%);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }


.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.15rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 14, 28, 0.72);
  color: var(--accent-cyan);
  font-size: 0.62rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  flex-shrink: 0;
  user-select: none;
}
.info-tip__mark { pointer-events: none; }
.info-tip__bubble {
  position: fixed;
  left: 0;
  bottom: auto;
  top: auto;
  transform: none;
  width: max(12rem, min(18rem, 70vw));
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 28, 0.96);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), visibility 0.15s;
  z-index: 9999;
  white-space: normal;
}
.info-tip__bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(10, 14, 28, 0.96);
}
.info-tip__bubble--below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(10, 14, 28, 0.96);
}
.info-tip:hover .info-tip__bubble,
.info-tip:focus .info-tip__bubble,
.info-tip:focus-visible .info-tip__bubble,
.info-tip.is-open .info-tip__bubble {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* Promo strip */
.promo-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.22), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(125, 211, 252, 0.45);
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.promo-banner__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b1220;
  background: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.55);
}
.promo-banner__text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e0f2fe;
}

/* Duration class tags */
.seg-btn--duration .seg-btn__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
}
.class-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}
.class-tag--blitz {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.12);
}
.class-tag--rapido {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}
.class-tag--clasico {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.12);
}

/* Border panel */
#borderSizeSeg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
#borderSpeedSeg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 900px) {
  #borderSizeSeg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #borderSizeSeg,
  #borderSpeedSeg { grid-template-columns: 1fr; }
}
.seg-btn.is-locked,
.seg-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
  border-style: dashed;
}
.subhead--border {
  margin-top: 0.15rem;
}


/* Footer + Terms */
.wrap--narrow { max-width: 48rem; }
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--glass-border);
}
.site-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; color: var(--accent); }
.site-footer__sep { opacity: 0.55; }
.same-day-notice {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-left: 3px solid #d97706;
  border-radius: var(--radius-md, 10px);
  color: #fbbf24;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}
.same-day-notice strong { color: #fcd34d; }
.legal-doc h2 {
  margin: 1.4rem 0 0.55rem;
  font-size: 1.05rem;
  color: var(--accent);
}
.legal-doc p, .legal-doc li {
  color: var(--text);
  font-size: 0.95rem;
}
.legal-doc ul {
  margin: 0.4rem 0 0.8rem 1.1rem;
  padding: 0;
}
.legal-doc li { margin: 0.35rem 0; }
.legal-updated {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0;
}
.legal-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.9rem;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn--ghost:hover {
  border-color: rgba(var(--accent-cyan-rgb), 0.45);
  color: var(--accent-cyan);
}

@media (max-width: 560px) {
  .nerf-config__label { white-space: normal; }
  .cfg-row, .nerf-row, .nerf-config { min-width: 0; }
}

@media (max-width: 700px), (pointer: coarse) {
  .info-tip { width: 2.75rem; height: 2.75rem; margin-left: 0.35rem; display: inline-flex; align-items: center; justify-content: center; }
  .info-tip__mark { font-size: 1rem; }
}

@media (max-width: 700px) {
  .field input, .field select, .field textarea { font-size: 16px; }
  .nerf-config__select { font-size: 16px; padding: 0.5rem 0.6rem; min-height: 2.75rem; }
}

@media (max-width: 700px) {
  .badge { font-size: 0.72rem; }
  .info-tip { font-size: 0.75rem; }
  .class-tag { font-size: 0.72rem; }
  .scen-list .toggle .meta, .pill, .bal .l { font-size: 0.72rem; }
}

@media (max-width: 700px) {
  .btn--sm, .btn--ghost { min-height: 2.75rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
}

@media (pointer: coarse) {
  input[type='range'] { height: 2.75rem; }
  input[type='range']::-webkit-slider-thumb { width: 1.5rem; height: 1.5rem; }
  input[type='range']::-moz-range-thumb { width: 1.5rem; height: 1.5rem; }
}

@media (max-width: 700px) {
  .site-footer a { padding: 0.45rem 0.3rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
}

/* ===== Light theme ===== */
[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-rgb: 244, 246, 251;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-up: rgba(238, 241, 248, 0.8);
  --text: #161d33;
  --muted: #5a6a8a;
  --accent: #a16207;
  --accent-rgb: 161, 98, 7;
  --accent-alt: #c2410c;
  --accent-alt-rgb: 194, 65, 12;
  --accent-cyan: #0e7490;
  --accent-cyan-rgb: 14, 116, 144;
  --border: rgba(23, 31, 51, 0.14);
  --glass-border: rgba(23, 31, 51, 0.09);
  --success: #15803d;
  --danger: #dc2626;
}

/* Hardcoded-color overrides for light theme */
[data-theme='light'] .demo-only code { background: rgba(23, 31, 51, 0.06); }

[data-theme='light'] .brand-mark {
  background: rgba(23, 31, 51, 0.08);
  border-color: rgba(23, 31, 51, 0.14);
}

[data-theme='light'] .btn--ghost:hover { border-color: rgba(23, 31, 51, 0.2); }

[data-theme='light'] .btn--primary { color: #fff; }

[data-theme='light'] .switch { background: rgba(23, 31, 51, 0.15); }

[data-theme='light'] .field input,
[data-theme='light'] .field select,
[data-theme='light'] .field textarea { background: rgba(23, 31, 51, 0.06); }

[data-theme='light'] .warn { color: #b45309; }

[data-theme='light'] .sub-panel,
[data-theme='light'] .nerf-config { background: rgba(23, 31, 51, 0.05); }

[data-theme='light'] .scen-col { background: rgba(23, 31, 51, 0.05); }

[data-theme='light'] .scen-list::-webkit-scrollbar-thumb { background: rgba(23, 31, 51, 0.18); }

[data-theme='light'] .bal { background: rgba(23, 31, 51, 0.05); }

[data-theme='light'] .badge-free { color: #15803d; }
[data-theme='light'] .badge-premium { color: #b45309; }

[data-theme='light'] .afford.ok { color: #15803d; }
[data-theme='light'] .afford.bad { color: #dc2626; }
[data-theme='light'] .afford.guest { color: #64748b; }

[data-theme='light'] .ticket-preview { background: rgba(23, 31, 51, 0.05); }

[data-theme='light'] .info-tip {
  border-color: rgba(23, 31, 51, 0.16);
  background: rgba(23, 31, 51, 0.08);
}
[data-theme='light'] .info-tip__bubble {
  background: var(--surface-solid);
  border-color: var(--border);
  box-shadow: 0 12px 36px rgba(23, 31, 51, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
[data-theme='light'] .info-tip__bubble::after { border-top-color: var(--surface-solid); }
[data-theme='light'] .info-tip__bubble--below::after { border-bottom-color: var(--surface-solid); }

[data-theme='light'] .promo-banner { color: #075985; }
[data-theme='light'] .promo-banner__text { color: #075985; }

[data-theme='light'] .class-tag {
  border-color: rgba(23, 31, 51, 0.14);
  color: #334155;
  background: rgba(23, 31, 51, 0.06);
}
[data-theme='light'] .class-tag--blitz { color: #be123c; }
[data-theme='light'] .class-tag--rapido { color: #b45309; }
[data-theme='light'] .class-tag--clasico { color: #1d4ed8; }

[data-theme='light'] .same-day-notice { color: #b45309; }
[data-theme='light'] .same-day-notice strong { color: #92400e; }

/* Theme toggle (sun/moon) */
.theme-toggle {
  position: relative;
  z-index: 300;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--surface-up);
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.theme-toggle svg {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle .icon-sun { opacity: 0; transform: scale(0.6); }
.theme-toggle .icon-moon { opacity: 1; transform: scale(1); }
[data-theme='light'] .theme-toggle .icon-sun { opacity: 1; transform: scale(1); }
[data-theme='light'] .theme-toggle .icon-moon { opacity: 0; transform: scale(0.6); }
