/* 
  Swipe Cup — World Cup Swipe Predictor Stylesheet
  Theme: "Golden Pitch Glassmorphism Mobile-First Edition"
*/

:root {
  /* Tinder Bright Light Theme HSL Palette - Pastel/Peach Whites + Hot Pink/Orange Gradients */
  --bg-slate-950: hsl(250, 40%, 98%);  /* Soft warm white backdrop */
  --bg-slate-900: hsl(250, 30%, 96%);  /* Soft pastel light-gray */
  --bg-slate-800: hsl(250, 24%, 93%);  /* Pastel lilac accent background */
  --bg-slate-700: hsl(250, 16%, 86%);  /* Muted outline light-gray */
  
  --emerald-500: hsl(142, 72%, 40%);   /* Bright Emerald Green */
  --emerald-600: hsl(142, 72%, 32%);
  --emerald-glow: rgba(16, 185, 129, 0.12);
  
  --gold-300: hsl(18, 100%, 60%);      /* Tinder Coral Orange */
  --gold-400: hsl(354, 100%, 58%);     /* Tinder Hot Pink */
  --gold-500: hsl(15, 100%, 54%);      /* Core Orange */
  --gold-600: hsl(350, 95%, 48%);      /* Deep Rose Red */
  --gold-glow: rgba(254, 60, 114, 0.15);
  
  --crimson-500: hsl(354, 85%, 52%);
  --crimson-600: hsl(354, 85%, 42%);
  
  --text-primary: hsl(262, 40%, 12%);   /* Deep slate charcoal for excellent readability */
  --text-secondary: hsl(262, 20%, 35%); /* Medium slate gray */
  --text-muted: hsl(262, 10%, 52%);     /* Muted slate gray */
  
  /* Glassmorphism Bright Edition */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-gold: rgba(254, 60, 114, 0.35);
  --glass-shadow: 0 8px 32px 0 rgba(100, 110, 140, 0.14);
  --glass-blur: blur(20px);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 32px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* General Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  background-color: var(--bg-slate-950);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* --- Animated mesh background (full viewport) --- */
.swipe-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.swipe-bg-base {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 90% 70% at 15% 10%, rgba(254, 60, 114, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 18%, rgba(255, 120, 84, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 70% 55% at 72% 88%, rgba(16, 185, 129, 0.18) 0%, transparent 52%),
    radial-gradient(ellipse 65% 50% at 8% 78%, rgba(168, 85, 247, 0.14) 0%, transparent 48%),
    linear-gradient(165deg, #faf8ff 0%, #fff5f7 38%, #f0fdf8 72%, #faf8ff 100%);
  background-size: 120% 120%;
  animation: bgMeshDrift 22s ease-in-out infinite alternate;
}

.swipe-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(254, 60, 114, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 20%, transparent 75%);
}

.swipe-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  will-change: transform;
}

.orb-1 {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  top: -8%;
  left: -12%;
  background: radial-gradient(circle, rgba(254, 60, 114, 0.55) 0%, rgba(254, 60, 114, 0) 68%);
  animation: orbFloat1 19s ease-in-out infinite;
}

.orb-2 {
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  top: 8%;
  right: -14%;
  background: radial-gradient(circle, rgba(255, 140, 90, 0.5) 0%, rgba(255, 140, 90, 0) 70%);
  animation: orbFloat2 24s ease-in-out infinite;
}

.orb-3 {
  width: min(48vw, 360px);
  height: min(48vw, 360px);
  bottom: 5%;
  left: 10%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, rgba(16, 185, 129, 0) 72%);
  animation: orbFloat3 21s ease-in-out infinite;
}

.orb-4 {
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  bottom: 18%;
  right: 5%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0) 70%);
  animation: orbFloat4 26s ease-in-out infinite;
}

.orb-5 {
  width: min(38vw, 280px);
  height: min(38vw, 280px);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(250, 204, 21, 0.35) 0%, rgba(250, 204, 21, 0) 68%);
  animation: orbFloat5 17s ease-in-out infinite;
}

.swipe-bg-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 48%,
    transparent 62%
  );
  background-size: 220% 100%;
  animation: bgShineSweep 14s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes bgMeshDrift {
  0% { background-position: 0% 0%; transform: scale(1); }
  100% { background-position: 100% 100%; transform: scale(1.04); }
}

