@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('libs/fonts/chakra-petch-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('libs/fonts/chakra-petch-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg-deep: #07090e;
  --bg-card: rgba(14, 18, 30, 0.94);
  --cyan-neon: #00e5ff;
  --crimson-neon: #ff2a5f;
  --gold-accent: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.45);
  --text-primary: #ffffff;
  --text-muted: #8e9bb0;
  --border-subtle: rgba(255, 215, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#wheel-wrapper {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 50% 30%, #121929 0%, #06080e 100%);
  border: 2px solid var(--border-subtle);
  border-radius: 28px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

/* Header */
/* Header with Segmented Mode Switcher */
.wheel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mode-switcher-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab-btn.active#tab-mode-battle {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 229, 255, 0.08));
  color: var(--cyan-neon);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
  border: 1px solid rgba(0, 229, 255, 0.5);
}

.mode-tab-btn.active#tab-mode-tourney {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.08));
  color: var(--gold-accent);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
  border: 1px solid rgba(255, 215, 0, 0.5);
}

@property --border-glow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.atlas-queue-badge {
  background: rgba(83, 252, 24, 0.14);
  border: 1px solid rgba(83, 252, 24, 0.45);
  color: #53fc18;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.8px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 12px rgba(83, 252, 24, 0.25);
}

#wheel-wrapper.mode-switching .reel-container {
  animation: modeSwitchPulse 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modeSwitchPulse {
  0%   { transform: scale(1); filter: brightness(1); }
  45%  { transform: scale(0.975); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); }
}

.step-label {
  letter-spacing: 1px;
}

.step-target-pill {
  background: rgba(0, 229, 255, 0.16);
  border: 1.5px solid rgba(0, 229, 255, 0.65);
  color: #00e5ff;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: 11px;
  transition: all 0.25s ease;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.28);
}

.step-target-pill.target-blue {
  background: linear-gradient(135deg, rgba(0, 145, 234, 0.35), rgba(0, 229, 255, 0.18));
  border-color: #00e5ff;
  color: #e0faff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}

.step-target-pill.target-red {
  background: linear-gradient(135deg, rgba(255, 42, 95, 0.38), rgba(213, 0, 0, 0.2));
  border-color: #ff2a5f;
  color: #ffe4ec;
  box-shadow: 0 0 18px rgba(255, 42, 95, 0.5);
}

.step-target-pill.tourney-target {
  background: rgba(255, 215, 0, 0.16);
  border-color: rgba(255, 215, 0, 0.65);
  color: var(--gold-accent);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
}

/* Reel Stage */
.reel-container {
  width: 100%;
  height: 400px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.reel-glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(7, 9, 14, 0.95) 0%,
    rgba(7, 9, 14, 0.1) 35%,
    rgba(7, 9, 14, 0.1) 65%,
    rgba(7, 9, 14, 0.95) 100%
  );
  z-index: 5;
}

/* Center Pointer Needle */
.reel-pointer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 96px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 10;
  border-top: 2px solid var(--gold-accent);
  border-bottom: 2px solid var(--gold-accent);
  box-shadow: 0 0 25px var(--gold-glow), inset 0 0 15px rgba(255, 215, 0, 0.1);
}

.pointer-arrow {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--gold-accent);
  filter: drop-shadow(0 0 8px var(--gold-accent));
}

/* Track of Duo Cards */
.reel-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s linear;
}

/* Duo Card Design (Participant Left + 3:4 Slot Right — Grow-Game Unboxing + OptionWheel) */
.duo-card {
  position: relative;
  width: calc(100% - 24px);
  height: 90px;
  margin: 3px 12px;
  background: linear-gradient(135deg, rgba(16, 22, 38, 0.95) 0%, rgba(10, 14, 24, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.duo-card.highlight,
.duo-card.winner-border-glow {
  border-color: var(--gold-accent);
  box-shadow: 0 0 32px rgba(255, 215, 0, 0.75), inset 0 0 22px rgba(255, 215, 0, 0.22);
  transform: scale(1.02);
  z-index: 12;
}

/* React-Bits BorderGlow golden conic beam on winning duo card */
.duo-card.winner-border-glow::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  padding: 3px;
  background: conic-gradient(from var(--border-glow-angle), #ffd700, #fff6b0, #00e5ff, #ffd700, #ff9100, #ffd700);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: duoBorderGlowSpin 1.6s linear infinite;
  pointer-events: none;
}

@keyframes duoBorderGlowSpin {
  to { --border-glow-angle: 360deg; }
}

/* Left Half: Participant */
.card-user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 46%;
}

.user-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0091ea, var(--cyan-neon));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  overflow: hidden;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.user-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.user-tag {
  font-size: 11px;
  color: var(--cyan-neon);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Center Divider */
.card-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8%;
  color: var(--gold-accent);
  font-size: 18px;
  filter: drop-shadow(0 0 8px var(--gold-accent));
}

/* Right Half: Slot Machine (3:4 Real Portrait Cover) */
.card-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 46%;
  justify-content: flex-end;
  text-align: right;
}

.slot-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.slot-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.slot-prov {
  font-size: 11px;
  color: var(--gold-accent);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.slot-icon-box {
  width: 54px;
  height: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.slot-cover-thumb {
  width: 55px;
  height: 72px;
  aspect-ratio: 180 / 236;
  border-radius: 9px;
  object-fit: contain;
  background: #070a12;
  border: 1.5px solid rgba(255, 215, 0, 0.55);
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.35);
  flex-shrink: 0;
}

/* Centered Large Winner Toast in the Middle of the Wheel */
.winner-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 44px);
  background: radial-gradient(circle at 50% 0%, rgba(22, 30, 52, 0.98) 0%, rgba(8, 11, 20, 0.98) 100%);
  border: 2.5px solid var(--gold-accent);
  border-radius: 22px;
  padding: 22px 24px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.92), 0 0 42px var(--gold-glow);
  z-index: 30;
  animation: toast-center-pop 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.winner-toast.active {
  display: flex;
}

.toast-crown {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
}

.toast-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.toast-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-accent);
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.toast-names {
  font-family: 'Chakra Petch', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.toast-chatter {
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.75);
  letter-spacing: 0.5px;
}

.toast-with {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.toast-slot {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-accent);
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

/* Footer */
.wheel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}

.cmd-pill {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-accent);
  background: rgba(255, 215, 0, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}

/* On-Screen Direct Spin Button */
.direct-spin-btn {
  background: linear-gradient(135deg, #ffd700, #ff9100);
  color: #000;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px auto 0;
}

.direct-spin-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.7);
}

.direct-spin-btn:active {
  transform: scale(0.96);
}

.reel-container {
  cursor: pointer;
}

@keyframes toast-slide {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes toast-center-pop {
  0% { transform: translate(-50%, -46%) scale(0.88); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
