/* R6 REDEMPTION V22 - ULTRA ENHANCED STYLES */

:root {
  --r6orange: #FF5500;
  --r6blue: #0055FF;
}

/* ===== THEME VARIABLES ===== */
.theme-tactical {
  --bg-main: #050505;
  --bg-panel: #0f0f0f;
  --bg-surface: #161616;
  --color-text: #f2f2f2;
  --color-muted: #737373;
  --color-accent: #FF5500;
  --color-border: #333;
  --radius-box: 0px;
  font-family: 'Oswald', sans-serif;
}

.theme-minimal {
  --bg-main: #f0f2f5;
  --bg-panel: rgba(255, 255, 255, 0.8);
  --bg-surface: rgba(255, 255, 255, 0.5);
  --color-text: #1a1a1a;
  --color-muted: #a3a3a3;
  --color-accent: #007AFF;
  --color-border: rgba(0, 0, 0, 0.05);
  --radius-box: 24px;
  font-family: 'Inter', sans-serif;
}

.theme-ultra {
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.75);
  --bg-surface: rgba(30, 41, 59, 0.5);
  --color-text: #e2e8f0;
  --color-muted: #64748b;
  --color-accent: #22d3ee;
  --color-border: rgba(34, 211, 238, 0.3);
  --radius-box: 12px;
  font-family: 'Rajdhani', sans-serif;
}

/* ===== TACTICAL THEME BACKGROUNDS ===== */
.theme-tactical .theme-tactical-bg {
  background: 
    radial-gradient(circle at 20% 50%, rgba(255,85,0,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,85,0,0.1) 0%, transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,85,0,0.03) 2px, rgba(255,85,0,0.03) 4px);
  animation: tacticalPulse 8s ease-in-out infinite;
}

@keyframes tacticalPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

.theme-tactical .shape-box {
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  border: 1px solid var(--color-border);
}

.theme-tactical .text-outline {
  -webkit-text-stroke: 2px var(--color-accent);
  color: transparent;
  text-shadow: 0 0 20px var(--color-accent);
}

.theme-tactical .theme-minimal-bg, 
.theme-tactical .theme-ultra-bg {
  display: none;
}

.theme-tactical .theme-btn[data-theme="theme-tactical"] {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 0 20px var(--color-accent);
}

/* ===== MINIMAL THEME BACKGROUNDS ===== */
.theme-minimal .theme-minimal-bg {
  background: linear-gradient(135deg, #f0f2f5 0%, #e8ebf0 100%);
  overflow: hidden;
}

.theme-minimal .theme-minimal-bg::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: 
    radial-gradient(circle at 30% 40%, rgba(0,122,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0,122,255,0.05) 0%, transparent 40%);
  animation: minimalFloat 20s ease-in-out infinite;
}

@keyframes minimalFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(5deg); }
  66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.theme-minimal .shape-box {
  border-radius: var(--radius-box);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  clip-path: none;
}

.theme-minimal .text-outline {
  color: var(--color-accent);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.theme-minimal .theme-tactical-bg, 
.theme-minimal .theme-ultra-bg {
  display: none;
}

.theme-minimal .theme-btn[data-theme="theme-minimal"] {
  background: white;
  color: #007AFF;
  box-shadow: 0 4px 15px rgba(0,122,255,0.15);
  font-weight: 700;
}

/* ===== ULTRA THEME BACKGROUNDS ===== */
.theme-ultra .theme-ultra-bg {
  background: 
    linear-gradient(0deg, transparent 0%, rgba(34,211,238,0.03) 50%, transparent 100%),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(34,211,238,0.05) 40px, rgba(34,211,238,0.05) 41px);
  animation: cyberScan 15s linear infinite;
}

@keyframes cyberScan {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 200%, 100px 0; }
}

.theme-ultra .shape-box {
  border-radius: var(--radius-box);
  border: 1px solid var(--color-border);
  box-shadow: 
    0 0 40px rgba(34, 211, 238, 0.15),
    inset 0 1px 0 rgba(34, 211, 238, 0.1);
  backdrop-filter: blur(20px);
  clip-path: none;
  position: relative;
}

.theme-ultra .shape-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(34,211,238,0.3), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
}

.theme-ultra .text-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--color-accent);
  text-shadow: 
    0 0 20px var(--color-accent),
    0 0 40px var(--color-accent);
  animation: cyberGlow 2s ease-in-out infinite;
}

@keyframes cyberGlow {
  0%, 100% { 
    text-shadow: 
      0 0 20px var(--color-accent),
      0 0 40px var(--color-accent);
  }
  50% { 
    text-shadow: 
      0 0 30px var(--color-accent),
      0 0 60px var(--color-accent),
      0 0 80px var(--color-accent);
  }
}

.theme-ultra .theme-tactical-bg, 
.theme-ultra .theme-minimal-bg {
  display: none;
}