@keyframes bgShineSweep {
  0%, 100% { background-position: 200% 0; opacity: 0.25; }
  50% { background-position: -80% 0; opacity: 0.55; }
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8vw, 6vh) scale(1.06); }
  66% { transform: translate(4vw, 12vh) scale(0.96); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-10vw, 8vh) scale(1.08); }
  70% { transform: translate(-5vw, 4vh) scale(0.94); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12vw, -8vh) scale(1.1); }
}

@keyframes orbFloat4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  45% { transform: translate(-8vw, -10vh) scale(1.05); }
}

@keyframes orbFloat5 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(calc(-50% + 6vw), calc(-50% - 5vh)) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-bg-base,
  .swipe-bg-shine,
  .swipe-bg-orb {
    animation: none !important;
  }
}

/* Glass Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    var(--glass-shadow),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  border-radius: var(--radius-md);
}

/* App Container */
.swipe-app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 15px;
  gap: 15px;
}

body.deck-active {
  overflow: hidden;
}

body.deck-active .swipe-app-container {
  max-width: 100%;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  gap: 0;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
}

body.deck-active .app-header {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 8px 14px;
}

body.deck-active .swipe-main-content {
  flex: 1;
  min-height: 0;
}

body.deck-active .swipe-footer {
  display: none;
}

body.deck-active #pane-swipe-deck {
  flex: 1;
  min-height: 0;
  gap: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 1.25rem;
  color: var(--gold-400);
}

.text-gold-glow {
  text-shadow: 0 0 10px var(--gold-glow);
  filter: drop-shadow(0 0 4px var(--gold-glow));
}

.header-brand h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-gold {
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0;
  box-shadow: 0 0 6px var(--gold-glow);
}

/* Main content area */
.swipe-main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#pane-bracket-view {
  flex: 1;
  min-height: 0;
}

#pane-swipe-deck {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

body.deck-active #pane-swipe-deck .stepper-progress-container {
  border-radius: 0;
  margin: 0;
}

body.deck-active .card-deck-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: auto;
  margin: 0;
  padding: 6px 10px 4px;
}

body.deck-active .action-footer-controls {
  flex-shrink: 0;
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0));
  margin-top: 0;
}

body.deck-active .global-swipe-indicators {
  padding: 0 14px 2px;
}

body.deck-active .swipe-card {
  justify-content: flex-start;
  gap: 10px;
}

body.deck-active .card-header-stage {
  flex-shrink: 0;
}

body.deck-active .card-vs-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  align-content: center;
  justify-items: center;
  margin: 0;
  width: 100%;
  padding: 0;
  gap: clamp(4px, 2vw, 12px);
}

body.deck-active .card-team-panel {
  justify-self: center;
  width: auto;
  max-width: min(44vw, 168px);
  gap: 10px;
  align-items: center;
}

body.deck-active .card-team-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3.35rem, 13vw, 5rem);
  padding: 10px;
  margin-inline: auto;
}

body.deck-active .card-team-name {
  font-size: clamp(1rem, 4.2vw, 1.2rem);
}

body.deck-active .card-team-rank {
  font-size: 0.76rem;
}

body.deck-active .card-stage-meta {
  font-size: 0.68rem;
}

body.deck-active .card-stage-title {
  font-size: 0.95rem;
}

body.deck-active .vs-line {
  height: clamp(36px, 10vh, 56px);
}

body.deck-active .vs-stamp {
  font-size: 0.9rem;
  padding: 4px 11px;
}

body.deck-active .card-team-stars {
  margin-top: 0;
  flex-shrink: 0;
  width: 100%;
  font-size: clamp(0.68rem, 2.9vw, 0.8rem);
  padding: 10px 12px;
  line-height: 1.5;
}

body.deck-active .card-insights-label {
  font-size: 0.72rem;
  margin-bottom: 5px;
}

#pane-swipe-welcome {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Visual Progress Stepper */
.stepper-progress-container {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stepper-stage-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: 0.08em;
}

