/* ===== Andy Games – Unified Theme (نفس شكل الإندكس) ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

:root {
  --andy-yellow: #f59e0b;
  --andy-yellow-dark: #d97706;
  --andy-dark: #0f172a;
  --andy-muted: #64748b;
  --andy-green: #10b981;
  --andy-red: #ef4444;
  --andy-purple: #8b5cf6;
  --andy-blue: #0284c7;
  --andy-border: #e2e8f0;
  /* تحويل المتغيرات القديمة (خصوصاً الصفحات الداكنة) للثيم الفاتح */
  --bg-color: #ffffff; --bg-main: #ffffff; --bg-body: #ffffff; --bg-white: #ffffff;
  --card-bg: #ffffff; --card-white: #ffffff; --bg-card: #ffffff;
  --text-color: #0f172a; --text-main: #0f172a; --text-dark: #0f172a; --text-light: #0f172a;
  --border-color: #e2e8f0; --border-light: #e2e8f0;
  --accent-color: #f59e0b;
}

/* ---------- الخلفية: أبيض + خطوط صفراء + كور ومرمى ---------- */
html, body {
  font-family: 'Cairo', sans-serif !important;
  color: var(--andy-dark) !important;
  background-color: #ffffff !important;
  background-image:
    repeating-linear-gradient(45deg, rgba(245,158,11,.4) 0, rgba(245,158,11,.4) 8px, transparent 8px, transparent 40px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23f59e0b' stroke-opacity='0.35' stroke-width='2'%3E%3Ccircle cx='30' cy='30' r='12'/%3E%3Cpolygon points='30,22 35,26 33,32 27,32 25,26'/%3E%3Cline x1='30' y1='18' x2='30' y2='22'/%3E%3Cline x1='42' y1='30' x2='35' y2='26'/%3E%3Cline x1='38' y1='40' x2='33' y2='32'/%3E%3Cline x1='22' y1='40' x2='27' y2='32'/%3E%3Cline x1='18' y1='30' x2='25' y2='26'/%3E%3Cg transform='translate(65,65)'%3E%3Crect x='0' y='0' width='32' height='22' rx='2'/%3E%3Cpath d='M0,7 L32,7 M0,14 L32,14 M8,0 L8,22 M16,0 L16,22 M24,0 L24,22' stroke-width='1' stroke-dasharray='1,1'/%3E%3Cline x1='0' y1='22' x2='-5' y2='28'/%3E%3Cline x1='32' y1='22' x2='37' y2='28'/%3E%3Cline x1='-5' y1='28' x2='37' y2='28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") !important;
  background-attachment: fixed !important;
}
* { font-family: 'Cairo', sans-serif; -webkit-tap-highlight-color: transparent; }

/* ---------- الكروت الرئيسية ---------- */
.container, .game-container, .guide-container, .arcade-card, .setup-screen,
.start-screen, .modal-card, .modal-box, .section-box, .section, .card,
.pack-area, .auction-box, .path-card, .squad-box, .bidding-box, .player-card,
.live-squad-container, .rank-card, .leaderboard-list, .team-column, .roadmap-container,
.header-card, .log-box, .sim-log-box, .question-card, .description-box, .match-board,
.answer-box, .game-guide-card, .huge-card-container, .pitch-container {
  background: #ffffff !important;
  color: var(--andy-dark) !important;
  border: 2px solid var(--andy-yellow) !important;
  border-radius: 22px !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.08) !important;
}
.container, .game-container, .guide-container, .arcade-card, .setup-screen { animation: andyIn .35s ease both; }
@keyframes andyIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* كروت داخلية أخف */
.slot, .slot-item, .squad-slot, .squad-item, .player-slot, .leaderboard-item, .log-entry,
.sim-event, .answer-item, .info-card, .budget-card, .header, .stats-bar, .player-card,
.player-card-choice, .card-wrapper .card, .club-badge, .box, .power-score, .auction-log {
  background: #fffbeb !important;
  color: var(--andy-dark) !important;
  border-color: var(--andy-yellow) !important;
  border-radius: 14px !important;
}
.slot.filled, .squad-slot.filled, .slot-item.filled { background: #ecfdf5 !important; border-color: var(--andy-green) !important; color: #065f46 !important; }
.slot-pos, .slot-name, .player-name, .squad-title, .modal-title, .modal-player { color: var(--andy-dark) !important; }

/* ---------- العناوين ---------- */
h1, .game-header-title, .header h1, .loader-title {
  color: var(--andy-dark) !important;
  text-shadow: 2px 2px 0 var(--andy-yellow) !important;
  font-weight: 900 !important;
  background: transparent !important;
  border: none !important;
}
h2, h3 { color: var(--andy-dark) !important; font-weight: 900 !important; }
.badge, .badge-tag, .turn-badge, .player-badge {
  background: #ffffff !important; color: var(--andy-yellow-dark) !important;
  border: 2px solid var(--andy-yellow) !important; border-radius: 50px !important; font-weight: 900 !important;
}

/* ---------- الأزرار ---------- */
button, .btn, .btn-fire, .btn-action, .btn-main-action, .btn-submit, .btn-bid, .btn-reveal {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 900 !important;
  border-radius: 16px !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 6px 16px rgba(245,158,11,.35) !important;
  text-shadow: none !important;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease !important;
}
button:hover:not(:disabled), .btn:hover, .btn-fire:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.05); }
button:active:not(:disabled), .btn:active { transform: scale(.96) !important; }
button:disabled { opacity: .4 !important; cursor: not-allowed; }
.btn-success, .btn-bid-ok, .choice-ok { background: linear-gradient(135deg, #10b981, #047857) !important; box-shadow: 0 6px 16px rgba(16,185,129,.3) !important; }
.btn-danger, .btn-pass, .btn-back { background: linear-gradient(135deg, #ef4444, #dc2626) !important; box-shadow: 0 6px 16px rgba(239,68,68,.3) !important; }
.btn-bid-5 { background: linear-gradient(135deg, #0ea5e9, #0284c7) !important; }
.btn-bid-10 { background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important; }
.btn-bluff, .btn-power { background: linear-gradient(135deg, #f97316, #ea580c) !important; color: #fff !important; }
.btn-lie, .btn-choice.btn-lie { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
.btn-truth, .btn-choice.btn-truth { background: linear-gradient(135deg, #10b981, #047857) !important; }
.buzzer-p1 { background: linear-gradient(135deg, #0ea5e9, #0284c7) !important; }
.buzzer-p2 { background: linear-gradient(135deg, #10b981, #047857) !important; }
.btn-arcade { background: #ffffff !important; color: var(--andy-dark) !important; border: 2px solid var(--andy-yellow) !important; box-shadow: 0 4px 12px rgba(0,0,0,.06) !important; }
.btn-arcade:hover:not(:disabled) { background: #fef3c7 !important; }
.btn-arcade.correct { background: #10b981 !important; color: #fff !important; }
.btn-arcade.wrong { background: #ef4444 !important; color: #fff !important; }

/* ---------- الحقول ---------- */
input, select, textarea, .form-control, .input-field {
  font-family: 'Cairo', sans-serif !important;
  background: #ffffff !important;
  color: var(--andy-dark) !important;
  border: 2px solid var(--andy-yellow) !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  outline: none !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus { border-color: var(--andy-yellow-dark) !important; box-shadow: 0 0 0 4px rgba(245,158,11,.18) !important; }
label { color: #334155 !important; font-weight: 900 !important; }

/* ---------- نصوص ثانوية ---------- */
p, li, small, .info-label, .budget-label, .subtitle, .info-val { color: #475569; }
.info-val, .budget-val, .bid-price, .card-rating, .huge-card-rating, .match-score, .score-board, .sim-score, .rank-number { color: var(--andy-yellow-dark) !important; }
.user-color, .player-score { color: var(--andy-green) !important; }
.bot-color { color: var(--andy-red) !important; }
.timer-box, .timer-display, #timer-seconds, .combo-text { color: var(--andy-red) !important; }

/* ---------- ألوان الصفحات الداكنة القديمة ---------- */
.modal-overlay, .blur-overlay { background: rgba(15,23,42,.45) !important; backdrop-filter: blur(8px); }
.huge-card-name, .huge-card-club, .huge-card-pos { color: var(--andy-dark) !important; }
.slot-item, .log-entry b { color: var(--andy-dark) !important; }
.match-board, .sim-header { background: #0f172a !important; color: #fff !important; border-color: var(--andy-yellow) !important; }
.match-board *, .sim-header * { color: #fff; }
.match-board .score-board, .sim-header .sim-score { color: #facc15 !important; }
.match-logs { background: #1e293b !important; color: #e2e8f0 !important; border-radius: 12px !important; }

/* ---------- خريطة المراحل ---------- */
.level-node { border-radius: 50% !important; background: #fff !important; border: 2px solid #cbd5e1 !important; }
.level-node.completed { background: #dcfce7 !important; border-color: var(--andy-green) !important; color: var(--andy-green) !important; }
.level-node.current { background: linear-gradient(135deg, #f59e0b, #d97706) !important; color: #fff !important; border-color: #fff !important; }

/* ---------- شريط التنقل السفلي ---------- */
.bottom-nav { background: #fff !important; border-top: 2px solid var(--andy-yellow) !important; }
.nav-item.active { background: linear-gradient(135deg, #f59e0b, #d97706) !important; color: #fff !important; }

/* ---------- زرار القائمة العائمة (الرئيسية) ---------- */
.kora-menu-wrap, #andy-home-fab { position: fixed !important; bottom: 15px; right: 15px; z-index: 99999; direction: rtl; }
.kora-burger-btn {
  width: 50px !important; height: 50px !important; border-radius: 16px !important;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border: 2px solid #fff !important; box-shadow: 0 6px 18px rgba(245,158,11,.5) !important;
}
.kora-burger-btn span { background: #fff !important; }
.kora-box { background: #fff !important; border: 2px solid var(--andy-yellow) !important; border-radius: 18px !important; box-shadow: 0 10px 30px rgba(0,0,0,.15) !important; backdrop-filter: none !important; }
.kora-home-link, #andy-home-fab a {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important; color: #fff !important;
  border: 2px solid #fff !important; border-radius: 14px !important; font-family: 'Cairo', sans-serif !important; font-weight: 900 !important;
  text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px;
  box-shadow: 0 6px 18px rgba(245,158,11,.45) !important;
}
.kora-home-link svg { fill: #fff !important; }

/* ---------- سكرول ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 10px; }
::-webkit-scrollbar-track { background: #fef3c7; border-radius: 10px; }

/* =================== 🔥 FIRE LAYER (كل الصفحات) =================== */
.float-balls { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.float-balls i { position: absolute; bottom: -60px; font-style: normal; opacity: .28; animation: andyFloat linear infinite; }
@keyframes andyFloat { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(-115vh) rotate(360deg); } }
.kora-menu-wrap, #andy-home-fab, #andy-install-pill, .andy-toast { z-index: 99999 !important; }

#andy-topbar { position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 100000;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #8b5cf6, #0ea5e9, #10b981, #f59e0b); background-size: 300%; animation: andyBar 4s linear infinite; }
@keyframes andyBar { to { background-position: 300%; } }

h1, .game-header-title { background: none !important; letter-spacing: .5px; animation: andyTitle .55s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes andyTitle { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

button, .btn, .btn-action { position: relative; overflow: hidden; }
button::after, .btn::after { content: ""; position: absolute; top: 0; left: -120%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent); transform: skewX(-20deg); transition: left .55s; pointer-events: none; }
button:hover:not(:disabled)::after, .btn:hover::after { left: 140%; }
.andy-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); transform: scale(0); animation: andyRip .6s ease-out forwards; pointer-events: none; }
@keyframes andyRip { to { transform: scale(2.6); opacity: 0; } }

.container, .game-container, .arcade-card, .setup-screen, .modal-card { position: relative; }
.container::before, .game-container::before, .arcade-card::before, .setup-screen::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; pointer-events: none;
  background: linear-gradient(135deg, rgba(245,158,11,.5), transparent 40%, rgba(245,158,11,.35)); filter: blur(10px); opacity: .7; }
.slot:hover, .squad-slot:hover, .leaderboard-item:hover, .player-card:hover, .answer-item:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(245,158,11,.25) !important; }
.slot, .squad-slot, .leaderboard-item, .player-card { transition: transform .15s, box-shadow .15s; }

.slot.filled, .squad-slot.filled { animation: andyPop .4s cubic-bezier(.2,1.5,.4,1); }
@keyframes andyPop { from { transform: scale(.8); } to { transform: none; } }

.andy-toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 20px;
  border-radius: 50px; font-weight: 900; font-family: 'Cairo', sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.3); border: 2px solid #f59e0b;
  animation: andyToastIn .35s cubic-bezier(.2,1.4,.4,1); white-space: nowrap; }
.andy-toast.out { opacity: 0; transition: opacity .5s; }
@keyframes andyToastIn { from { transform: translate(-50%,-30px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }

#andy-install-pill { position: fixed; bottom: 15px; left: 15px; direction: rtl; padding: 12px 18px !important; font-size: .95rem; animation: andyGlow 2s ease-in-out infinite; }
@keyframes andyGlow { 50% { box-shadow: 0 0 0 6px rgba(245,158,11,.25), 0 10px 26px rgba(245,158,11,.55); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
