/* ============================================================
   DIAMOND GATE – Egypt vs Australia Live Lottery
   Premium Dark Theme – RTL Arabic
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --gold:       #F5C842;
  --gold-light: #FFE082;
  --gold-dark:  #C49A00;
  --red:        #E53935;
  --green:      #00C853;
  --blue:       #1565C0;
  --bg-deep:    #07090F;
  --bg-card:    #0E1320;
  --bg-card2:   #141927;
  --border:     rgba(245, 200, 66, 0.15);
  --border2:    rgba(255,255,255,0.07);
  --text-main:  #F0F2F8;
  --text-sub:   #8D93A8;
  --text-muted: #5A607A;
  --radius:     16px;
  --radius-lg:  24px;
  --shadow:     0 8px 40px rgba(0,0,0,0.6);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Particle Canvas ---------- */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px rgba(245, 200, 66, 0.4);
  transition: transform 0.3s ease;
}

.company-logo-img:hover {
  transform: scale(1.08);
}

.diamond-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(245,200,66,0.8));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 57, 53, 0.15);
  border: 1px solid rgba(229, 57, 53, 0.4);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FF5252;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #FF5252;
  border-radius: 50%;
  animation: pulse-red 1.2s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,82,82,0.7); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(255,82,82,0); }
}

/* ---------- Match Banner ---------- */
.match-banner {
  position: relative;
  z-index: 1;
  padding: 30px 20px 20px;
  max-width: 960px;
  margin: 0 auto;
}

.match-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.status-bar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-left: 6px;
}

.status-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border2);
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.status-btn:hover {
  border-color: var(--gold);
  color: var(--text-main);
}

.status-btn.active {
  background: rgba(245, 200, 66, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(245, 200, 66, 0.3);
}

.match-card {
  background: linear-gradient(135deg, rgba(14,19,32,0.9), rgba(20,25,39,0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow), 0 0 60px rgba(245,200,66,0.05);
  position: relative;
  overflow: hidden;
}

.match-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(245,200,66,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.team {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flag {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.team-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-main);
}

.team-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.score-badge {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(245, 200, 66, 0.18), rgba(245, 200, 66, 0.05));
  border: 2px solid var(--gold);
  color: var(--gold-light);
  font-size: 1.8rem;
  font-weight: 900;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(245, 200, 66, 0.35);
  text-shadow: 0 0 10px rgba(245, 200, 66, 0.8);
  font-family: 'Tajawal', monospace, sans-serif;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.score-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(245, 200, 66, 0.6);
}

.vs-block {
  text-align: center;
  flex-shrink: 0;
}

.vs-text {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}

.match-label {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.prize-badge {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a0a;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  white-space: nowrap;
}

/* ---------- Main App Container ---------- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(245,200,66,0.08);
  color: var(--text-main);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(245,200,66,0.18), rgba(245,200,66,0.08));
  color: var(--gold);
  border: 1px solid rgba(245,200,66,0.3);
}

.tab-icon { font-size: 1rem; }

/* ---------- Tab Panels ---------- */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active { display: block; }

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

/* ---------- Panel Header ---------- */
.panel-header {
  margin-bottom: 24px;
}

.panel-title {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--text-main), var(--text-sub));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.panel-desc {
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Input Cards ---------- */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.input-card:hover {
  border-color: rgba(245,200,66,0.2);
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.bulk-textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  resize: vertical;
  min-height: 120px;
  transition: var(--transition);
  direction: rtl;
}

.bulk-textarea:focus {
  outline: none;
  border-color: rgba(245,200,66,0.5);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.1);
}

.bulk-textarea::placeholder { color: var(--text-muted); }

.input-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.single-card { }

.single-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.single-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  transition: var(--transition);
  direction: rtl;
}

.single-input:focus {
  outline: none;
  border-color: rgba(245,200,66,0.5);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.1);
}

.single-input::placeholder { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a0a;
  box-shadow: 0 4px 20px rgba(245,200,66,0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245,200,66,0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-sub);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(245,200,66,0.3);
  color: var(--gold);
}

.btn-accent {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,35,126,0.5);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(229,57,53,0.3);
  color: rgba(229,57,53,0.8);
  font-size: 0.85rem;
  padding: 8px 14px;
}

.btn-danger-outline:hover {
  background: rgba(229,57,53,0.1);
  border-color: rgba(229,57,53,0.6);
  color: var(--red);
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 20px;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  transition: var(--transition);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border2);
  margin: 0 16px;
}