.theme-ultra .theme-btn[data-theme="theme-ultra"] {
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  box-shadow: 
    0 0 15px var(--color-accent),
    inset 0 0 15px rgba(34,211,238,0.1);
  background: rgba(34,211,238,0.05);
}

/* ===== TEXT EFFECTS ===== */
.hyper-glitch {
  position: relative;
  color: var(--color-text);
}

.hyper-glitch::before, 
.hyper-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.hyper-glitch::before {
  color: #ff00c1;
  z-index: -1;
  animation: glitch-1 0.3s infinite;
}

.hyper-glitch::after {
  color: #00fff9;
  z-index: -2;
  animation: glitch-2 0.3s infinite;
}

@keyframes glitch-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  100% { transform: translate(0); }
}

@keyframes glitch-2 {
  0% { transform: translate(0); }
  20% { transform: translate(3px, -3px); }
  40% { transform: translate(3px, 3px); }
  60% { transform: translate(-3px, -3px); }
  80% { transform: translate(-3px, 3px); }
  100% { transform: translate(0); }
}

.typewriter-cursor::after {
  content: '▎';
  animation: blink 1s step-end infinite;
  color: var(--color-accent);
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.glass-fade-in {
  animation: glassFade 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  filter: blur(15px);
  opacity: 0;
}

@keyframes glassFade {
  to {
    filter: blur(0);
    opacity: 1;
  }
}

/* ===== ROLL ANIMATIONS - TACTICAL (MILITARY SLOT MACHINE) ===== */
.reel-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
  will-change: transform;
  position: absolute;
  top: 0;
  left: 0;
}

.reel-icon {
  width: 250px;
  height: 250px;
  object-fit: contain;
  padding: 20px;
  flex-shrink: 0;
  filter: 
    drop-shadow(0 0 15px rgba(255,85,0,0.6))
    brightness(0.8)
    contrast(1.2);
  transition: filter 0.3s;
}

.theme-tactical .reel-icon {
  filter: 
    drop-shadow(0 0 20px rgba(255,85,0,0.8))
    drop-shadow(0 10px 30px rgba(0,0,0,0.8))
    contrast(1.3);
}

/* ===== ROLL ANIMATIONS - MINIMAL (ELEGANT MORPHING CAROUSEL) ===== */
.minimal-carousel-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2000px;
  overflow: hidden;
}

.minimal-card {
  position: absolute;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 100%
  );
  backdrop-filter: blur(40px) saturate(200%);
  box-shadow: 
    0 20px 60px rgba(0, 122, 255, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  transform-style: preserve-3d;
  opacity: 0;
  transform: scale(0.5) translateZ(-300px) rotateY(-45deg);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.minimal-card.entering {
  animation: minimalEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.minimal-card.active {
  opacity: 1;
  transform: scale(1) translateZ(0) rotateY(0deg);
  z-index: 10;
}

.minimal-card.exiting {
  animation: minimalExit 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes minimalEnter {
  0% {
    opacity: 0;
    transform: scale(0.5) translateZ(-300px) rotateY(-45deg) translateY(100px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateZ(50px) rotateY(5deg) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateZ(0) rotateY(0deg) translateY(0);
  }
}

@keyframes minimalExit {
  0% {
    opacity: 1;
    transform: scale(1) translateZ(0) rotateY(0deg) translateY(0);
    filter: blur(0px) brightness(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateZ(-200px) rotateY(45deg) translateY(-80px);
    filter: blur(10px) brightness(1.5);
  }
}
.minimal-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 0.3),
    rgba(0, 122, 255, 0.1),
    rgba(0, 122, 255, 0)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}


.minimal-card.active::before {
  opacity: 1;
  animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% {
    background: linear-gradient(
      135deg,
      rgba(0, 122, 255, 0.3),
      rgba(0, 122, 255, 0.1),
      rgba(0, 122, 255, 0)
    );
  }
  50% {
    background: linear-gradient(
      135deg,
      rgba(0, 122, 255, 0.6),
      rgba(0, 122, 255, 0.3),
      rgba(0, 122, 255, 0.1)
    );
  }
}

.minimal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 70%
  );
  transform: translateX(-100%) translateY(-100%);
  transition: transform 0.6s;
}

.minimal-card.active::after {
  animation: minimalShimmer 2s ease-in-out infinite;
}

@keyframes minimalShimmer {
  0% {
    transform: translateX(-100%) translateY(-100%);
  }
  50% {
    transform: translateX(100%) translateY(100%);
  }
  100% {
    transform: translateX(-100%) translateY(-100%);
  }
}

.minimal-card-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.minimal-card-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 40px rgba(0, 122, 255, 0.3));
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.minimal-card.active .minimal-card-content img {
  animation: minimalIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes minimalIconPop {
  0% {
    transform: scale(0.8) rotate(-5deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Floating particles effect for minimal theme */
.minimal-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.minimal-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(0, 122, 255, 0.4);
  border-radius: 50%;
  animation: minimalFloat 3s ease-in-out infinite;
}

@keyframes minimalFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0;
  }
}

/* ===== ROLL ANIMATIONS - ULTRA (MATRIX GLITCH MORPH) ===== */
.glitch-morph-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.glitch-icon {
  width: 280px;
  height: 280px;
  object-fit: contain;
  filter: 
    drop-shadow(0 0 30px var(--color-accent))
    drop-shadow(0 0 60px var(--color-accent));
  position: relative;
}

.glitch-active-anim {
  animation: glitchMorph 0.15s infinite;
}

@keyframes glitchMorph {
  0% {
    transform: translate(0) scale(1);
    filter: 
      hue-rotate(0deg) 
      drop-shadow(0 0 30px rgba(34,211,238,0.8));
  }
  25% {
    transform: translate(-8px, 4px) scale(1.05);
    filter: 
      hue-rotate(90deg) 
      drop-shadow(8px -4px 30px rgba(255,0,255,0.8));
  }
  50% {
    transform: translate(6px, -6px) scale(0.95);
    filter: 
      hue-rotate(180deg) 
      drop-shadow(-6px 6px 30px rgba(0,255,255,0.8));
  }
  75% {
    transform: translate(-4px, 8px) scale(1.08);
    filter: 
      hue-rotate(270deg) 
      drop-shadow(4px -8px 30px rgba(255,255,0,0.8));
  }
  100% {
    transform: translate(0) scale(1);
    filter: 
      hue-rotate(360deg) 
      drop-shadow(0 0 30px rgba(34,211,238,0.8));
  }
}

.glitch-icon::before,
.glitch-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0.6;
}

