/* R3: stable scrollbar gutter so content does not shift when it toggles */
html { scrollbar-gutter: stable; }

/* ============================================
   SMARTSCORER - PREMIUM AUTH STYLES WITH PARALLAX WIDGETS
   - Centered card layout with morphing gradient meshes
   - Independent 3D parallax layers for floating widgets
   - Glassmorphic widget aesthetics with neon indicators
   - 3D card flips (Y-axis rotation)
   - SaaS-style outline inputs with glowing focus
   - Responsive design (hides widgets on <= 1100px)
   ============================================ */

/* ===== Layout Container ===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--app-vh, 100vh);
  width: 100%;
  padding: var(--space-4);
  background-color: var(--color-bg);
  position: relative;
  overflow: hidden;
  transition: background-color var(--t-normal) var(--ease-out);
}

/* Stadium Background pseudo-element (breathing zoom animation) */
.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(5, 7, 12, 0.25) 0%, rgba(5, 7, 12, 0.85) 100%),
              url('../../../images/backdrops/stadium-night.png') no-repeat center center / cover;
  z-index: 0;
  pointer-events: none;
  animation: background-zoom 45s ease-in-out infinite alternate;
  transition: opacity var(--t-normal) var(--ease-out), background-image var(--t-normal) var(--ease-out);
}

[data-theme="light"] .auth-page::before {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.82) 100%),
              url('../../../images/backdrops/stadium-day.png') no-repeat center center / cover;
  opacity: 0.85; /* Increased opacity to clearly render stadium image details in light mode */
}

@keyframes background-zoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ===== Stadium Dust Particles Animation ===== */
.stadium-dust {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.dust-particle {
  position: absolute;
  background-color: var(--color-primary);
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0;
  animation: rise-and-fade 12s linear infinite;
  box-shadow: 0 0 8px var(--color-primary);
}

.dust-particle--1 { width: 4px; height: 4px; left: 15%; animation-delay: 0s; animation-duration: 10s; }
.dust-particle--2 { width: 6px; height: 6px; left: 45%; animation-delay: 2s; animation-duration: 14s; }
.dust-particle--3 { width: 3px; height: 3px; left: 75%; animation-delay: 5s; animation-duration: 9s; }
.dust-particle--4 { width: 5px; height: 5px; left: 25%; animation-delay: 7s; animation-duration: 12s; }
.dust-particle--5 { width: 4px; height: 4px; left: 85%; animation-delay: 3s; animation-duration: 11s; }

@keyframes rise-and-fade {
  0% { transform: translateY(110vh) scale(0.8); opacity: 0; }
  30% { opacity: 0.35; }
  70% { opacity: 0.35; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* ===== Morphing Gradient Background ===== */
.mesh-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.14;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity var(--t-slow) var(--ease-out);
}

[data-theme="light"] .mesh-blob {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

.mesh-blob--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #34d176 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation: float-blob-1 25s ease-in-out infinite alternate;
}

.mesh-blob--2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ff8c3a 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation: float-blob-2 30s ease-in-out infinite alternate-reverse;
}

.mesh-blob--3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
  top: 40%;
  left: 50%;
  animation: float-blob-3 28s ease-in-out infinite alternate;
}

@keyframes float-blob-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(150px, 80px) scale(1.15); }
}

@keyframes float-blob-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, -120px) scale(1.2); }
}

@keyframes float-blob-3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, 80px) scale(0.9); }
}

/* ===== Card Header Action Tools ===== */
.auth-panel-header {
  position: absolute;
  top: 56px; /* Offset to clear the top ticker bar */
  right: var(--space-6); /* Pinned to the top-right corner */
  z-index: 10;
  pointer-events: none;
}

@media (max-width: 768px) {
  .auth-panel-header {
    top: 52px;
    right: var(--space-3); /* 12px from the right edge */
  }
}

.back-to-home, #theme-toggle {
  pointer-events: auto;
}

.back-to-home {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color var(--t-fast) var(--ease-out);
}

.back-to-home:hover {
  color: var(--color-primary);
}

.back-to-home svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast) var(--ease-out);
}

.back-to-home:hover svg {
  transform: translateX(-4px);
}

/* ===== Parallax Layers & Floating Widgets ===== */
.parallax-layer {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.2, 1);
  will-change: transform;
}