/* ---------- Participants List ---------- */
.participants-section {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
}

.participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.participants-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  width: 180px;
  direction: rtl;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: rgba(245,200,66,0.4);
}

.search-input::placeholder { color: var(--text-muted); }

.participants-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.participants-list::-webkit-scrollbar { width: 6px; }
.participants-list::-webkit-scrollbar-track { background: transparent; }
.participants-list::-webkit-scrollbar-thumb {
  background: rgba(245,200,66,0.2);
  border-radius: 3px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-sub);
}

.empty-state span { font-size: 0.85rem; }

/* ---------- Participant Item ---------- */
.participant-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 14px;
  transition: var(--transition);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.participant-item:hover {
  background: rgba(245,200,66,0.05);
  border-color: rgba(245,200,66,0.15);
}

.participant-item.removed {
  opacity: 0.4;
  text-decoration: line-through;
  background: rgba(229,57,53,0.05);
  border-color: rgba(229,57,53,0.15);
}

.participant-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), rgba(245,200,66,0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0a0a0a;
  flex-shrink: 0;
}

.participant-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.participant-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-toggle {
  background: rgba(0,200,83,0.1);
  color: var(--green);
  border: 1px solid rgba(0,200,83,0.2);
}

.btn-toggle:hover { background: rgba(0,200,83,0.2); }

.btn-toggle.inactive {
  background: rgba(229,57,53,0.1);
  color: var(--red);
  border: 1px solid rgba(229,57,53,0.2);
}

.btn-delete {
  background: rgba(229,57,53,0.1);
  color: var(--red);
  border: 1px solid rgba(229,57,53,0.2);
}

.btn-delete:hover { background: rgba(229,57,53,0.2); }

/* ---------- Draw Arena ---------- */
.draw-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Slot Machine */
.slot-machine {
  width: 100%;
  max-width: 500px;
  position: relative;
}

.slot-screen {
  background: linear-gradient(135deg, #080c18, #0d1226);
  border: 2px solid rgba(245,200,66,0.25);
  border-radius: var(--radius-lg);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow), inset 0 0 60px rgba(245,200,66,0.03);
}

.slot-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: scanLine 2s ease-in-out infinite;
}

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

.slot-idle {
  text-align: center;
  color: var(--text-muted);
}

.slot-question {
  font-size: 4rem;
  margin-bottom: 8px;
  filter: grayscale(1);
  opacity: 0.4;
}

.slot-idle p {
  font-size: 1rem;
  font-weight: 600;
}

.slot-spinning {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinning-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: spinLoop 0.15s linear infinite;
}

@keyframes spinLoop {
  from { transform: translateY(0); }
  to { transform: translateY(-40px); }
}

.spin-name-item {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
  padding: 4px 16px;
  text-align: center;
  opacity: 0.7;
}

.spin-name-item.center {
  font-size: 2rem;
  opacity: 1;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245,200,66,0.8);
}

.slot-winner {
  text-align: center;
}

.winner-crown {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.winner-name {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.winner-label {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.slot-glow {
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  pointer-events: none;
  transition: box-shadow 0.4s ease;
}

.slot-glow.active {
  box-shadow: 0 0 40px rgba(245,200,66,0.4), 0 0 80px rgba(245,200,66,0.15);
}

.slot-glow.winner-glow {
  box-shadow: 0 0 60px rgba(245,200,66,0.6), 0 0 120px rgba(245,200,66,0.25);
  animation: glowPulse 1s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 60px rgba(245,200,66,0.6), 0 0 120px rgba(245,200,66,0.25); }
  50% { box-shadow: 0 0 80px rgba(245,200,66,0.9), 0 0 160px rgba(245,200,66,0.4); }
}

/* Draw Info */
.draw-info {
  text-align: center;
}

.draw-stat { }

.draw-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.draw-label {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 4px;
}

/* Draw Button */
.draw-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 60px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #b8860b, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% 200%;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 40px rgba(245,200,66,0.4);
  overflow: hidden;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.draw-btn:not(:disabled):hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 16px 60px rgba(245,200,66,0.6);
}

.draw-btn:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.draw-btn:disabled {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

.draw-btn-icon { font-size: 1.5rem; }

.draw-btn-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shine 2.5s ease-in-out infinite;
}

@keyframes shine {
  0% { left: -100%; }
  40%, 100% { left: 150%; }
}

/* ---------- Winner Reveal ---------- */
.winner-reveal {
  width: 100%;
  position: relative;
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

.winner-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(14,19,32,0.98), rgba(20,25,39,0.98));
  border: 2px solid rgba(245,200,66,0.4);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 80px rgba(245,200,66,0.2), var(--shadow);
  animation: revealCard 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealCard {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: spin3d 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(245,200,66,0.8));
}