.glitch-icon::before {
  animation: glitchSlice1 0.2s infinite;
  mix-blend-mode: screen;
}

.glitch-icon::after {
  animation: glitchSlice2 0.2s infinite reverse;
  mix-blend-mode: screen;
}

@keyframes glitchSlice1 {
  0%, 100% { 
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  20% { 
    clip-path: inset(20% 0 60% 0);
    transform: translate(-10px, 5px);
  }
  40% { 
    clip-path: inset(60% 0 20% 0);
    transform: translate(8px, -3px);
  }
}

@keyframes glitchSlice2 {
  0%, 100% { 
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  30% { 
    clip-path: inset(40% 0 40% 0);
    transform: translate(7px, -6px);
  }
  60% { 
    clip-path: inset(10% 0 70% 0);
    transform: translate(-9px, 4px);
  }
}

/* ===== SCAN LINE & EFFECTS ===== */
.bg-scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.03) 1px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 4px
  );
  background-size: 100% 4px;
}

@keyframes scan {
  0% {
    top: -10%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 110%;
    opacity: 0;
  }
}

.rolling-active #scan-line {
  animation: scan 1.5s linear infinite;
  opacity: 1;
}

/* ===== IMPACT SHAKE ===== */
.impact-shake {
  animation: impactShake 0.5s cubic-bezier(.36,.07,.19,.97);
}

@keyframes impactShake {
  0%, 100% { transform: scale(1) rotate(0deg); }
  10% { transform: scale(1.05) rotate(-1deg); }
  20% { transform: scale(1.03) rotate(1deg); }
  30% { transform: scale(1.07) rotate(-0.5deg); }
  40% { transform: scale(1.04) rotate(0.5deg); }
  50% { transform: scale(1.08) rotate(-0.3deg); }
  60% { transform: scale(1.05) rotate(0.3deg); }
  70% { transform: scale(1.03) rotate(-0.2deg); }
  80% { transform: scale(1.02) rotate(0.2deg); }
  90% { transform: scale(1.01) rotate(-0.1deg); }
}

/* ===== OPERATOR CARDS ===== */
.op-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.op-card::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    135deg,
    transparent 30%,
    var(--color-accent) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.op-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.op-card:hover::before {
  opacity: 0.1;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.peer:checked + .op-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(255,255,255,0.05) 100%);
  border-color: var(--color-accent);
  box-shadow: 
    0 0 20px var(--color-accent),
    0 4px 15px rgba(0,0,0,0.3);
  transform: scale(1.02);
}

.theme-minimal .peer:checked + .op-card {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent));
  color: white;
  border: none;
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

.theme-minimal .peer:checked + .op-card span {
  color: white;
}

.theme-minimal .peer:checked + .op-card .rounded-full {
  background: white;
}

/* ===== STRAT BOX ===== */
.strat-box {
  border-top: 2px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 1rem;
  animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCROLLBAR ===== */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
  transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

/* ===== PERSPECTIVE ===== */
.preserve-3d {
  transform-style: preserve-3d;
}

.perspective {
  perspective: 1500px;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== WINNER INFO ANIMATION ===== */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-modal-in {
  animation: modalIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .reel-icon,
  .flip-card,
  .glitch-icon {
    width: 200px;
    height: 200px;
  }
  
  .flip-card-back img {
    width: 180px;
    height: 180px;
  }
}