.stepper-count-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-sim-stage {
  flex-shrink: 0;
  margin: 0 8px;
  padding: 9px 18px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #fe3c72 0%, #ff7854 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 3px 16px rgba(254, 60, 114, 0.45),
    0 0 0 1px rgba(254, 60, 114, 0.12);
  gap: 7px;
  white-space: nowrap;
}

.btn-sim-stage i {
  font-size: 1.05em;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.btn-sim-stage:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 6px 22px rgba(254, 60, 114, 0.55),
    0 0 0 1px rgba(254, 60, 114, 0.2);
}

.btn-sim-stage:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(254, 60, 114, 0.4);
}

.btn-sim-stage:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-500), var(--gold-400));
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* Card Deck Container */
.card-deck-container {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  min-height: 345px;
  height: 345px;
  margin-top: 0;
  perspective: 1000px;
  z-index: 1;
  isolation: isolate;
}

/* The Swipable Match Card — collectible trading-card feel */
.swipe-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 248, 252, 0.96) 45%, rgba(240, 253, 250, 0.94) 100%);
  border: 2px solid rgba(254, 60, 114, 0.22);
  border-radius: 20px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 40px rgba(80, 60, 120, 0.14),
    0 6px 16px rgba(254, 60, 114, 0.08);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-origin: 50% 50%;
  transform: translate3d(0, 0, 0) rotate(0deg);
  cursor: grab;
  align-items: center;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.swipe-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35) 0%,
    transparent 35%,
    transparent 65%,
    rgba(255, 255, 255, 0.2) 100%
  );
  pointer-events: none;
  opacity: 0.5;
}

.swipe-card::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400));
  opacity: 0.35;
  box-shadow: 0 0 12px var(--gold-glow);
  pointer-events: none;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card.dragging {
  transition: none; /* Instant tracking during drag */
}

/* Card Header details */
.card-header-stage {
  width: 100%;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 8px;
}

.card-stage-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
}

.card-stage-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Card Match Body VS Layout */
.card-vs-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  margin: 15px auto;
  gap: 8px;
}

.card-team-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  width: 100%;
  max-width: 140px;
  justify-self: center;
}

.card-team-flag {
  font-size: 3.4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s var(--transition-spring);
  position: relative;
  z-index: 1;
  padding: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff 0%, rgba(255, 255, 255, 0.4) 55%, transparent 70%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.swipe-card:hover .card-team-flag {
  transform: scale(1.08);
}

.card-team-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-team-rank {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-team-rank span {
  color: var(--gold-400);
}

.card-vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 4px;
}

.vs-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.12), transparent);
}

.vs-stamp {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-slate-800);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 3px 8px;
  border-radius: 20px;
}

/* Card Team Stars Footer */
.card-team-stars {
  width: 100%;
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: center;
  background: var(--bg-slate-800);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-insights-label,
.card-team-stars > span:first-child {
  color: var(--gold-400);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

/* Overlay Stamps inside Card */
.swipe-stamp {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  border: 3px solid;
  border-radius: 8px;
  padding: 6px 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
  z-index: 5;
}

.stamp-win-a {
  top: 30px;
  left: 30px;
  border-color: var(--gold-400);
  color: var(--gold-400);
  transform: rotate(-15deg);
  text-shadow: 0 0 10px var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow);
}

.stamp-win-b {
  top: 30px;
  right: 30px;
  border-color: var(--gold-400);
  color: var(--gold-400);
  transform: rotate(15deg);
  text-shadow: 0 0 10px var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow);
}

.stamp-draw {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  border-color: var(--gold-400);
  color: var(--gold-400);
  text-shadow: 0 0 10px var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Global stamps wrapper for backups */
.global-swipe-indicators {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
  margin-top: 0;
  margin-bottom: 0;
}

.global-stamp {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* Card Deck Placeholder */
.swipe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
}

.placeholder-spinner {
  font-size: 2rem;
  color: var(--gold-400);
}

/* EXIT ANIMATIONS */
.swipe-out-left {
  transform: translate(-150vw, 80px) rotate(-35deg) !important;
  transition: transform 0.4s ease-in !important;
}

.swipe-out-right {
  transform: translate(150vw, 80px) rotate(35deg) !important;
  transition: transform 0.4s ease-in !important;
}

.swipe-out-up {
  transform: translate(0, -150vh) rotate(0deg) !important;
  transition: transform 0.4s ease-in !important;
}

/* Tactile Footer controls */
.action-footer-controls {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  gap: 8px;
}

.btn-action-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-slate-900);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