@keyframes spin3d {
  from { transform: rotateY(-15deg); }
  to { transform: rotateY(15deg); }
}

.winner-heading {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 16px;
}

.winner-name-big {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  line-height: 1.3;
}

.winner-sub {
  color: var(--text-sub);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.winner-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Conditions ---------- */
.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: var(--transition);
}

.condition-item:hover {
  border-color: rgba(245,200,66,0.2);
  background: var(--bg-card2);
}

.cond-num {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a0a;
  font-size: 1rem;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cond-body { flex: 1; }

.cond-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.cond-desc {
  font-size: 0.875rem;
  color: var(--text-sub);
  line-height: 1.5;
}

.conditions-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
}

.cond-edit-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.cond-edit-desc {
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.cond-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.cond-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cond-edit-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 60px;
}

.cond-edit-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 9px 12px;
  direction: rtl;
  transition: var(--transition);
}

.cond-edit-input:focus {
  outline: none;
  border-color: rgba(245,200,66,0.4);
}

/* ---------- Post Embed ---------- */
.post-embed-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.fb-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow);
}

.fb-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border2);
}

.fb-logo {
  font-weight: 900;
  color: #1877F2;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.fb-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

.fb-link:hover {
  text-decoration: underline;
}

.fb-iframe-wrapper {
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border2);
  background: rgba(7,9,15,0.9);
  padding: 20px;
  text-align: center;
}

.footer-inner {}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .match-card {
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px;
  }
  .vs-block { order: -1; }
  .tab-btn { font-size: 0.78rem; padding: 10px 8px; }
  .tab-icon { display: none; }
  .draw-btn { padding: 16px 32px; font-size: 1.1rem; }
  .winner-name-big { font-size: 1.6rem; }
  .stat-divider { margin: 0 8px; }
  .participants-controls { flex-direction: column; align-items: flex-end; }
  .search-input { width: 140px; }
}

/* ---------- Scrollbar Global ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(245,200,66,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245,200,66,0.4); }

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast.success { border-color: rgba(0,200,83,0.4); color: #69F0AE; }
.toast.error   { border-color: rgba(229,57,53,0.4); color: #FF5252; }
.toast.info    { border-color: rgba(245,200,66,0.4); color: var(--gold); }

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

/* ---------- Post Image Card & Embed Layout ---------- */
.post-embed-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  align-items: start;
}

.post-image-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.post-image-card:hover {
  border-color: rgba(245, 200, 66, 0.4);
  transform: translateY(-2px);
}

.post-banner-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  object-fit: contain;
}

.winner-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.6);
  margin-bottom: 12px;
}

/* ---------- Header Actions & Sound Toggle ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.sound-toggle-btn:hover {
  background: rgba(245, 200, 66, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Card Title Row & Tools Badges ---------- */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.tools-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-success-outline {
  background: transparent;
  border: 1px solid rgba(0, 200, 83, 0.4);
  color: #69F0AE;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-success-outline:hover {
  background: rgba(0, 200, 83, 0.15);
  border-color: #69F0AE;
}

/* ---------- Smart Extractor Card ---------- */
.extractor-card {
  background: linear-gradient(135deg, rgba(20, 25, 39, 0.9), rgba(245, 200, 66, 0.05));
  border: 1px solid rgba(245, 200, 66, 0.3);
  margin-bottom: 20px;
}

