/* ═══════════════════════════════════════════════════
   TEAM REVEAL — Reveal Experience
   ═══════════════════════════════════════════════════ */

/* ── Controls widget (in main app) ── */
.reveal-controls { display: flex; gap: 8px; margin-bottom: 10px; }
.reveal-skip-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.reveal-skip-toggle input { width: auto; }

/* ── Base ── */
.reveal-route {
  background: #0f161a;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  font-family: "Inter", sans-serif;
}

#particles-bg { position: fixed; inset: 0; z-index: 0; opacity: 1; }

.screen-flash {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
}

/* ── Spotlights ── */
.spotlight {
  position: fixed;
  width: min(50vw, 600px);
  height: 180vh;
  top: -10vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  mix-blend-mode: screen;
  filter: blur(8px);
  transform-origin: 50% 0%;
  -webkit-clip-path: polygon(42% 0%, 58% 0%, 100% 100%, 0% 100%);
  clip-path: polygon(42% 0%, 58% 0%, 100% 100%, 0% 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.35) 65%, transparent 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.35) 65%, transparent 100%);
}
.spotlight-1 {
  left: 16%;
  background: conic-gradient(from 0deg at 50% 0%, transparent 38%, rgba(255,255,255,0.03) 43%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.03) 57%, transparent 62%);
  animation: spotSweep1 8s ease-in-out infinite;
}
.spotlight-2 {
  right: 12%;
  background: conic-gradient(from 0deg at 50% 0%, transparent 39%, rgba(255,255,255,0.03) 44%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.03) 56%, transparent 61%);
  animation: spotSweep2 10s ease-in-out infinite;
}
.spotlight-3 {
  left: 50%;
  background: conic-gradient(from 0deg at 50% 0%, transparent 37%, rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.03) 58%, transparent 63%);
  animation: spotSweep3 6s ease-in-out infinite;
}

@keyframes spotSweep1 {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}
@keyframes spotSweep2 {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-20deg); }
}
@keyframes spotSweep3 {
  0%, 100% { transform: rotate(-8deg) translateX(-50%); }
  50% { transform: rotate(12deg) translateX(-50%); }
}

/* ── Camera flashes ── */
.camera-flashes {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 3;
}
.camera-flash-dot {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
}

/* ── Shell ── */
.reveal-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.reveal-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
}

.reveal-back-link {
  text-decoration: none;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  transition: color 0.2s;
}
.reveal-back-link:hover { color: rgba(255,255,255,0.6); }
.reveal-meta { font-size: 11px; color: rgba(255,255,255,0.2); }

