:root{
  --bg1:#0a0a0a;
  --bg2:#080604;
  --glass: rgba(20,20,20,.85);
  --glass2: rgba(10,10,10,.75);
  --line: rgba(255,255,255,.12);
  --txt: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --shadow: 0 16px 60px rgba(0,0,0,.55);
  --accent: #e85820;
  --accent-dark: #c45c2a;
  --depth-1: 0 2px 4px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.2);
  --depth-2: 0 4px 8px rgba(0,0,0,.35), 0 8px 16px rgba(0,0,0,.25), 0 16px 32px rgba(0,0,0,.15);
  --depth-3: 0 8px 16px rgba(0,0,0,.4), 0 16px 32px rgba(0,0,0,.3), 0 32px 64px rgba(0,0,0,.2), 0 0 80px rgba(232,88,32,.08);
  --glow-accent: 0 0 20px rgba(232,88,32,.15), 0 0 40px rgba(232,88,32,.08);
}

/* Floating animation keyframes */
@keyframes float {
  0%, 100% { transform: translateY(0) translateZ(0); }
  50% { transform: translateY(-6px) translateZ(10px); }
}
@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes depth-breathe {
  0%, 100% { box-shadow: var(--depth-2); }
  50% { box-shadow: var(--depth-3); }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--txt);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, #18110d 0%, #0f0a08 50%, #080604 100%);
  overflow-x:hidden;
}

.bg-clouds{
  position:fixed; inset:-30px;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(232,88,32,.08) 0 22%, transparent 45%),
    radial-gradient(circle at 60% 15%, rgba(232,88,32,.06) 0 18%, transparent 42%),
    radial-gradient(circle at 75% 35%, rgba(232,88,32,.05) 0 20%, transparent 45%),
    radial-gradient(circle at 30% 60%, rgba(232,88,32,.04) 0 26%, transparent 50%),
    radial-gradient(circle at 65% 70%, rgba(232,88,32,.03) 0 24%, transparent 48%);
  filter: blur(12px);
  opacity:.6;
  pointer-events:none;
  transform: translateZ(0);
}

.wrap{ width:min(1200px, 92vw); margin: 22px auto 60px; }

.glass{
  background: linear-gradient(180deg, rgba(30,30,30,.9), rgba(20,20,20,.85));
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--depth-2), inset 0 1px 0 rgba(255,255,255,.06);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.topbar{
  position:sticky; top:0; z-index:10;
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between;
  border-radius:18px;
  margin-bottom:16px;
  box-shadow: var(--depth-2), inset 0 1px 0 rgba(255,255,255,.08);
  transform-style: preserve-3d;
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo3d{
  width:46px; height:46px; border-radius:14px;
  display:grid; place-items:center;
  font-weight:900;
  background: linear-gradient(180deg, #e85820, #c45c2a);
  color: #fff;
  box-shadow: var(--depth-2), 0 0 30px rgba(232,88,32,.4), inset 0 1px 0 rgba(255,255,255,.2);
  transform: perspective(800px) rotateX(8deg);
  animation: float-subtle 4s ease-in-out infinite;
  transition: transform .3s ease, box-shadow .3s ease;
}
.logo3d:hover{
  transform: perspective(800px) rotateX(0deg) scale(1.05);
  box-shadow: var(--depth-3), 0 0 40px rgba(232,88,32,.5);
}
.h1{ font-weight:900; letter-spacing:.5px; }
.sub{ color:var(--muted); font-size:13px; margin-top:2px; }

.card3d{
  border-radius:18px;
  padding:16px;
  margin-top:16px;
  box-shadow: var(--depth-2);
  transform-style: preserve-3d;
  transform: translateZ(0);
  transition: transform .4s cubic-bezier(.25,.46,.45,.94), box-shadow .4s ease;
  animation: float-subtle 6s ease-in-out infinite;
  position: relative;
}
.card3d::before{
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0.5;
}
.card3d:hover{
  transform: translateY(-4px) translateZ(20px);
  box-shadow: var(--depth-3);
}
.cardHead{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:12px;
}
.h2{ font-weight:850; font-size:18px; }
.muted{ color:var(--muted); }
.tiny{ font-size:12px; }
.pill{
  background: rgba(232,88,32,.2);
  border:1px solid rgba(232,88,32,.35);
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,88,32,.2), inset 0 1px 0 rgba(255,255,255,.1);
  animation: glow-pulse 3s ease-in-out infinite;
}

.btn3d{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border:1px solid rgba(255,255,255,.15);
  background: linear-gradient(180deg, rgba(60,60,60,.95), rgba(40,40,40,.85)) !important;
  color:#fff !important;
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255,255,255,.12);
  transform: perspective(800px) translateZ(0);
  transition: transform .2s cubic-bezier(.25,.46,.45,.94), box-shadow .2s ease, filter .15s ease;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.btn3d::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 50%);
  pointer-events: none;
  border-radius: 14px;
}
.btn3d:hover{ 
  transform: perspective(800px) translateY(-3px) translateZ(8px); 
  box-shadow: var(--depth-2);
  filter: brightness(1.15); 
}
.btn3d:active{ 
  transform: perspective(800px) translateY(1px) translateZ(-4px); 
  box-shadow: var(--depth-1);
}