.btn-action-circle:hover {
  background: var(--bg-slate-800);
  color: var(--gold-500);
  border-color: rgba(254, 60, 114, 0.35);
}

.btn-undo-circle:hover {
  transform: rotate(-30deg);
  color: var(--gold-300);
}

.btn-reset-circle:hover {
  color: var(--crimson-500);
}

.swipe-choice-row {
  flex: 1;
  display: flex;
  gap: 8px;
}

.btn-choice {
  flex: 1;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  padding: 10px 6px;
  border-radius: 40px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-choice-subtle {
  flex: 0 0 auto;
  min-width: 44px;
  max-width: 52px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
  opacity: 0.72;
}

.btn-choice-subtle:hover {
  opacity: 1;
}

.btn-choice-subtle .btn-flag-micro {
  font-size: 1.15rem;
}

.btn-choice-icon {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-muted);
  line-height: 1;
}

body.deck-active .swipe-choice-row {
  flex: 0;
  justify-content: center;
  gap: 14px;
}

.btn-choice span {
  white-space: nowrap;
}

.btn-flag-micro {
  font-size: 1rem;
  line-height: 1;
}

.btn-win-a:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--emerald-500);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.btn-win-b:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--emerald-500);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.btn-draw:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--gold-400);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Keyboard Help Banner */
.keyboard-help-banner {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 600;
  text-transform: uppercase;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  background: var(--bg-slate-900);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text-primary);
}

/* PANE 2: CHAMPIONSHIP SHOWCASE (GRAND PODIUM) */
.podium-glass-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 247, 250, 0.98));
  border: 2px solid var(--gold-400);
  box-shadow: 0 0 45px var(--gold-glow);
  padding: 30px 20px;
  animation: float 4s ease-in-out infinite;
}

.gold-crown-animated {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.sub-podium-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--gold-300);
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  display: block;
}

.podium-glass-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.champion-podium-block {
  background: linear-gradient(135deg, rgba(254, 60, 114, 0.08), rgba(255, 120, 84, 0.12));
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(254, 60, 114, 0.25);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(100, 110, 140, 0.12);
}

#finish-flag {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