.floating-widget {
  background-color: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  backdrop-filter: var(--color-glass-backdrop);
  -webkit-backdrop-filter: var(--color-glass-backdrop);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg), 0 4px 20px rgba(0, 0, 0, 0.05);
  width: 230px;
  pointer-events: auto; /* Allow interactions on widgets if needed */
  transition: background-color var(--t-normal) var(--ease-out), border-color var(--t-normal) var(--ease-out);
}

/* Individual idle floating animations */
.drift-1 { animation: idle-drift-1 7s ease-in-out infinite alternate; }
.drift-2 { animation: idle-drift-2 8s ease-in-out infinite alternate; }
.drift-3 { animation: idle-drift-3 6s ease-in-out infinite alternate; }
.drift-4 { animation: idle-drift-4 9s ease-in-out infinite alternate; }

@keyframes idle-drift-1 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-12px) rotate(1.5deg); }
}

@keyframes idle-drift-2 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(12px) rotate(-2deg); }
}

@keyframes idle-drift-3 {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(10px) translateY(-10px); }
}

@keyframes idle-drift-4 {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-8px) translateY(12px); }
}

/* Widget Components Style details */
.widget-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: var(--space-2);
}

.widget-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.widget-badge {
  font-size: 10px;
  font-weight: var(--fw-bold);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.widget-badge--live {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  gap: 4px;
}

.widget-badge--live::before {
  content: '';
  width: 5px;
  height: 5px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.widget-badge--auction {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.widget-body {
  font-family: var(--font-body);
}

/* Score Widget details */
.score-value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--color-text);
  margin-bottom: 2px;
}

.score-details {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
}

/* Auction Widget details */
.auction-player-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.auction-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad-team-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: #ffffff;
}

.auction-player-name {
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  color: var(--color-text);
}

.auction-bid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auction-bid-label {
  font-size: 10px;
  color: var(--color-text-subtle);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
}

.auction-bid-value {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-extrabold);
  color: #ff8c3a;
  text-shadow: 0 0 10px rgba(255, 140, 58, 0.15);
}

/* Player Rating Widget details */
.player-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--fs-xs);
}

.player-rating-name {
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

.player-rating-score {
  font-weight: var(--fw-extrabold);
  color: var(--color-primary);
  font-family: var(--font-display);
}

.player-rating-bar {
  height: 4px;
  background-color: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.player-rating-fill {
  height: 100%;
  width: 90%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: var(--radius-pill);
}

/* Stats HUD details */
.stats-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.stats-desc {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* ===== 3D Card Flipping Core Structure ===== */
.card-3d-container {
  perspective: 1200px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.card-3d-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Rotate container when flipped */
.card-3d-inner.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: var(--space-10) var(--space-8);
  box-shadow: var(--shadow-xl), 0 20px 45px rgba(0, 0, 0, 0.22);
  background-color: rgba(15, 23, 42, 0.88); /* Increased dark opacity for readability */
  backdrop-filter: var(--color-glass-backdrop);
  -webkit-backdrop-filter: var(--color-glass-backdrop);
  transition: background-color var(--t-normal) var(--ease-out), border-color var(--t-normal) var(--ease-out);
}

[data-theme="light"] .card-front,
[data-theme="light"] .card-back {
  background-color: rgba(255, 255, 255, 0.94); /* Increased light opacity for readability */
  border-color: rgba(226, 232, 240, 0.9);
}

.card-front {
  position: relative;
  z-index: 2;
  transform: rotateY(0deg);
}

.card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  transform: rotateY(180deg);
}

/* Transitions for forgot password overlay inside front card */
.front-swap { position: relative; }

.front-content-login { position: relative; }
.front-content-login,
.front-content-forgot {
  transition: opacity var(--t-normal) var(--ease-out);
}

.front-content-forgot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
}

.show-forgot-form .front-content-login {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
}

.show-forgot-form .front-content-forgot {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

/* Brand logo inside cards */
.card-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

.card-logo img {
  width: 32px;
  height: 32px;
}

.card-logo span span {
  color: var(--color-primary);
}

/* Form Headings */
.form-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  text-align: center;
}

.form-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  text-align: center;
}

.form-subtitle a {
  color: var(--color-primary);
  font-weight: var(--fw-bold);
}

.form-subtitle a:hover {
  text-decoration: underline;
}

/* ===== SaaS-style Inputs ===== */
.form-group {
  position: relative;
  margin-bottom: var(--space-6);
}