.primary, .btn3d.primary{
  background: linear-gradient(180deg, #e85820, #c45c2a) !important;
  color: #fff !important;
  border-color: rgba(232,88,32,.4) !important;
  box-shadow: var(--depth-1), 0 0 20px rgba(232,88,32,.25), inset 0 1px 0 rgba(255,255,255,.15);
}
.primary:hover, .btn3d.primary:hover{ 
  filter: brightness(1.1); 
  box-shadow: var(--depth-2), 0 0 30px rgba(232,88,32,.35);
}

.playerGrid{
  display:grid;
  grid-template-columns: 1.55fr .95fr;
  gap:14px;
}
.playerShell{
  position:relative;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(0,0,0,.2);
  min-height: 320px;
  box-shadow: var(--depth-2), inset 0 0 60px rgba(0,0,0,.3);
  transform-style: preserve-3d;
}
#twitch-embed{ width:100%; height:100%; min-height: 360px; }
.overlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.55);
}
.overlayInner{
  padding:18px 20px;
  border-radius:18px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  box-shadow: var(--depth-3), inset 0 1px 0 rgba(255,255,255,.15);
  text-align:center;
  animation: float 4s ease-in-out infinite;
  transform-style: preserve-3d;
}
.overlayInner .big{ font-weight:950; font-size:28px; }
.overlayInner .small{ margin-top:6px; color:var(--muted); }

.chatShell{
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--line);
  height: 100%;
  min-height: 360px;
  box-shadow: var(--depth-2), inset 0 0 40px rgba(0,0,0,.2);
  transform-style: preserve-3d;
}
.chatHead{ padding:12px; border-bottom:1px solid var(--line); }
#twitch-chat{ width:100%; height: 340px; }
.chatNote{ padding:10px 12px; border-top:1px solid var(--line); }

.rowControls{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}
.soundPad{ display:flex; gap:10px; }
.padBtn{
  width:46px; height:46px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.08);
  color:var(--txt);
  font-size:18px;
  cursor:pointer;
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .2s ease, box-shadow .2s ease, filter .15s ease;
}
.padBtn:hover{ 
  filter:brightness(1.1); 
  transform: translateY(-3px);
  box-shadow: var(--depth-2);
}
.padBtn:active{
  transform: translateY(1px);
  box-shadow: var(--depth-1);
}