#finish-name {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-primary);
  background: linear-gradient(to right, var(--text-primary), var(--gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.podium-finishers-row {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.finisher-podium {
  flex: 1;
  background: var(--bg-slate-900);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.finisher-podium .podium-number {
  margin-bottom: 2px;
}

.finisher-podium .finisher-info {
  text-align: center;
  width: 100%;
}

.finisher-flag {
  display: block;
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 6px 0 4px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.finisher-podium.silver {
  border-color: rgba(192, 192, 192, 0.2);
}

.finisher-podium.bronze {
  border-color: rgba(205, 127, 50, 0.2);
}

.podium-number {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
}

.silver .podium-number { color: #9ca3af; }
.bronze .podium-number { color: #b87333; }

.medal-label {
  font-size: 0.5rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.silver .medal-label { color: #6b7280; }
.bronze .medal-label { color: #9a5f1a; }

.finisher-info h3 {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-top: 1px;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* Quick Stats dashboard on swiped podium */
.quick-stats-panel {
  padding: 15px;
  margin-bottom: 24px;
  background: var(--bg-slate-900);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-stats-panel {
  padding: 10px 12px;
}

.quick-upset-card {
  background: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.quick-upset-title {
  font-size: 0.55rem;
  color: var(--gold-400);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.quick-upset-match {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

/* Swipe intro overlay */
.swipe-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(250, 248, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.swipe-intro-overlay:not(.hidden) {
  display: flex !important;
}

.swipe-intro-card {
  width: 100%;
  max-width: 340px;
  padding: 20px 18px;
  text-align: center;
}

.swipe-intro-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.swipe-intro-lead {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.swipe-intro-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 6px;
  align-items: center;
  justify-items: center;
  margin-bottom: 12px;
}

.intro-gesture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.intro-left { grid-column: 1; grid-row: 2; }
.intro-right { grid-column: 3; grid-row: 2; }
.intro-up { grid-column: 2; grid-row: 1; }

.intro-gesture.hidden {
  display: none;
}

.intro-arrow {
  font-size: 1.25rem;
  color: var(--gold-400);
  line-height: 1;
}

.intro-card-mock {
  grid-column: 2;
  grid-row: 2;
  box-sizing: border-box;
  width: 132px;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  border-radius: 20px;
  border: 2px solid rgba(254, 60, 114, 0.22);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 248, 252, 0.96) 45%,
    rgba(240, 253, 250, 0.94) 100%
  );
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 28px rgba(80, 60, 120, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.intro-match-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  flex-shrink: 0;
}

.intro-match-ball {
  font-size: 1.15rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.intro-match-vs {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(254, 60, 114, 0.55);
  line-height: 1;
  user-select: none;
}

.btn-intro-kickoff {
  margin-top: 4px;
  padding: 16px 20px !important;
  font-size: 1.05rem !important;
  border-radius: 999px !important;
  min-height: 52px;
}

.swipe-intro-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Podium signature panels */
.podium-signature-panel {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  text-align: left;
}

.podium-signature-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.podium-signature-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-400);
  display: block;
  margin-bottom: 4px;
}

.podium-chaos-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-400);
  line-height: 1.1;
}

.podium-chaos-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.path-to-glory-route {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 600;
}

/* CTA to View Bracket in Main App */
.podium-cta-box {
  margin-bottom: 18px;
}

.pulse-gold {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  animation: pulseGold 2s infinite alternate;
}

.cta-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
  padding: 0 10px;
}

.podium-restart-box {
  margin-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 15px;
}

/* BUTTONS SIZING & DECORATIONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-slate-900);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-slate-800);
  color: var(--text-primary);
  border-color: rgba(254, 60, 114, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #fff;
  border-color: var(--gold-300);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--gold-glow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.72rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.9rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* TOAST NOTIFICATION */
.toast-notification {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 8px 18px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.2) forwards;
}

/* App Footer */
.swipe-footer {
  text-align: center;
  padding: 10px;
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.highlight-gold {
  color: var(--gold-400);
}

/* ANIMATIONS & KEYFRAMES */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-25px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  100% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* Desktop: wider colorful backdrop around the phone-width app */
@media (min-width: 481px) {
  .orb-1 { width: 480px; height: 480px; }
  .orb-2 { width: 440px; height: 440px; }
  .orb-3 { width: 400px; height: 400px; }
  .orb-4 { width: 360px; height: 360px; }
  .orb-5 { width: 300px; height: 300px; }
  .swipe-bg-orb {
    filter: blur(72px);
  }
}

/* Mobile browser (not fixed app chrome) */
@media (max-width: 480px) {
  .swipe-bg-orb {
    filter: blur(44px);
  }

  .swipe-bg-grid {
    background-size: 36px 36px;
    opacity: 0.28;
  }

  .swipe-app-container {
    padding: 8px;
    padding-left: max(8px, env(safe-area-inset-left, 0));
    padding-right: max(8px, env(safe-area-inset-right, 0));
    gap: 10px;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    justify-content: flex-start;
  }

  body.deck-active {
    overflow: hidden;
  }

  body.deck-active .swipe-app-container {
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow: hidden;
  }

  .swipe-main-content {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }

  body.deck-active .swipe-main-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .app-header {
    padding: 6px 10px;
    padding-top: max(6px, env(safe-area-inset-top, 0));
    flex-shrink: 0;
  }

  body.deck-active .app-header h1 {
    font-size: 0.92rem !important;
  }

  body.deck-active .stepper-progress-container {
    padding: 6px 10px;
    flex-shrink: 0;
  }

  body.deck-active .stepper-stage-label,
  body.deck-active .stepper-count-label {
    font-size: 0.58rem;
  }

  body.deck-active .btn-sim-stage {
    padding: 7px 14px;
    font-size: 0.72rem;
    margin: 0 6px;
    box-shadow: 0 2px 12px rgba(254, 60, 114, 0.4);
  }

  body.deck-active .card-deck-container {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none;
    height: auto !important;
    padding: 4px 8px 2px;
  }

  .card-deck-container {
    min-height: 260px;
    height: auto;
  }

  body.deck-active .swipe-card {
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 10px 10px;
    overflow: hidden;
  }

  .swipe-card {
    padding: 12px 10px;
  }

  body.deck-active .card-header-stage {
    padding-bottom: 4px;
    flex-shrink: 0;
  }

  body.deck-active .card-stage-meta {
    font-size: 0.7rem;
  }

  body.deck-active .card-stage-title {
    font-size: 1rem;
  }

  body.deck-active .card-vs-body {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 !important;
    gap: clamp(6px, 2.5vw, 14px);
    align-content: center;
    align-items: center;
    justify-items: center;
    width: 100%;
    padding: 0;
  }

  body.deck-active .card-team-panel {
    width: auto;
    max-width: min(46vw, 172px);
    gap: clamp(8px, 1.5vh, 12px);
    align-items: center;
    justify-self: center;
  }

  body.deck-active .card-team-flag {
    font-size: clamp(3.5rem, 16vw, 5.25rem) !important;
    padding: clamp(9px, 2.2vh, 14px) !important;
  }

  body.deck-active .card-team-name {
    font-size: clamp(1.02rem, 4.5vw, 1.22rem) !important;
  }

  body.deck-active .card-team-rank {
    font-size: 0.76rem !important;
  }

  body.deck-active .vs-line {
    height: clamp(40px, 11vh, 58px) !important;
  }

  body.deck-active .vs-stamp {
    font-size: 0.92rem !important;
    padding: 5px 12px !important;
  }

  body.deck-active .card-team-stars {
    margin-top: 0;
    padding: 10px 12px !important;
    font-size: clamp(0.68rem, 3vw, 0.82rem) !important;
    line-height: 1.5;
  }

  body.deck-active .card-insights-label {
    font-size: 0.72rem !important;
    margin-bottom: 6px !important;
  }

  .global-swipe-indicators {
    display: none !important;
  }

  body.deck-active .action-footer-controls {
    gap: 8px;
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0));
  }

  body.deck-active .btn-action-circle {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  body.deck-active .swipe-choice-row {
    gap: 12px;
  }

  body.deck-active .btn-choice-subtle {
    min-width: 48px;
    max-width: 54px;
    padding: 9px;
  }

  body.deck-active .btn-flag-micro {
    font-size: 1.4rem;
  }

  body.deck-active .btn-choice-icon {
    font-size: 1.1rem;
  }

  .keyboard-help-banner {
    display: none !important;
  }

  .swipe-footer {
    padding: 4px;
    font-size: 0.55rem;
    flex-shrink: 0;
  }

  #pane-swipe-welcome .welcome-glass-card {
    padding: 20px 14px;
  }

  #pane-swipe-welcome .leaderboard-list {
    max-height: 28vh;
  }
}

/* Very short mobile viewports (browser chrome + small phones) */
@media (max-width: 480px) and (max-height: 700px) {
  body.deck-active .card-team-flag {
    font-size: clamp(3.1rem, 14vw, 4rem) !important;
    padding: 8px !important;
  }

  body.deck-active .card-team-name {
    font-size: 0.98rem !important;
  }

  body.deck-active .vs-line {
    height: 38px !important;
  }

  body.deck-active .card-team-stars {
    font-size: 0.66rem !important;
    padding: 8px 10px !important;
  }
}

/* Welcome Screen & Text Input Styling */
.welcome-glass-card {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--text-primary);
}

.welcome-glass-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.welcome-logo-animated {
  margin: 0 auto 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.welcome-logo-img {
  display: block;
  width: auto;
  max-width: 140px;
  height: auto;
  max-height: 168px;
  object-fit: contain;
  border-radius: 12px;
}

.welcome-intro {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.name-input-container {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glass-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.glass-input::placeholder {
  color: var(--text-muted);
}

.glass-input:focus {
  border-color: var(--gold-400);
  background: #fff;
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Ensure all panes inherit readable text on light surfaces */
.swipe-pane {
  color: var(--text-primary);
}

.swipe-card-placeholder p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 280px;
}

/* Save & Share modal (Supabase) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border-radius: var(--radius-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.modal-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}

.save-share-field {
  margin-bottom: 12px;
}

.save-share-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.save-share-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: #fff;
  color: var(--text-primary);
  font-family: inherit;
}

.save-share-error {
  color: #dc2626;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.save-share-error.hidden {
  display: none;
}

/* Simple bracket viewer */
.bracket-view-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.bracket-view-toolbar h2 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
  text-align: center;
  color: var(--text-primary);
}

.bracket-view-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.bracket-view-footer {
  padding: 12px;
  margin-top: 8px;
}

.bracket-view-footer .btn-intro-kickoff {
  margin-top: 0;
}

.bv-section-title {
  font-size: 0.9rem;
  margin: 16px 0 10px;
  color: var(--text-primary);
}

.bv-muted {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bv-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.bv-group-card {
  padding: 10px;
}

.bv-group-title {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 6px;
  color: var(--gold-400);
}

.bv-standings-table {
  width: 100%;
  font-size: 0.72rem;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.bv-standings-table th,
.bv-standings-table td {
  padding: 3px 4px;
  text-align: left;
}

.bv-standings-table .bv-stat {
  text-align: right;
  font-weight: 700;
}

.bv-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.65rem;
}

.bv-match-list li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

.bv-match-list strong {
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Knockout tree (horizontal bracket) */
.bv-tree-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin: 0 -4px;
}

.bv-tree-canvas {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 8px 4px 16px;
  width: max-content;
  min-height: 520px;
}

.bv-tree-col {
  display: flex;
  flex-direction: column;
  width: 148px;
  flex-shrink: 0;
}

.bv-col-title {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bv-tree-col .bv-match-list {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 10px;
}

.bv-match-card {
  overflow: hidden;
  padding: 0;
}

.bv-match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.bv-score-pill {
  color: var(--gold-400);
  font-weight: 800;
}

.bv-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.68rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.bv-slot:last-child {
  border-bottom: none;
}

.bv-slot-flag {
  font-size: 1rem;
  line-height: 1;
}

.bv-slot-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.bv-slot-winner {
  background: rgba(16, 185, 129, 0.12);
}

.bv-slot-winner .bv-slot-name {
  color: #059669;
  font-weight: 800;
}

.bv-col-center {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 148px;
  overflow: visible;
}

.bv-col-center-head {
  height: auto;
  overflow: visible;
  border-bottom: none;
}

.bv-col-center-head .bv-champion-hero {
  position: static;
  transform: none;
  width: 100%;
  max-width: 100%;
  text-align: center;
  pointer-events: none;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px 16px;
  margin: 0;
}

.bv-col-center-head .bv-champion-hero .bv-champion-hero-flag {
  font-size: 3rem;
  line-height: 1;
}

.bv-col-center-head .bv-champion-hero .bv-champion-hero-title {
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  margin-top: 6px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  max-width: 148px;
}

.bv-center-finals {
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  flex: 1;
  align-items: stretch;
  min-height: 0;
}

/* Row 2: Final aligns with semi-final cards; row 3: 3rd place directly underneath */
.bv-finals-final {
  grid-row: 2;
}

.bv-consolation-block {
  grid-row: 3;
  margin-top: 10px;
  justify-self: center;
  width: 100%;
  max-width: 124px;
}

.bv-match-card--final {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.12);
}

.bv-match-card--consolation {
  opacity: 0.94;
  border-style: dashed;
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(255, 255, 255, 0.55);
}

.bv-match-card--consolation .bv-match-meta {
  padding: 3px 6px;
  font-size: 0.52rem;
}

.bv-match-card--consolation .bv-slot {
  padding: 4px 6px;
  font-size: 0.62rem;
}

.bv-match-card--consolation .bv-slot-flag {
  font-size: 0.85rem;
}

.bv-champion-hero {
  text-align: center;
  padding: 0 4px 14px;
  margin-bottom: 2px;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bv-champion-hero-flag {
  font-size: 4rem;
  line-height: 1.05;
  display: block;
}

.bv-champion-hero-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fe3c72;
  margin-top: 8px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
}

/* Off-screen bracket-only image for share/download */
.bracket-share-capture-root {
  position: fixed;
  left: -16000px;
  top: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg-primary, #faf8ff);
  padding: 16px;
  box-sizing: border-box;
}

.bracket-share-capture-root .bv-tree-viewport {
  overflow: visible;
}

.bv-finals-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-400);
  text-align: center;
  margin-bottom: 6px;
}

.bv-finals-pair .bv-slot {
  padding: 8px;
}

.bv-finals-score {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-400);
  margin-bottom: 4px;
  line-height: 1.35;
}

.bv-finals-champion-line {
  font-size: 0.62rem;
  font-weight: 700;
  color: #b45309;
  margin-top: 2px;
}

.bv-champion-slot {
  background: rgba(245, 158, 11, 0.15);
}

.bv-champion-slot .bv-slot-name {
  color: #b45309;
}

.bracket-view-panel {
  width: 100%;
}

.bracket-view-toolbar .btn-sm {
  white-space: nowrap;
}

#pane-bracket-view.swipe-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

body.viewer-mode .swipe-footer {
  display: none;
}

body.viewer-mode #pane-swipe-deck,
body.viewer-mode #pane-swipe-welcome {
  display: none !important;
}

body.viewer-mode #pane-bracket-view:not(.hidden) {
  display: flex !important;
}

/* Leaderboard (welcome screen) */
.leaderboard-widget {
  width: 100%;
}

.leaderboard-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.leaderboard-champion-bars {
  margin: 8px 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.champion-bars-title {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.champion-bars-body {
  min-height: 24px;
}

.champion-bars-msg {
  margin: 0;
}

.champion-bars-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.champion-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(48px, 2.2fr) 36px;
  align-items: center;
  gap: 8px;
}

.champion-bar-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champion-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.champion-bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  box-sizing: border-box;
  border: 1px solid #000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: width 0.35s ease;
}

.champion-bar-fill--default {
  background: linear-gradient(90deg, var(--gold-400), #ff7854);
}

.champion-bar-pct {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold-400);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  font-size: 0.78rem;
}

.leaderboard-row:hover {
  border-color: var(--gold-400);
}

.leaderboard-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.leaderboard-nick {
  font-weight: 700;
  color: var(--gold-400);
}

.leaderboard-champ {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-help-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Stage transition overlay (Tinder-style) */
.stage-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(250, 248, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stage-transition-overlay:not(.hidden) {
  display: flex !important;
}

body.stage-transition-active #pane-swipe-deck .card-deck-container,
body.stage-transition-active #pane-swipe-deck .action-footer-controls,
body.stage-transition-active #pane-swipe-deck .global-swipe-indicators {
  pointer-events: none;
  opacity: 0.35;
}

.stage-transition-card {
  width: 100%;
  max-width: 320px;
  min-height: 380px;
  padding: 32px 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  border: 2px solid rgba(254, 60, 114, 0.25);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95) inset,
    0 24px 48px rgba(80, 60, 120, 0.18);
  transition: transform 0.35s ease-in;
  will-change: transform;
}

.stage-transition-card.dragging {
  transition: none;
  cursor: grabbing;
}

.stage-transition-card.swipe-out-left {
  transform: translate(-150vw, 60px) rotate(-28deg) !important;
}

.stage-transition-card.swipe-out-right {
  transform: translate(150vw, 60px) rotate(28deg) !important;
}

.stage-transition-card.swipe-out-up {
  transform: translate(0, -150vh) rotate(0deg) !important;
}

.stage-transition-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold-400);
  text-transform: uppercase;
}

.stage-transition-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(135deg, #fe3c72 0%, #ff7854 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stage-transition-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.stage-transition-arrows {
  display: flex;
  gap: 20px;
  font-size: 1.1rem;
  color: rgba(254, 60, 114, 0.45);
  margin-top: 8px;
}

/* Share modal */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(250, 248, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.share-modal-overlay:not(.hidden) {
  display: flex !important;
}

.share-modal-card {
  width: 100%;
  max-width: 400px;
  padding: 20px 18px;
}

.share-modal-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  margin: 0 0 14px;
}

.share-modal-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.share-modal-url {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.share-modal-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
