/* =========================================================================
   CISCO ARENA — Celebrations, Tweaks panel, theme-specific flourishes
   ========================================================================= */

/* ---- Celebration overlay ---- */
.celeb {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 100;
  pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in oklch, var(--accent) 30%, transparent) 0%, color-mix(in oklch, #000 60%, transparent) 70%);
  animation: fade-up var(--dur-2) var(--ease);
}
.celeb-inner {
  text-align: center;
  animation: scale-in 400ms var(--ease);
}
.celeb-word {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 168px;
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--accent);
  text-shadow: 0 4px 40px color-mix(in oklch, var(--accent) 70%, transparent);
  margin: 0;
  position: relative;
}
.celeb-word::after {
  content: ""; position: absolute; top: 10%; left: -10%; right: -10%; bottom: 10%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  mix-blend-mode: overlay;
  animation: sweep 1.2s var(--ease);
}
.celeb-sub {
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 12px;
  opacity: .9;
}
.celeb-streak {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 32px;
  color: var(--accent-2);
  margin-top: 16px;
  letter-spacing: .08em;
}

/* Confetti */
.confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.confetti span {
  position: absolute; top: -20px;
  width: 8px; height: 14px;
  animation: confetti-fall linear forwards;
}

/* ---- Theme-specific celebration words / flourishes ---- */
[data-theme="cup"]   .celeb-word { color: var(--accent); letter-spacing: .02em; }
[data-theme="gp"]    .celeb-word { font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; }
[data-theme="nfl"]   .celeb-word { text-transform: uppercase; }
[data-theme="realm"] .celeb-word { font-weight: 700; letter-spacing: .05em; }

/* Theme field-lines / texture layer for hero backgrounds */
.hero-fx { position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: overlay; }
[data-theme="cup"] .hero-fx {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 80px, color-mix(in oklch, var(--success) 25%, transparent) 80px 82px);
  opacity: .25;
}
[data-theme="gp"] .hero-fx {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 40px, rgba(255,255,255,.05) 40px 41px),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(255,255,255,.03) 40px 41px);
}
[data-theme="nfl"] .hero-fx {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 10%, rgba(255,255,255,.07) 10% 10.2%);
}
[data-theme="realm"] .hero-fx {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,200,120,.3) 50%, transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,200,120,.25) 50%, transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,200,120,.2) 50%, transparent),
    radial-gradient(1px 1px at 85% 85%, rgba(255,200,120,.3) 50%, transparent);
}

/* ---- Checkered flag strip (GP only decoration in footer/header) ---- */
.checker-strip {
  height: 4px;
  background-image:
    repeating-conic-gradient(#fff 0% 25%, #000 0% 50%);
  background-size: 10px 10px;
  width: 100%;
  display: none;
}
[data-theme="gp"] .checker-strip { display: block; }

/* ---- Tweaks panel ---- */
.tweak-toggle {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-pill);
  font-weight: 700; font-size: 12.5px;
  letter-spacing: .06em;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; gap: 8px;
}
.tweak-panel {
  position: fixed; bottom: 72px; right: 16px; z-index: 200;
  width: 360px; max-height: 78vh;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: scale-in var(--dur-2) var(--ease);
}
.tweak-head {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
}
.tweak-head .t {
  font-family: var(--f-display); font-weight: 800; font-size: 14px;
  letter-spacing: .06em; text-transform: uppercase;
}
.tweak-body { overflow-y: auto; padding: 8px 0; }
.tweak-section {
  padding: 12px 18px;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent);
}
.tweak-section:last-child { border-bottom: 0; }
.tweak-label {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 10px;
  display: flex; justify-content: space-between;
}
.tweak-grid { display: grid; gap: 8px; }
.tweak-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.tweak-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.tweak-grid.c5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tweak-opt {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease);
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  text-align: left;
}
.tweak-opt.active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 15%, var(--bg));
  color: var(--ink);
}
.tweak-opt .sw {
  width: 100%; height: 24px; border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.tweak-opt .nm { font-size: 11px; font-weight: 700; }
.tweak-opt .tg { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-muted); letter-spacing: .08em; }