.payGrid{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:14px;
}
.paySheet{
  margin-top:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.sheetTitle{ font-weight:900; margin-bottom:10px; }
.payBox{
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,.35);
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .3s ease, box-shadow .3s ease;
}
.payBox:hover{
  transform: translateY(-2px);
  box-shadow: var(--depth-2);
}
.payRow{
  display:flex; justify-content:space-between;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.payRow:last-child{ border-bottom:none; }
.label{ color:var(--muted); }
.value{ font-weight:900; }
.priceLine{ display:flex; justify-content:space-between; margin-top:10px; }
.price{ font-weight:950; font-size:18px; }

.contactBox{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,.35);
}
.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
input, select, textarea{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(20,15,12,.9) !important;
  border:1px solid rgba(232,88,32,.25) !important;
  color:#fff !important;
  padding:12px 12px;
  border-radius:14px;
  outline:none;
  min-width: 210px;
  font-size: 16px;
}
input::placeholder, textarea::placeholder{
  color: rgba(255,255,255,.45) !important;
}
textarea{ min-width: 260px; min-height: 90px; resize: vertical; }
.codeOut{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(232,88,32,.25);
  background: rgba(0,0,0,.45);
  font-weight:900;
  color:#fff;
}

.unlockBox, .statsBox{
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,.35);
  margin-bottom:12px;
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .3s ease, box-shadow .3s ease;
}
.unlockBox:hover, .statsBox:hover{
  transform: translateY(-2px);
  box-shadow: var(--depth-2);
}
.statRow{ display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.1);}
.statRow:last-child{ border-bottom:none; }

.wallLocked{
  padding:18px;
  border-radius:16px;
  border:1px dashed rgba(232,88,32,.35);
  background: rgba(0,0,0,.35);
  text-align:center;
}
.wallContent{ margin-top:10px; }
.wallCols{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.wallSectionTitle{
  font-weight:950;
  margin: 8px 0 10px;
}
.stack{ display:flex; flex-direction:column; gap:10px; }
.wallCard{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(232,88,32,.2);
  background: rgba(0,0,0,.35);
}
.wallCard .meta{ color:var(--muted); font-size:12px; margin-top:6px; }

.adminGrid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:14px;
}
.adminCol{}
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.field label{ color:var(--muted); font-size:12px; }
.toggleRow{ margin:10px 0; }

.toggle-label{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  background: rgba(0,0,0,.2);
  border-radius:10px;
  cursor:pointer;
  transition: background 0.2s;
}
.toggle-label:hover{ background: rgba(0,0,0,.3); }
.toggle-label input[type="checkbox"]{
  width:20px;
  height:20px;
  accent-color:#e85820;
  cursor:pointer;
}
.toggle-label span{ font-weight:600; }

.hidden{ display:none !important; }

.gate{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:60vh;
}
.gateCard{
  max-width:520px;
  width:100%;
}
.policy-list{
  list-style:none;
  padding:0;
  margin:16px 0;
}
.policy-list li{
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.1);
  font-size:14px;
}
.policy-list li:last-child{
  border-bottom:none;
}
.fine-print{
  font-size:12px;
  color:var(--muted);
}