.form-control-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 1.625rem 1rem 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--t-fast) var(--ease-out);
}

.form-input::placeholder {
  color: transparent;
}

.form-label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all var(--t-fast) var(--ease-out);
}

/* Label slides up inside the input elegantly */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-input:-webkit-autofill ~ .form-label,
.form-input:autofill ~ .form-label {
  top: 0.45rem;
  transform: translateY(0) scale(0.75);
  transform-origin: left top;
  color: var(--color-primary);
  font-weight: var(--fw-bold);
}

/* Autofill / browser suggestion: keep our surface + text, float the label
   (fixes the label overlapping the suggested value on load) */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--color-text);
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface-2) inset;
  box-shadow: 0 0 0 1000px var(--color-surface-2) inset;
  caret-color: var(--color-text);
  border-radius: var(--radius-md);
  transition: background-color 100000s ease-out 0s;
}
.form-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset, 0 0 0 3px var(--color-primary-glow);
  box-shadow: 0 0 0 1000px var(--color-surface) inset, 0 0 0 3px var(--color-primary-glow);
}

/* Focus outline glow */
.form-input:focus {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* Password Toggle Icon */
.password-toggle {
  position: absolute;
  right: 14px;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast) var(--ease-out);
}

.password-toggle:hover {
  color: var(--color-primary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* Password strength meter segments */
.strength-meter {
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-5);
  display: none;
}

.strength-meter.is-visible {
  display: block;
}

.strength-bars-container {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.strength-segment {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--color-border);
  transition: all var(--t-normal) var(--ease-out);
}

.strength-text {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  display: block;
}

/* Helper Row (remember me + forgot) */
.form-helper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  font-size: var(--fs-sm);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease-out);
  color: transparent;
  background-color: var(--color-surface);
}

.checkbox-custom svg {
  width: 12px;
  height: 12px;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 0.25s var(--ease-out);
}

input[type="checkbox"]:checked + .checkbox-custom {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-on-primary);
}

input[type="checkbox"]:checked + .checkbox-custom svg {
  stroke-dashoffset: 0;
}

.forgot-link {
  color: var(--color-primary);
  font-weight: var(--fw-bold);
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ===== Submit Button Hover Reflection Sweep ===== */
.auth-submit-btn {
  width: 100%;
  height: 48px;
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: none;
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-extrabold);
  box-shadow: 0 4px 12px var(--color-primary-glow);
  cursor: pointer;
  transition: all var(--t-normal) var(--ease-out);
}

.auth-submit-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px var(--color-primary-glow);
}

.auth-submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
}

.auth-submit-btn:hover::after {
  left: 150%;
  transition: left 0.75s ease-in-out;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
  margin: 0 auto;
}

[data-theme="dark"] .btn-spinner {
  border-top-color: var(--color-text-on-primary);
}

.auth-submit-btn.is-loading .btn-text {
  display: none;
}

.auth-submit-btn.is-loading .btn-spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Social Login Row ===== */
.social-separator {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-6);
}

.social-separator::before,
.social-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.social-separator span {
  padding: 0 var(--space-4);
  font-size: 11px;
  color: var(--color-text-subtle);
  font-weight: var(--fw-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Circular social node grid */
.social-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-5);
  margin-bottom: var(--space-2);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  transition: all var(--t-fast) var(--ease-spring);
  color: var(--color-text);
  cursor: pointer;
}

.social-btn:hover {
  transform: scale(1.08) translateY(-1px);
  border-color: var(--color-border-strong);
  background-color: var(--color-surface-hover);
}

.social-btn svg {
  width: 20px;
  height: 20px;
}

/* Shake transition validation error */
.form-group.has-error .form-input {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px var(--color-danger-soft);
}

.error-text {
  font-size: var(--fs-xs);
  color: var(--color-danger);
  margin-top: 6px;
  display: none;
  font-weight: var(--fw-semibold);
}

.form-group.has-error .error-text {
  display: block;
}

.shake {
  animation: shake-anim 0.45s ease-in-out;
}

@keyframes shake-anim {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-10px); }
  35%, 75% { transform: translateX(10px); }
  45% { transform: translateX(-6px); }
  65% { transform: translateX(6px); }
}