/* Screen nav (left strip) */
.scr-nav {
  position: fixed; left: 12px; bottom: 56px;
  z-index: 150;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px;
  box-shadow: var(--shadow-2);
}
.scr-nav button {
  width: 36px; height: 36px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: .05em;
  transition: all var(--dur-2) var(--ease);
}
.scr-nav button:hover { color: var(--ink); background: var(--bg-elev-2); }
.scr-nav button.active {
  background: var(--accent); color: var(--accent-ink);
}

/* Toasts */
.toasts {
  position: absolute; right: 16px; top: 80px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  font-weight: 600;
  animation: fade-up var(--dur-2) var(--ease);
  min-width: 220px;
}
.toast .t { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 2px; }
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }

@media (max-width: 768px) {
  .celeb-inner { padding: 0 var(--sp-6); }
  .celeb-word { font-size: 104px; }

  .celeb-sub {
    font-size: 12px;
    letter-spacing: .18em;
  }

  .celeb-streak { font-size: 24px; }

  .tweak-toggle {
    min-height: 44px;
    padding: 12px 16px;
  }

  .tweak-panel {
    left: 16px;
    right: 16px;
    width: auto;
    max-height: min(72vh, 560px);
  }

  .tweak-grid.c5 { grid-template-columns: repeat(3, 1fr); }

  .scr-nav {
    left: 16px;
    bottom: 124px;
    flex-direction: row;
    border-radius: var(--r-xl);
  }

  .scr-nav button {
    width: 40px;
    height: 40px;
  }

  .toasts {
    left: 16px;
    right: 16px;
    top: 72px;
  }

  .toast { min-width: 0; }
}

@media (max-width: 480px) {
  .celeb-inner { padding: 0 var(--sp-4); }
  .celeb-word { font-size: 72px; }

  .celeb-sub {
    font-size: 11px;
    letter-spacing: .14em;
  }

  .celeb-streak { font-size: 20px; }

  .confetti span {
    width: 6px;
    height: 10px;
  }

  .tweak-toggle {
    left: 12px;
    right: 12px;
    bottom: 12px;
    justify-content: center;
  }

  .tweak-panel {
    left: 12px;
    right: 12px;
    bottom: 64px;
    max-height: calc(100dvh - 88px);
    border-radius: var(--r-lg);
  }

  .tweak-head { padding: 12px 14px; }
  .tweak-section { padding: 12px 14px; }

  .tweak-grid.c2,
  .tweak-grid.c3,
  .tweak-grid.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .tweak-opt {
    min-height: 44px;
    padding: 10px;
  }

  .scr-nav {
    left: 12px;
    right: 12px;
    bottom: 72px;
    justify-content: center;
  }

  .scr-nav button {
    flex: 1 1 0;
    width: auto;
    height: 44px;
  }

  .toasts {
    left: 12px;
    right: 12px;
    top: 68px;
  }

  .toast {
    width: 100%;
    padding: 10px 12px;
  }
}

/* ── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .celeb-word {
    animation: none;
  }
  .celeb-inner {
    animation: none;
  }
  .celeb-particles,
  .celeb-confetti {
    display: none;
  }
  .toast {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 375px) {
  /* Celebration: scale down for SE/mini */
  .celeb-word { font-size: 56px; }
  .celeb-sub { font-size: 10px; letter-spacing: .12em; }
  .celeb-streak { font-size: 18px; }

  /* Tweaks panel: full-width with safe insets */
  .tweak-toggle {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
  .tweak-panel {
    left: 8px;
    right: 8px;
    bottom: 58px;
    max-height: calc(100dvh - 80px);
  }
  .tweak-head { padding: 10px 12px; }
  .tweak-head .t { font-size: 12px; }
  .tweak-section { padding: 10px 12px; }
  .tweak-label { font-size: 10px; margin-bottom: 8px; }
  .tweak-opt { padding: 8px; min-height: 44px; }
  .tweak-opt .nm { font-size: 10px; }

  /* Screen nav: tighter spacing */
  .scr-nav {
    left: 8px;
    right: 8px;
    bottom: 64px;
  }
  .scr-nav button { height: 40px; font-size: 9px; }

  /* Toasts: edge-to-edge */
  .toasts { left: 8px; right: 8px; }
}