.logTable{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.logTable th, .logTable td{
  padding:8px 6px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.logTable th{
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
}
.logTable td{
  color:var(--txt);
}
.logTable tbody tr:hover{
  background:rgba(255,255,255,.04);
}
.logTable td.ua-cell{
  max-width:200px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.hero-section{
  position:relative;
  overflow:hidden;
  min-height:420px;
  margin-bottom:16px;
}
.sky-bg{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, #18110d 0%, #0f0a08 50%, #080604 100%);
  opacity:0.8;
  z-index:0;
}
.cloud{
  position:absolute;
  background:rgba(255,255,255,.25);
  border-radius:50%;
  filter:blur(30px);
}
.cloud.c1{
  width:200px;height:80px;top:15%;left:10%;
  animation:floatCloud 25s ease-in-out infinite;
}
.cloud.c2{
  width:160px;height:60px;top:30%;right:15%;
  animation:floatCloud 30s ease-in-out infinite reverse;
}
.cloud.c3{
  width:180px;height:70px;top:50%;left:40%;
  animation:floatCloud 35s ease-in-out infinite;
}
.plane{
  position:absolute;
  width:40px;height:20px;
  background:linear-gradient(90deg,rgba(255,255,255,.9),rgba(255,255,255,.5));
  clip-path:polygon(0 50%,70% 0,100% 50%,70% 100%);
}
.plane.p1{
  top:20%;left:-50px;
  animation:flyPlane 20s linear infinite;
}
.plane.p2{
  top:60%;left:-50px;
  animation:flyPlane 25s linear infinite 5s;
}
@keyframes floatCloud{
  0%,100%{transform:translateX(0) translateY(0);}
  50%{transform:translateX(30px) translateY(-10px);}
}
@keyframes flyPlane{
  0%{transform:translateX(0);}
  100%{transform:translateX(calc(100vw + 100px));}
}
@keyframes slideDown{
  0%{transform:translateY(-100%);opacity:0;}
  100%{transform:translateY(0);opacity:1;}
}
@keyframes slideUp{
  0%{transform:translateY(0);opacity:1;}
  100%{transform:translateY(-100%);opacity:0;}
}
.hero-content{
  position:relative;
  z-index:1;
  padding:24px;
}
.hero-title{
  font-size:clamp(1.5rem,4vw,2.2rem);
  font-weight:900;
  margin-bottom:12px;
  text-align:center;
}
.hero-sub{
  text-align:center;
  color:var(--muted);
  margin-bottom:24px;
  font-size:14px;
}
.tiles-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
  margin-bottom:24px;
}
.tile{
  padding:16px;
  border-radius:14px;
  position:relative;
}
.tile h3{
  font-size:15px;
  font-weight:700;
  margin:0 0 4px;
}
.tile-tag{
  position:absolute;
  top:12px;right:12px;
  background:#e85820;
  color:#fff;
  font-size:10px;
  font-weight:800;
  padding:3px 8px;
  border-radius:6px;
  letter-spacing:0.5px;
}
.hero-cta{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

@media (max-width: 980px){
  .playerGrid{ grid-template-columns: 1fr; }
  .payGrid{ grid-template-columns: 1fr; }
  .wallCols{ grid-template-columns: 1fr; }
  .adminGrid{ grid-template-columns: 1fr; }
  #twitch-embed{ min-height: 280px; }
  .chatShell{ min-height: 280px; }
}

/* Landscape mode on mobile/tablet - full screen video, chat below (scroll to access) */
@media (orientation: landscape) and (max-height: 700px) {
  .playerGrid{ 
    display: flex;
    flex-direction: column;
  }
  .playerShell {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }
  #twitch-embed { 
    width: 100%;
    height: 100vh;
    min-height: 100vh;
  }
  .chatShell { 
    width: 100%;
    min-height: 300px;
    border-radius: 0;
    margin-top: 0;
  }
  #twitch-chat {
    height: 280px;
  }
  .wrap { 
    width: 100%; 
    margin: 0; 
    padding: 0;
  }
  .topbar { 
    display: none; 
  }
  .card3d {
    margin-top: 0;
    border-radius: 0;
  }
}

/* ========== MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
  .wrap { width: 95vw; margin: 12px auto 40px; }
  .topbar { padding: 10px 12px; border-radius: 14px; }
  .logo3d { width: 38px; height: 38px; }
  .h1 { font-size: 16px; }
  .card3d { padding: 12px; border-radius: 14px; }
  .h2 { font-size: 16px; }
  
  /* Touch-friendly buttons */
  .btn3d, .padBtn, button, a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Payment flow mobile optimization */
  .paySheet { padding: 12px; }
  .payBox { padding: 10px; }
  .payRow { padding: 10px 0; flex-wrap: wrap; gap: 4px; }
  
  /* Forms mobile */
  input, select, textarea {
    min-width: 100%;
    width: 100%;
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 14px 12px;
  }
  
  /* Stack controls on mobile */
  .rowControls { flex-direction: column; align-items: stretch; }
  .soundPad { justify-content: center; }
  .row { flex-direction: column; }
  
  /* Overlay mobile */
  .overlayInner { padding: 14px 16px; max-width: 90vw; }
  .overlayInner .big { font-size: 22px; }
}