.reveal-actions {
  position: fixed;
  bottom: calc(40px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.reveal-return-btn { text-decoration: none; }

.btn-generate,
.reveal-return-btn {
  padding: 10px 16px;
  background: #4ade80;
  color: #0f1210;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-generate:hover,
.reveal-return-btn:hover { background: #86efac; }

.btn-reroll {
  padding: 10px 16px;
  background: rgba(255,255,255,0.06);
  color: #e5e5e5;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-reroll:hover { background: rgba(255,255,255,0.1); border-color: rgba(74,222,128,0.3); }

/* ── Phases ── */
.phase {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.phase.hidden { display: none; }

/* ═══ Phase 0: Tap to begin ═══ */
.phase-tap { cursor: pointer; }

.tap-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.draft-logo {
  font-family: "Oswald", sans-serif;
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(255,255,255,0.15);
  animation: logoPulse 3s ease-in-out infinite;
}

.tap-subtitle {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  animation: subtitleFade 2s ease-in-out infinite;
}

.tap-pulse-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: ringExpand 3s ease-out infinite;
}

@keyframes logoPulse {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 40px rgba(255,255,255,0.1); }
  50% { opacity: 1; text-shadow: 0 0 60px rgba(255,255,255,0.25); }
}
@keyframes subtitleFade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}
@keyframes ringExpand {
  0% { transform: scale(0.8); opacity: 0.4; }
  100% { transform: scale(2); opacity: 0; }
}

/* ═══ Phase 1: Buildup ═══ */
.phase-buildup {
  gap: 0;
  justify-content: center;
}

.buildup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  animation: livePulse 1.5s ease-in-out infinite;
}
.buildup-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: liveDot 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes liveDot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.buildup-ticker {
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  margin-bottom: 48px;
}

.buildup-announce {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 120px;
}

.announce-line {
  display: block;
  text-align: center;
}

.announce-line-1 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.announce-line-2 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.buildup-bar {
  width: min(400px, 80vw);
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 40px;
}

.buildup-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), #fff);
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* ═══ Phase 2: The Jumbotron ═══ */
.phase-reveal {
  perspective: 1000px;
}

.jumbotron {
  width: min(700px, 92vw);
  position: relative;
}

.jumbotron-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(170deg, #0d0d14, #090910);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.jumbotron-team-stripe {
  height: 6px;
  background: var(--reveal-color, #8b5cf6);
  box-shadow: 0 2px 20px var(--reveal-color, #8b5cf6);
}

.jumbotron-content {
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
  text-align: center;
}

.jumbotron-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.jumbotron-team {
  font-family: "Oswald", sans-serif;
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 700;
  color: var(--reveal-color, #8b5cf6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 40px color-mix(in srgb, var(--reveal-color, #8b5cf6) 40%, transparent);
}

.jumbotron-divider {
  width: 60px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  margin: 20px auto;
}

.jumbotron-player {
  font-family: "Oswald", sans-serif;
  font-size: clamp(42px, 9vw, 80px);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.jumbotron-meta {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

/* Glow behind jumbotron */
.jumbotron::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, var(--reveal-color, #8b5cf6), transparent 70%);
  opacity: 0;
  filter: blur(40px);
  z-index: -1;
  transition: opacity 0.5s;
}
.jumbotron.glow::before { opacity: 0.2; }

/* ═══ Phase 3: Squad Board + Other Teams ═══ */
.phase-squad {
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
}

.squad-screen {
  width: min(600px, 94vw);
  background: linear-gradient(175deg, #0a0a10, #06060a);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.squad-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.squad-team-badge {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--reveal-color, #8b5cf6);
  box-shadow: 0 0 10px var(--reveal-color, #8b5cf6);
}

.squad-title {
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.squad-board {
  padding: 8px 0;
}

/* Individual squad row */
.squad-row {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s;
}
.squad-row:last-child { border-bottom: none; }
.squad-row:hover { background: rgba(255,255,255,0.02); }

.squad-row-number {
  width: 28px;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.squad-row-name {
  flex: 1;
  font-family: "Oswald", sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  overflow: hidden;
}

/* Flip board letter animation */
.squad-letter {
  display: inline-block;
  opacity: 0;
  transform: rotateX(-90deg);
  transition: all 0.15s ease-out;
}
.squad-letter.revealed {
  opacity: 1;
  transform: rotateX(0deg);
}

.squad-row-pos {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  flex-shrink: 0;
  width: 40px;
  text-align: right;
}

/* Highlight for the current player */
.squad-row-you {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03));
}
.squad-row-you .squad-row-name {
  color: var(--reveal-color, #8b5cf6);
  font-weight: 700;
}
.squad-row-you .squad-row-number {
  color: var(--reveal-color, #8b5cf6);
}

/* ═══ Other Teams (below main squad) ═══ */
.squad-scroll {
  width: min(600px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: 80px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.squad-screen-main {
  flex-shrink: 0;
}

.other-teams-label {
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  text-align: center;
  padding-top: 8px;
}
.other-teams-label.hidden { display: none; }

.other-teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.other-team-card {
  background: linear-gradient(175deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.other-team-card:hover { opacity: 1; }

.other-team-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.other-team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.other-team-name {
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.other-team-count {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

.other-team-players {
  padding: 4px 0;
}

.other-team-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 32px;
}

.other-team-row-num {
  width: 24px;
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.other-team-row-name {
  flex: 1;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.other-team-row-pos {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase;
  width: 36px;
  text-align: right;
}

/* ── Camera shake ── */
@keyframes cameraShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-4px, -2px) rotate(-0.5deg); }
  20% { transform: translate(5px, 1px) rotate(0.6deg); }
  30% { transform: translate(-3px, 4px) rotate(-0.4deg); }
  40% { transform: translate(4px, -2px) rotate(0.5deg); }
  50% { transform: translate(-2px, 3px) rotate(-0.3deg); }
  60% { transform: translate(3px, -3px) rotate(0.4deg); }
  70% { transform: translate(-4px, 2px) rotate(-0.5deg); }
  80% { transform: translate(2px, -3px) rotate(0.3deg); }
  90% { transform: translate(-3px, 4px) rotate(-0.4deg); }
}
.shake { animation: cameraShake 0.6s ease-out; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .reveal-route { min-height: 100dvh; }
  .reveal-shell { min-height: 100dvh; }
  .jumbotron-content { padding: 24px 16px; }
  .jumbotron-team { font-size: clamp(28px, 7vw, 48px); }
  .jumbotron-player { font-size: clamp(32px, 8vw, 60px); }
  .squad-scroll { width: 96vw; }
  .squad-row { padding: 0 14px; height: 40px; }
  .squad-row-name { font-size: 14px; }
  .other-team-row { padding: 0 12px; height: 30px; }
  .other-team-row-name { font-size: 12px; }
  .reveal-actions { flex-direction: column; align-items: center; }
  .reveal-footer {
    padding:
      calc(8px + env(safe-area-inset-top))
      calc(12px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      calc(12px + env(safe-area-inset-left));
  }
  .spotlight {
    display: block;
    top: -10vh;
    width: min(65vw, 500px);
    height: 190vh;
    opacity: 0.6;
    filter: blur(6px);
    transform-origin: 50% 0%;
  }
  .spotlight-1 { left: 4%; }
  .spotlight-2 { right: 2%; }
  .spotlight-3 { left: 50%; }
  .draft-logo { font-size: clamp(36px, 9vw, 64px); }
  .buildup-announce { min-height: 90px; }
  .announce-line-1 { font-size: clamp(14px, 3.5vw, 22px); }
  .announce-line-2 { font-size: clamp(18px, 4.5vw, 32px); }
}

@media (max-width: 480px) {
  .jumbotron-content { padding: 20px 12px; }
  .jumbotron-label { font-size: 10px; letter-spacing: 0.2em; }
  .jumbotron-divider { margin: 14px auto; }
  .jumbotron-meta { font-size: 12px; }
  .squad-row { padding: 0 10px; height: 38px; }
  .squad-row-number { width: 22px; font-size: 11px; }
  .squad-row-name { font-size: 13px; }
  .squad-row-pos { font-size: 10px; width: 32px; }
  .squad-header { padding: 12px 14px; }
  .squad-title { font-size: 12px; }
  .other-team-header { padding: 8px 12px; }
  .other-team-name { font-size: 12px; }
  .other-team-row { padding: 0 12px; height: 28px; }
  .other-team-row-name { font-size: 11px; }
  .other-team-row-num { font-size: 10px; width: 20px; }
  .other-teams-label { font-size: 10px; }
  .phase-squad { padding-top: 20px; }
  .reveal-actions { bottom: calc(24px + env(safe-area-inset-bottom)); gap: 6px; }
  .reveal-actions .btn-reroll,
  .reveal-actions .btn-generate { font-size: 12px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .spotlight, .tap-pulse-ring { animation: none; }
  .draft-logo, .tap-subtitle, .buildup-badge { animation: none; opacity: 1; }
}
