/* =========================================================
   MINIMALISTIC VIP ONSCREEN PREDICTOR
   Ultra-Fast, High-Performance Glassmorphism UI
   ========================================================= */

:root {
  --bg-dark: #07090e;
  --bg-glass: rgba(12, 16, 26, 0.92);
  --bg-glass-card: rgba(20, 26, 42, 0.75);
  --border-glow: rgba(0, 242, 254, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.1);
  
  --primary-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gold: #ffd200;
  --accent-red: #ff2a5f;
  --accent-green: #00e676;
  --accent-neon: #00ff88;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Courier New', Courier, monospace;
  
  --glass-blur: blur(16px);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   PREMIUM VIP AI PRELOADER
   ========================================================= */
.ai-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 45%, #0e172e 0%, #050811 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s ease, visibility 0.35s;
  contain: strict;
}

.ai-preloader.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  visibility: hidden;
}

.ai-bg-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, rgba(79, 172, 254, 0.05) 50%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: aiGlowPulse 3s ease-in-out infinite alternate;
}

.ai-card {
  position: relative;
  z-index: 2;
  width: 310px;
  max-width: 90vw;
  background: rgba(14, 20, 36, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8),
              0 0 35px rgba(0, 242, 254, 0.2);
  padding: 24px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

/* AI Glowing Neural Orb */
.ai-orb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.ai-pulse-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.35) 0%, transparent 70%);
  animation: aiHaloPulse 2s ease-in-out infinite alternate;
}

.ai-orb-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ring-outer {
  inset: 2px;
  border: 1.5px dashed rgba(0, 242, 254, 0.6);
  animation: orbRotateClockwise 6s linear infinite;
}

.ring-inner {
  inset: 10px;
  border: 1.5px dotted rgba(0, 255, 136, 0.7);
  animation: orbRotateCounter 4s linear infinite;
}

.ai-core-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25) 0%, rgba(14, 20, 36, 0.9) 100%);
  border: 1.5px solid var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.5), inset 0 0 10px rgba(0, 242, 254, 0.3);
  animation: aiCorePop 1.8s ease-in-out infinite alternate;
}

/* AI Badge & Title */
.ai-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-badge {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
}

.ai-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: dotBlink 1.2s infinite;
}

.ai-main-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #ffffff 30%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-status-msg {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.3px;
  min-height: 16px;
  transition: opacity 0.15s ease;
}

/* Progress Track */
.ai-progress-wrap {
  width: 100%;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.ai-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00f2fe 0%, #00ff88 100%);
  box-shadow: 0 0 12px #00f2fe;
  border-radius: 6px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-pct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #64748b;
}

.ai-pct-val {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #00f2fe;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

/* Animations */
@keyframes orbRotateClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbRotateCounter {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes aiGlowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

@keyframes aiHaloPulse {
  0% { transform: scale(0.95); opacity: 0.4; }
  100% { transform: scale(1.2); opacity: 0.9; }
}

@keyframes aiCorePop {
  0% { transform: scale(0.96); }
  100% { transform: scale(1.04); }
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* =========================================================
   FULLSCREEN IFRAME VIEWPORT
   ========================================================= */
.game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  background: #000;
  overflow: hidden;
  contain: strict;
}

#game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* =========================================================
   COMPACT FLOATING BUTTON (FAB)
   ========================================================= */
.floating-btn {
  position: fixed;
  left: 14px;
  right: auto;
  bottom: 80px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: grab;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  filter: drop-shadow(0 6px 18px rgba(0, 230, 118, 0.5)) drop-shadow(0 0 10px rgba(0, 242, 254, 0.35));
  transition: opacity 0.2s ease, transform 0.15s ease, visibility 0.2s;
  will-change: transform, left, top;
  contain: layout paint;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.floating-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.4) translate3d(0, 0, 0);
  visibility: hidden;
}

.floating-btn:active {
  cursor: grabbing;
  transform: scale(0.92) translate3d(0, 0, 0);
}

.fab-inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #090e1a;
  border: 1.5px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 230, 118, 0.4), 0 0 16px rgba(0, 230, 118, 0.45);
}

.fab-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  aspect-ratio: 1 / 1;
}

.fab-pulse-ring {
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--accent-green);
  border-radius: 50%;
  opacity: 0.7;
  animation: pulseRing 2.2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

/* =========================================================
   MINIMALISTIC FLOATING PREDICTOR WINDOW
   ========================================================= */
.predictor-window {
  position: fixed;
  top: 70px;
  left: calc(50% - 110px);
  width: 220px;
  max-width: calc(100vw - 20px);
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.75),
              0 0 25px rgba(0, 242, 254, 0.25);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: transform, left, top;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.predictor-window.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translateY(15px) translate3d(0, 0, 0);
}

/* Window Header */
.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-subtle);
  cursor: grab;
  touch-action: none;
}

.window-header:active {
  cursor: grabbing;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-cyan);
  box-shadow: 0 0 6px var(--primary-cyan);
}

.header-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hdr-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hdr-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.hdr-btn.close:hover {
  background: var(--accent-red);
  color: #fff;
}

/* Window Body */
.window-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Mini Period Card */
.mini-period-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  overflow: hidden;
}

.period-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-cyan);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.35);
  white-space: nowrap;
  text-align: center;
}

/* Result Box (BIG / SMALL & CONFIDENCE) */
.mini-result-box {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.9) 0%, rgba(9, 13, 23, 0.95) 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  overflow: hidden;
}

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

.result-badge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.result-badge.big {
  background: rgba(0, 230, 118, 0.12);
  border: 1.5px solid var(--accent-green);
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.35);
}

.result-badge.big .result-en {
  color: #00ff88;
  text-shadow: 0 0 14px #00ff88;
}

.result-badge.small {
  background: rgba(255, 42, 95, 0.14);
  border: 1.5px solid var(--accent-red);
  box-shadow: 0 0 18px rgba(255, 42, 95, 0.35);
}

.result-badge.small .result-en {
  color: #ff2a5f;
  text-shadow: 0 0 14px #ff2a5f;
}

.result-en {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
}

.mini-confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.conf-lbl {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.conf-val {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-cyan);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

/* Scanner Overlay */
.scanner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 22, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.2s ease;
  will-change: opacity;
}

.scanner-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.mini-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 242, 254, 0.25);
  border-top-color: var(--primary-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  will-change: transform;
}

.scanner-text {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--primary-cyan);
}

/* Predict Button */
.btn-mini-predict {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #040915;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-mini-predict:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 242, 254, 0.55);
}

.btn-mini-predict:active {
  transform: translateY(1px);
}

/* VIP Telegram Channel Button */
.btn-telegram {
  width: 100%;
  padding: 7px 10px;
  background: linear-gradient(135deg, #0088cc 0%, #00b4d8 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 12px rgba(0, 136, 204, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-telegram:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0, 180, 216, 0.6);
  filter: brightness(1.1);
}

.btn-telegram:active {
  transform: translateY(1px);
}

.tg-svg-icon {
  flex-shrink: 0;
  display: block;
}

/* GPU Accelerated Keyframes */
@keyframes pulseRing {
  0% { transform: scale(0.95) translate3d(0, 0, 0); opacity: 0.7; }
  100% { transform: scale(1.35) translate3d(0, 0, 0); opacity: 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg) translate3d(0, 0, 0); }
  100% { transform: rotate(360deg) translate3d(0, 0, 0); }
}

/* Mobile Constraints */
@media (max-width: 380px) {
  .predictor-window {
    width: 220px;
    left: 10px;
  }
}