@media (max-width: 480px) {
  .wrap { width: 97vw; margin: 8px auto 30px; }
  .topbar { margin-bottom: 10px; }
  .brand { gap: 8px; }
  .logo3d { width: 32px; height: 32px; font-size: 14px; }
  .h1 { font-size: 14px; }
  .sub { font-size: 11px; }
  
  .card3d { margin-top: 10px; }
  .cardHead { flex-direction: column; align-items: flex-start; gap: 6px; }
  
  .tiles-grid { grid-template-columns: 1fr; }
  .tile { padding: 12px; }
  
  /* Payment buttons stack */
  .hero-cta { flex-direction: column; }
  .btn-row { flex-direction: column; gap: 10px; }
}

/* ========== ACCESSIBILITY ========== */
/* Focus states for keyboard navigation */
:focus-visible {
  outline: 2px solid #e85820;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #e85820;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(232, 88, 32, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --txt: #ffffff;
    --muted: rgba(255,255,255,.85);
    --line: rgba(255,255,255,.3);
  }
  
  .btn3d, button, a.btn {
    border-width: 2px;
  }
  
  input, select, textarea {
    border-width: 2px;
  }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .cloud, .plane, .bg-clouds {
    animation: none !important;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #e85820;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

/* Ensure minimum color contrast */
.muted { color: rgba(255,255,255,.75); }
.tiny { color: rgba(255,255,255,.7); }

/* Touch targets - ensure 44x44 minimum */
.toggle-label {
  min-height: 44px;
}

.toggle-label input[type="checkbox"] {
  min-width: 24px;
  min-height: 24px;
}

/* Loading states for async operations */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Error/success states with accessible colors */
.error-text { color: #f87171; }
.success-text { color: #4ade80; }
.warning-text { color: #fbbf24; }

/* Toggle Switch for Admin Chat Controls */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  pointer-events: none;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,.14);
  border: 1px solid var(--line);
  transition: .2s;
  border-radius: 999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(232, 88, 32, .45);
  border-color: rgba(232, 88, 32, .6);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(232, 88, 32, .35);
}

.toggle-switch.sm {
  width: 38px;
  height: 20px;
}
.toggle-switch.sm .toggle-slider:before {
  height: 14px;
  width: 14px;
  left: 3px;
  top: 2px;
}
.toggle-switch.sm input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* ===== MOBILE POLISH - Touch-Friendly UI ===== */

/* Ensure all buttons have minimum 44x44 touch target */
button, .btn3d, .pay-btn, input[type="submit"], 
a.btn, .action-btn, .category-tab {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Icon-only buttons need proper sizing */
button[aria-label], .icon-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Improve touch spacing between interactive elements */
@media (max-width: 768px) {
  /* Larger touch targets on mobile */
  button, .btn3d, input[type="submit"] {
    min-height: 48px;
    padding: 12px 20px;
  }
  
  /* More space between buttons */
  .btn-row, .action-row, .button-group {
    gap: 12px;
  }
  
  /* Improve form input touch targets */
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="password"], input[type="number"], textarea, select {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* Cards need more padding for touch */
  .glass, .card, .stat-card {
    padding: 16px;
  }
  
  /* Better spacing in lists */
  .list-item, .referral-item, .participant-item {
    padding: 14px 12px;
    margin-bottom: 8px;
  }
  
  /* Larger close buttons */
  .close-btn, .modal-close {
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
  }
  
  /* Swipe-friendly horizontal scrolling */
  .scroll-container {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }
  
  /* Fix topbar on mobile */
  .topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Admin panel mobile fixes */
  .admin-section {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  /* Table mobile scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Small phone specific */
@media (max-width: 380px) {
  button, .btn3d {
    width: 100%;
    justify-content: center;
  }
  
  .btn-row {
    flex-direction: column;
  }
}

/* Improve disabled state visibility */
button:disabled, .btn3d:disabled, input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Active/pressed state feedback */
button:active, .btn3d:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* ===== FRIENDLY ERROR/SUCCESS TOAST STYLES ===== */

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90vw;
  width: 400px;
}

.toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s ease;
  box-shadow: var(--depth-2);
}

.toast-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.toast-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: white;
  opacity: 0.7;
  cursor: pointer;
  padding: 4px;
  min-width: 28px;
  min-height: 28px;
}

.toast-close:hover {
  opacity: 1;
}

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

/* ===== ANALYTICS DASHBOARD STYLES ===== */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.analytics-card {
  background: linear-gradient(180deg, rgba(30,30,30,.9), rgba(20,20,20,.85));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--depth-1);
}

.analytics-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.analytics-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 4px;
}