.badge-tag {
  background: var(--gold);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

.extractor-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.extractor-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.extractor-controls .single-input {
  flex: 1;
  min-width: 220px;
}

/* ---------- Live Countdown Card ---------- */
.countdown-card {
  margin-top: 20px;
  background: rgba(14, 19, 32, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
}

.countdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}

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

.time-block {
  background: rgba(7, 9, 15, 0.8);
  border: 1px solid rgba(245, 200, 66, 0.3);
  border-radius: 10px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.time-block span:first-child {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
  font-family: monospace;
}

.time-block .unit {
  font-size: 0.7rem;
  color: var(--text-sub);
}

.time-colon {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
}

/* ---------- Public Name Checker ---------- */
.check-card {
  max-width: 650px;
  margin: 0 auto;
}

.check-field {
  font-size: 1.1rem;
  padding: 14px 18px;
}

.check-result-box {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

.check-result-box.success-box {
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.4);
  color: #69F0AE;
}

.check-result-box.warning-box {
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid rgba(229, 57, 53, 0.4);
  color: #FF5252;
}

.result-icon {
  font-size: 2rem;
}

.result-body h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.result-body p {
  font-size: 0.95rem;
  color: var(--text-main);
}

.badge-num {
  display: inline-block;
  margin-top: 10px;
  background: rgba(245, 200, 66, 0.2);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Winner Certificate Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 9, 15, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.cert-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 860px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--gold); }

.modal-title {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.canvas-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
  background: #000;
  border-radius: 12px;
  padding: 8px;
}

#cert-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============================================================
   ADMIN DASHBOARD & BROADCAST SYNC STYLES
   ============================================================ */

.admin-badge-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(245, 200, 66, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  margin-top: 2px;
}

.admin-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.admin-link-btn:hover {
  background: rgba(245, 200, 66, 0.2);
  border-color: var(--gold);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(245, 200, 66, 0.3);
}

.btn-accent-glow {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #07090F;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(245, 200, 66, 0.4);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-accent-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(245, 200, 66, 0.7);
  color: #000;
}

.broadcast-status-bar {
  background: rgba(14, 19, 32, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  position: relative;
  z-index: 90;
}

.broadcast-status-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.pulse-green-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 200, 83, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

.btn-outline-gold {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline-gold:hover {
  background: var(--gold);
  color: #07090F;
  box-shadow: 0 0 12px rgba(245, 200, 66, 0.4);
}

/* Admin Container & Section Cards */
.admin-container {
  padding-top: 24px;
  padding-bottom: 40px;
}

.admin-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-card-header {
  border-bottom: 1px solid var(--border2);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.section-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);

}

.section-card-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* Match Control Grid */
.match-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.admin-control-box {
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
}

.control-box-label {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.status-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-edit-group {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.team-score-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.team-flag-sm {
  font-size: 1.1rem;
  font-weight: 700;
}

.score-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 8px;
}

.counter-btn {
  background: rgba(245, 200, 66, 0.15);
  border: 1px solid var(--border);
  color: var(--gold);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-btn:hover {
  background: var(--gold);
  color: #000;
}

.score-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold-light);
  min-width: 30px;
  text-align: center;
  font-family: 'Tajawal', monospace;
}

.score-vs-divider {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-muted);
}

/* Admin Draw Arena */
.admin-draw-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.admin-draw-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.broadcast-draw-btn {
  background: linear-gradient(135deg, #00C853, #69F0AE);
  color: #07090F;
  box-shadow: 0 0 20px rgba(0, 200, 83, 0.4);
}

.broadcast-draw-btn:hover {
  box-shadow: 0 0 30px rgba(0, 200, 83, 0.8);
  transform: scale(1.04);
}

/* Read-only Score Badges in Public View */
.score-badge.readonly {
  cursor: default;
  pointer-events: none;
}

/* Database Status Badge & Login Modal */
.db-status-badge {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
  margin-right: 10px;
}

.db-status-badge.connected {
  background: rgba(0, 200, 83, 0.15);
  border-color: rgba(0, 200, 83, 0.4);
  color: #69F0AE;
}

.db-status-badge.local {
  background: rgba(255, 171, 0, 0.15);
  border-color: rgba(255, 171, 0, 0.4);
  color: #FFE082;
}

.login-modal-card {
  max-width: 420px;
  background: linear-gradient(145deg, #121829, #0d1222);
  border: 1px solid var(--gold);
  box-shadow: 0 0 40px rgba(245, 200, 66, 0.25);
}

/* Match Live Clock Badge */
.match-live-clock {
  font-family: 'Tajawal', monospace;
  font-size: 1.2rem;
  font-weight: 900;
  color: #69F0AE;
  background: rgba(0, 200, 83, 0.15);
  border: 1px solid rgba(0, 200, 83, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  margin-top: 6px;
  letter-spacing: 1px;
  display: inline-block;
  box-shadow: 0 0 12px rgba(0, 200, 83, 0.2);
}