/* ===== Responsive Adaptations ===== */
@media (max-width: 1100px) {
  .parallax-layer {
    display: none !important; /* Hide floating widgets on smaller screens */
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: var(--space-2);
  }

  .card-front, .card-back {
    padding: var(--space-8) var(--space-4);
    border: none;
    background-color: transparent;
    box-shadow: none;
  }

  [data-theme="dark"] .card-front,
  [data-theme="dark"] .card-back {
    background-color: transparent;
    box-shadow: none;
    border: none;
  }

  .form-title {
    font-size: var(--fs-xl);
  }
}

/* ===== CARD-LEVEL DRS RADAR SCANNER OVERLAY ===== */
.card-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal) var(--ease-out);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-loader-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .card-loader-overlay {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Radar scanning target reticle */
.radar-container {
  width: 120px;
  height: 120px;
  border: 2px dashed rgba(52, 209, 118, 0.35);
  border-radius: 50%;
  position: relative;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(52, 209, 118, 0.05);
}

.radar-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 50%, rgba(52, 209, 118, 0.22) 100%);
  animation: radar-sweep 2.2s linear infinite;
  z-index: 1;
}

.radar-crosshairs {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 1;
}

.radar-crosshairs::before,
.radar-crosshairs::after {
  content: '';
  position: absolute;
  background-color: rgba(52, 209, 118, 0.22);
}

/* Horizontal crosshair line */
.radar-crosshairs::before {
  top: 50%;
  left: 10%;
  width: 80%;
  height: 1px;
  transform: translateY(-50%);
}

/* Vertical crosshair line */
.radar-crosshairs::after {
  left: 50%;
  top: 10%;
  height: 80%;
  width: 1px;
  transform: translateX(-50%);
}

/* Sonar Wave pulsing center circle */
.sonar-wave {
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 50%;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 12px var(--color-primary);
}

.sonar-wave::before,
.sonar-wave::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  opacity: 0;
  animation: sonar-pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.sonar-wave::after {
  animation-delay: 0.9s;
}

@keyframes sonar-pulse-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Vertical scanning sweep line */
.scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #34d176, transparent);
  box-shadow: 0 0 8px #34d176;
  z-index: 3;
  animation: scan-sweep 2.5s ease-in-out infinite;
}

.scanner-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-extrabold);
  color: var(--color-text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.scanner-status {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: #ff8c3a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

@keyframes scan-sweep {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* ===== MINIMALIST STUMPS & ELEGANT VICTORY CELEBRATION ===== */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal) var(--ease-out);
}

.success-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .success-overlay {
  background: rgba(255, 255, 255, 0.96);
}

.success-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  pointer-events: none;
}

/* LED Stumps Wickets container */
.wickets-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 120px;
  margin-bottom: var(--space-8);
  position: relative;
  z-index: 1002;
}

.stump {
  width: 8px;
  height: 110px;
  background-color: var(--color-border-strong);
  border-radius: var(--radius-xs);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
  transform-origin: bottom center;
}

.bail {
  position: absolute;
  top: 6px;
  height: 6px;
  background-color: var(--color-border-strong);
  border-radius: var(--radius-xs);
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.5s ease, box-shadow 0.5s ease;
}

.bail--left {
  left: 2px;
  width: 22px;
}

.bail--right {
  right: 2px;
  width: 22px;
}

/* Glowing LED effect and bails lift on success */
.success-overlay.is-active .stump {
  background-color: #34d176;
  box-shadow: 0 0 12px #34d176, 0 0 25px rgba(52, 209, 118, 0.5);
}

.success-overlay.is-active .bail {
  background-color: #34d176;
  box-shadow: 0 0 10px #34d176;
}

/* Lift bails up gently in place (no messy angles or rotation) */
.success-overlay.is-active .bail--left,
.success-overlay.is-active .bail--right {
  transform: translateY(-16px);
}

.success-title {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  color: #34d176;
  text-shadow: 0 0 15px rgba(52, 209, 118, 0.35);
  text-align: center;
  margin-bottom: var(--space-2);
  z-index: 1002;
  transform: scale(0.92);
  opacity: 0;
  transition: all 0.5s var(--ease-spring);
}

.success-overlay.is-active .success-title {
  transform: scale(1);
  opacity: 1;
}

.success-message {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  text-align: center;
  z-index: 1002;
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.5s var(--ease-spring) 0.15s;
}

.success-overlay.is-active .success-message {
  transform: translateY(0);
  opacity: 1;
}