.analytics-card-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.analytics-card-change.positive {
  color: #4ade80;
}

.analytics-card-change.negative {
  color: #f87171;
}

.analytics-chart-container {
  background: linear-gradient(180deg, rgba(30,30,30,.9), rgba(20,20,20,.85));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  min-height: 200px;
}

.analytics-chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--txt);
}

.peak-times-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 60px;
}

.peak-hour {
  background: rgba(232, 88, 32, 0.2);
  border-radius: 4px;
  position: relative;
  transition: background 0.2s;
}

.peak-hour:hover {
  background: rgba(232, 88, 32, 0.4);
}

.peak-hour-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, #e85820, #c45c2a);
  border-radius: 4px;
  transition: height 0.3s ease;
}

.peak-times-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.retention-bar {
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.retention-fill {
  height: 100%;
  background: linear-gradient(90deg, #e85820, #c45c2a);
  border-radius: 12px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

/* Mobile analytics */
@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .analytics-card {
    padding: 14px;
  }
  
  .analytics-card-value {
    font-size: 22px;
  }
  
  .peak-times-grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

/* ============================================= */
/* ENHANCED UI POLISH - Animations & Transitions */
/* ============================================= */

/* Page load animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(232,88,32,0.4); }
  50% { box-shadow: 0 0 20px rgba(232,88,32,0.8), 0 0 30px rgba(232,88,32,0.4); }
}

@keyframes countdown-tick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Staggered entrance animations */
.animate-in { animation: fadeInUp 0.4s ease-out forwards; opacity: 0; }
.animate-in-1 { animation-delay: 0.05s; }
.animate-in-2 { animation-delay: 0.1s; }
.animate-in-3 { animation-delay: 0.15s; }
.animate-in-4 { animation-delay: 0.2s; }
.animate-in-5 { animation-delay: 0.25s; }

/* Skeleton loading state */
.skeleton {
  background: linear-gradient(90deg, rgba(60,60,60,0.3) 25%, rgba(80,80,80,0.4) 50%, rgba(60,60,60,0.3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-text { height: 16px; width: 80%; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-button { height: 44px; width: 120px; border-radius: 10px; }

/* Enhanced button hover states */
.btn3d {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, box-shadow;
}

.btn3d:active {
  transform: translateY(2px) scale(0.98) !important;
  transition-duration: 0.1s;
}

/* Card entrance and hover improvements */
.card3d {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              box-shadow 0.4s ease,
              border-color 0.3s ease;
}

.card3d:focus-within {
  border-color: rgba(232,88,32,0.4);
  box-shadow: var(--depth-3), 0 0 0 2px rgba(232,88,32,0.2);
}

/* Smooth section transitions */
section {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

section.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* ===================================== */
/* MARKETING TOOLS - Countdown & Social  */
/* ===================================== */

/* Event countdown timer */
.countdown-container {
  background: linear-gradient(135deg, rgba(232,88,32,0.2), rgba(196,92,42,0.15));
  border: 1px solid rgba(232,88,32,0.35);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  animation: pulse-glow 3s ease-in-out infinite;
}

.countdown-title {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.countdown-unit {
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 70px;
  animation: countdown-tick 1s ease-in-out infinite;
}

.countdown-value {
  font-size: 32px;
  font-weight: 900;
  color: #e85820;
  line-height: 1;
}

.countdown-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .countdown-unit {
    padding: 10px 12px;
    min-width: 60px;
  }
  .countdown-value {
    font-size: 24px;
  }
}

/* Social share buttons */
.social-share-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 48px;
}

.social-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.social-btn:active {
  transform: translateY(0);
}

.social-btn.twitter {
  background: #1da1f2;
  color: white;
}

.social-btn.facebook {
  background: #4267B2;
  color: white;
}

.social-btn.whatsapp {
  background: #25D366;
  color: white;
}

.social-btn.copy-link {
  background: rgba(60,60,60,0.9);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
}

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

/* ===================================== */
/* ENGAGEMENT TOOLS - Loyalty & Rewards  */
/* ===================================== */

/* Referral bonus badge */
.bonus-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a1a;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(251,191,36,0.4);
  animation: float-subtle 2s ease-in-out infinite;
}

.bonus-badge::before {
  content: "★";
  font-size: 10px;
}

/* Loyalty tier badges */
.loyalty-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.loyalty-tier.bronze { background: linear-gradient(135deg, #cd7f32, #b8860b); color: #fff; }
.loyalty-tier.silver { background: linear-gradient(135deg, #c0c0c0, #a8a8a8); color: #333; }
.loyalty-tier.gold { background: linear-gradient(135deg, #ffd700, #daa520); color: #333; }
.loyalty-tier.platinum { background: linear-gradient(135deg, #e5e4e2, #b8b8b8); color: #1a1a1a; }
.loyalty-tier.vip { background: linear-gradient(135deg, #e85820, #c45c2a); color: #fff; }

/* Progress bar for referral goals */
.goal-progress {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e85820, #fbbf24);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.goal-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

.goal-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* Notification bell with badge */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Success celebration animation */
@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.celebrate {
  animation: fadeInScale 0.3s ease-out, pulse-glow 0.5s ease-in-out 2;
}

/* ===================================== */
/* ENHANCED MOBILE OPTIMIZATION          */
/* ===================================== */

/* Pull-to-refresh indicator */
.pull-refresh-indicator {
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(232,88,32,0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: top 0.3s ease;
  z-index: 9999;
}

.pull-refresh-indicator.visible {
  top: 20px;
}

/* Swipe action hint */
.swipe-hint {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .swipe-hint {
    display: flex;
    align-items: center;
    gap: 4px;
  }
}

/* Mobile bottom navigation */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(30,30,30,0.98), rgba(20,20,20,0.95));
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  transition: all 0.2s ease;
  min-width: 60px;
}

.mobile-nav-item:active {
  transform: scale(0.95);
}

.mobile-nav-item.active {
  color: #e85820;
  background: rgba(232,88,32,0.15);
}

.mobile-nav-item svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: block;
  }
  
  body {
    padding-bottom: 80px;
  }
}

/* Improved tap feedback for mobile */
@media (hover: none) {
  .btn3d:active,
  .card3d:active,
  .social-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
}

/* Haptic-like visual feedback */
.tap-feedback {
  position: relative;
  overflow: hidden;
}

.tap-feedback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--tap-x, 50%) var(--tap-y, 50%), rgba(255,255,255,0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tap-feedback:active::after {
  opacity: 1;
}

/* Floating action button for mobile */
.fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e85820, #c45c2a);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--depth-3), 0 0 20px rgba(232,88,32,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.1);
}

.fab:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .fab {
    display: flex;
  }
}

/* Quick action sheet for mobile */
.action-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(40,40,40,0.98), rgba(25,25,25,0.98));
  border-radius: 24px 24px 0 0;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

.action-sheet.visible {
  transform: translateY(0);
}

.action-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.action-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.action-sheet-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
