/* =========================================================
   لعبة "سين جيم" - نظام التصميم (TV Game Show Modern Theme)
   ========================================================= */

:root {
  /* ألوان الخلفية الداكنة */
  --bg-deep: #060a18;
  --bg-mid: #0c132b;
  --bg-surface: rgba(17, 25, 52, 0.78);
  --bg-surface-solid: #111936;
  --bg-surface-elevated: rgba(25, 36, 72, 0.88);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(148, 163, 184, 0.3);

  /* ألوان النصوص */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8ea0be;

  /* ألوان الفريقين */
  --team1: #22d3ee;
  --team1-strong: #06b6d4;
  --team1-bg: rgba(6, 182, 212, 0.14);
  --team1-glow: rgba(34, 211, 238, 0.42);

  --team2: #fb923c;
  --team2-strong: #f97316;
  --team2-bg: rgba(249, 115, 22, 0.14);
  --team2-glow: rgba(251, 146, 60, 0.42);

  /* ألوان النقاط والأزرار */
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --emerald: #10b981;
  --rose: #f43f5e;
  --violet: #8b5cf6;

  /* فئات النقاط (200 / 400 / 600) */
  --pts-200-bg: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  --pts-400-bg: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --pts-600-bg: linear-gradient(135deg, #be123c 0%, #e11d48 55%, #a21caf 100%);

  /* ظلال وأنصاف أقطار */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-card: 0 18px 45px rgba(2, 6, 23, 0.55);
  --shadow-glow-primary: 0 10px 30px rgba(6, 182, 212, 0.35);

  /* الخطوط */
  --font-main: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  --transition: 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* إعادة ضبط أساسية */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.32) rgba(6, 10, 24, 0.6);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(6, 10, 24, 0.7);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

body {
  font-family: var(--font-main);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(49, 46, 129, 0.42) 0%, transparent 65%),
    radial-gradient(ellipse 65% 45% at 88% 12%, rgba(8, 145, 178, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 12% 85%, rgba(67, 56, 202, 0.18) 0%, transparent 65%),
    linear-gradient(180deg, #0b1124 0%, #070b19 52%, #040712 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   خلفية الأستوديو المضيئة
   ========================================================= */
.studio-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.studio-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.3;
}

.studio-orb-1 {
  width: 520px;
  height: 520px;
  background: #06b6d4;
  top: -180px;
  right: -120px;
}

.studio-orb-2 {
  width: 480px;
  height: 480px;
  background: #f97316;
  bottom: -180px;
  left: -120px;
  opacity: 0.24;
}

.studio-orb-3 {
  width: 380px;
  height: 380px;
  background: #8b5cf6;
  top: 40%;
  left: 42%;
  opacity: 0.16;
}

.studio-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
}

/* =========================================================
   إدارة الشاشات والحاويات
   ========================================================= */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeSlideIn 0.35s ease;
}

.screen.active {
  display: block;
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 44px;
}

.setup-container {
  padding-bottom: 112px;
}

/* =========================================================
   الإشعارات السريعة (Sleek Top-Center Frosted Toasts)
   ========================================================= */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 28px);
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(9, 14, 34, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.48);
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: toastIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-icon {
  font-size: 1.02rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-text {
  line-height: 1.35;
}

.toast.toast-success {
  border-color: rgba(52, 211, 153, 0.62);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.62), 0 0 22px rgba(16, 185, 129, 0.18);
}

.toast.toast-warning {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.62), 0 0 22px rgba(245, 158, 11, 0.18);
}

.toast.toast-error {
  border-color: rgba(251, 113, 133, 0.68);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.62), 0 0 22px rgba(244, 63, 94, 0.2);
}

.toast.toast-exit {
  animation: toastOut 0.22s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

/* =========================================================
   الأزرار العامة (Buttons)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.96rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-xs {
  padding: 6px 11px;
  font-size: 0.8rem;
  border-radius: 9px;
  gap: 5px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.btn-xl {
  padding: 15px 38px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 16px;
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  font-size: 1.05rem;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(6, 182, 212, 0.48);
}

.btn-primary:disabled {
  background: rgba(71, 85, 105, 0.45);
  color: rgba(203, 213, 225, 0.45);
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}

.btn-amber:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.42);
}

.btn-gold-outline {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--gold-light);
}

.btn-gold-outline:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.22);
}

.btn-danger-outline {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.42);
  color: #fda4af;
}

.btn-danger-outline:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.35);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-primary);
}

/* =========================================================
   شاشة إعداد الجولة (Setup Screen)
   ========================================================= */
.hero-header {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}

.hero-top-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.hero-top-row .brand-badge {
  margin-bottom: 0;
}

.hero-utility-actions {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-sound-btn {
  position: static;
  transform: none;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-sound-btn:hover {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.5);
}

.hero-sound-btn:active {
  transform: scale(0.96);
}

@media (max-width: 640px) {
  .hero-top-row {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .hero-utility-actions {
    position: static;
    transform: none;
  }
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--team1);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--team1);
  box-shadow: 0 0 10px var(--team1);
}

.brand-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.brand-highlight {
  background: linear-gradient(135deg, #22d3ee 0%, #fcd34d 55%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  max-width: 650px;
  margin: 0 auto;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  margin-bottom: 22px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

/* إدخال أسماء الفريقين */
.teams-inputs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.team-input-card {
  background: rgba(9, 14, 34, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.team-1-accent:focus-within {
  border-color: var(--team1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

.team-2-accent:focus-within {
  border-color: var(--team2);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.18);
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.team-color-dot,
.team-badge-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.team-1-dot {
  background: var(--team1);
  box-shadow: 0 0 10px var(--team1);
}

.team-2-dot {
  background: var(--team2);
  box-shadow: 0 0 10px var(--team2);
}

.text-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 700;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.text-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.45);
}

.vs-divider {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(251, 146, 60, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

/* شريط اختيار الفئات */
.categories-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.categories-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.selection-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.selection-counter strong {
  color: var(--text-primary);
  font-weight: 800;
}

.selection-counter.ready {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.65);
  color: #6ee7b7;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.22);
}

.selection-counter.ready strong {
  color: #ecfdf5;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* شريط إحصائيات بنك الأسئلة المدمج */
.bank-stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.bank-stats-strip strong {
  color: var(--gold-light);
  font-weight: 800;
}

.bank-stat-sep {
  color: rgba(148, 163, 184, 0.35);
}

/* مؤشر حالة المزامنة مع Google Sheets */
.sheets-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  margin-bottom: 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.sheets-status-bar.status-loading {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(34, 211, 238, 0.42);
  color: #67e8f9;
}

.sheets-status-bar.status-success {
  background: rgba(16, 185, 129, 0.13);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.sheets-status-bar.status-warning {
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.sheets-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(34, 211, 238, 0.25);
  border-top-color: #22d3ee;
  flex-shrink: 0;
  animation: sheetsSpin 0.75s linear infinite;
}

@keyframes sheetsSpin {
  to {
    transform: rotate(360deg);
  }
}

/* شريط التصنيفات الرئيسية (Sticky Horizontal Pill Top Bar) */
.category-groups-bar-wrap {
  position: sticky;
  top: 10px;
  z-index: 30;
  margin-bottom: 12px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(16px);
}

.category-groups-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
}

.category-groups-bar::-webkit-scrollbar {
  display: none;
}

.category-group-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--transition);
}

.category-group-tab:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-bright);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.category-group-tab:focus-visible {
  outline: 2px solid var(--team1);
  outline-offset: 2px;
}

.category-group-tab:active {
  transform: scale(0.98);
}

.category-group-tab.has-selected {
  border-color: rgba(16, 185, 129, 0.52);
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-primary);
}

.category-group-tab.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.34), rgba(37, 99, 235, 0.38));
  border-color: rgba(34, 211, 238, 0.88);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.group-tab-icon {
  font-size: 1.02rem;
  line-height: 1;
}

.group-tab-label {
  line-height: 1.2;
}

.group-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
}

.category-group-tab.active .group-tab-count {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.group-tab-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.65);
  color: #6ee7b7;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.25;
}

.category-group-tab.active .group-tab-selected-badge {
  background: rgba(16, 185, 129, 0.34);
  border-color: rgba(110, 231, 183, 0.85);
  color: #ecfdf5;
}

/* شريط البحث والتصفية السريعة والاختيار العشوائي */
.category-quick-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.category-search-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}

.category-search-icon {
  position: absolute;
  right: 12px;
  font-size: 0.92rem;
  opacity: 0.72;
  pointer-events: none;
}

.category-search-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 36px 8px 34px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: all var(--transition);
}

.category-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.category-search-input:focus {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* إخفاء زر المسح الافتراضي في المتصفح لصالح زر المسح المخصص */
.category-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.category-search-clear {
  position: absolute;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.22);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.category-search-clear:hover {
  background: rgba(244, 63, 94, 0.45);
}

.category-search-clear:active {
  transform: scale(0.95);
}

.quick-filter-pill,
.quick-random-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--transition);
}

.quick-filter-pill {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.quick-filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.quick-filter-pill:active,
.quick-random-btn:active {
  transform: scale(0.98);
}

.quick-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  transition: all var(--transition);
}

.quick-filter-pill.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.65);
  color: #6ee7b7;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
}

.quick-filter-pill.active .quick-filter-dot {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.quick-random-btn {
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.45);
  color: #c7d2fe;
}

.quick-random-btn:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(165, 180, 252, 0.72);
  color: #ffffff;
  transform: translateY(-1px);
}

/* شبكة بطاقات الفئات في شاشة الإعداد */
.setup-categories-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.setup-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 15px 11px 13px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition);
  overflow: hidden;
}

/* شريط علوي رفيع بلون الفئة */
.setup-cat-card::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--cat-color, #06b6d4);
  opacity: 0.78;
  transition: opacity var(--transition), height var(--transition);
  pointer-events: none;
}

.setup-cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, var(--cat-color, #06b6d4), transparent 72%);
  opacity: 0.06;
  transition: opacity var(--transition);
  pointer-events: none;
}

@media (hover: hover) {
  .setup-cat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(18, 28, 56, 0.86);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.45);
  }

  .setup-cat-card:hover::before {
    opacity: 0.14;
  }

  .setup-cat-card:hover::after {
    opacity: 1;
  }
}

.setup-cat-card:active {
  transform: scale(0.98);
}

.setup-cat-card.selected {
  background: rgba(15, 30, 62, 0.92);
  background: color-mix(in srgb, var(--cat-color, #22d3ee) 15%, rgba(15, 23, 42, 0.92));
  border-color: var(--cat-color, #22d3ee);
  box-shadow:
    0 0 0 1px var(--cat-color, #22d3ee),
    0 10px 26px color-mix(in srgb, var(--cat-color, #22d3ee) 30%, transparent);
}

.setup-cat-card.selected::before {
  opacity: 0.2;
}

.setup-cat-card.selected::after {
  opacity: 1;
}

.setup-cat-check {
  position: absolute;
  top: 10px;
  left: 9px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: transparent;
  transition: all var(--transition);
}

.setup-cat-card.selected .setup-cat-check {
  background: var(--cat-color, #10b981);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--cat-color, #10b981) 50%, transparent);
  transform: scale(1.06);
}

.setup-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--cat-color, #06b6d4) 16%, rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-color: color-mix(in srgb, var(--cat-color, #06b6d4) 36%, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  flex-shrink: 0;
}

.setup-cat-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
}

.setup-cat-desc {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}

.setup-cat-count {
  margin-top: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.34);
}

.setup-cat-count.low {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.42);
}

.setup-cat-count.empty {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.42);
}

/* شريط التقدم النحيف داخل البطاقة للفئات ذات التقدم الجزئي */
.setup-cat-progress-track {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.setup-cat-progress-fill {
  height: 100%;
  background: var(--cat-color, #22d3ee);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* حالة عدم وجود نتائج للبحث أو الفلتر */
.categories-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}

.categories-empty-icon {
  font-size: 2rem;
}

.categories-empty-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.categories-empty-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* الشريط السفلي الثابت لبدء اللعبة (Sticky Bottom Action Dock) */
.setup-action-dock {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -10px 32px rgba(2, 6, 23, 0.65);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
}

.setup-dock-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-dock-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.btn-clear-selections {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.38);
  color: #fda4af;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--transition);
}

.btn-clear-selections:hover {
  background: rgba(244, 63, 94, 0.24);
  color: #ffffff;
}

.btn-clear-selections:active {
  transform: scale(0.98);
}

.setup-start-btn {
  min-width: 210px;
  min-height: 48px;
  padding: 11px 26px;
  border-radius: 14px;
  font-size: 1.02rem;
  font-weight: 800;
}

.setup-start-btn:not(:disabled) {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 55%, #7c3aed 100%);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.42);
}

.setup-start-btn:disabled {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  box-shadow: none;
}

/* =========================================================
   شاشة لوحة اللعب الرئيسية (Game Board - Phase 2)
   ========================================================= */
.game-screen.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* الشريط العلوي للنقاط (Sticky Team Scoreboard Header) */
.scoreboard-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 9, 24, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 10px 16px;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.55);
}

.scoreboard-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) auto minmax(270px, 1fr);
  align-items: center;
  gap: 14px;
}

.score-team-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 9px 14px;
  transition: all var(--transition);
}

.score-team-card:not(.active-turn) {
  opacity: 0.76;
}

.team-1-card.active-turn {
  border-color: var(--team1);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(15, 23, 42, 0.94));
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 26px rgba(6, 182, 212, 0.24);
}

.team-2-card.active-turn {
  border-color: var(--team2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0.94));
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.35), 0 0 26px rgba(245, 158, 11, 0.24);
}

.score-team-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.score-team-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.score-team-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.score-team-card.active-turn .turn-pill {
  visibility: visible;
  opacity: 1;
  animation: pulseSoft 1.8s infinite;
}

.team-1-card .turn-pill {
  background: var(--team1);
  color: #04131c;
}

.team-2-card .turn-pill {
  background: var(--gold);
  color: #1f0e02;
}

@keyframes pulseSoft {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);
  }
}

.score-team-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.score-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-number {
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 68px;
  text-align: center;
  transition: transform 0.22s ease;
}

.score-number.score-pop {
  animation: scorePop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes scorePop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.24);
  }
  100% {
    transform: scale(1);
  }
}

.team-1-card .score-number {
  color: #67e8f9;
}

.team-2-card .score-number {
  color: #fcd34d;
}

.score-adjust-btn {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.score-adjust-btn:active {
  transform: scale(0.96);
}

.score-adjust-btn.plus:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.65);
  color: #a7f3d0;
}

.score-adjust-btn.minus:hover {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.65);
  color: #fecdd3;
}

.lifelines-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lifeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  transition: all var(--transition);
}

.lifeline-chip.used {
  opacity: 0.28;
  text-decoration: line-through;
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.12);
}

/* أزرار التحكم في منتصف الشريط العلوي */
.scoreboard-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-brand-title {
  font-size: 1.2rem;
  font-weight: 900;
}

.mini-brand-title span {
  background: linear-gradient(135deg, #22d3ee, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.remaining-pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.center-controls .btn-icon-only.btn-xs {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0.92rem;
}

/* =========================================================
   شبكة الفئات الست على لوحة اللعب (6 أعمدة × 6 بطاقات)
   ========================================================= */
.board-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 24px;
}

.game-board-grid {
  width: 100%;
  max-width: 1560px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

/* عمود الفئة الواحدة: ترويسة علوية ملونة + شبكة 2×3 لأزرار النقاط */
.board-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px 12px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.48);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

/* شريط علوي رفيع بلون الفئة */
.board-cat-card::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3.5px;
  background: var(--cat-color, #06b6d4);
  pointer-events: none;
}

.board-cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, var(--cat-color, #06b6d4), transparent 62%);
  opacity: 0.09;
  pointer-events: none;
}

.board-cat-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 13px;
  background: rgba(6, 10, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 118px;
}

.board-cat-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--cat-color, #06b6d4) 18%, rgba(15, 23, 42, 0.75));
  border: 1.5px solid color-mix(in srgb, var(--cat-color, #06b6d4) 55%, rgba(255, 255, 255, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.board-cat-title {
  font-size: clamp(0.88rem, 1.05vw, 1.02rem);
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-cat-progress {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.board-tiles-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
}

/* أزرار النقاط (200 Cyan / 400 Amber / 600 Rose-Crimson) */
.q-point-btn {
  min-height: 62px;
  border-radius: 12px;
  font-size: clamp(1.08rem, 1.35vw, 1.32rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.q-point-btn.pts-200 {
  background: var(--pts-200-bg);
  border-color: rgba(103, 232, 249, 0.38);
}

.q-point-btn.pts-400 {
  background: var(--pts-400-bg);
  border-color: rgba(253, 224, 71, 0.38);
}

.q-point-btn.pts-600 {
  background: var(--pts-600-bg);
  border-color: rgba(251, 113, 133, 0.42);
}

@media (hover: hover) {
  .q-point-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.12);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.52);
  }
}

.q-point-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.q-point-btn.played,
.q-point-btn:disabled {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.12);
  color: rgba(148, 163, 184, 0.45);
  box-shadow: none;
  opacity: 0.28;
  text-decoration: line-through;
}

.q-point-btn.played::after {
  content: "✓";
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 900;
  color: rgba(203, 213, 225, 0.8);
  text-decoration: none;
}

/* نقطة صغيرة بلون الفريق الفائز بالبطاقة */
.q-point-btn.played.won-team-0,
.q-point-btn.played.won-team-1 {
  opacity: 0.38;
}

.q-point-btn.played.won-team-0::before,
.q-point-btn.played.won-team-1::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.q-point-btn.played.won-team-0::before {
  background: var(--team1);
  box-shadow: 0 0 8px var(--team1);
}

.q-point-btn.played.won-team-1::before {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* =========================================================
   النوافذ المنبثقة (Modals)
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 6, 18, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.22s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  width: 100%;
  background: linear-gradient(165deg, rgba(17, 25, 52, 0.97) 0%, rgba(9, 14, 34, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
  animation: modalPop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 2;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   نافذة السؤال (Question Modal - Zero-Scroll Flex Layout)
   ========================================================= */
.question-modal-card {
  max-width: min(860px, calc(100vw - 24px));
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.q-modal-header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 10, 26, 0.45);
}

.q-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.q-header-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
  font-size: 0.9rem;
  color: #f8fafc;
}

.q-points-pill {
  padding: 5px 13px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  background: var(--pts-200-bg);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.32);
  transition: all var(--transition);
}

.q-points-pill.pts-200 {
  background: var(--pts-200-bg);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.32);
}

.q-points-pill.pts-400 {
  background: var(--pts-400-bg);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.q-points-pill.pts-600 {
  background: var(--pts-600-bg);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.38);
}

.q-points-pill.doubled {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.55), 0 4px 20px rgba(245, 158, 11, 0.52);
  transform: scale(1.04);
}

.q-turn-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.q-turn-badge.team-1-turn {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(34, 211, 238, 0.55);
  color: #67e8f9;
}

.q-turn-badge.team-2-turn {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.q-modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.q-modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.55);
  color: #ffffff;
}

.q-modal-close-btn:active {
  transform: scale(0.95);
}

/* المؤقت الديناميكي (ثابت أسفل الترويسة) */
.timer-section {
  flex-shrink: 0;
  background: rgba(6, 10, 26, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px 11px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.timer-section.steal-active {
  background: rgba(245, 158, 11, 0.12);
  border-bottom-color: rgba(251, 191, 36, 0.4);
}

.timer-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.timer-display-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.timer-display {
  font-size: clamp(1.65rem, 2.6vw, 2.15rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #22d3ee;
  transition: color 0.2s ease;
}

.timer-display.steal {
  color: #fb923c;
}

.timer-display.warning {
  color: #fbbf24;
}

.timer-display.danger {
  color: #fb7185;
  animation: timerPulse 0.7s infinite;
}

.timer-display.paused {
  opacity: 0.62;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

.timer-mode-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.timer-mode-label.steal-mode {
  color: #fbbf24;
}

.timer-mode-label.ended-mode {
  color: #fb7185;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timer-controls .btn:disabled {
  opacity: 0.4;
  filter: grayscale(0.35);
}

.timer-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #22d3ee);
  transition: width 0.35s linear, background 0.25s ease;
}

.timer-progress-bar.steal {
  background: linear-gradient(90deg, #ea580c, #fbbf24);
}

.timer-progress-bar.warning {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.timer-progress-bar.danger {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

/* جسم النافذة القابل للتمرير عند الحاجة فقط */
.q-modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* شريط وسائل المساعدة المفعّلة في السؤال */
.active-lifelines-banners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-lifeline-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  animation: modalPop 0.22s ease;
}

.banner-double {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.65);
  color: #fde68a;
}

.banner-twoAnswers {
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.65);
  color: #ddd6fe;
}

.banner-callFriend {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.6);
  color: #a7f3d0;
}

/* صندوق السؤال والصورة */
.question-body-box {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 18px 20px;
  text-align: center;
}

.question-text {
  font-size: clamp(1.2rem, 2.2vw, 1.68rem);
  font-weight: 800;
  line-height: 1.58;
  color: #ffffff;
}

.media-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.modal-media-img {
  max-width: 100%;
  max-height: min(35vh, 255px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
}

/* شريط وسائل المساعدة الأفقي المدمج (3 أعمدة دائماً) */
.lifelines-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lifelines-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lifelines-panel-title span {
  color: var(--text-primary);
}

.lifelines-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lifeline-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all var(--transition);
  min-width: 0;
}

.lifeline-btn:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.6);
  transform: translateY(-1px);
}

.lifeline-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.lifeline-btn.activated-now {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.45), 0 0 18px rgba(245, 158, 11, 0.28);
}

.lifeline-btn:disabled:not(.activated-now) {
  opacity: 0.32;
  background: rgba(15, 23, 42, 0.48);
  border-color: rgba(148, 163, 184, 0.12);
}

.lifeline-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
}

.lifeline-btn.activated-now .lifeline-icon {
  background: rgba(245, 158, 11, 0.28);
  color: #fde68a;
}

.lifeline-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.lifeline-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.lifeline-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lifeline-active-tag {
  display: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.7);
  color: #fef3c7;
  font-size: 0.65rem;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
}

.lifeline-btn.activated-now .lifeline-active-tag {
  display: inline-flex;
}

.lifeline-desc {
  font-size: 0.71rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* بطاقة الإجابة الصحيحة (Emerald-Accented Answer Card) */
.answer-section {
  animation: fadeSlideIn 0.24s ease;
}

.answer-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 95, 70, 0.22));
  border: 1.5px solid rgba(52, 211, 153, 0.65);
  border-radius: 16px;
  padding: 15px 18px;
  text-align: center;
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.16);
}

.answer-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #6ee7b7;
  margin-bottom: 4px;
}

.answer-text {
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.4;
}

.answer-card .modal-media-img {
  max-height: min(28vh, 210px);
}

/* التذييل السفلي الثابت (Sticky Footer: Reveal / Award Bar) */
.q-modal-sticky-footer {
  flex-shrink: 0;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 9, 24, 0.92);
  backdrop-filter: blur(14px);
}

.q-modal-pre-reveal {
  display: flex;
  width: 100%;
}

.btn-reveal-full {
  width: 100%;
  min-height: 50px;
  font-size: 1.08rem;
  font-weight: 800;
  border-radius: 14px;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 55%, #7c3aed 100%);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.38);
}

.award-prompt {
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.award-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.btn-award-team1,
.btn-award-team2,
.btn-award-none {
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px;
  border-radius: 12px;
  white-space: normal;
  text-align: center;
  min-height: 56px;
}

.btn-award-team1 {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(2, 132, 199, 0.4));
  border: 1.5px solid rgba(34, 211, 238, 0.65);
  color: #ecfeff;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.24);
}

.btn-award-team1:hover {
  background: linear-gradient(135deg, #0891b2, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.4);
}

.btn-award-team2 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.4));
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  color: #fffbeb;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.24);
}

.btn-award-team2:hover {
  background: linear-gradient(135deg, #d97706, #ea580c);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.4);
}

.btn-award-none {
  background: rgba(51, 65, 85, 0.55);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  color: var(--text-secondary);
}

.btn-award-none:hover {
  background: rgba(71, 85, 105, 0.78);
  color: #ffffff;
  transform: translateY(-1px);
}

.award-team-label {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.award-points-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.award-points-tag {
  font-size: 0.84rem;
  font-weight: 900;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

/* شارات اختصارات لوحة المفاتيح للمذيع (تظهر على سطح المكتب فقط) */
.kbd-hint {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  min-width: 20px;
  height: 19px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  direction: ltr;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(226, 232, 240, 0.85);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.kbd-hint-light {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

@media (min-width: 768px) {
  .kbd-hint {
    display: inline-flex;
  }
}

/* =========================================================
   شاشة الفائز (Winner Modal - Phase 2)
   ========================================================= */
.winner-modal-card {
  max-width: 600px;
  padding: 32px 26px 28px;
  text-align: center;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95) 0%, rgba(7, 11, 28, 0.98) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}

.winner-modal-card.winner-team-1 {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.82), 0 0 60px rgba(6, 182, 212, 0.24);
}

.winner-modal-card.winner-team-2 {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.82), 0 0 60px rgba(245, 158, 11, 0.24);
}

.winner-modal-card.winner-draw {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.82), 0 0 50px rgba(99, 102, 241, 0.2);
}

.winner-trophy {
  font-size: 4.2rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 10px 25px rgba(245, 158, 11, 0.45));
  animation: trophyBounce 1.6s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.04);
  }
}

.winner-eyebrow {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.winner-modal-card.winner-team-1 .winner-eyebrow {
  color: #67e8f9;
}

.winner-modal-card.winner-team-2 .winner-eyebrow {
  color: #fde68a;
}

.winner-modal-card.winner-draw .winner-eyebrow {
  color: #c7d2fe;
}

.winner-title {
  font-size: clamp(1.75rem, 3.6vw, 2.35rem);
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fde68a 60%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.winner-modal-card.winner-team-1 .winner-title {
  background: linear-gradient(135deg, #ffffff 0%, #67e8f9 55%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.winner-modal-card.winner-team-2 .winner-title {
  background: linear-gradient(135deg, #ffffff 0%, #fde68a 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.winner-modal-card.winner-draw .winner-title {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 55%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.winner-scores-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.winner-team-box {
  position: relative;
  padding: 18px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
}

.team-1-box.is-winner {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--team1);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.26);
}

.team-2-box.is-winner {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.26);
}

.winner-crown {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c1002;
  font-size: 0.76rem;
  font-weight: 900;
}

.team-1-box.is-winner .winner-crown {
  background: var(--team1);
  color: #04131c;
}

.winner-team-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.winner-team-score {
  font-size: 2.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.team-1-box .winner-team-score {
  color: #67e8f9;
}

.team-2-box .winner-team-score {
  color: #fcd34d;
}

.winner-score-unit {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.winner-stats-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.winner-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.winner-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.winner-primary-actions .btn {
  flex: 1 1 200px;
}

/* طبقة قصاصات الاحتفال عبر HTML5 Canvas */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   نافذة إدارة بنك الأسئلة (Bank Manager Modal - Phase 3)
   ========================================================= */
.bank-manager-card {
  max-width: min(840px, calc(100vw - 24px));
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.bank-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(6, 10, 26, 0.52);
}

.bank-modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bank-modal-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(5, 9, 24, 0.9);
  backdrop-filter: blur(14px);
}

.bank-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bank-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.32rem;
  font-weight: 900;
  color: #f8fafc;
}

.bank-sources-summary {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.bank-sources-summary strong {
  color: var(--gold-light);
}

.bank-section {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 0;
}

.bank-search-row {
  margin-bottom: 10px;
}

.bank-categories-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.bank-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(7, 11, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.bank-cat-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bank-cat-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cat-color, #06b6d4) 18%, rgba(15, 23, 42, 0.75));
  border: 1px solid color-mix(in srgb, var(--cat-color, #06b6d4) 45%, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.bank-cat-row-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bank-cat-row-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-cat-row-group {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-cat-row-stat {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
}

.bank-cat-row-stat.is-empty {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.bank-cat-row-stat.is-partial {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.36);
  color: #fcd34d;
}

.bank-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bank-section-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--text-primary);
}

.bank-section-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bank-section-hint code,
.bank-export-note code {
  font-family: Consolas, "Courier New", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  color: #67e8f9;
  direction: ltr;
  unicode-bidi: embed;
}

.bank-json-textarea {
  width: 100%;
  min-height: 155px;
  resize: vertical;
  background: rgba(4, 7, 18, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  color: #e2e8f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.bank-json-textarea:focus {
  border-color: var(--team1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.bank-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bank-feedback-box {
  margin-top: 12px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
  animation: fadeSlideIn 0.22s ease;
}

.bank-feedback-box.feedback-success {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #a7f3d0;
}

.bank-feedback-box.feedback-warning {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.bank-feedback-box.feedback-error {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.55);
  color: #fecdd3;
}

.bank-count-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #67e8f9;
}

.bank-export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bank-export-note {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bank-custom-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bank-empty-state {
  text-align: center;
  padding: 18px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bank-custom-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.bank-custom-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.bank-custom-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--cat-color, rgba(255, 255, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.bank-custom-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bank-custom-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bank-custom-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.bank-custom-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
}

.bank-custom-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.confirm-modal-overlay {
  z-index: 300;
}

/* =========================================================
   نافذة التأكيد (Confirm Modal)
   ========================================================= */
.confirm-modal-card {
  max-width: 440px;
  padding: 28px 24px;
  text-align: center;
}

.confirm-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.confirm-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.confirm-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

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

/* =========================================================
   الأسئلة الصورية والتفاعلية (Visual Question Types)
   ========================================================= */
.q-visual-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.55);
  color: #e9d5ff;
}

.media-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.visual-image-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 11, 26, 0.65);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.48);
  max-width: 100%;
  transition: background 0.45s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.visual-image-stage .modal-media-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(560px, 100%);
  max-height: min(36vh, 260px);
  border: none;
  box-shadow: none;
  border-radius: 0;
  object-fit: contain;
  transition: filter 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.visual-image-stage.is-zoomable {
  cursor: zoom-in;
}

.visual-image-stage.is-zoomable:hover {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 16px 38px rgba(6, 182, 212, 0.28);
}

.zoom-hint-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(6, 10, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(8px);
  opacity: 0.86;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.visual-image-stage.is-zoomable:hover .zoom-hint-badge,
.multi-img-card:hover .zoom-hint-badge {
  opacity: 1;
  transform: scale(1.04);
}

.visual-image-stage.no-visual-transition .modal-media-img {
  transition: none !important;
}

/* 1) التغبيش (blur) مع دعم blurLevel الديناميكي وحركة كشف سلسة 650ms ease-out */
.visual-image-stage.visual-mode-blur {
  width: min(480px, 100%);
  height: min(35vh, 250px);
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.visual-image-stage.visual-mode-blur .modal-media-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter: blur(var(--blur-amount, 18px));
  transform: scale(1.06);
  transition: filter 650ms ease-out, transform 650ms ease-out;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.visual-image-stage.visual-mode-blur.blur-reduced .modal-media-img {
  filter: blur(var(--blur-half, 9px));
  transform: scale(1.03);
}

.visual-image-stage.visual-mode-blur.visual-revealed .modal-media-img {
  object-fit: contain;
  filter: blur(0px);
  transform: scale(1);
  pointer-events: auto;
}

.blur-controls-wrap,
.zoom-controls-wrap {
  display: flex;
  justify-content: center;
}

.blur-controls-wrap .btn:disabled,
.zoom-controls-wrap .btn:disabled {
  opacity: 0.52;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.2);
}

/* 2) التقريب الشديد (zoom) مع دعم zoomLevel و zoomOrigin وحركة كشف سلسة 750ms */
.visual-image-stage.visual-mode-zoom {
  width: min(480px, 100%);
  height: min(35vh, 250px);
  overflow: hidden;
  background: #0b1124;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.visual-image-stage.visual-mode-zoom .modal-media-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: scale(var(--zoom-amount, 3.8));
  transition: transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-touch-callout: none;
  pointer-events: none;
}

.visual-image-stage.visual-mode-zoom.zoom-reduced .modal-media-img {
  transform: scale(var(--zoom-half, 2));
}

.visual-image-stage.visual-mode-zoom.visual-revealed .modal-media-img {
  transform: scale(1);
  pointer-events: auto;
}

/* 3) الألوان المعكوسة (invert) */
.visual-image-stage.visual-mode-invert {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.visual-image-stage.visual-mode-invert .modal-media-img {
  filter: invert(1);
  pointer-events: none;
}

.visual-image-stage.visual-mode-invert.visual-revealed .modal-media-img {
  filter: invert(0);
  pointer-events: auto;
}

/* 4) الظل الأسود (silhouette) على منصة مضيئة متباينة */
.visual-image-stage.visual-mode-silhouette {
  background: radial-gradient(circle at center, #f8fafc 0%, #cbd5e1 100%);
  padding: 14px 24px;
  border-color: rgba(255, 255, 255, 0.45);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.visual-image-stage.visual-mode-silhouette .modal-media-img {
  filter: brightness(0);
  background: transparent;
  pointer-events: none;
}

.visual-image-stage.visual-mode-silhouette.visual-revealed .modal-media-img {
  filter: brightness(1);
  pointer-events: auto;
}

/* 5) وضع الذاكرة (memory) */
.memory-ready-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 24px 18px;
  border-radius: 16px;
  background: radial-gradient(circle at top center, rgba(139, 92, 246, 0.24), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.memory-ready-icon {
  font-size: 3.1rem;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(139, 92, 246, 0.45));
}

.memory-ready-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #f5f3ff;
}

.memory-ready-desc {
  max-width: 520px;
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.visual-image-stage.visual-mode-memory-viewing {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.visual-image-stage.visual-mode-memory-viewing .modal-media-img {
  pointer-events: none;
  -webkit-touch-callout: none;
}

.memory-countdown-panel {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(6, 182, 212, 0.16));
  border: 1px solid rgba(167, 139, 250, 0.55);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  text-align: right;
}

.memory-countdown-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.memory-countdown-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f5f3ff;
}

.memory-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #8b5cf6;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}

.memory-seconds-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #fde047;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.memory-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.memory-progress-bar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a855f7, #38bdf8);
  transition: width 0.35s linear;
}

/* 6 و 7) الصور المتعددة (spot-diff و multi-image) */
.spot-diff-badge-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.spot-diff-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(239, 68, 68, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18);
}

.multi-images-wrap {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  width: 100%;
}

.multi-images-wrap.layout-spot-diff {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.multi-images-wrap.layout-multi-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.multi-images-wrap.layout-multi-2-plus {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.multi-images-wrap.layout-multi-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.multi-images-wrap.layout-multi-3-plus {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.multi-images-wrap.layout-multi-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.multi-plus-separator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: #1c1002;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.38);
  border: 2px solid rgba(254, 240, 138, 0.65);
  user-select: none;
}

.multi-img-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  overflow: hidden;
  background: rgba(7, 11, 26, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.26);
  cursor: zoom-in;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.multi-img-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.75);
  box-shadow: 0 12px 28px rgba(6, 182, 212, 0.24);
}

.multi-img-label {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(6, 10, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.multi-img-el {
  width: 100%;
  height: min(26vh, 190px);
  object-fit: contain;
  display: block;
  background: rgba(15, 23, 42, 0.6);
}

.layout-spot-diff .multi-img-el {
  height: min(30vh, 215px);
  object-fit: contain;
  background: #0b1124;
}

.layout-multi-4 .multi-img-el {
  height: min(19vh, 138px);
  object-fit: contain;
}

/* التلميح الاختياري والشرح */
.question-hint-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.question-hint-wrap .btn:disabled {
  opacity: 0.52;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.question-hint-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  font-size: 0.95rem;
  font-weight: 700;
  animation: fadeSlideIn 0.25s ease;
}

.answer-explanation {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(110, 231, 183, 0.32);
  color: #d1fae5;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.55;
}

/* =========================================================
   عارض تكبير الصور التفاعلي (Image Lightbox)
   ========================================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(3, 6, 18, 0.93);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

.lightbox-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 92vw;
  max-height: 90vh;
}

.lightbox-img {
  width: auto;
  height: auto;
  min-width: min(520px, 84vw);
  max-width: 88vw;
  max-height: 80vh;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8);
  object-fit: contain;
  background: rgba(15, 23, 42, 0.75);
  animation: modalPop 0.22s ease;
}

.lightbox-caption {
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
}

.lightbox-close-btn {
  position: fixed;
  top: 20px;
  left: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.lightbox-close-btn:hover {
  background: rgba(244, 63, 94, 0.85);
  transform: scale(1.06);
}

.lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.lightbox-nav-btn:hover {
  background: rgba(34, 211, 238, 0.4);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  right: 22px;
}

.lightbox-next {
  left: 22px;
}

/* =========================================================
   التجاوب مع جميع الشاشات (TV / Desktop / Tablet / Mobile)
   ========================================================= */

/* الشاشات العريضة والتلفاز */
@media (min-width: 1560px) {
  html {
    font-size: 17px;
  }

  .game-board-grid {
    max-width: 1620px;
    gap: 22px;
  }

  .q-point-btn {
    min-height: 70px;
    font-size: 1.48rem;
  }

  .board-cat-icon-badge {
    width: 54px;
    height: 54px;
    font-size: 1.8rem;
  }
}

/* الشاشات المتوسطة والأجهزة اللوحية */
@media (max-width: 1180px) {
  .setup-categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scoreboard-inner {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .scoreboard-center {
    grid-column: 1 / -1;
    order: -1;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .game-board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

/* الهواتف المحمولة */
@media (max-width: 700px) {
  .container {
    padding: 14px 12px 36px;
  }

  .setup-container {
    padding-bottom: 108px;
  }

  .panel {
    padding: 14px 12px;
  }

  .teams-inputs-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .vs-divider {
    margin: 0 auto;
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }

  .toolbar-actions {
    width: 100%;
    gap: 6px;
  }

  .toolbar-actions .btn-sm {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .bank-stats-strip {
    font-size: 0.78rem;
    padding: 7px 10px;
    gap: 4px 10px;
  }

  .category-groups-bar-wrap {
    top: 6px;
    padding: 6px 7px;
    margin-bottom: 10px;
  }

  .category-group-tab {
    min-height: 40px;
    padding: 6px 11px;
    font-size: 0.82rem;
    gap: 6px;
  }

  .category-quick-toolbar {
    gap: 6px;
    margin-bottom: 12px;
  }

  .category-search-icon {
    right: 9px;
    font-size: 0.84rem;
  }

  .category-search-input {
    min-height: 40px;
    padding: 7px 30px 7px 28px;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .category-search-clear {
    left: 6px;
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
  }

  .quick-filter-pill,
  .quick-random-btn {
    min-height: 40px;
    padding: 0 9px;
    font-size: 0.76rem;
    border-radius: 10px;
    gap: 5px;
  }

  .setup-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .setup-cat-card {
    padding: 12px 9px 11px;
    gap: 5px;
    border-radius: 13px;
  }

  .setup-cat-check {
    top: 8px;
    left: 7px;
    width: 21px;
    height: 21px;
    font-size: 0.72rem;
  }

  .setup-cat-name {
    font-size: 0.9rem;
  }

  .setup-cat-desc {
    font-size: 0.73rem;
  }

  .setup-cat-count {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .setup-action-dock {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .setup-dock-inner {
    gap: 8px;
  }

  .selection-counter {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .btn-clear-selections {
    padding: 6px 9px;
    font-size: 0.76rem;
  }

  .setup-start-btn {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 44px;
    padding: 9px 14px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .toast-container {
    top: 10px;
    max-width: calc(100vw - 20px);
  }

  .toast {
    font-size: 0.82rem;
    padding: 8px 14px;
  }

  .scoreboard-bar {
    padding: 8px 10px;
  }

  .scoreboard-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .scoreboard-center {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 6px;
  }

  .score-team-card {
    padding: 7px 9px;
    border-radius: 12px;
  }

  .score-team-name {
    font-size: 0.84rem;
  }

  .turn-pill {
    font-size: 0.64rem;
    padding: 2px 6px;
  }

  .score-team-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .score-value-row {
    justify-content: space-between;
    gap: 4px;
  }

  .score-number {
    font-size: 1.42rem;
    min-width: 0;
    flex: 1;
  }

  .score-adjust-btn {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .lifelines-status-row {
    justify-content: center;
    gap: 4px;
  }

  .lifeline-chip {
    padding: 2px 6px;
    font-size: 0.66rem;
  }

  .board-wrapper {
    padding: 12px 10px 22px;
  }

  .game-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .board-cat-card {
    padding: 10px 8px 9px;
    gap: 8px;
    border-radius: 14px;
  }

  .board-cat-header {
    min-height: 96px;
    padding: 8px 6px;
    gap: 5px;
  }

  .board-cat-icon-badge {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
    border-radius: 10px;
  }

  .board-cat-title {
    font-size: 0.84rem;
  }

  .board-tiles-grid {
    gap: 6px;
  }

  .q-point-btn {
    min-height: 46px;
    font-size: 1.02rem;
    border-radius: 10px;
  }

  .modal-overlay {
    padding: 8px;
  }

  .question-modal-card {
    max-width: calc(100vw - 16px);
    max-height: 94vh;
    border-radius: 18px;
  }

  .q-modal-header {
    padding: 10px 12px 8px;
    gap: 6px;
  }

  .q-category-pill,
  .q-points-pill,
  .q-turn-badge {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .timer-section {
    padding: 8px 12px 9px;
  }

  .timer-display {
    font-size: 1.45rem;
  }

  .timer-mode-label {
    font-size: 0.74rem;
  }

  .timer-controls .btn-xs {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .q-modal-scroll-body {
    padding: 10px 12px;
    gap: 10px;
  }

  .question-body-box {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .question-text {
    font-size: 1.08rem;
  }

  /* إبقاء شريط وسائل المساعدة أفقياً دائماً (3 أعمدة) بدون تكديس عمودي */
  .lifelines-buttons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .lifeline-btn {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 7px 5px;
    gap: 4px;
  }

  .lifeline-icon {
    width: 28px;
    height: 28px;
    font-size: 0.88rem;
    border-radius: 8px;
  }

  .lifeline-info {
    align-items: center;
  }

  .lifeline-title-row {
    flex-direction: column;
    gap: 2px;
  }

  .lifeline-title {
    font-size: 0.74rem;
  }

  .lifeline-desc {
    display: none;
  }

  .q-modal-sticky-footer {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .award-buttons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .btn-award-team1,
  .btn-award-team2,
  .btn-award-none {
    padding: 8px 6px;
    min-height: 50px;
  }

  .award-team-label {
    font-size: 0.76rem;
  }

  .award-points-tag {
    font-size: 0.74rem;
  }

  .bank-manager-card {
    max-width: calc(100vw - 16px);
    max-height: 90vh;
    border-radius: 18px;
  }

  .bank-modal-header,
  .bank-modal-scroll-body,
  .bank-modal-footer {
    padding-inline: 12px;
  }

  .bank-categories-overview {
    grid-template-columns: 1fr;
  }

  .bank-section {
    padding: 12px 11px;
  }

  .winner-modal-card {
    padding: 24px 18px 22px;
  }

  .winner-scores-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .winner-primary-actions {
    flex-direction: column;
  }

  .winner-primary-actions .btn {
    flex: none;
    width: 100%;
  }

  .multi-images-wrap.layout-spot-diff,
  .multi-images-wrap.layout-multi-2,
  .multi-images-wrap.layout-multi-2-plus,
  .multi-images-wrap.layout-multi-3,
  .multi-images-wrap.layout-multi-3-plus,
  .multi-images-wrap.layout-multi-4 {
    grid-template-columns: 1fr;
  }

  .visual-image-stage.visual-mode-zoom,
  .visual-image-stage.visual-mode-blur {
    height: min(28vh, 195px);
  }

  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    right: 10px;
  }

  .lightbox-next {
    left: 10px;
  }
}

/* الهواتف الصغيرة جداً (360px - 430px) */
@media (max-width: 440px) {
  .category-quick-toolbar {
    gap: 5px;
  }

  .category-search-icon {
    right: 8px;
    font-size: 0.78rem;
  }

  .category-search-input {
    padding: 6px 26px 6px 22px;
    font-size: 0.78rem;
  }

  .quick-filter-pill,
  .quick-random-btn {
    padding: 0 8px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .quick-filter-dot {
    width: 6px;
    height: 6px;
  }
}


/* =========================================================
   المرحلة الرابعة — الحزمة الأولى (Phase 4 Enhancements)
   1) مُبدّل ملفات المجموعات (Profile Switcher)
   2) زر التراجع (Undo) ونافذة استئناف المباراة (Resume Modal)
   3) تقرير صحة البنك وإحصائيات اللعب
   4) Skeleton/Spinner وحالات فشل تحميل الصور وإعادة المحاولة
   ========================================================= */

/* 1) مُبدّل ملفات المجموعات (Profile Switcher) */
.profile-switcher-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(9, 14, 34, 0.72);
  border: 1px solid rgba(34, 211, 238, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-switcher-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-switcher-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
  white-space: nowrap;
}

.profile-pills-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-pill-wrap {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all var(--transition);
  overflow: hidden;
}

.profile-pill-wrap:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.profile-pill-wrap.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(37, 99, 235, 0.34));
  border-color: rgba(34, 211, 238, 0.82);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.24);
}

.profile-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-secondary);
  white-space: nowrap;
}

.profile-pill-wrap.active .profile-pill-btn {
  color: #ffffff;
}

.profile-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.profile-pill-wrap.active .profile-pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ecfeff;
}

.profile-pill-delete {
  width: 24px;
  height: 24px;
  margin-inline-end: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 900;
  color: rgba(253, 164, 175, 0.8);
  transition: all var(--transition);
}

.profile-pill-delete:hover {
  background: rgba(244, 63, 94, 0.35);
  color: #ffffff;
}

.profile-add-btn {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px dashed rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  transition: all var(--transition);
}

.profile-add-btn:hover {
  background: rgba(16, 185, 129, 0.26);
  border-style: solid;
  color: #ecfdf5;
}

.new-profile-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeSlideIn 0.2s ease;
}

.new-profile-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-name-input {
  flex: 1 1 200px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.38);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.profile-name-input:focus {
  border-color: var(--team1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.profile-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.profile-presets-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 700;
}

.profile-preset-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  transition: all var(--transition);
}

.profile-preset-chip:hover {
  background: rgba(34, 211, 238, 0.16);
  border-color: rgba(34, 211, 238, 0.55);
  color: #ffffff;
}

/* 2) زر التراجع (Undo) وشارة الخطوات المتاحة */
.btn-undo-action:disabled {
  opacity: 0.38;
  filter: grayscale(0.35);
}

.btn-undo-action:not(:disabled) {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.55);
  color: #ede9fe;
}

.btn-undo-action:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.32);
  border-color: rgba(196, 181, 253, 0.8);
  color: #ffffff;
}

.undo-steps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.35);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* شارة السؤال المعاد تدويره على اللوحة */
.q-point-btn.recycled-slot:not(.played)::after {
  content: "♻️";
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 0.62rem;
  opacity: 0.72;
  pointer-events: none;
}

/* 3) نافذة استئناف المباراة السابقة (Glassmorphism Resume Modal) */
.resume-modal-overlay {
  z-index: 260;
}

.resume-modal-card {
  max-width: 540px;
  padding: 28px 24px 24px;
  text-align: center;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.92) 0%, rgba(8, 13, 31, 0.96) 100%);
  border: 1.5px solid rgba(34, 211, 238, 0.42);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.82), 0 0 42px rgba(6, 182, 212, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.resume-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #67e8f9;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.resume-modal-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #f8fafc;
  margin-bottom: 8px;
}

.resume-modal-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.resume-match-summary {
  background: rgba(6, 10, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resume-teams-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.resume-team-pill {
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.resume-team-pill.team-1 {
  border-color: rgba(34, 211, 238, 0.4);
}

.resume-team-pill.team-2 {
  border-color: rgba(251, 146, 60, 0.4);
}

.resume-team-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-team-score {
  font-size: 1.45rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.resume-team-pill.team-1 .resume-team-score {
  color: #67e8f9;
}

.resume-team-pill.team-2 .resume-team-score {
  color: #fcd34d;
}

.resume-vs {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--gold-light);
}

.resume-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.resume-meta-row strong {
  color: var(--text-primary);
}

.resume-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.resume-modal-actions .btn {
  flex: 1 1 200px;
}

/* 4) إحصائيات الملف النشط وتقرير «صحة البنك» داخل إدارة البنك */
.bank-profile-stats-grid,
.bank-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bank-stat-card {
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.bank-stat-card.stat-good {
  border-color: rgba(16, 185, 129, 0.35);
}

.bank-stat-card.stat-warn {
  border-color: rgba(245, 158, 11, 0.42);
}

.bank-stat-value {
  font-size: 1.2rem;
  font-weight: 900;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.bank-stat-card.stat-good .bank-stat-value {
  color: #6ee7b7;
}

.bank-stat-card.stat-warn .bank-stat-value {
  color: #fcd34d;
}

.bank-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bank-profile-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bank-sync-time-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #a7f3d0;
}

.bank-health-subbox {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bank-subbox-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.under50-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 115px;
  overflow-y: auto;
}

.under50-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.36);
  color: #fde68a;
  font-size: 0.73rem;
  font-weight: 700;
}

.health-all-good-note {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ee7b7;
}

/* 5) Skeleton / Spinner وحالة فشل تحميل الصور مع زر إعادة المحاولة */
.visual-image-stage.is-loading,
.visual-image-stage.has-error {
  min-width: min(360px, 100%);
  min-height: 175px;
}

.visual-image-stage.is-loading .modal-media-img,
.visual-image-stage.has-error .modal-media-img {
  display: none;
}

.visual-image-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 175px;
  padding: 22px 18px;
  background: linear-gradient(
    110deg,
    rgba(15, 23, 42, 0.72) 25%,
    rgba(34, 211, 238, 0.12) 50%,
    rgba(15, 23, 42, 0.72) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s linear infinite;
}

@keyframes skeletonShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.visual-loading-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(34, 211, 238, 0.22);
  border-top-color: #22d3ee;
  animation: sheetsSpin 0.8s linear infinite;
}

.visual-loading-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.visual-image-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 175px;
  padding: 20px 18px;
  text-align: center;
  background: rgba(244, 63, 94, 0.08);
}

.visual-error-icon {
  font-size: 2rem;
  line-height: 1;
}

.visual-error-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fecdd3;
}

.visual-error-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 320px;
}

.visual-error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.multi-img-card.has-img-error {
  cursor: default;
  border-color: rgba(244, 63, 94, 0.45);
}

.multi-img-error-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(15, 23, 42, 0.82);
}

.multi-img-error-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fda4af;
}

@media (max-width: 700px) {
  .bank-profile-stats-grid,
  .bank-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resume-teams-row {
    grid-template-columns: 1fr;
  }

  .resume-vs {
    display: none;
  }
}


/* =========================================================
   المرحلة الرابعة — الحزمة الثانية (Phase 4 Pack 2)
   1) قسم إعدادات وسائل المساعدة القابل للطي (Tactical Setup Panel)
   2) شارات وسائل المساعدة وتفعيل 2x على لوحة اللعب (Scoreboard Powerups)
   3) واجهة وضع «من غير كلام» المخصّص (CharadesQuestionView + Hold-to-Reveal)
   4) نظام التلميح المخصوم، تبديل السؤال، وفرصة السرقة (Steal Mode)
   ========================================================= */

.select-none {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.steal-confetti-canvas {
  z-index: 1250;
  pointer-events: none;
}

/* 1) قسم إعداد وسائل المساعدة القابل للطي */
.tactical-setup-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(245, 158, 11, 0.28);
}

.tactical-collapse-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  text-align: right;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(6, 182, 212, 0.06));
  transition: background var(--transition);
}

.tactical-collapse-trigger:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(6, 182, 212, 0.1));
}

.tactical-trigger-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  flex: 1;
}

.tactical-panel-title {
  font-size: 1.14rem;
}

.tactical-summary-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tactical-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
}

.tactical-summary-pill.is-active {
  border-color: rgba(251, 191, 36, 0.48);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
}

.tactical-summary-pill.is-off {
  opacity: 0.55;
  text-decoration: line-through;
}

.tactical-chevron {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--gold-light);
  transition: transform 0.25s ease, background var(--transition);
  flex-shrink: 0;
}

.tactical-collapse-trigger[aria-expanded="true"] .tactical-chevron {
  transform: rotate(180deg);
  background: rgba(245, 158, 11, 0.22);
}

.tactical-panel-body {
  padding: 18px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  animation: fadeSlideIn 0.22s ease;
}

.tactical-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tactical-config-card {
  background: rgba(9, 14, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), opacity var(--transition);
}

.tactical-config-card.is-disabled {
  opacity: 0.62;
  border-color: rgba(148, 163, 184, 0.14);
}

.tactical-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tactical-card-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.tactical-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.tactical-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.tactical-card-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* مفتاح التبديل (Switch) */
.tactical-switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  direction: ltr;
}

.tactical-switch.active {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: rgba(110, 231, 183, 0.75);
  justify-content: flex-end;
}

.tactical-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition);
}

.tactical-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tactical-config-card.is-disabled .tactical-options-group {
  pointer-events: none;
  opacity: 0.45;
}

.tactical-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.tactical-opt-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tactical-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tactical-opt-btn {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  transition: all var(--transition);
}

.tactical-opt-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.tactical-opt-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(234, 88, 12, 0.34));
  border-color: rgba(251, 191, 36, 0.85);
  color: #fef3c7;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.22);
}

.tactical-panel-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tactical-footer-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* 2) شارات وسائل المساعدة وتفعيل 2x على لوحة اللعب */
.powerup-board-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  transition: all var(--transition);
  font-variant-numeric: tabular-nums;
}

button.powerup-board-chip.is-interactive:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.8);
  color: #fef3c7;
  transform: translateY(-1px);
}

button.powerup-board-chip.is-armed {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 55%, #ea580c 100%);
  border-color: #fde047;
  color: #1c0f02;
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.55), 0 0 22px rgba(245, 158, 11, 0.72);
  animation: goldenArmPulse 1.4s ease-in-out infinite;
}

@keyframes goldenArmPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.5), 0 0 16px rgba(245, 158, 11, 0.65);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(253, 224, 71, 0.85), 0 0 28px rgba(251, 191, 36, 0.92);
  }
}

.powerup-board-chip.is-inactive-team {
  opacity: 0.62;
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.2);
}

.powerup-board-chip.is-depleted {
  opacity: 0.3;
  text-decoration: line-through;
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.12);
}

.powerup-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: #fde68a;
  font-size: 0.7rem;
  font-weight: 900;
}

button.powerup-board-chip.is-armed .powerup-count-badge {
  background: rgba(28, 15, 2, 0.25);
  color: #ffffff;
}

/* شارة النقاط الحية مع الشطب والمضاعفة والسرقة */
.q-points-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.q-points-pill .pts-strike {
  opacity: 0.74;
  text-decoration: line-through;
  font-weight: 700;
  font-size: 0.8rem;
}

.q-points-pill.discounted:not(.doubled) {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.45), 0 4px 16px rgba(6, 182, 212, 0.35);
}

.q-points-pill.steal-pill {
  background: linear-gradient(135deg, #ea580c, #e11d48);
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.55), 0 4px 18px rgba(234, 88, 12, 0.45);
}

.banner-double {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.22));
  border: 1.5px solid rgba(253, 224, 71, 0.85);
  color: #fef08a;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
}

.banner-hint-discount {
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.55);
  color: #a5f3fc;
}

/* 3) واجهة «من غير كلام» المخصّصة (CharadesQuestionView) */
.question-body-box.is-charades-mode {
  padding: 14px 16px;
  background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.16), rgba(15, 23, 42, 0.78));
  border-color: rgba(129, 140, 248, 0.32);
}

.charades-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.charades-header-card {
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(236, 72, 153, 0.14));
  border: 1px solid rgba(165, 180, 252, 0.42);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.charades-header-eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  color: #c7d2fe;
  letter-spacing: 0.02em;
}

.charades-topic-title {
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
}

.charades-meta-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.charades-word-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(251, 191, 36, 0.7);
  color: #fde68a;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

/* منطقة الكشف السري للممثل (Hold-to-Reveal) */
.charades-actor-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.charades-card-viewport {
  width: 100%;
  height: 164px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.charades-decoy-card {
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  border-radius: 15px;
  background: rgba(7, 11, 26, 0.78);
  border: 1.5px dashed rgba(148, 163, 184, 0.34);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  overflow: hidden;
}

.charades-decoy-icon {
  font-size: 1.85rem;
  line-height: 1;
}

.charades-decoy-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #e2e8f0;
}

.charades-decoy-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 520px;
}

.charades-secret-card {
  width: 100%;
  height: 100%;
  padding: 10px 16px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(6, 95, 70, 0.34));
  border: 2px solid rgba(52, 211, 153, 0.85);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  overflow-y: auto;
}

.charades-secret-badge {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.85);
  border: 1px solid rgba(110, 231, 183, 0.55);
  color: #a7f3d0;
  font-size: 0.76rem;
  font-weight: 800;
}

.charades-secret-answer {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
}

.charades-secret-explanation {
  font-size: 0.88rem;
  font-weight: 600;
  color: #d1fae5;
  background: rgba(6, 10, 24, 0.52);
  border: 1px solid rgba(110, 231, 183, 0.3);
  padding: 7px 14px;
  border-radius: 10px;
  max-width: 620px;
  line-height: 1.5;
}

.charades-hold-btn {
  width: 100%;
  max-width: 480px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border: 1.5px solid rgba(254, 240, 138, 0.7);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.38);
  touch-action: none;
  cursor: pointer;
}

.charades-hold-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.charades-hold-btn.is-holding {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.45), 0 8px 26px rgba(16, 185, 129, 0.45);
  transform: scale(0.99);
}

/* مؤقت «من غير كلام» المدمج */
.charades-timer-box {
  padding: 12px 16px;
  border-radius: 15px;
  background: rgba(6, 10, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.charades-timer-box.is-danger {
  background: rgba(225, 29, 72, 0.15);
  border-color: rgba(251, 113, 133, 0.75);
  box-shadow: 0 0 26px rgba(244, 63, 94, 0.25);
}

.charades-timer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.charades-duration-selector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.charades-dur-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-inline-end: 2px;
}

.charades-dur-pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: all var(--transition);
}

.charades-dur-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.charades-dur-pill.active {
  background: rgba(34, 211, 238, 0.22);
  border-color: rgba(34, 211, 238, 0.85);
  color: #ecfeff;
}

.charades-dur-pill:disabled:not(.active) {
  opacity: 0.35;
}

.charades-timer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.charades-timer-readout-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.charades-timer-display {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #22d3ee;
  transition: color 0.2s ease;
}

.charades-timer-display.is-paused {
  opacity: 0.78;
}

.charades-timer-display.is-danger {
  color: #fb7185;
  animation: charadesUrgentPulse 0.55s ease-in-out infinite;
}

.charades-timer-display.is-ended {
  color: #f43f5e;
}

@keyframes charadesUrgentPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(244, 63, 94, 0);
  }
  50% {
    transform: scale(1.09);
    text-shadow: 0 0 22px rgba(251, 113, 133, 0.75);
  }
}

.charades-timer-status {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
}

.charades-timer-box.is-danger .charades-timer-status {
  color: #fda4af;
}

.charades-timer-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.charades-timer-progress {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #818cf8);
  transition: width 0.35s linear, background 0.25s ease;
}

.charades-timer-progress.is-danger {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

/* 4) شريط الأدوات التكتيكية داخل السؤال (التلميح + التبديل) */
.question-tactical-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tactical-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.question-tactical-bar .question-hint-wrap {
  margin-top: 0;
}

.question-swap-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tactical-action-btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
}

.question-swap-wrap .btn:disabled {
  opacity: 0.45;
}

.swap-unavailable-note {
  font-size: 0.73rem;
  font-weight: 700;
  color: #fda4af;
}

/* 5) شريط وأزرار فرصة السرقة (Steal Mode) */
.steal-status-banner {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 9px 18px;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.28), rgba(225, 29, 72, 0.22));
  border-bottom: 1.5px solid rgba(251, 146, 60, 0.65);
  color: #ffedd5;
  animation: fadeSlideIn 0.2s ease;
}

.steal-status-banner.steal-team-0 {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.28), rgba(37, 99, 235, 0.24));
  border-bottom-color: rgba(34, 211, 238, 0.72);
  color: #ecfeff;
}

.steal-status-banner.steal-team-1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.26));
  border-bottom-color: rgba(251, 191, 36, 0.72);
  color: #fffbeb;
}

.steal-banner-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 0.94rem;
}

.steal-banner-pts-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.8rem;
  font-weight: 900;
  color: #fde047;
}

.steal-team-selector {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.steal-team-pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.steal-team-pill.active {
  background: #f59e0b;
  border-color: #fde047;
  color: #1c0f02;
}

.q-turn-badge.steal-turn-0 {
  background: rgba(6, 182, 212, 0.26);
  border-color: rgba(34, 211, 238, 0.85);
  color: #ecfeff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.q-turn-badge.steal-turn-1 {
  background: rgba(245, 158, 11, 0.26);
  border-color: rgba(251, 191, 36, 0.85);
  color: #fffbeb;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

/* التذييل السفلي المحدّث لنافذة السؤال */
.q-modal-pre-reveal {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-reveal-main {
  flex: 1 1 auto;
  min-height: 50px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 14px;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 55%, #7c3aed 100%);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.38);
}

.btn-wrong-turn {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 800;
}

.steal-footer-panel {
  width: 100%;
  animation: fadeSlideIn 0.2s ease;
}

.steal-offer-prompt,
.steal-active-prompt {
  color: #fde68a;
}

.steal-offer-grid,
.steal-resolve-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-steal-main,
.btn-steal-win {
  flex: 1 1 220px;
  min-height: 48px;
  border-radius: 13px;
  font-size: 0.96rem;
  font-weight: 900;
}

.btn-steal-win {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1.5px solid rgba(110, 231, 183, 0.75);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
}

.btn-steal-win:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-steal-secondary,
.btn-steal-lose {
  flex: 1 1 220px;
  min-height: 48px;
  border-radius: 13px;
  font-size: 0.9rem;
  font-weight: 800;
}

.closing-reveal-actions {
  display: flex;
  width: 100%;
}

@media (max-width: 760px) {
  .tactical-cards-grid {
    grid-template-columns: 1fr;
  }

  .tactical-collapse-trigger {
    padding: 14px 16px;
  }

  .tactical-panel-body {
    padding: 14px 16px;
  }

  .q-modal-pre-reveal {
    flex-direction: column;
  }

  .btn-wrong-turn {
    width: 100%;
    min-height: 44px;
  }

  .charades-timer-top {
    flex-direction: column;
    align-items: stretch;
  }

  .charades-duration-selector,
  .charades-timer-actions {
    justify-content: center;
  }
}


/* =========================================================
   المرحلة الرابعة — الحزمة الثالثة (Phase 4 Pack 3)
   1) شريط الاتصال وتوجيه الصوت لوضع الشاشتين (Dual-Screen Host Controls)
   2) لوحة تحكم المقدّم (Host Cockpit) ومعاينة حالة التلفزيون
   3) شاشة العرض التلفزيوني للجمهور (TV DisplayView - ?mode=display)
   4) لوحة إحصائيات نهاية المباراة وسجل الأسئلة (Match Analytics Dashboard)
   ========================================================= */

.btn-xxs {
  padding: 4px 9px;
  font-size: 0.72rem;
  border-radius: 8px;
  gap: 4px;
}

.btn-tv-open {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(99, 102, 241, 0.28));
  border: 1px solid rgba(34, 211, 238, 0.52);
  color: #ecfeff;
}

.btn-tv-open:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.36), rgba(99, 102, 241, 0.42));
  border-color: rgba(103, 232, 249, 0.85);
}

.btn-tv-open.is-live {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.28));
  border-color: rgba(52, 211, 153, 0.78);
  color: #ecfdf5;
}

.dual-screen-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.dual-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--text-muted);
}

.dual-status-pill.is-connected {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.65);
  color: #6ee7b7;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.dual-audio-route-btn {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

/* 2) لوحة تحكم المقدّم (Host Cockpit) وشريط معاينة التلفزيون */
.host-tv-status-bar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 18px;
  background: rgba(16, 185, 129, 0.12);
  border-bottom: 1px solid rgba(52, 211, 153, 0.35);
}

.host-tv-preview-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 800;
}

.host-tv-live-tag {
  color: #a7f3d0;
}

.host-tv-vis-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.host-tv-vis-pill.state-hidden {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.38);
  color: #cbd5e1;
}

.host-tv-vis-pill.state-hint {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
}

.host-tv-vis-pill.state-revealed {
  background: rgba(16, 185, 129, 0.24);
  border: 1px solid rgba(52, 211, 153, 0.75);
  color: #a7f3d0;
}

.host-tv-mask-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.48);
  color: #c7d2fe;
  font-size: 0.74rem;
  font-weight: 800;
}

.host-cockpit-card {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.32), rgba(15, 23, 42, 0.88));
  border: 1.5px solid rgba(52, 211, 153, 0.62);
  border-radius: 16px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(6, 95, 70, 0.22);
}

.host-cockpit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.host-cockpit-badge {
  font-size: 0.76rem;
  font-weight: 900;
  color: #6ee7b7;
}

.host-cockpit-charades-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.22);
  border: 1px solid rgba(251, 146, 60, 0.6);
  color: #fed7aa;
  font-size: 0.72rem;
  font-weight: 800;
}

.host-cockpit-answer-box {
  background: rgba(4, 12, 24, 0.72);
  border: 1px solid rgba(110, 231, 183, 0.35);
  border-radius: 11px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.host-cockpit-field-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #a7f3d0;
  white-space: nowrap;
}

.host-cockpit-answer-text {
  font-size: 1.18rem;
  font-weight: 900;
  color: #ffffff;
}

.host-cockpit-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.host-cockpit-detail-content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  flex: 1 1 240px;
}

.host-cockpit-detail-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.45;
}

/* 3) شاشة العرض التلفزيوني للجمهور (TV DisplayView - ?mode=display) */
body.display-tv-mode {
  overflow: hidden;
  user-select: none;
}

.tv-display-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.tv-confetti-canvas {
  z-index: 150;
}

.tv-screen {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.2vh, 28px) clamp(18px, 2.4vw, 36px);
  overflow: hidden;
  animation: fadeSlideIn 0.25s ease;
}

/* شاشة الترحيب / الانتظار التلفزيونية */
.tv-standby-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tv-standby-card {
  max-width: 900px;
  width: 100%;
  padding: clamp(32px, 5vh, 60px) clamp(24px, 4vw, 56px);
  border-radius: 32px;
  background: rgba(13, 20, 44, 0.84);
  border: 1.5px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.72), 0 0 60px rgba(6, 182, 212, 0.16);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.tv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 800;
}

.tv-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  animation: pulseSoft 1.8s infinite;
}

.tv-brand-title {
  font-size: clamp(3.6rem, 7vw, 6.2rem);
  font-weight: 900;
  line-height: 1.08;
}

.tv-standby-subtitle {
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  color: var(--text-secondary);
  font-weight: 700;
}

.tv-standby-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tv-standby-team {
  padding: 12px 28px;
  border-radius: 18px;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 900;
}

.tv-standby-team.team-1 {
  background: rgba(6, 182, 212, 0.2);
  border: 1.5px solid var(--team1);
  color: #ecfeff;
}

.tv-standby-team.team-2 {
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid var(--team2);
  color: #fffbeb;
}

.tv-standby-vs {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold-light);
}

.tv-standby-meta {
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 800;
}

/* شاشة لوحة اللعب التلفزيونية */
.tv-board-screen {
  gap: clamp(12px, 1.8vh, 22px);
}

.tv-scoreboard-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  flex-shrink: 0;
}

.tv-team-card {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: clamp(12px, 1.5vh, 18px) clamp(16px, 1.8vw, 24px);
  transition: all 0.25s ease;
}

.tv-team-card:not(.active-turn) {
  opacity: 0.74;
}

.tv-team-card.team-1-card.active-turn {
  border-color: var(--team1);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(15, 23, 42, 0.94));
  box-shadow: 0 0 32px rgba(6, 182, 212, 0.32);
}

.tv-team-card.team-2-card.active-turn {
  border-color: var(--team2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(15, 23, 42, 0.94));
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.32);
}

.tv-team-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.tv-team-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tv-team-name {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-turn-pill {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  font-weight: 900;
  visibility: hidden;
}

.tv-team-card.active-turn .tv-turn-pill {
  visibility: visible;
  animation: pulseSoft 1.6s infinite;
}

.team-1-card .tv-turn-pill {
  background: var(--team1);
  color: #04131c;
}

.team-2-card .tv-turn-pill {
  background: var(--gold);
  color: #1c0f02;
}

.tv-team-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-team-score {
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.team-1-card .tv-team-score {
  color: #67e8f9;
}

.team-2-card .tv-team-score {
  color: #fcd34d;
}

.tv-powerups-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-powerup-chip {
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
  font-weight: 800;
  color: #f8fafc;
}

.tv-powerup-chip.is-armed {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: #fde047;
  color: #1c0f02;
  animation: goldenArmPulse 1.4s infinite;
}

.tv-powerup-chip.is-depleted {
  opacity: 0.34;
  text-decoration: line-through;
}

.tv-scoreboard-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tv-center-brand {
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
  font-weight: 900;
}

.tv-center-brand span {
  background: linear-gradient(135deg, #22d3ee, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tv-remaining-pill {
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  font-weight: 800;
  color: var(--text-secondary);
}

.tv-board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
}

.tv-board-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  align-items: stretch;
}

.tv-board-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.84);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.tv-board-cat-card::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 5px;
  background: var(--cat-color, #06b6d4);
}

.tv-board-cat-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 12px 8px;
  border-radius: 15px;
  background: rgba(6, 10, 26, 0.72);
  min-height: 124px;
}

.tv-board-cat-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--cat-color, #06b6d4) 20%, rgba(15, 23, 42, 0.8));
  border: 1.5px solid color-mix(in srgb, var(--cat-color, #06b6d4) 60%, rgba(255, 255, 255, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
}

.tv-board-cat-title {
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.tv-board-cat-progress {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-muted);
}

.tv-board-tiles-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tv-point-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
}

.tv-point-tile.pts-200 {
  background: var(--pts-200-bg);
}

.tv-point-tile.pts-400 {
  background: var(--pts-400-bg);
}

.tv-point-tile.pts-600 {
  background: var(--pts-600-bg);
}

.tv-point-tile.played {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.14);
  color: rgba(148, 163, 184, 0.4);
  opacity: 0.28;
  text-decoration: line-through;
  box-shadow: none;
}

.tv-point-tile.played.won-team-0::before,
.tv-point-tile.played.won-team-1::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.tv-point-tile.played.won-team-0::before {
  background: var(--team1);
  box-shadow: 0 0 10px var(--team1);
}

.tv-point-tile.played.won-team-1::before {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* شاشة السؤال التلفزيونية للجمهور (خطوط مكبّرة لـ 3-4 أمتار) */
.tv-question-screen {
  align-items: center;
  justify-content: center;
}

.tv-question-shell {
  width: min(1320px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(15, 23, 48, 0.94), rgba(7, 11, 28, 0.96));
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

.tv-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 28px;
  background: rgba(6, 10, 26, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-q-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-q-cat-pill,
.tv-q-type-pill,
.tv-q-turn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-weight: 900;
}

.tv-q-cat-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tv-q-type-pill {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.55);
  color: #f3e8ff;
}

.tv-q-points-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 999px;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  font-weight: 900;
  color: #ffffff;
}

.tv-q-points-pill.pts-200 {
  background: var(--pts-200-bg);
}

.tv-q-points-pill.pts-400 {
  background: var(--pts-400-bg);
}

.tv-q-points-pill.pts-600 {
  background: var(--pts-600-bg);
}

.tv-q-points-pill.doubled {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.65), 0 0 24px rgba(245, 158, 11, 0.55);
}

.tv-q-points-pill.steal-pill {
  background: linear-gradient(135deg, #ea580c, #e11d48);
}

.tv-q-points-pill .pts-strike {
  opacity: 0.72;
  text-decoration: line-through;
  font-size: 0.85em;
}

.tv-q-turn-badge.team-1-turn,
.tv-q-turn-badge.steal-turn-0 {
  background: rgba(6, 182, 212, 0.22);
  border: 1.5px solid var(--team1);
  color: #ecfeff;
}

.tv-q-turn-badge.team-2-turn,
.tv-q-turn-badge.steal-turn-1 {
  background: rgba(245, 158, 11, 0.22);
  border: 1.5px solid var(--gold);
  color: #fffbeb;
}

.tv-q-steal-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 24px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 900;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.34), rgba(225, 29, 72, 0.28));
  border-bottom: 2px solid rgba(251, 146, 60, 0.75);
}

.tv-q-steal-banner.steal-team-0 {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.32), rgba(37, 99, 235, 0.28));
  border-bottom-color: var(--team1);
}

.tv-q-steal-pts {
  padding: 3px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #fde047;
}

.tv-q-timer-wrap {
  padding: 12px 28px 14px;
  background: rgba(6, 10, 26, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-q-timer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tv-q-timer-display {
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #22d3ee;
  line-height: 1;
}

.tv-q-timer-display.warning {
  color: #fbbf24;
}

.tv-q-timer-display.steal {
  color: #fb923c;
}

.tv-q-timer-display.danger {
  color: #fb7185;
  animation: timerPulse 0.65s infinite;
}

.tv-q-timer-label {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  font-weight: 800;
  color: var(--text-secondary);
}

.tv-q-timer-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.tv-q-timer-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #06b6d4, #22d3ee);
  transition: width 0.35s linear, background 0.25s ease;
}

.tv-q-timer-progress.warning {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.tv-q-timer-progress.steal {
  background: linear-gradient(90deg, #ea580c, #fbbf24);
}

.tv-q-timer-progress.danger {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.tv-q-banners {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 28px 0;
}

.tv-q-stage {
  flex: 1;
  min-height: 0;
  padding: clamp(18px, 3vh, 36px) clamp(24px, 3.6vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  overflow-y: auto;
}

.tv-q-text {
  font-size: clamp(1.85rem, 3.4vw, 3.1rem);
  font-weight: 900;
  line-height: 1.48;
  color: #ffffff;
  max-width: 1050px;
}

.tv-visual-stage .tv-media-img {
  display: block;
  max-width: min(760px, 84vw);
  max-height: min(46vh, 390px);
  object-fit: contain;
  transition: filter 650ms ease-out, transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tv-visual-stage.visual-mode-blur,
.tv-visual-stage.visual-mode-zoom {
  width: min(680px, 82vw);
  height: min(44vh, 380px);
}

.tv-visual-stage.visual-mode-blur .tv-media-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  filter: blur(var(--blur-amount, 18px));
  transform: scale(1.06);
}

.tv-visual-stage.visual-mode-blur.blur-reduced .tv-media-img {
  filter: blur(var(--blur-half, 9px));
  transform: scale(1.03);
}

.tv-visual-stage.visual-mode-blur.visual-revealed .tv-media-img {
  filter: blur(0px);
  transform: scale(1);
}

.tv-visual-stage.visual-mode-zoom .tv-media-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  transform: scale(var(--zoom-amount, 3.8));
}

.tv-visual-stage.visual-mode-zoom.zoom-reduced .tv-media-img {
  transform: scale(var(--zoom-half, 2));
}

.tv-visual-stage.visual-mode-zoom.visual-revealed .tv-media-img {
  transform: scale(1);
}

.tv-visual-stage.visual-mode-invert .tv-media-img {
  filter: invert(1);
}

.tv-visual-stage.visual-mode-invert.visual-revealed .tv-media-img {
  filter: invert(0);
}

.tv-visual-stage.visual-mode-silhouette .tv-media-img {
  filter: brightness(0);
}

.tv-visual-stage.visual-mode-silhouette.visual-revealed .tv-media-img {
  filter: brightness(1);
}

.tv-multi-img-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(7, 11, 26, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
}

.tv-multi-img-el {
  width: 100%;
  height: min(32vh, 260px);
  object-fit: contain;
  display: block;
}

/* واجهة «من غير كلام» التلفزيونية المكبّرة */
.tv-charades-stage {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tv-charades-eyebrow {
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  font-weight: 800;
  color: #c7d2fe;
}

.tv-charades-topic {
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
}

.tv-charades-words-pill {
  padding: 10px 28px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(251, 191, 36, 0.78);
  color: #fde68a;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 900;
}

.tv-charades-giant-timer-wrap {
  width: 100%;
  max-width: 680px;
  padding: 20px 28px;
  border-radius: 24px;
  background: rgba(6, 10, 26, 0.84);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tv-charades-giant-timer-wrap.is-danger {
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(251, 113, 133, 0.85);
  box-shadow: 0 0 42px rgba(244, 63, 94, 0.35);
}

.tv-charades-timer-num {
  font-size: clamp(3.6rem, 7vw, 6rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #22d3ee;
}

.tv-charades-timer-num.is-danger {
  color: #fb7185;
  animation: charadesUrgentPulse 0.55s ease-in-out infinite;
}

.tv-charades-timer-status {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 800;
  color: var(--text-secondary);
}

.tv-charades-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.tv-charades-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #06b6d4, #818cf8);
  transition: width 0.35s linear;
}

.tv-charades-progress.is-danger {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

/* الذاكرة التلفزيونية */
.tv-memory-ready {
  padding: 28px 36px;
  border-radius: 24px;
  background: radial-gradient(circle at top, rgba(139, 92, 246, 0.28), rgba(15, 23, 42, 0.85));
  border: 1.5px solid rgba(167, 139, 250, 0.55);
}

.tv-memory-icon {
  font-size: 4rem;
}

.tv-memory-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  margin-top: 8px;
}

.tv-memory-sub {
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  color: var(--text-secondary);
  margin-top: 8px;
}

.tv-memory-bar {
  width: 100%;
  max-width: 720px;
  padding: 12px 20px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.6);
}

.tv-memory-bar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.tv-memory-secs {
  font-size: 1.8rem;
  color: #fde047;
}

/* التلميح وبطاقة الإجابة التلفزيونية */
.tv-q-hint {
  max-width: 960px;
  padding: 14px 28px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: clamp(1.25rem, 2.1vw, 1.85rem);
  font-weight: 800;
  animation: fadeSlideIn 0.25s ease;
}

.tv-q-answer-card {
  width: 100%;
  max-width: 980px;
  padding: 20px 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(6, 95, 70, 0.3));
  border: 2px solid rgba(52, 211, 153, 0.78);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.24);
  animation: fadeSlideIn 0.26s ease;
}

.tv-answer-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: #6ee7b7;
  margin-bottom: 6px;
}

.tv-answer-text {
  font-size: clamp(1.85rem, 3.4vw, 3rem);
  font-weight: 900;
  color: #ffffff;
}

.tv-answer-exp {
  margin-top: 10px;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  color: #d1fae5;
  font-weight: 600;
}

.tv-answer-img {
  margin-top: 12px;
  max-height: 24vh;
  max-width: 100%;
  border-radius: 14px;
}

/* شاشة الفائز والإحصائيات على التلفزيون */
.tv-winner-screen {
  align-items: center;
  justify-content: center;
}

.tv-winner-card {
  width: min(1060px, 100%);
  padding: clamp(24px, 3.6vh, 42px) clamp(24px, 3.5vw, 48px);
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(7, 11, 28, 0.98));
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.8);
}

.tv-winner-card.winner-team-1 {
  border-color: var(--team1);
}

.tv-winner-card.winner-team-2 {
  border-color: var(--gold);
}

.tv-winner-trophy {
  font-size: 4.5rem;
  line-height: 1;
}

.tv-winner-eyebrow {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-top: 8px;
}

.tv-winner-title {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 900;
  margin: 6px 0 20px;
}

.tv-winner-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.tv-winner-team-box {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.tv-winner-team-name {
  font-size: 1.45rem;
  font-weight: 900;
}

.tv-winner-team-score {
  font-size: 3.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tv-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tv-kpi-card {
  padding: 12px;
  border-radius: 15px;
  background: rgba(6, 10, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-kpi-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fde68a;
}

.tv-kpi-lbl {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 700;
}

.tv-analytics-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tv-compare-col {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(6, 10, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-compare-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.tv-compare-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* زر ملء الشاشة العائم الذي يختفي تلقائياً عند السكون */
.tv-floating-controls {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.4s ease, transform 0.3s ease;
}

.tv-floating-controls.is-idle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.tv-float-btn {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(9, 14, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f8fafc;
  font-size: 0.86rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.tv-float-btn:hover {
  background: rgba(34, 211, 238, 0.22);
  border-color: var(--team1);
}

.tv-audio-unlock-btn {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(251, 191, 36, 0.78);
  color: #fef3c7;
}

/* 4) لوحة إحصائيات نهاية المباراة داخل نافذة الفائز (Winner Modal Analytics) */
.winner-modal-card {
  max-width: min(760px, calc(100vw - 24px));
  max-height: 92vh;
  overflow-y: auto;
}

.winner-analytics-dashboard {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(6, 10, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.11);
  text-align: right;
}

.analytics-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.analytics-tabs-group {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-tab-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: all var(--transition);
}

.analytics-tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(37, 99, 235, 0.34));
  color: #ffffff;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.analytics-kpi-card {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: center;
}

.analytics-kpi-card.kpi-good {
  border-color: rgba(16, 185, 129, 0.38);
}

.analytics-kpi-card.kpi-amber {
  border-color: rgba(245, 158, 11, 0.42);
}

.analytics-kpi-card.kpi-violet {
  border-color: rgba(139, 92, 246, 0.42);
}

.analytics-kpi-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.analytics-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.analytics-team-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.analytics-team-card {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analytics-team-card.team-1 {
  border-color: rgba(34, 211, 238, 0.36);
}

.analytics-team-card.team-2 {
  border-color: rgba(251, 146, 60, 0.36);
}

.analytics-team-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.analytics-team-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-acc-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 800;
}

.analytics-team-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.analytics-metric-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.analytics-tiers-row {
  display: flex;
  gap: 6px;
}

.tier-badge {
  flex: 1;
  text-align: center;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tier-badge.t200 {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
}

.tier-badge.t400 {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.tier-badge.t600 {
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
}

.analytics-sub-heading {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.analytics-cats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.analytics-cat-name {
  font-weight: 800;
  color: #f8fafc;
}

.analytics-cat-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cat-score-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.cat-score-pill.t1 {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
}

.cat-score-pill.t2 {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.cat-score-pill.none {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.analytics-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.analytics-event-item {
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-event-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}

.analytics-event-num {
  font-weight: 900;
  color: var(--text-muted);
}

.analytics-event-cat {
  font-weight: 800;
  color: #cbd5e1;
}

.analytics-event-tags {
  display: inline-flex;
  gap: 4px;
}

.ev-tag {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
}

.ev-tag.tag-double {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

.ev-tag.tag-steal {
  background: rgba(234, 88, 12, 0.24);
  color: #fed7aa;
}

.ev-tag.tag-hint {
  background: rgba(6, 182, 212, 0.2);
  color: #a5f3fc;
}

.ev-tag.tag-swap {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

.analytics-event-winner {
  margin-inline-start: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.analytics-event-winner.w-team-1 {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
}

.analytics-event-winner.w-team-2 {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.analytics-event-winner.w-none {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.analytics-event-q {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
}

.analytics-event-a {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6ee7b7;
}

@media (max-width: 720px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-team-compare {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   المرحلة الرابعة — الحزمة الرابعة (PWA، Wake Lock، مراجعة الأسئلة،
   النسخ الاحتياطي، التشكيلة المتوازنة، والتحكم بالصوت)
   ========================================================= */
.hero-badges-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-utility-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.offline-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 800;
  animation: pulseSoft 2.2s ease-in-out infinite;
}

.offline-badge-compact {
  padding: 0.16rem 0.5rem;
  font-size: 0.7rem;
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
}

.toast-action-btn {
  margin-inline-start: 0.5rem;
  flex-shrink: 0;
}

/* زر التشكيلة المتوازنة */
.quick-balanced-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.92rem;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.48);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.18));
  color: #e0f2fe;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-balanced-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 182, 212, 0.8);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.22);
}

/* زر ودرج تحديد السؤال للمراجعة */
.q-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.34rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.q-flag-btn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
}

.q-flag-btn.is-flagged {
  border-color: rgba(245, 158, 11, 0.75);
  background: rgba(245, 158, 11, 0.22);
  color: #fef3c7;
}

.flag-question-drawer {
  margin: 0.35rem 0 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.38);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.flag-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.flag-drawer-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fde68a;
}

.flag-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.flag-reason-chip {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flag-reason-chip:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fff;
}

.flag-reason-chip.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.78);
  color: #fef3c7;
}

.flag-drawer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.flag-note-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 11, 25, 0.75);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
}

.flag-note-input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.7);
}

.flag-drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* قسم الأسئلة المحدّدة للمراجعة داخل إدارة البنك */
.bank-flagged-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.bank-flagged-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 260px;
  overflow-y: auto;
}

.bank-flagged-empty {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.6;
}

.bank-flagged-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.flagged-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.flagged-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.flagged-reason-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 800;
}

.flagged-cat-tag {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
}

.flagged-qid {
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
}

.flagged-item-q {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f8fafc;
}

.flagged-item-a {
  font-size: 0.8rem;
  color: #6ee7b7;
  font-weight: 700;
}

.flagged-item-note {
  font-size: 0.78rem;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
}

.flagged-remove-btn {
  flex-shrink: 0;
}

/* قسم النسخ الاحتياطي والاستعادة */
.backup-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.backup-file-label {
  cursor: pointer;
}

.backup-import-preview {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.09);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.backup-preview-summary {
  font-size: 0.84rem;
  color: #e0f2fe;
  line-height: 1.65;
  margin-bottom: 0.65rem;
}

.backup-restore-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.backup-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.backup-mode-pill {
  padding: 0.34rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.backup-mode-pill.active {
  background: rgba(6, 182, 212, 0.24);
  border-color: rgba(6, 182, 212, 0.72);
  color: #ffffff;
}

.backup-confirm-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* لوحة التحكم المتقدمة بالصوت (Audio Mixer Popover) */
.audio-mixer-popover {
  position: fixed;
  top: 4.4rem;
  left: 1.2rem;
  z-index: 1200;
  width: min(330px, calc(100vw - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(11, 18, 40, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.audio-mixer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.audio-mixer-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
}

.audio-volume-row {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.7rem;
}

.audio-volume-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.audio-volume-label-row strong {
  color: #38bdf8;
  font-weight: 800;
}

.audio-volume-slider {
  width: 100%;
  accent-color: #06b6d4;
  cursor: pointer;
}

.audio-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.audio-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.8rem;
  color: #e2e8f0;
  font-weight: 700;
}

.audio-mixer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

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


/* شريط مستوى الصوت المدمج في الشريط العلوي (Inline Top-Bar Volume Control) */
.inline-volume-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem 0.2rem 0.3rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.inline-volume-control .hero-sound-btn,
.inline-volume-control .btn-icon-only {
  background: transparent;
  border: none;
  box-shadow: none;
}

.inline-volume-slider {
  width: 78px;
  height: 5px;
  accent-color: #06b6d4;
  cursor: pointer;
}

.inline-volume-slider-sm {
  width: 62px;
}

.inline-volume-pct {
  min-width: 34px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

.inline-volume-compact {
  padding: 0.12rem 0.42rem 0.12rem 0.22rem;
  gap: 0.3rem;
}

@media (max-width: 640px) {
  .inline-volume-slider {
    width: 58px;
  }
}

.timer-display.danger,
.tv-q-timer-display.danger {
  animation: timerDangerPulse 0.85s ease-in-out infinite;
}

@keyframes timerDangerPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.55);
  }
  50% {
    transform: scale(1.06);
    text-shadow: 0 0 22px rgba(239, 68, 68, 0.9);
  }
}


/* =========================================================
   المرحلة الرابعة — الحزمة الخامسة:
   دعم 2–4 فرق + التحكم التحكيمي السريع + جولة الرهان النهائي
   ========================================================= */

/* لوحة ألوان عالية التباين للفرق الأربعة (1: أزرق سماوي، 2: ذهبي، 3: زمردي، 4: بنفسجي) */
.team-3-dot {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}
.team-4-dot {
  background: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.7);
}
.team-3-accent {
  border-color: rgba(16, 185, 129, 0.35);
}
.team-4-accent {
  border-color: rgba(192, 132, 252, 0.35);
}

/* اختيار عدد الفرق في شاشة الإعداد */
.teams-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.team-count-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: rgba(6, 11, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.team-count-pill {
  padding: 0.34rem 0.78rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}

.team-count-pill:hover {
  color: #f8fafc;
}

.team-count-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(245, 158, 11, 0.22));
  border-color: rgba(6, 182, 212, 0.6);
  color: #ffffff;
}

.teams-inputs-grid[data-team-count="3"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.teams-inputs-grid[data-team-count="4"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 720px) {
  .teams-inputs-grid[data-team-count="3"],
  .teams-inputs-grid[data-team-count="4"] {
    grid-template-columns: 1fr;
  }
}

/* شريط لوحة النقاط المرن لـ 2–4 فرق (Host + TV Display) */
.scoreboard-shell {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.scoreboard-top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 14px;
  background: rgba(11, 18, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scoreboard-teams-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scoreboard-teams-grid[data-team-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scoreboard-teams-grid[data-team-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1020px) {
  .scoreboard-teams-grid[data-team-count="4"],
  .scoreboard-teams-grid[data-team-count="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .scoreboard-teams-grid[data-team-count="2"],
  .scoreboard-teams-grid[data-team-count="3"],
  .scoreboard-teams-grid[data-team-count="4"] {
    grid-template-columns: 1fr;
  }
}

.score-team-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-mini-action-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-mini-action-btn:hover {
  border-color: rgba(6, 182, 212, 0.65);
  background: rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.score-team-card.team-3-card,
.tv-team-card.team-3-card {
  border-color: rgba(16, 185, 129, 0.32);
}
.score-team-card.team-3-card.active-turn,
.tv-team-card.team-3-card.active-turn {
  border-color: #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}
.score-team-card.team-3-card .score-number,
.tv-team-card.team-3-card .tv-team-score {
  color: #34d399;
}

.score-team-card.team-4-card,
.tv-team-card.team-4-card {
  border-color: rgba(192, 132, 252, 0.34);
}
.score-team-card.team-4-card.active-turn,
.tv-team-card.team-4-card.active-turn {
  border-color: #c084fc;
  box-shadow: 0 0 24px rgba(192, 132, 252, 0.32);
}
.score-team-card.team-4-card .score-number,
.tv-team-card.team-4-card .tv-team-score {
  color: #e879f9;
}

/* نقاط الفوز على بطاقات اللوحة للفرق 3 و4 */
.q-point-btn.won-team-2::after,
.tv-point-tile.won-team-2::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.q-point-btn.won-team-3::after,
.tv-point-tile.won-team-3::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.85);
}

/* أزرار منح النقاط لـ 3 و4 فرق وشارات الدور والسرقة */
.q-turn-badge.team-3-turn,
.tv-q-turn-badge.team-3-turn,
.q-turn-badge.steal-turn-2,
.tv-q-turn-badge.steal-turn-2 {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.6);
  color: #a7f3d0;
}

.q-turn-badge.team-4-turn,
.tv-q-turn-badge.team-4-turn,
.q-turn-badge.steal-turn-3,
.tv-q-turn-badge.steal-turn-3 {
  background: rgba(192, 132, 252, 0.22);
  border-color: rgba(192, 132, 252, 0.6);
  color: #f5d0fe;
}

.steal-status-banner.steal-team-2,
.tv-q-steal-banner.steal-team-2 {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.16);
}

.steal-status-banner.steal-team-3,
.tv-q-steal-banner.steal-team-3 {
  border-color: rgba(192, 132, 252, 0.65);
  background: rgba(192, 132, 252, 0.16);
}

.steal-team-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.award-buttons-grid[data-team-count="3"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.award-buttons-grid[data-team-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn-award-team3 {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.55);
}
.btn-award-team3:hover {
  filter: brightness(1.08);
}

.btn-award-team4 {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: #ffffff;
  border: 1px solid rgba(232, 121, 249, 0.55);
}
.btn-award-team4:hover {
  filter: brightness(1.08);
}

/* ألوان الفوز والتحليلات للفرق 3 و4 */
.winner-scores-grid[data-team-count="3"],
.tv-winner-scores[data-team-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.winner-scores-grid[data-team-count="4"],
.tv-winner-scores[data-team-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .winner-scores-grid[data-team-count="3"],
  .winner-scores-grid[data-team-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.winner-team-box.team-3-box,
.tv-winner-team-box.team-3-box {
  border-color: rgba(16, 185, 129, 0.4);
}
.winner-team-box.team-3-box .winner-team-score,
.tv-winner-team-box.team-3-box .tv-winner-team-score {
  color: #34d399;
}

.winner-team-box.team-4-box,
.tv-winner-team-box.team-4-box {
  border-color: rgba(192, 132, 252, 0.42);
}
.winner-team-box.team-4-box .winner-team-score,
.tv-winner-team-box.team-4-box .tv-winner-team-score {
  color: #e879f9;
}

.winner-referee-note {
  margin: 0.45rem auto 0.25rem;
  padding: 0.42rem 0.8rem;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 0.8rem;
}

.winner-tiebreaker-btn {
  width: 100%;
  margin-bottom: 0.55rem;
}

.analytics-team-compare[data-team-count="3"],
.analytics-team-compare[data-team-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-team-card.team-3,
.tv-compare-col.team-3 {
  border-color: rgba(16, 185, 129, 0.35);
}
.analytics-team-card.team-4,
.tv-compare-col.team-4 {
  border-color: rgba(192, 132, 252, 0.35);
}

.cat-score-pill.t3 {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
.cat-score-pill.t4 {
  background: rgba(192, 132, 252, 0.18);
  color: #f0abfc;
}

.analytics-event-winner.w-team-3 {
  color: #34d399;
}
.analytics-event-winner.w-team-4 {
  color: #e879f9;
}

.ev-tag.tag-final {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

/* أشرطة بيانية لمستويات الصعوبة 200 / 400 / 600 */
.analytics-tiers-bars {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  margin-top: 0.5rem;
}

.tier-bar-row {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 0.45rem;
}

.tier-bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tier-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.tier-bar-fill.t200 { background: #06b6d4; }
.tier-bar-fill.t400 { background: #f59e0b; }
.tier-bar-fill.t600 { background: #ec4899; }

.tier-bar-num {
  font-size: 0.76rem;
  color: #cbd5e1;
  text-align: center;
}

/* شاشة التلفزيون للوحة النقاط المرنة 2–4 فرق */
.tv-scoreboard-adaptive {
  display: flex !important;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1.2rem;
}

.tv-scoreboard-top-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tv-scoreboard-teams-grid {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-scoreboard-teams-grid[data-team-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tv-scoreboard-teams-grid[data-team-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tv-standby-team.team-3 {
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}
.tv-standby-team.team-4 {
  border-color: rgba(192, 132, 252, 0.55);
  color: #f0abfc;
}

.tv-analytics-compare[data-team-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tv-analytics-compare[data-team-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* قائمة التحكم التحكيمي السريع (Referee Popover) */
.referee-popover {
  position: fixed;
  top: 5.5rem;
  right: 1.25rem;
  z-index: 1220;
  width: min(330px, calc(100vw - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(11, 18, 40, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
}

.referee-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.referee-team-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fde68a;
}

.referee-section {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.65rem;
}

.referee-section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.referee-custom-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.referee-number-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 11, 25, 0.8);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
}

.referee-quick-deltas {
  display: flex;
  gap: 0.35rem;
}

.ref-delta-chip {
  flex: 1;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.ref-delta-chip.is-neg {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.referee-powerup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  padding: 0.3rem 0;
}

.referee-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* نافذة جولة الرهان النهائي وكسر التعادل (Host + TV Display) */
.final-round-card {
  width: min(860px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.35rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.final-round-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.final-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.15rem;
}

.final-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
}

.final-header-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.final-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}

.final-step.active {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.final-round-scroll-body {
  overflow-y: auto;
  flex: 1;
  padding-inline-end: 0.25rem;
}

.final-category-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-bottom: 0.9rem;
}

.final-cat-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.final-cat-icon {
  font-size: 1.75rem;
}

.final-cat-label {
  font-size: 0.74rem;
  color: #cbd5e1;
}

.final-cat-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
}

.final-cat-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.final-phase-hint {
  font-size: 0.84rem;
  color: #cbd5e1;
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.final-wagers-grid,
.final-judgments-grid,
.final-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.final-wager-card,
.final-judge-card,
.final-result-card {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.final-wager-card.is-locked {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.09);
}

.final-wager-head,
.final-judge-info,
.final-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.final-wager-id {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.final-wager-cap {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
}

.final-wager-input-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.final-wager-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 11, 25, 0.8);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
}

.final-wager-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.wager-preset-chip {
  flex: 1;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.wager-preset-chip.is-allin {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.final-timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.final-question-card {
  margin: 0.85rem 0;
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.final-question-text {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.65;
  color: #ffffff;
  text-align: center;
}

.final-judge-heading {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fde68a;
  margin: 0.85rem 0 0.55rem;
}

.final-judge-wager-tag {
  font-size: 0.76rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  font-weight: 800;
}

.final-judge-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.final-judge-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}
.final-judge-btn.is-correct.active {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #ffffff;
}
.final-judge-btn.is-wrong.active {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
}

.final-result-card.is-correct {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.1);
}
.final-result-card.is-wrong {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.09);
}

.final-result-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.final-result-delta.pos,
.tv-final-delta.pos {
  color: #34d399;
  font-weight: 900;
  font-size: 1.1rem;
}

.final-result-delta.neg,
.tv-final-delta.neg {
  color: #f87171;
  font-weight: 900;
  font-size: 1.1rem;
}

.final-round-footer {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

.final-reveal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

/* شاشة جولة الرهان النهائي التلفزيونية (?mode=display) */
.tv-final-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.tv-final-shell {
  width: min(1220px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.tv-final-header {
  text-align: center;
}

.tv-final-eyebrow {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.35rem;
}

.tv-final-title {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  color: #ffffff;
}

.tv-final-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(6, 182, 212, 0.22));
  border: 2px solid rgba(245, 158, 11, 0.55);
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
}

.tv-final-question-card {
  width: 100%;
  padding: 2rem 2.4rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
}

.tv-final-question-text {
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.55;
  color: #ffffff;
  text-align: center;
}

.tv-final-participants-grid {
  width: 100%;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tv-final-team-card {
  padding: 1.25rem 1.4rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.tv-final-team-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: #ffffff;
}

.tv-final-cur-score {
  font-size: 1.05rem;
  color: #cbd5e1;
}

.tv-final-lock-pill {
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
}

.tv-final-lock-pill.waiting {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.tv-final-lock-pill.locked {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.tv-final-wager-reveal {
  font-size: 1.1rem;
  color: #fde68a;
}

.tv-final-delta {
  font-size: 1.8rem !important;
}

.tv-final-score-shift {
  font-size: 1.15rem;
  color: #e2e8f0;
}

.tv-final-tie-banner {
  padding: 0.85rem 1.6rem;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fde68a;
  font-size: 1.2rem;
  font-weight: 800;
}


/* =========================================================
   المرحلة الرابعة — الحزمة السادسة (المسار الأول):
   الثيمات الثلاثة + مقياس التلفزيون + لوحة المؤثرات +
   شاشة الاستراحة التلفزيونية + معاينة بطاقة النتيجة
   ========================================================= */

/* 1) نظام الثيمات عبر data-theme على العنصر الجذري */
html[data-theme="royal-gold"] {
  --bg-deep: #090b1a;
  --bg-mid: #14142b;
  --bg-surface: rgba(27, 24, 52, 0.84);
  --bg-surface-solid: #1a1834;
  --bg-surface-elevated: rgba(39, 31, 62, 0.92);
  --border-subtle: rgba(251, 191, 36, 0.22);
  --border-bright: rgba(251, 191, 36, 0.48);
  --text-primary: #fefce8;
  --text-secondary: #fde68a;
  --text-muted: #d6c598;
  --shadow-glow-primary: 0 10px 32px rgba(245, 158, 11, 0.36);
}

html[data-theme="royal-gold"] body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(217, 119, 6, 0.3) 0%, transparent 65%),
    radial-gradient(ellipse 65% 45% at 88% 12%, rgba(245, 158, 11, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, #090b1a 0%, #14142b 55%, #090a18 100%);
}

html[data-theme="royal-gold"] .studio-orb-1 {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.32), transparent 65%);
}
html[data-theme="royal-gold"] .studio-orb-2 {
  background: radial-gradient(circle, rgba(217, 119, 6, 0.26), transparent 65%);
}

html[data-theme="high-contrast"] {
  --bg-deep: #000000;
  --bg-mid: #080c16;
  --bg-surface: #0f172a;
  --bg-surface-solid: #0f172a;
  --bg-surface-elevated: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.42);
  --border-bright: rgba(255, 255, 255, 0.78);
  --text-primary: #ffffff;
  --text-secondary: #f8fafc;
  --text-muted: #e2e8f0;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.24);
}

html[data-theme="high-contrast"] body {
  background: #000000;
}

html[data-theme="high-contrast"] .studio-orb,
html[data-theme="high-contrast"] .studio-grid {
  opacity: 0.08;
}

html[data-theme="high-contrast"] .panel,
html[data-theme="high-contrast"] .modal-card,
html[data-theme="high-contrast"] .score-team-card,
html[data-theme="high-contrast"] .tv-team-card,
html[data-theme="high-contrast"] .board-cat-card,
html[data-theme="high-contrast"] .tv-board-cat-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #0f172a;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.45);
}

/* أزرار اختيار الثيم ومنزلق مقياس التلفزيون */
.theme-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.theme-pills-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.theme-choice-btn {
  padding: 0.4rem 0.78rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s ease;
}

.theme-choice-btn:hover {
  border-color: rgba(6, 182, 212, 0.6);
  color: #ffffff;
}

.theme-choice-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.26), rgba(245, 158, 11, 0.22));
  border-color: rgba(245, 158, 11, 0.72);
  color: #ffffff;
}

.tv-scale-setup-row {
  flex-direction: column;
  align-items: stretch !important;
  gap: 0.4rem;
}

.tv-scale-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tv-scale-slider {
  flex: 1;
  accent-color: #f59e0b;
  cursor: pointer;
}

/* ضمان عدم ظهور شريط تمرير أفقي على شاشة التلفزيون عند التكبير حتى 130% */
body.display-tv-mode {
  overflow-x: hidden;
  max-width: 100vw;
}

body.display-tv-mode .tv-display-root,
body.display-tv-mode .tv-screen {
  max-width: 100vw;
  overflow-x: hidden;
}

/* قوائم أدوات المقدّم العائمة (المؤثرات، الاستراحة، المظهر) */
.host-tool-popover {
  position: fixed;
  top: 4.5rem;
  left: 1.25rem;
  z-index: 1240;
  width: min(350px, calc(100vw - 2rem));
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: rgba(11, 18, 40, 0.96);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(18px);
}

.soundboard-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.soundboard-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.58rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.soundboard-btn:hover {
  border-color: rgba(6, 182, 212, 0.65);
  background: rgba(6, 182, 212, 0.18);
  transform: translateX(-2px);
}

.soundboard-btn.is-firing {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.25);
}

.sb-icon {
  font-size: 1.15rem;
}

.sb-label {
  flex: 1;
  text-align: right;
}

.q-mini-tool-btn {
  padding: 0.34rem 0.52rem;
}

/* شاشة وإعدادات الاستراحة التلفزيونية */
.intermission-form-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.intermission-dur-label {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.intermission-duration-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.intermission-dur-pill {
  padding: 0.38rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.intermission-dur-pill.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.72);
  color: #fef3c7;
}

.host-intermission-active-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.6);
}

.host-intermission-pill {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fde68a;
}

.is-intermission-live {
  border-color: rgba(245, 158, 11, 0.8) !important;
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fef3c7 !important;
}

/* طبقة شاشة الاستراحة الكاملة على التلفزيون (?mode=display) */
.tv-intermission-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(5, 9, 22, 0.92);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.tv-intermission-overlay[hidden] {
  display: none !important;
}

.tv-intermission-card {
  width: min(1040px, 94vw);
  padding: 2.6rem 2.8rem;
  border-radius: 30px;
  background: var(--bg-surface);
  border: 2px solid var(--border-bright);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
}

.tv-intermission-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.35rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  font-size: 1.15rem;
  font-weight: 800;
}

.tv-intermission-title {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.3rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.35;
}

.tv-intermission-timer {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #38bdf8;
  padding: 0.25rem 1.8rem;
  border-radius: 20px;
  background: rgba(6, 182, 212, 0.14);
  border: 2px solid rgba(6, 182, 212, 0.45);
}

.tv-intermission-timer.is-ended {
  color: #fde68a;
  border-color: #f59e0b;
}

.tv-intermission-standings-wrap {
  width: 100%;
  margin-top: 0.4rem;
}

.tv-intermission-standings-label {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
}

.tv-intermission-standings {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tv-intermission-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.14);
  font-size: 1.2rem;
}

.tv-intermission-rank {
  font-weight: 900;
  color: #fbbf24;
}

.tv-intermission-team-name {
  flex: 1;
  text-align: right;
  font-weight: 800;
  color: var(--text-primary);
}

.tv-intermission-team-score {
  font-size: 1.55rem;
  font-weight: 900;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

/* نافذة معاينة وحفظ بطاقة النتيجة (1080×1350) */
.winner-result-card-btn {
  width: 100%;
  margin-bottom: 0.55rem;
}

.result-card-modal-card {
  width: min(520px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem;
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.result-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
}

.result-card-preview-wrap {
  flex: 1;
  min-height: 240px;
  max-height: 64vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(6, 11, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.5rem;
  margin-bottom: 0.85rem;
}

.result-card-loading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #cbd5e1;
}

.result-card-preview-img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.result-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}


/* =========================================================
   المرحلة الرابعة — الحزمة السابعة (المسار الثاني):
   1) شريط إطلاق الأطوار السريعة وقاعة المشاهير
   2) المربعات الذهبية المخفية (Hidden Daily Double)
   3) طور جولة البرق السريعة وطور «من غير كلام» المستقل (Host + TV)
   4) قاعة المشاهير وأرشيف المباريات (Hall of Fame & Match Archive)
   ========================================================= */

/* 1) شريط إطلاق الأطوار السريعة وقاعة المشاهير */
.mode-launcher-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.mode-launch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  color: var(--text-primary);
  text-align: right;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.mode-launch-card:hover {
  transform: translateY(-2px);
}

.mode-launch-card.mode-blitz {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.8));
}
.mode-launch-card.mode-blitz:hover {
  border-color: #fbbf24;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.22);
}

.mode-launch-card.mode-charades {
  border-color: rgba(249, 115, 22, 0.42);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(15, 23, 42, 0.8));
}
.mode-launch-card.mode-charades:hover {
  border-color: #fb923c;
  box-shadow: 0 10px 26px rgba(249, 115, 22, 0.22);
}

.mode-launch-card.mode-hof {
  border-color: rgba(34, 211, 238, 0.4);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(15, 23, 42, 0.8));
}
.mode-launch-card.mode-hof:hover {
  border-color: #22d3ee;
  box-shadow: 0 10px 26px rgba(6, 182, 212, 0.22);
}

.mode-launch-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.mode-launch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mode-launch-text strong {
  font-size: 0.96rem;
  font-weight: 900;
  color: #ffffff;
}

.mode-launch-text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* 2) المربعات الذهبية المخفية (Hidden Daily Double) */
.daily-double-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.16));
  border: 1.5px solid rgba(251, 191, 36, 0.72);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.24);
  margin-bottom: 12px;
  animation: fadeSlideIn 0.25s ease;
}

.daily-double-banner .dd-star {
  font-size: 1.8rem;
  line-height: 1;
}

.daily-double-banner strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fef3c7;
}

.daily-double-banner span {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fde68a;
}

.daily-double-wager-panel {
  padding: 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

.dd-wager-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dd-wager-team-label {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fef08a;
}

.dd-wager-bounds-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.dd-wager-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dd-wager-input-row .final-wager-input {
  flex: 1 1 160px;
  font-size: 1.35rem;
  text-align: center;
  font-weight: 900;
}

.dd-wager-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dd-wager-rule-note {
  margin: 0;
  font-size: 0.84rem;
  color: #fde68a;
  font-weight: 600;
  line-height: 1.5;
}

.dd-resolve-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dd-resolve-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ev-tag.tag-dd {
  background: rgba(245, 158, 11, 0.24);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fef3c7;
}

/* شاشة التلفزيون للمربع الذهبي */
.tv-q-dd-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(180, 83, 9, 0.28));
  border: 2px solid #fbbf24;
  color: #fef3c7;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 900;
  box-shadow: 0 0 36px rgba(245, 158, 11, 0.32);
}

.tv-q-dd-wager-pill {
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1.5px solid #fde047;
  color: #fef08a;
  font-size: 0.92em;
}

.tv-dd-wager-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: clamp(28px, 5vh, 56px) 24px;
  border-radius: 28px;
  background: radial-gradient(circle at top, rgba(245, 158, 11, 0.28), rgba(15, 23, 42, 0.88));
  border: 2px solid rgba(251, 191, 36, 0.78);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 48px rgba(245, 158, 11, 0.25);
  max-width: 820px;
  width: 100%;
  margin: auto;
}

.tv-dd-star-badge {
  font-size: clamp(3.4rem, 6vw, 5.2rem);
  line-height: 1;
  animation: pulseSoft 1.8s infinite;
}

.tv-dd-stage-title {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 900;
  color: #fef08a;
  margin: 0;
}

.tv-dd-stage-team {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.tv-dd-stage-bounds {
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 800;
}

/* 3) نوافذ الأطوار المستقلة (جولة البرق السريعة + من غير كلام المستقل) */
.side-mode-card {
  max-width: 840px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.side-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.65);
}

.side-mode-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-mode-scroll-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.side-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.side-config-box {
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-team-names-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.side-team-input,
.side-select-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 14, 30, 0.85);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
}

.csolo-categories-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.csolo-cat-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.csolo-cat-chip.active {
  background: rgba(249, 115, 22, 0.26);
  border-color: #fb923c;
  color: #ffedd5;
}

.side-mode-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.side-ready-box,
.side-finish-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 8px;
}

.side-ready-title {
  font-size: 1.7rem;
  font-weight: 900;
  margin: 0;
}

.side-ready-desc {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 0.96rem;
  font-weight: 600;
  margin: 0;
}

.side-mini-scores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.side-mini-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.blitz-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.blitz-hud-team {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.blitz-score-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #cffafe;
  font-weight: 900;
}

.blitz-streak-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), rgba(239, 68, 68, 0.25));
  border: 1px solid #fb923c;
  color: #ffedd5;
  font-weight: 900;
}

.blitz-hud-timer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blitz-question-stage {
  margin: 14px 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blitz-q-text {
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  font-weight: 800;
  line-height: 1.6;
  margin: 0;
  color: #ffffff;
}

.blitz-answer-cockpit {
  margin-top: 2px;
}

.blitz-judge-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.blitz-big-btn {
  padding: 14px 12px;
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.csolo-header-card {
  margin: 12px 0;
}

.side-summary-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 10px;
  text-align: center;
}

.side-summary-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.side-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.side-summary-item {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.side-summary-q {
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.side-summary-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.side-summary-a {
  font-size: 0.86rem;
  font-weight: 700;
  color: #a7f3d0;
}

.side-finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

/* شاشات التلفزيون لطور البرق وطور من غير كلام المستقل */
.tv-side-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: clamp(14px, 2vh, 24px);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.tv-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.84);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.tv-side-team-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tv-side-mode-tag {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  font-weight: 900;
  font-size: 1.05rem;
}

.tv-side-team-name {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  font-weight: 900;
}

.tv-side-score-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tv-blitz-streak {
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #ffffff;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 900;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.5);
}

.tv-side-score-val {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 900;
  color: #38bdf8;
  line-height: 1;
}

.tv-side-timer-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tv-side-giant-timer {
  font-size: clamp(3.6rem, 7vw, 6.2rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.tv-side-giant-timer.danger {
  color: #f87171;
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.65);
  animation: pulseSoft 0.7s infinite;
}

.tv-side-timer-track {
  max-width: 780px;
  width: 100%;
  height: 14px;
}

.tv-side-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vh, 42px);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

@keyframes tvFlashCorrect {
  0% { background: rgba(16, 185, 129, 0.34); border-color: #34d399; }
  100% { background: rgba(15, 23, 42, 0.8); border-color: rgba(255, 255, 255, 0.14); }
}

@keyframes tvFlashWrong {
  0% { background: rgba(239, 68, 68, 0.32); border-color: #f87171; }
  100% { background: rgba(15, 23, 42, 0.8); border-color: rgba(255, 255, 255, 0.14); }
}

.tv-side-stage.flash-correct {
  animation: tvFlashCorrect 0.55s ease;
}

.tv-side-stage.flash-wrong {
  animation: tvFlashWrong 0.55s ease;
}

.tv-side-play-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 1080px;
}

.tv-blitz-q-text {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 900;
  line-height: 1.45;
  color: #ffffff;
  margin: 0;
}

.tv-side-ready-icon {
  font-size: clamp(3.2rem, 6vw, 5rem);
}

.tv-side-ready-title {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 900;
  margin: 8px 0;
}

.tv-side-ready-sub {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--text-secondary);
  font-weight: 700;
}

.tv-side-standings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.tv-side-standing-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 800;
}

.tv-side-summary-box {
  width: 100%;
  max-width: 1040px;
  text-align: right;
}

.tv-side-summary-heading {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 900;
  margin: 0 0 14px;
  text-align: center;
}

.tv-side-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tv-side-summary-item {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tv-side-summary-q {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.tv-side-summary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
}

.tv-sum-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
}
.tv-sum-badge.ok { background: rgba(16, 185, 129, 0.22); color: #a7f3d0; }
.tv-sum-badge.bad { background: rgba(239, 68, 68, 0.22); color: #fecaca; }
.tv-sum-badge.skip { background: rgba(148, 163, 184, 0.22); color: #e2e8f0; }

/* 4) قاعة المشاهير وأرشيف المباريات (Hall of Fame & Match Archive) */
.hof-modal-card {
  max-width: 920px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.hof-records-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hof-record-card {
  padding: 14px 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.52));
  border: 1px solid rgba(251, 191, 36, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hof-rec-icon {
  font-size: 1.5rem;
}

.hof-rec-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fef08a;
}

.hof-rec-lbl {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
}

.hof-rec-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.hof-table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hof-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: center;
}

.hof-leaderboard-table th,
.hof-leaderboard-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hof-leaderboard-table th {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-secondary);
  font-weight: 800;
}

.hof-leaderboard-table tr.is-rank-1 {
  background: rgba(245, 158, 11, 0.14);
}

.hof-mode-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hof-filter-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.hof-filter-pill.active {
  background: rgba(6, 182, 212, 0.26);
  border-color: #22d3ee;
  color: #ecfeff;
}

.hof-archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hof-archive-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hof-archive-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.hof-archive-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hof-mode-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}
.hof-mode-badge.mode-classic { background: rgba(6, 182, 212, 0.2); color: #cffafe; }
.hof-mode-badge.mode-blitz { background: rgba(245, 158, 11, 0.24); color: #fef3c7; }
.hof-mode-badge.mode-charades { background: rgba(249, 115, 22, 0.24); color: #ffedd5; }

.hof-archive-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.hof-archive-winner {
  font-size: 0.84rem;
  font-weight: 800;
  color: #fde68a;
}

.hof-archive-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hof-archive-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hof-team-chip {
  padding: 4px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
}

.hof-team-chip.is-winner {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.18);
  color: #fef3c7;
}

.hof-archive-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* استجابة الهواتف والشاشات المتوسطة للحزمة السابعة */
@media (max-width: 768px) {
  .mode-launcher-bar {
    grid-template-columns: 1fr;
  }
  .side-config-grid,
  .dd-resolve-grid,
  .tv-side-summary-list {
    grid-template-columns: 1fr;
  }
  .hof-records-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blitz-judge-actions {
    grid-template-columns: 1fr;
  }
}

/* دعم ثيم التباين العالي لعناصر الحزمة السابعة */
:root[data-theme="high-contrast"] .mode-launch-card,
:root[data-theme="high-contrast"] .daily-double-wager-panel,
:root[data-theme="high-contrast"] .hof-record-card,
:root[data-theme="high-contrast"] .hof-archive-card {
  background: #000000;
  border-color: #facc15;
}


/* =========================================================
   المرحلة الرابعة — الحزمة التاسعة (المسار الرابع):
   1) نافذة الغرفة اللاسلكية + رموز QR المحلية + إعدادات Firebase
   2) طبقات التلفزيون (بطاقة QR الفرق + شريط فائز جرس السرعة)
   3) واجهة ريموت المقدّم على الهاتف (?mode=remote)
   4) واجهة هاتف الفريق — جرس السرعة والرهان السري (?mode=player)
   ========================================================= */

/* 1) نافذة الغرفة اللاسلكية وشريط الجرس */
.wireless-modal-card {
  max-width: 900px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.wireless-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.wireless-status-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wireless-code-pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.22);
  border: 1.5px solid #22d3ee;
  color: #ecfeff;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.wireless-top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wireless-feedback-box {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
}
.wireless-feedback-box.is-info { background: rgba(6, 182, 212, 0.16); border: 1px solid rgba(34, 211, 238, 0.45); color: #cffafe; }
.wireless-feedback-box.is-success { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(52, 211, 153, 0.5); color: #a7f3d0; }
.wireless-feedback-box.is-warning { background: rgba(245, 158, 11, 0.2); border: 1px solid rgba(251, 191, 36, 0.55); color: #fef3c7; }
.wireless-feedback-box.is-error { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(248, 113, 113, 0.55); color: #fecaca; }

.wireless-settings-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wireless-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.wireless-settings-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.wireless-paste-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.wireless-snippet-input {
  flex: 1 1 260px;
  font-family: monospace;
  font-size: 0.8rem;
  direction: ltr;
  text-align: left;
}

.wireless-cfg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wireless-cfg-grid input {
  direction: ltr;
  text-align: left;
  font-size: 0.84rem;
}

.wireless-cfg-span-2 {
  grid-column: span 2;
}

.wireless-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wireless-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.wireless-qr-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.wireless-qr-card.is-host-qr {
  border-color: rgba(245, 158, 11, 0.5);
}

.wireless-qr-card.is-player-qr {
  border-color: rgba(34, 211, 238, 0.5);
}

.wireless-qr-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  text-align: right;
}

.wireless-qr-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.wireless-qr-sub {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.wireless-qr-svg-wrap {
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  line-height: 0;
}

.wireless-qr-masked {
  width: 216px;
  height: 216px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px dashed rgba(251, 191, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #fde68a;
  font-weight: 800;
  font-size: 0.88rem;
}

.wireless-player-code-display {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ecfeff;
  letter-spacing: 0.08em;
}

.wireless-player-code-display strong {
  font-size: 1.4rem;
  color: #38bdf8;
}

.wireless-connected-teams {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.wireless-team-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 700;
}

.wireless-qr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.wireless-buzzer-result-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}

.wireless-buzzer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.wireless-buzzer-host-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  margin: 0 18px 8px;
}

.wb-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.wb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 2) طبقات التلفزيون للغرفة اللاسلكية (QR الفرق + فائز الجرس) */
.tv-buzzer-banner {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.94), rgba(5, 150, 105, 0.94));
  border: 2px solid #a7f3d0;
  color: #ffffff;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 900;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
  animation: fadeSlideIn 0.2s ease;
}

.tv-buzzer-delta {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.75em;
  direction: ltr;
}

.tv-player-qr-card {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 190;
  padding: 12px;
  border-radius: 18px;
  background: rgba(11, 18, 40, 0.94);
  border: 2px solid rgba(34, 211, 238, 0.65);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.tv-qr-head {
  font-size: 0.95rem;
  font-weight: 900;
  color: #cffafe;
}

.tv-player-qr-svg {
  padding: 6px;
  border-radius: 10px;
  background: #ffffff;
  line-height: 0;
}

.tv-qr-code-pill {
  font-size: 1rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.08em;
}

/* 3) واجهة ريموت المقدّم على الهاتف (?mode=remote) — Mobile-First بدون تمرير أفقي */
body.remote-host-mode,
body.player-mobile-mode {
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.remote-host-root,
.player-view-root {
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  z-index: 50;
}

.rh-shell {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 24px;
  gap: 10px;
}

.rh-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 40, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rh-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rh-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rh-room-badge {
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.22);
  border: 1px solid #22d3ee;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.rh-conn-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.rh-conn-pill.is-online { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; }
.rh-conn-pill.is-reconnecting { background: rgba(245, 158, 11, 0.22); color: #fef3c7; }
.rh-conn-pill.is-offline { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.rh-undo-btn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.rh-scores-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rh-scores-placeholder {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rh-score-chip {
  flex: 1 1 44%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

.rh-score-chip.is-turn {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

.rh-score-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.rh-score-val {
  font-size: 0.95rem;
  font-weight: 900;
}

.rh-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rh-tab-btn {
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
}

.rh-tab-btn.active {
  background: rgba(6, 182, 212, 0.24);
  border-color: #22d3ee;
  color: #ffffff;
}

.rh-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rh-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rh-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 900;
  font-size: 0.92rem;
}

.rh-touch-btn {
  min-height: 48px;
  width: 100%;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 10px 10px;
}

.rh-mini-btn {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.rh-btn-row {
  display: grid;
  gap: 8px;
}
.rh-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rh-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rh-span-2 { grid-column: span 2; }

.rh-buzzer-winner {
  color: #a7f3d0;
  font-size: 0.88rem;
}
.rh-delta-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.25);
  direction: ltr;
  display: inline-block;
}
.rh-buzzer-open-note { color: #fef08a; font-size: 0.84rem; }
.rh-buzzer-locked-note { color: var(--text-secondary); font-size: 0.82rem; }

.rh-board-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rh-board-cat {
  padding: 10px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rh-board-cat-title {
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.rh-board-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.rh-cell-btn {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 900;
  cursor: pointer;
}
.rh-cell-btn.is-played {
  opacity: 0.3;
  text-decoration: line-through;
}
.rh-cell-btn.is-secret-dd {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
}

.rh-secret-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(6, 78, 59, 0.3);
  border: 1.5px solid rgba(52, 211, 153, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rh-secret-box.is-dd {
  background: rgba(180, 83, 9, 0.25);
  border-color: #fbbf24;
}
.rh-secret-label { font-size: 0.76rem; font-weight: 800; color: #a7f3d0; }
.rh-secret-answer { font-size: 1.15rem; font-weight: 900; color: #ffffff; }
.rh-secret-meta { font-size: 0.84rem; color: #e2e8f0; }

.rh-question-text {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.55;
}

.rh-timer-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums;
}

.rh-dd-wager-row {
  display: flex;
  gap: 8px;
}

.rh-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(9, 14, 30, 0.9);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

.rh-alert-card {
  text-align: center;
  align-items: center;
  padding: 22px 16px;
}
.rh-alert-icon { font-size: 2.4rem; }
.rh-alert-title { margin: 0; font-size: 1.15rem; font-weight: 900; }
.rh-alert-desc { margin: 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }

.rh-ref-team,
.rh-final-row {
  padding: 10px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rh-ref-team-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rh-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #22d3ee;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  z-index: 90;
}

/* 4) واجهة هاتف الفريق — جرس السرعة والرهان السري (?mode=player) */
.pl-shell {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 24px;
  gap: 14px;
}

.pl-join-hero {
  text-align: center;
  padding-top: 8px;
}

.pl-brand-title {
  margin: 8px 0 0;
  font-size: 2.4rem;
  font-weight: 900;
}

.pl-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pl-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.pl-room-row {
  display: flex;
  gap: 8px;
}

.pl-room-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(9, 14, 30, 0.9);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pl-answer-input {
  letter-spacing: normal;
  text-transform: none;
  font-size: 1rem;
  text-align: right;
}

.pl-touch-btn {
  min-height: 50px;
  padding: 0 18px;
  font-size: 0.98rem;
  font-weight: 900;
}

.pl-full-btn {
  width: 100%;
}

.pl-error-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  font-size: 0.84rem;
  font-weight: 700;
}

.pl-section-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
}

.pl-sub-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.pl-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pl-team-pick-card {
  min-height: 84px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(9, 14, 30, 0.72);
  color: #ffffff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.pl-team-pick-card.team-1 { border-color: rgba(6, 182, 212, 0.6); }
.pl-team-pick-card.team-2 { border-color: rgba(245, 158, 11, 0.6); }
.pl-team-pick-card.team-3 { border-color: rgba(16, 185, 129, 0.6); }
.pl-team-pick-card.team-4 { border-color: rgba(217, 70, 239, 0.6); }
.pl-team-pick-card:disabled { opacity: 0.45; cursor: not-allowed; }
.pl-team-pick-name { font-size: 0.96rem; font-weight: 900; }
.pl-team-pick-score { font-size: 0.8rem; color: var(--text-secondary); }

.pl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pl-topbar-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pl-team-title {
  font-size: 0.96rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-team-score {
  font-size: 0.84rem;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
}

.pl-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pl-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pl-buzzer-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.pl-buzzer-btn {
  width: min(290px, 78vw);
  height: min(290px, 78vw);
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.22);
  font-family: inherit;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pl-buzzer-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.pl-buzzer-btn.state-locked {
  background: radial-gradient(circle at top, #334155, #1e293b);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  cursor: not-allowed;
}

.pl-buzzer-btn.state-open.team-1 {
  background: radial-gradient(circle at top, #22d3ee, #0284c7);
  border-color: #a5f3fc;
  box-shadow: 0 0 46px rgba(6, 182, 212, 0.65);
}
.pl-buzzer-btn.state-open.team-2 {
  background: radial-gradient(circle at top, #fbbf24, #d97706);
  border-color: #fde68a;
  box-shadow: 0 0 46px rgba(245, 158, 11, 0.65);
}
.pl-buzzer-btn.state-open.team-3 {
  background: radial-gradient(circle at top, #34d399, #059669);
  border-color: #a7f3d0;
  box-shadow: 0 0 46px rgba(16, 185, 129, 0.65);
}
.pl-buzzer-btn.state-open.team-4 {
  background: radial-gradient(circle at top, #e879f9, #a21caf);
  border-color: #f5d0fe;
  box-shadow: 0 0 46px rgba(217, 70, 239, 0.65);
}

.pl-buzzer-btn.state-winner {
  background: radial-gradient(circle at top, #34d399, #047857);
  border-color: #a7f3d0;
  box-shadow: 0 0 54px rgba(16, 185, 129, 0.8);
}

.pl-buzzer-btn.state-lost {
  background: radial-gradient(circle at top, #7f1d1d, #450a0a);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.pl-buzzer-icon { font-size: 3.1rem; line-height: 1; }
.pl-buzzer-label { font-size: 1.35rem; font-weight: 900; }
.pl-buzzer-sub { font-size: 0.84rem; font-weight: 700; opacity: 0.92; }

.pl-wager-card {
  text-align: center;
  align-items: center;
}

.pl-wager-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.pl-wager-big-val {
  font-size: 2.8rem;
  font-weight: 900;
  color: #fef08a;
  line-height: 1.1;
}

.pl-wager-range {
  width: 100%;
  accent-color: #fbbf24;
  height: 32px;
}

.pl-preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.pl-final-q {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.6;
  margin: 4px 0;
}

@media (max-width: 768px) {
  .wireless-qr-grid,
  .wireless-cfg-grid {
    grid-template-columns: 1fr;
  }
  .wireless-cfg-span-2 {
    grid-column: span 1;
  }
}

/* =========================================================
   الحزمة العاشرة (Pack 10): تشخيص حزمة البيانات، إدارة الأجهزة، قفل الغرفة، والطرد
   ========================================================= */
.wireless-diagnostics-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.wireless-diagnostics-bar strong {
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}

.wireless-room-guard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.wireless-devices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.wireless-device-team-group {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wireless-device-team-group.has-dup {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(180, 83, 9, 0.14);
}

.wireless-device-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.wireless-device-team-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}
.wireless-device-count-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.wireless-dup-warning,
.rh-dup-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.wireless-team-count-chip.has-dup {
  border-color: rgba(251, 191, 36, 0.75);
}

.wireless-device-team-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wireless-device-row,
.rh-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wireless-device-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wireless-device-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.75);
  flex-shrink: 0;
}

.wireless-device-label,
.rh-device-name {
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wireless-device-id {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.wireless-device-empty,
.rh-device-empty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 2px;
}

/* قائمة الأجهزة داخل تبويب أدوات المقدّم في الريموت */
.rh-devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.rh-device-group {
  padding: 10px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rh-device-group.has-dup {
  border-color: rgba(251, 191, 36, 0.65);
}
.rh-device-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rh-device-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* شاشات وحالات هاتف الفريق الجديدة (قفل الغرفة، حد الفريق، الطرد، المؤقت الحي) */
.pl-label-input {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.96rem;
  text-align: right;
  min-height: 44px;
}

.pl-locked-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  color: #fef08a;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.pl-team-pick-card.is-team-full {
  opacity: 0.55;
  border-style: dashed;
}

.pl-team-cap-note {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fca5a5;
  text-align: center;
  line-height: 1.35;
}

.pl-kicked-card {
  text-align: center;
  align-items: center;
  padding: 28px 18px;
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(127, 29, 29, 0.35);
}
.pl-kicked-icon {
  font-size: 3.2rem;
  line-height: 1;
}
.pl-kicked-title {
  margin: 4px 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #fecaca;
}

.pl-timer-strip {
  display: flex;
  justify-content: center;
}
.pl-timer-pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
  font-size: 0.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   لعبة «برا السالفة» (الوضع المحلي + اللاسلكي + هاتف اللاعب + التلفزيون)
   ========================================================= */
.mode-launch-card.mode-bara-salfa {
  border-color: rgba(168, 85, 247, 0.45);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.32), rgba(15, 23, 42, 0.86));
}
.mode-launch-card.mode-bara-salfa:hover {
  border-color: rgba(192, 132, 252, 0.85);
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.28);
}

.bara-salfa-modal-card {
  width: min(920px, 96vw);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
}
.bara-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bara-salfa-body {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bs-setup-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bs-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bs-mode-tab {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}
.bs-mode-tab.active {
  border-color: #c084fc;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(56, 189, 248, 0.18));
  color: #ffffff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.22);
}

.bs-section {
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bs-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.bs-sec-head h3,
.bs-sec-head h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 900;
}
.bs-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.bs-add-player-row {
  display: flex;
  gap: 8px;
}
.bs-players-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bs-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  font-weight: 800;
}
.bs-chip-del {
  border: none;
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
}

.bs-wl-init-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.bs-wl-active-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.bs-wl-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bs-wl-players-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bs-wl-guard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bs-wl-roster-head {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.bs-wl-roster-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
}
.bs-mini-score {
  font-size: 0.76rem;
  color: #7dd3fc;
}

.bs-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.bs-opt-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bs-opt-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.bs-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bs-cat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bs-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.bs-cat-chip {
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 14, 30, 0.7);
  color: #ffffff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-align: center;
}
.bs-cat-chip.active {
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}
.bs-cat-ico { font-size: 1.4rem; }
.bs-cat-name { font-size: 0.84rem; font-weight: 800; }
.bs-cat-meta { font-size: 0.72rem; color: var(--text-secondary); }

.bs-custom-panel {
  padding: 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.82);
  border: 1px solid rgba(192, 132, 252, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bs-custom-form-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
}
.bs-icon-input { text-align: center; font-size: 1.2rem; }
.bs-words-textarea { resize: vertical; font-family: inherit; }
.bs-custom-feedback { font-size: 0.82rem; font-weight: 800; color: #fde68a; }
.bs-custom-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bs-custom-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bs-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
}
.bs-custom-item-btns { display: flex; gap: 6px; }

.bs-footer-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* بطاقات مراحل اللعب الثماني */
.bs-stage-card {
  padding: 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.bs-stage-badge {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #f3e8ff;
  font-size: 0.84rem;
  font-weight: 800;
}
.bs-stage-title { margin: 0; font-size: 1.45rem; font-weight: 900; }
.bs-stage-sub { margin: 0; font-size: 0.92rem; color: var(--text-secondary); max-width: 560px; }
.bs-progress-big { font-size: 2rem; font-weight: 900; color: #38bdf8; }

.bs-status-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.bs-status-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  font-weight: 800;
}
.bs-status-chip.is-done {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(6, 78, 59, 0.45);
  color: #a7f3d0;
}

.bs-secret-reveal-box {
  width: min(460px, 100%);
  min-height: 150px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.88);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.bs-secret-reveal-box .bs-secret-content { display: none; }
.bs-secret-reveal-box.is-revealed .bs-secret-curtain { display: none; }
.bs-secret-reveal-box.is-revealed .bs-secret-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bs-secret-reveal-box.is-revealed.is-insider {
  border-style: solid;
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.45);
}
.bs-secret-reveal-box.is-revealed.is-outsider {
  border-style: solid;
  border-color: #f59e0b;
  background: rgba(120, 53, 15, 0.48);
}
.bs-secret-cat { font-size: 0.9rem; font-weight: 800; color: #cbd5e1; }
.bs-insider-label, .bp-role-insider-lbl { font-size: 0.88rem; color: #a7f3d0; font-weight: 800; }
.bs-secret-word, .bp-role-word { font-size: 2rem; font-weight: 900; color: #ffffff; }
.bs-outsider-alert, .bp-role-outsider { font-size: 1.55rem; font-weight: 900; color: #fde68a; }
.bs-outsider-tip { margin: 0; font-size: 0.88rem; color: #fef3c7; }
.bs-hold-btn { min-height: 56px; user-select: none; -webkit-user-select: none; touch-action: none; }
.bs-hold-btn.is-holding { transform: scale(0.97); box-shadow: 0 0 28px rgba(245, 158, 11, 0.65); }

.bs-pair-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
  padding: 12px 0;
}
.bs-pair-player {
  min-width: 170px;
  padding: 14px 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bs-pair-player.is-asker { background: rgba(6, 182, 212, 0.2); border: 1.5px solid #22d3ee; }
.bs-pair-player.is-target { background: rgba(245, 158, 11, 0.2); border: 1.5px solid #fbbf24; }
.bs-pair-role { font-size: 0.78rem; color: var(--text-secondary); font-weight: 800; }
.bs-pair-player strong { font-size: 1.4rem; font-weight: 900; }
.bs-pair-arrow { font-size: 1.15rem; font-weight: 900; color: #e2e8f0; }

.bs-disc-timer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bs-disc-timer-num {
  font-size: 3.4rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #38bdf8;
}
.bs-disc-timer-num.danger { color: #f87171; }
.bs-timer-btns { display: flex; gap: 8px; }

.bs-vote-grid,
.bs-choices-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.bs-vote-btn,
.bs-choice-btn {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 900;
}
.bs-choice-pill {
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.bs-outsider-reveal-banner,
.bs-secret-reveal-final {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.2));
  border: 1.5px solid #fbbf24;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bs-secret-reveal-final {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.2));
  border-color: #34d399;
}
.bs-reveal-eyebrow { font-size: 0.9rem; font-weight: 800; color: #fde68a; }
.bs-reveal-names,
.bs-secret-reveal-final strong { font-size: 1.9rem; font-weight: 900; color: #ffffff; }

.bs-top-voted-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-size: 0.9rem;
}

.bs-votes-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bs-vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(9, 14, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.bs-vote-row.is-hit {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(6, 78, 59, 0.32);
}
.bs-vote-arrow { font-size: 0.8rem; color: var(--text-secondary); }

.bs-results-columns {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  text-align: right;
}
.bs-res-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bs-res-box h3 { margin: 0; font-size: 0.96rem; font-weight: 900; }
.bs-res-list { display: flex; flex-direction: column; gap: 6px; }
.bs-res-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
}
.bs-res-row.is-win,
.bs-res-row.is-leader {
  border: 1px solid rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.35);
}
.bs-res-reason { font-size: 0.78rem; color: var(--text-secondary); }
.bs-res-delta { font-size: 1.05rem; color: #34d399; }
.bs-res-total { font-size: 1rem; color: #7dd3fc; }
.bs-role-tag {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.bs-stage-actions,
.bs-stage-sub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* واجهة هاتف لاعب برا السالفة (?mode=bara-player) */
.bp-center-card { text-align: center; align-items: center; }
.bp-big-icon { font-size: 3rem; line-height: 1; }
.bp-role-cat { font-size: 0.9rem; font-weight: 800; color: #cbd5e1; }
.bp-pair-box {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1.15rem;
}
.bp-live-timer {
  font-size: 2.6rem;
  font-weight: 900;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}
.bp-mini-secret { min-height: 110px; }
.bp-vote-list { display: flex; flex-direction: column; gap: 8px; }
.bp-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bp-reveal-names { font-size: 1.8rem; font-weight: 900; color: #fde68a; }
.bp-my-delta {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
}
.bp-my-delta.is-win {
  background: rgba(6, 78, 59, 0.45);
  border: 1px solid #34d399;
}

/* شاشة التلفزيون للعبة «برا السالفة» (?mode=display) */
.tv-bara-stage {
  width: min(1120px, 94vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82dvh;
}
.tv-bara-card {
  width: 100%;
  padding: 36px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.84);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.tv-bara-title { margin: 0; font-size: 2.6rem; font-weight: 900; }
.tv-bara-sub { margin: 0; font-size: 1.3rem; color: var(--text-secondary); }
.tv-bara-lobby-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
}
.tv-bara-qr-box {
  padding: 14px;
  border-radius: 20px;
  background: #ffffff;
}
.tv-bara-code-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 32px;
  border-radius: 20px;
  background: rgba(9, 14, 30, 0.8);
  border: 2px solid #22d3ee;
}
.tv-bara-code-box strong {
  font-size: 3.4rem;
  letter-spacing: 0.18em;
  color: #7dd3fc;
}
.tv-bara-progress { font-size: 3rem; font-weight: 900; color: #38bdf8; }
.tv-bara-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.tv-bara-chip {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1.2rem;
  font-weight: 800;
}
.tv-bara-chip.is-done {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.5);
  color: #a7f3d0;
}
.tv-bara-pair-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}
.tv-bara-pair-box {
  min-width: 260px;
  padding: 24px 32px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tv-bara-pair-box.is-asker { background: rgba(6, 182, 212, 0.24); border: 2px solid #22d3ee; }
.tv-bara-pair-box.is-target { background: rgba(245, 158, 11, 0.24); border: 2px solid #fbbf24; }
.tv-bara-pair-box strong { font-size: 2.6rem; font-weight: 900; }
.tv-bara-pair-arrow { font-size: 1.8rem; font-weight: 900; }
.tv-bara-giant-timer { font-size: 5.5rem; font-weight: 900; color: #38bdf8; font-variant-numeric: tabular-nums; }
.tv-bara-giant-timer.danger { color: #f87171; }
.tv-bara-outsider-hero,
.tv-bara-word-reveal {
  width: 100%;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(239, 68, 68, 0.22));
  border: 2px solid #fbbf24;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tv-bara-word-reveal {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.22));
  border-color: #34d399;
}
.tv-bara-outsider-hero strong,
.tv-bara-word-reveal strong { font-size: 3.2rem; font-weight: 900; }
.tv-bara-votes-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.tv-bara-vote-item {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.15rem;
}
.tv-bara-vote-item.is-hit {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.4);
}
.tv-bara-choices-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tv-bara-choice-pill {
  padding: 18px 12px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  font-size: 1.4rem;
  font-weight: 900;
}
.tv-bara-standings {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tv-bara-standing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.82);
  font-size: 1.35rem;
  font-weight: 800;
}
.tv-bara-standing-row.is-first {
  border: 2px solid #fbbf24;
  background: rgba(180, 83, 9, 0.3);
}

@media (max-width: 768px) {
  .bs-mode-switch,
  .bs-wl-active-grid {
    grid-template-columns: 1fr;
  }
  .tv-bara-choices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   الحزمة الحادية عشرة (Pack 11):
   1) تحكم اللاعب الأول VIP + وضع التلفزيون النظيف في «برا السالفة»
   2) تبويب إحصائيات «برا السالفة» في قاعة المشاهير
   3) نظام البطولات والدوري (Tournament & League) + شاشة التلفزيون
   4) وضع «الكل يجاوب» (All-Play) للمقدّم والريموت والهاتف والتلفزيون
   ========================================================= */

/* 1) بطاقة نظام البطولة في شريط الأطوار الرئيسية */
.mode-launch-card.mode-tournament {
  border-color: rgba(251, 191, 36, 0.48);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 70, 239, 0.14));
}
.mode-launch-card.mode-tournament:hover {
  border-color: #fbbf24;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.26);
}

/* 2) وضع العرض الكامل النظيف في «برا السالفة» وشريط تحكم VIP على الهاتف */
.bara-salfa-overlay.is-clean-tv-mode {
  padding: 0;
  background: #060b19;
}
.bara-salfa-overlay.is-clean-tv-mode .bara-salfa-modal-card {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  background: radial-gradient(circle at top, #131f3d, #060b19 72%);
}
.bara-salfa-overlay.is-clean-tv-mode .bank-modal-header,
.bara-salfa-overlay.is-clean-tv-mode .bs-actions-row,
.bara-salfa-overlay.is-clean-tv-mode .bs-footer-actions,
.bara-salfa-overlay.is-clean-tv-mode .bs-player-kick-btn,
.bara-salfa-overlay.is-clean-tv-mode .bs-player-vip-btn,
.bara-salfa-overlay.is-clean-tv-mode .bs-wl-controls {
  display: none !important;
}
.bara-salfa-overlay.is-clean-tv-mode .bara-salfa-body {
  max-height: 100vh;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.25rem;
}
.bara-exit-clean-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9999;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}
.bara-exit-clean-btn:hover {
  opacity: 1;
}

.bp-vip-dock {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.32), rgba(15, 23, 42, 0.96));
  border: 1.5px solid rgba(251, 191, 36, 0.72);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bp-vip-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 900;
  color: #fde68a;
}
.bp-vip-select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(9, 14, 30, 0.92);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}
.bp-vip-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bp-vip-btn-row .btn {
  flex: 1 1 120px;
  min-height: 44px;
}
.bs-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 900;
}

/* 3) تبويب قاعة المشاهير (سين جيم / برا السالفة) */
.hof-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.hof-view-tab {
  min-height: 46px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.68);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}
.hof-view-tab.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(245, 158, 11, 0.2));
  border-color: #22d3ee;
  color: #ffffff;
}

/* 4) نافذة نظام البطولات والدوري (Tournament Mode) */
.tournament-modal-card {
  width: min(1080px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.tournament-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.trn-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.trn-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trn-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #f8fafc;
}
.trn-teams-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.trn-team-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.trn-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trn-team-input-row .text-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.trn-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.trn-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trn-champion-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(16, 185, 129, 0.18));
  border: 2px solid #fbbf24;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.trn-champion-trophy {
  font-size: 3rem;
  line-height: 1;
}
.trn-champion-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fef08a;
}
.trn-bracket-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}
.trn-bracket-cols {
  display: flex;
  gap: 18px;
  min-width: max-content;
  align-items: stretch;
}
.trn-round-col {
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trn-round-title {
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #cffafe;
  font-size: 0.86rem;
  font-weight: 900;
}
.trn-round-matches {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
}
.trn-match-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trn-match-card.is-ready {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.14);
}
.trn-match-card.is-completed {
  border-color: rgba(52, 211, 153, 0.5);
}
.trn-match-card.is-tie {
  border-color: #f97316;
  background: rgba(124, 45, 18, 0.28);
}
.trn-match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 700;
}
.trn-match-team.is-winner {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
}
.trn-match-team-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trn-match-team-score {
  font-weight: 900;
  color: #fde68a;
}
.trn-match-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-top: 4px;
}
.trn-tie-box {
  padding: 8px;
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.18);
  border: 1px dashed #fb923c;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  text-align: center;
}
.trn-league-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

/* شاشة التلفزيون للبطولة */
.tv-tournament-stage {
  width: min(1360px, 96vw);
  margin: 0 auto;
  padding: 20px;
}
.tv-trn-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}
.tv-trn-header {
  text-align: center;
}
.tv-trn-title {
  margin: 8px 0 0;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 900;
}
.tv-trn-champion-banner {
  width: min(760px, 100%);
  padding: 24px 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(16, 185, 129, 0.22));
  border: 2.5px solid #fbbf24;
  text-align: center;
}
.tv-trn-champ-trophy { font-size: 4rem; line-height: 1; }
.tv-trn-champ-eyebrow { font-size: 1.2rem; font-weight: 800; color: #fde68a; margin-top: 6px; }
.tv-trn-champ-name { margin: 6px 0 0; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 900; }
.tv-trn-next-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.2);
  border: 1.5px solid #22d3ee;
  font-size: 1.25rem;
  font-weight: 800;
}
.tv-trn-vs {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.3);
  color: #fde68a;
  font-size: 0.9em;
}
.tv-trn-bracket {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 0;
}
.tv-trn-col {
  min-width: 280px;
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tv-trn-col-title {
  text-align: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1.1rem;
  font-weight: 900;
}
.tv-trn-col-matches {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 16px;
}
.tv-trn-match-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tv-trn-match-card.is-next {
  border-color: #fbbf24;
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.32);
}
.tv-trn-match-card.is-done {
  border-color: rgba(52, 211, 153, 0.55);
}
.tv-trn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.15rem;
  font-weight: 800;
}
.tv-trn-row.is-win {
  background: rgba(16, 185, 129, 0.28);
  color: #ecfdf5;
}
.tv-trn-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tv-trn-tname { flex: 1; }
.tv-trn-tscore { color: #fde68a; font-size: 1.25rem; }
.tv-trn-league-wrap {
  width: min(980px, 100%);
  overflow-x: auto;
}
.tv-trn-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.88);
  border-radius: 16px;
  overflow: hidden;
  font-size: 1.2rem;
}
.tv-trn-table th,
.tv-trn-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tv-trn-table th {
  background: rgba(30, 41, 59, 0.95);
  color: #cbd5e1;
  font-weight: 900;
}
.tv-trn-table tr.is-leader {
  background: rgba(245, 158, 11, 0.22);
}

/* 5) وضع «الكل يجاوب» (Host Panel + Remote + Player Phone + TV Display) */
.allplay-host-panel {
  margin: 0 18px 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.allplay-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}
.allplay-head-actions {
  display: flex;
  gap: 6px;
}
.allplay-teams-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.allplay-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.allplay-team-row.is-ok {
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(6, 78, 59, 0.28);
}
.allplay-team-row.is-bad {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(127, 29, 29, 0.22);
}
.allplay-team-info {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.allplay-manual-input {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 6px 10px;
  font-size: 0.86rem;
}
.allplay-status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
}
.allplay-status-pill.is-sent {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}
.allplay-judge-btns {
  display: flex;
  gap: 6px;
}

.rh-allplay-box {
  padding: 10px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rh-allplay-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(9, 14, 30, 0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}
.rh-allplay-text {
  font-weight: 800;
  color: #f8fafc;
}

.tv-q-allplay-stage {
  width: 100%;
  margin-top: 10px;
}
.tv-allplay-box {
  padding: 18px 22px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid rgba(34, 211, 238, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tv-allplay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #cffafe;
}
.tv-allplay-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.tv-allplay-chip {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  font-size: 1.2rem;
  font-weight: 800;
}
.tv-allplay-chip.is-sent {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.45);
  color: #ecfdf5;
}
.tv-allplay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.tv-allplay-answer-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tv-allplay-answer-card.is-correct {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.36);
}
.tv-allplay-answer-card.is-wrong {
  border-color: #f87171;
  background: rgba(127, 29, 29, 0.3);
}
.tv-allplay-ans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.1rem;
}
.tv-allplay-ans-text {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
}
.tv-allplay-verdict {
  font-size: 0.9rem;
  font-weight: 800;
}

/* ضمان ظهور نافذة بطاقة النتيجة ونافذة التأكيد فوق نافذتي برا السالفة والبطولة */
.result-card-overlay {
  z-index: 1500;
}
#confirm-modal {
  z-index: 1600;
}

/* =========================================================
   الحزمة الثانية عشرة (Pack 12):
   1) شريط تبديل ومقارنة صورة السؤال وصورة الإجابة (answerImage)
   2) نمط «أوجد الفروقات» مع العدّاد والمؤشرات النقطية المتوهجة
   3) التحديات الصوتية المتزامنة (Host + TV Visualizer + Remote)
   4) صانع الفئات الخاصة البصري والصوتي (Custom Pack Builder)
   ========================================================= */

/* 1) تبديل ومقارنة صورة السؤال وصورة الإجابة */
.answer-image-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.answer-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.answer-compare-col {
  padding: 8px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.answer-compare-col.is-answer {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(6, 78, 59, 0.22);
}
.answer-compare-col img {
  max-height: 280px;
  width: 100%;
  object-fit: contain;
  border-radius: 10px;
  cursor: zoom-in;
}

.tv-answer-compare-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 12px;
}
.tv-compare-img-col {
  padding: 12px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tv-compare-img-col.is-answer {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.28);
}
.tv-img-swap-fade {
  animation: fadeSlideIn 0.28s ease;
}

/* 2) عدّاد «أوجد الفروقات» والمؤشرات النقطية المتوهجة */
.diff-live-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.diff-live-dots,
.tv-diff-dots {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.diff-dot,
.tv-diff-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.28);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}
.tv-diff-dot {
  width: 22px;
  height: 22px;
}
.diff-dot.is-found,
.tv-diff-dot.is-found {
  background: #34d399;
  border-color: #a7f3d0;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.85);
  transform: scale(1.16);
}
.spot-diff-badge-wrap.is-complete .spot-diff-count-badge {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #ecfdf5;
}
.diff-host-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.tv-diff-live-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tv-media-wrap.is-differences-hero .tv-media-img {
  max-height: 62vh;
  max-width: 92vw;
}
.rh-diff-box,
.rh-audio-box {
  padding: 10px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rh-diff-dots {
  color: #34d399;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

/* 3) لوحة التحدي الصوتي المتزامن (Host + TV Visualizer) */
.audio-challenge-panel {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(99, 102, 241, 0.18));
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.audio-ch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.audio-ch-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.audio-ch-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.28);
  border: 1px solid #22d3ee;
  font-size: 0.82rem;
  font-weight: 900;
}
.audio-ch-status {
  font-size: 0.84rem;
  font-weight: 700;
  color: #e2e8f0;
}
.audio-ch-visualizer,
.tv-audio-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 52px;
}
.tv-audio-visualizer {
  height: 110px;
  gap: 10px;
}
.audio-ch-visualizer span,
.tv-audio-visualizer span {
  display: block;
  width: 6px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22d3ee, #818cf8);
  opacity: 0.5;
  transition: height 0.2s ease, opacity 0.2s ease;
}
.tv-audio-visualizer span {
  width: 12px;
  height: 24px;
}
@keyframes sjAudioWavePulse {
  0%, 100% { transform: scaleY(0.35); opacity: 0.65; }
  50% { transform: scaleY(1.85); opacity: 1; }
}
.audio-ch-visualizer.is-playing span,
.tv-audio-visualizer.is-playing span {
  height: 26px;
  opacity: 1;
  animation: sjAudioWavePulse 0.9s ease-in-out infinite;
}
.tv-audio-visualizer.is-playing span {
  height: 56px;
}
.audio-ch-visualizer.is-playing span:nth-child(odd),
.tv-audio-visualizer.is-playing span:nth-child(odd) {
  animation-duration: 0.72s;
  background: linear-gradient(180deg, #fbbf24, #22d3ee);
}
.audio-ch-visualizer.is-playing span:nth-child(3n),
.tv-audio-visualizer.is-playing span:nth-child(3n) {
  animation-delay: 0.18s;
  animation-duration: 1.05s;
}
.audio-ch-visualizer.is-playing span:nth-child(2n),
.tv-audio-visualizer.is-playing span:nth-child(2n) {
  animation-delay: 0.32s;
}
.audio-ch-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}
.audio-ch-time {
  font-size: 0.84rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}
.audio-ch-seek {
  flex: 1;
  accent-color: #22d3ee;
}
.audio-ch-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.audio-ch-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 14, 30, 0.6);
}
.audio-ch-vol-slider {
  width: 82px;
  accent-color: #fbbf24;
}
.audio-ch-error {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.tv-audio-stage {
  width: min(820px, 94%);
  margin: 8px auto;
}
.tv-audio-card {
  padding: 28px 32px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.9));
  border: 2px solid rgba(34, 211, 238, 0.65);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.tv-audio-badge {
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.24);
  border: 1.5px solid #22d3ee;
  font-size: 1.25rem;
  font-weight: 900;
  color: #cffafe;
}
.tv-audio-status-label {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
}
.tv-audio-progress-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  direction: ltr;
}
.tv-audio-time {
  font-size: 1.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-width: 58px;
}
.tv-audio-progress-track {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.tv-audio-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #fbbf24);
  transition: width 0.16s linear;
}
.tv-audio-autoplay-banner {
  margin-top: 6px;
  font-size: 1.25rem;
  padding: 14px 28px;
}

/* 4) نافذة صانع الفئات الخاصة (Custom Pack Builder) */
.cpb-modal-card {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.cpb-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cpb-toolbar,
.cpb-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.cpb-file-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cpb-packs-list,
.cpb-questions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cpb-pack-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.cpb-pack-title {
  font-size: 1rem;
  font-weight: 900;
}
.cpb-pack-meta {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.cpb-pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cpb-section {
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cpb-section-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 900;
  color: #fde68a;
}
.cpb-meta-grid,
.cpb-q-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cpb-span-full {
  grid-column: 1 / -1;
}
.cpb-color-input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
}
.cpb-special-box,
.cpb-media-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.68);
  border: 1px solid rgba(34, 211, 238, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cpb-media-box.is-answer-media {
  border-color: rgba(52, 211, 153, 0.45);
}
.cpb-special-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.84rem;
}
.cpb-special-head span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}
.cpb-media-input-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cpb-media-input-row .text-input {
  flex: 1 1 220px;
  min-width: 0;
}
.cpb-audio-trim-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.cpb-diff-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cpb-num-input {
  width: 110px;
  text-align: center;
}
.cpb-img-preview img {
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.cpb-q-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cpb-q-row {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cpb-q-row.is-editing {
  border-color: #fbbf24;
}
.cpb-q-row-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.cpb-q-type-tag,
.cpb-mini-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
}
.cpb-q-row-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 640px) {
  .cpb-meta-grid,
  .cpb-q-form-grid,
  .cpb-audio-trim-row,
  .answer-compare-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   الحزمة الثالثة عشرة (Pack 13):
   1) المزامنة السحابية لحساب المقدّم (Google Auth + Smart Merge)
   2) إرسال بلاغات الأسئلة تلقائياً إلى Google Sheets
   ========================================================= */
.cloud-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cloud-header-pill.is-synced {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(6, 78, 59, 0.35);
  color: #ecfdf5;
}
.cloud-header-pill.is-pending {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(180, 83, 9, 0.3);
  color: #fef3c7;
}
.cloud-sync-section {
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.85));
}
.cloud-sync-desc {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.cloud-auth-actions,
.cloud-manual-actions,
.sheet-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cloud-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cloud-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #22d3ee;
}
.cloud-user-info {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cloud-user-email,
.cloud-last-sync-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.cloud-quota-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(251, 191, 36, 0.45);
  font-size: 0.78rem;
  color: #fde68a;
  line-height: 1.5;
}

.sheet-report-settings-box {
  margin: 10px 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-report-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.88rem;
}
.sheet-report-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.flagged-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}
.flagged-sync-pill.is-sent {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.45);
}
.flagged-sync-pill.is-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}
.flagged-sync-pill.is-failed {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.45);
}
@media (max-width: 640px) {
  .sheet-report-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   الحزمة الرابعة عشرة: لعبة «المافيا» اللاسلكية بالهواتف والتلفزيون (الراوي الآلي)
   ========================================================= */
.mode-launch-card.mode-mafia {
  background: linear-gradient(135deg, rgba(159, 18, 57, 0.28), rgba(15, 23, 42, 0.88));
  border-color: rgba(244, 63, 94, 0.45);
}
.mode-launch-card.mode-mafia:hover {
  border-color: rgba(251, 113, 133, 0.85);
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.22);
}

.mafia-modal-card {
  width: min(1040px, 96vw);
  max-height: 92vh;
}
.mafia-overlay.is-clean-tv-mode .mafia-modal-card {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
}
.mafia-overlay.is-clean-tv-mode .bank-modal-header,
.mafia-overlay.is-clean-tv-mode .mafia-host-actions {
  display: none !important;
}

.mafia-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mafia-intro-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(159, 18, 57, 0.2), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.mafia-intro-banner p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.mafia-ideal-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(251, 113, 133, 0.5);
  font-weight: 800;
  font-size: 0.84rem;
  color: #ffe4e6;
}
.mafia-open-room-box {
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mafia-lobby-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: 16px;
}
.mafia-qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mafia-qr-svg {
  background: #ffffff;
  padding: 10px;
  border-radius: 14px;
  line-height: 0;
}
.mafia-room-code-big {
  font-size: 1.05rem;
  color: var(--text-secondary);
}
.mafia-room-code-big strong {
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: #fde68a;
  margin-inline-start: 6px;
}
.mafia-qr-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.mafia-players-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mafia-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.mafia-count-hint {
  font-size: 0.82rem;
  color: #fde68a;
  font-weight: 700;
}
.mafia-lobby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
}
.mafia-lobby-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mafia-lobby-player.is-vip {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(120, 53, 15, 0.25);
}
.mafia-vip-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.28);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 800;
  margin-inline-start: 6px;
}
.mafia-player-tools {
  display: flex;
  gap: 6px;
}
.mafia-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.mafia-cfg-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mafia-cfg-label {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.mafia-timers-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mafia-timer-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.mafia-timer-group small {
  min-width: 66px;
  font-weight: 800;
  color: var(--text-secondary);
}
.mafia-setup-footer {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}
.mafia-start-btn {
  min-width: min(420px, 100%);
}

/* مراحل اللعب (الليل، الفجر، النقاش، التصويت، النهاية) */
.mafia-center-stage {
  align-items: center;
  text-align: center;
  padding: 22px 16px;
  border-radius: 20px;
  background: rgba(9, 14, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mafia-center-stage.is-night-theme {
  background: radial-gradient(circle at top, rgba(30, 27, 75, 0.92), rgba(2, 6, 23, 0.96));
  border-color: rgba(99, 102, 241, 0.45);
}
.mafia-center-stage.is-dawn-theme {
  background: radial-gradient(circle at top, rgba(120, 53, 15, 0.38), rgba(15, 23, 42, 0.92));
  border-color: rgba(251, 191, 36, 0.45);
}
.mafia-moon-orb {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 0 24px rgba(129, 140, 248, 0.6));
}
.mafia-phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #cffafe;
}
.mafia-phase-pill.is-night {
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(129, 140, 248, 0.55);
  color: #e0e7ff;
}
.mafia-phase-pill.is-dawn {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fef3c7;
}
.mafia-phase-pill.is-vote {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(251, 113, 133, 0.55);
  color: #ffe4e6;
}
.mafia-big-title {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  font-weight: 900;
}
.mafia-big-sub {
  margin: 0;
  max-width: 660px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}
.mafia-giant-timer {
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #38bdf8;
  line-height: 1.1;
}
.mafia-giant-timer.danger {
  color: #fb7185;
  animation: pulse 0.9s infinite;
}
.mafia-progress-counter {
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  font-size: 1.05rem;
}
.mafia-status-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.mafia-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 800;
  font-size: 0.9rem;
}
.mafia-status-chip.is-done,
.mafia-status-chip.is-alive-chip {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.35);
}
.mafia-status-chip.is-dead-chip {
  opacity: 0.72;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
  text-decoration: line-through;
}
.mafia-dawn-hero {
  width: min(740px, 100%);
  padding: 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.16);
}
.mafia-dawn-hero.is-saved {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(6, 78, 59, 0.28);
}
.mafia-dawn-hero.is-elim {
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(136, 19, 55, 0.28);
}
.mafia-dawn-icon,
.mafia-winner-icon {
  font-size: 3.2rem;
  line-height: 1.1;
}
.mafia-roster-split {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mafia-roster-col h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.mafia-votes-table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.mafia-tally-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  font-weight: 800;
}
.mafia-tally-pill.is-hit {
  border-color: #fb7185;
  background: rgba(159, 18, 57, 0.35);
}
.mafia-vote-breakdown-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.mafia-vote-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}
.mafia-gameover-hero {
  text-align: center;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
  border: 2px solid #fbbf24;
}
.mafia-gameover-stage.is-mafia-win .mafia-gameover-hero {
  border-color: #f43f5e;
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.45), rgba(15, 23, 42, 0.94));
}
.mafia-gameover-stage.is-jester-win .mafia-gameover-hero {
  border-color: #c084fc;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.45), rgba(15, 23, 42, 0.94));
}
.mafia-closing-event {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #fde68a;
  font-weight: 700;
}
.mafia-reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.mafia-reveal-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mafia-reveal-card.team-mafia {
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(136, 19, 55, 0.25);
}
.mafia-reveal-card.team-jester {
  border-color: rgba(192, 132, 252, 0.65);
  background: rgba(88, 28, 135, 0.25);
}
.mafia-reveal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
}
.mafia-reveal-name {
  font-size: 1.05rem;
}
.mafia-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.mafia-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(9, 14, 30, 0.65);
  font-size: 0.86rem;
}
.mafia-host-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

/* شاشة التلفزيون للعبة المافيا */
.tv-mafia-screen.is-night-sky {
  background: radial-gradient(circle at 50% 18%, rgba(49, 46, 129, 0.65), #020617 75%);
}
.tv-mafia-stage {
  width: min(1240px, 95vw);
  margin: 0 auto;
}
.tv-mafia-moon {
  font-size: 5rem;
  line-height: 1;
}
.tv-bara-chip.is-dead-tv {
  opacity: 0.65;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.35);
}
.tv-mafia-reveal-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.tv-mafia-reveal-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  font-size: 1.15rem;
}
.tv-mafia-reveal-pill.team-mafia {
  border-color: #fb7185;
  background: rgba(159, 18, 57, 0.32);
}

/* واجهة هاتف اللاعب للعبة المافيا (?mode=mafia-player — موبايل-أولاً RTL بدون تمرير أفقي وأزرار >= 48px) */
.mafia-player-root {
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  padding: 12px;
  box-sizing: border-box;
}
.mafia-player-root.is-mafia-night {
  background: radial-gradient(circle at top, #1e1b4b, #020617 80%);
}
.mp-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 92px;
}
.mp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mp-brand {
  font-size: 1.1rem;
  font-weight: 900;
}
.mp-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mp-code-pill,
.mp-conn-dot {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}
.mp-conn-dot.is-on {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}
.mp-error-banner {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fecaca;
  font-weight: 700;
  font-size: 0.88rem;
}
.mp-card {
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mp-center {
  text-align: center;
  align-items: center;
}
.mp-big-emoji {
  font-size: 3.2rem;
  line-height: 1;
}
.mp-muted {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}
.mp-label {
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
  width: 100%;
}
.mp-input {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  box-sizing: border-box;
}
.mp-big-btn,
.mp-hold-btn,
.mp-target-btn,
.mp-vip-btn {
  min-height: 50px;
  width: 100%;
  font-size: 1rem;
  font-weight: 800;
  touch-action: manipulation;
}
.mp-hold-role-card {
  width: 100%;
  min-height: 170px;
  padding: 18px 14px;
  border-radius: 18px;
  border: 2px dashed rgba(251, 191, 36, 0.6);
  background: rgba(9, 14, 30, 0.82);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mp-hold-role-card.is-holding {
  border-style: solid;
  border-color: #22d3ee;
  background: rgba(15, 23, 42, 0.98);
}
.mp-role-masked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mp-lock-icon {
  font-size: 2.2rem;
}
.mp-role-reveal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mp-role-reveal-box.team-mafia .mp-role-title { color: #fb7185; }
.mp-role-reveal-box.team-jester .mp-role-title { color: #d8b4fe; }
.mp-role-reveal-box.team-citizens .mp-role-title { color: #38bdf8; }
.mp-role-icon { font-size: 2.6rem; }
.mp-role-title { font-size: 1.55rem; font-weight: 900; }
.mp-role-desc { margin: 0; font-size: 0.88rem; color: var(--text-secondary); }
.mp-teammates-box {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(251, 113, 133, 0.5);
  font-size: 0.86rem;
}
.mp-reminder-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-secret-drawer {
  padding: 14px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.94);
  border: 1.5px solid #22d3ee;
  text-align: center;
}
.mp-phase-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.18);
  color: #cffafe;
  font-weight: 800;
  font-size: 0.84rem;
}
.mp-phase-tag.is-night {
  background: rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
}
.mp-timer-big {
  font-size: 2.6rem;
  font-weight: 900;
  text-align: center;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}
.mp-targets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}
.mp-done-box {
  padding: 14px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #d1fae5;
  font-weight: 800;
  text-align: center;
}
.mp-intel-banner,
.mp-intel-log {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 0.85rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-intel-banner.is-mafia {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(136, 19, 55, 0.28);
}
.mp-intel-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(9, 14, 30, 0.65);
}
.mp-intel-row.is-mafia-hit { color: #fda4af; }
.mp-intel-row.is-clean { color: #a7f3d0; }
.mp-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.mp-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
}
.mp-chip.is-me {
  border-color: #22d3ee;
  color: #cffafe;
}
.mp-reveal-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-reveal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
}
.mp-reveal-row.team-mafia {
  border-color: rgba(244, 63, 94, 0.55);
}
.mp-vip-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  padding: 10px 12px;
  background: rgba(9, 14, 30, 0.96);
  border-top: 1.5px solid rgba(251, 191, 36, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mp-vip-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fde68a;
}
.mp-vip-bar .mp-vip-btn {
  max-width: 520px;
}

@media (max-width: 760px) {
  .mafia-lobby-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   الحزمة الخامسة عشرة: طور «تحدي الصوت» المستقل (Standalone Audio Challenge Mode)
   ========================================================= */
.mode-launch-card.mode-audio-challenge {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.34), rgba(88, 28, 135, 0.34));
  border-color: rgba(56, 189, 248, 0.5);
}
.mode-launch-card.mode-audio-challenge:hover {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.24);
}
.audio-challenge-modal-card {
  width: min(1020px, 96vw);
  max-height: 92vh;
}
.ac-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ac-source-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.ac-tab-btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ac-tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.26), rgba(168, 85, 247, 0.22));
  border-color: #38bdf8;
  color: #f8fafc;
}
.ac-empty-box {
  text-align: center;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ac-empty-icon {
  font-size: 3rem;
}
.ac-empty-box h3 {
  margin: 0;
  font-size: 1.1rem;
}
.ac-empty-box p {
  margin: 0;
  max-width: 580px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.ac-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.ac-bank-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.ac-cat-select {
  min-width: 220px;
  flex: 1 1 220px;
}
.ac-local-upload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ac-file-label {
  cursor: pointer;
}
.ac-local-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.ac-local-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ac-local-num {
  min-width: 28px;
  font-weight: 900;
  color: #38bdf8;
}
.ac-local-inp {
  flex: 2 1 180px;
}
.ac-local-cat {
  flex: 1 1 120px;
}
.ac-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}
.ac-teams-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.ac-team-row-inp {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ac-color-picker {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.ac-team-text-inp {
  flex: 1;
  min-width: 0;
}

/* شاشة الجولة النشطة */
.ac-round-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ac-points-live-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  font-size: 0.88rem;
  font-weight: 800;
}
.ac-scoreboard-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ac-score-card {
  flex: 1 1 130px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}
.ac-score-card.is-awarded {
  background: rgba(16, 185, 129, 0.24);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.35);
}
.ac-team-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ac-score-name {
  flex: 1;
  font-weight: 800;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-score-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fde68a;
}
.ac-buzzer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.86);
  border: 1.5px solid rgba(34, 211, 238, 0.45);
}
.ac-buzzer-bar.is-buzzed {
  border-color: #fbbf24;
  background: rgba(120, 53, 15, 0.35);
}
.ac-buzz-winner {
  font-weight: 800;
  color: #fef3c7;
}
.ac-buzz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ac-player-panel {
  padding: 18px 16px;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(14, 116, 144, 0.26), rgba(9, 14, 30, 0.88));
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ac-host-visualizer {
  height: 54px;
}
.ac-status-label {
  font-weight: 800;
  font-size: 0.92rem;
  color: #e0f2fe;
}
.ac-playback-btns,
.ac-progressive-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ac-progress-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}
.ac-seek-slider {
  flex: 1;
}
.ac-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ac-vol-wrap input {
  width: 78px;
}
.ac-host-secret-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ac-host-secret-box {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  font-size: 0.96rem;
}
.ac-revealed-answer-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.45), rgba(15, 23, 42, 0.92));
  border: 2px solid #34d399;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ac-revealed-eyebrow {
  font-size: 0.85rem;
  font-weight: 800;
  color: #a7f3d0;
}
.ac-revealed-text {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 900;
}
.ac-revealed-exp {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.ac-revealed-img {
  max-height: 200px;
  max-width: 100%;
  border-radius: 12px;
  margin-top: 6px;
}
.ac-judge-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.ac-bottom-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ac-summary-standings {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  font-size: 1rem;
}
.ac-summary-row.is-first {
  background: rgba(245, 158, 11, 0.2);
}

/* شاشة التلفزيون لطور تحدي الصوت */
.tv-ac-stage {
  width: min(1240px, 95vw);
  margin: 0 auto;
}
.tv-ac-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.tv-ac-scores-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.tv-ac-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 1.2rem;
  font-weight: 800;
}
.tv-ac-score-pill.is-awarded {
  background: rgba(16, 185, 129, 0.34);
  transform: scale(1.06);
  transition: transform 0.25s ease;
}
.tv-ac-score-pill strong {
  color: #fde68a;
  font-size: 1.35rem;
}
.tv-ac-prog-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.tv-ac-prog-step {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  font-size: 1.1rem;
  font-weight: 800;
}
.tv-ac-prog-step.is-now {
  background: rgba(245, 158, 11, 0.32);
  border-color: #fbbf24;
  color: #fef3c7;
  transform: scale(1.06);
}
.tv-ac-prog-step.is-passed {
  opacity: 0.45;
  text-decoration: line-through;
}
.tv-ac-pts-badge {
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.26);
  border: 1.5px solid #fbbf24;
  font-size: 1.2rem;
  font-weight: 900;
  color: #fef3c7;
}
.tv-ac-viz-card {
  width: min(820px, 100%);
}
.tv-ac-answer-reveal {
  width: min(820px, 100%);
  padding: 22px 26px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.55), rgba(15, 23, 42, 0.94));
  border: 2.5px solid #34d399;
  text-align: center;
}
.tv-ac-answer-eyebrow {
  font-size: 1.15rem;
  font-weight: 800;
  color: #a7f3d0;
}
.tv-ac-answer-text {
  margin: 8px 0 0;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 900;
}
.tv-ac-answer-exp {
  margin: 8px 0 0;
  font-size: 1.25rem;
  color: #e2e8f0;
}
.tv-ac-answer-img {
  max-height: 260px;
  margin-top: 12px;
  border-radius: 16px;
}
@media (max-width: 640px) {
  .ac-source-tabs {
    grid-template-columns: 1fr;
  }
  .ac-local-item {
    flex-wrap: wrap;
  }
}

/* =========================================================
   الحزمة السادسة عشرة: بوابة البطاقات المنفصلة، تسجيل الدخول، البروفايل، ولوحة الإدارة
   ========================================================= */
.hub-header {
  margin-bottom: 14px;
}
.hub-top-row {
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}
.hub-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
}
.hub-logo-icon {
  font-size: 1.45rem;
}
.hub-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding-inline: 12px 14px;
}
.hub-pill-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.95rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}
.hub-pill-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hub-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.game-hub-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}
.hub-hero-welcome {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.game-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.hub-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: 8px;
  padding: 22px 20px;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.72));
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  min-height: 174px;
}
.hub-game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.78);
  box-shadow: 0 16px 34px rgba(6, 182, 212, 0.2);
}
.hub-game-card.mode-seen-jeem {
  background: linear-gradient(145deg, rgba(8, 145, 178, 0.3), rgba(15, 23, 42, 0.9));
  border-color: rgba(34, 211, 238, 0.5);
}
.hub-game-card.mode-blitz {
  background: linear-gradient(145deg, rgba(217, 119, 6, 0.28), rgba(15, 23, 42, 0.9));
  border-color: rgba(251, 191, 36, 0.45);
}
.hub-game-card.mode-charades {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.24), rgba(15, 23, 42, 0.9));
  border-color: rgba(52, 211, 153, 0.45);
}
.hub-game-card.mode-audio-challenge {
  background: linear-gradient(145deg, rgba(14, 116, 144, 0.34), rgba(88, 28, 135, 0.34));
  border-color: rgba(56, 189, 248, 0.5);
}
.hub-game-card.mode-bara-salfa {
  background: linear-gradient(145deg, rgba(147, 51, 234, 0.3), rgba(15, 23, 42, 0.9));
  border-color: rgba(192, 132, 252, 0.5);
}
.hub-game-card.mode-mafia {
  background: linear-gradient(145deg, rgba(159, 18, 57, 0.34), rgba(15, 23, 42, 0.92));
  border-color: rgba(244, 63, 94, 0.5);
}
.hub-game-card.mode-tournament {
  background: linear-gradient(145deg, rgba(202, 138, 4, 0.28), rgba(15, 23, 42, 0.9));
  border-color: rgba(250, 204, 21, 0.5);
}
.hub-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.hub-card-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 4px;
}
.hub-card-title {
  font-size: 1.32rem;
  font-weight: 900;
}
.hub-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.hub-quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.hub-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  text-align: right;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.hub-quick-card:hover {
  border-color: rgba(251, 191, 36, 0.65);
  transform: translateY(-2px);
}
.hub-quick-icon {
  font-size: 1.9rem;
}
.hub-quick-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hub-quick-text strong {
  font-size: 0.98rem;
  font-weight: 800;
}
.hub-quick-text span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sj-subpage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(34, 211, 238, 0.35);
}
.sj-subpage-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
}
.sj-subpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* نافذة تسجيل الدخول الودية */
.auth-login-modal-card {
  width: min(460px, 94vw);
}
.auth-login-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.auth-hero-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(168, 85, 247, 0.28));
  border: 2px solid rgba(34, 211, 238, 0.55);
}
.auth-welcome-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}
.auth-welcome-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}
.auth-google-btn {
  width: 100%;
  min-height: 50px;
}

/* نافذة «ملفي الشخصي» والأوسمة */
.profile-modal-card {
  width: min(860px, 96vw);
  max-height: 90vh;
}
.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.78));
  border: 2px solid rgba(34, 211, 238, 0.45);
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: rgba(9, 14, 30, 0.85);
  border: 3px solid #22d3ee;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-hero-name {
  font-size: 1.3rem;
  font-weight: 900;
}
.profile-title-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 800;
}
.profile-level-bar-wrap {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.profile-level-track {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.profile-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #fbbf24);
}
.profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.profile-kpi-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 14, 30, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.profile-kpi-card strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  color: #38bdf8;
}
.profile-kpi-card span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.profile-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}
.profile-game-stat-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
}
.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.profile-badge-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.48;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.profile-badge-item.is-unlocked {
  opacity: 1;
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.28), rgba(15, 23, 42, 0.88));
}
.profile-badge-icon {
  font-size: 1.8rem;
}
.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.profile-avatars-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.profile-avatar-opt {
  min-height: 40px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.8);
  font-size: 1.25rem;
  cursor: pointer;
}
.profile-avatar-opt.active {
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.25);
}
.profile-colors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-color-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
}
.profile-color-dot.active {
  border-color: #ffffff;
  transform: scale(1.14);
}
@media (max-width: 640px) {
  .game-hub-grid {
    grid-template-columns: 1fr;
  }
  .profile-avatars-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* =========================================================
   الحزمة السابعة عشرة: غرف QR للألعاب السريعة + العرض الكامل + واجهة الهاتف (Pack 17)
   ========================================================= */
.qg-setup-qr-section {
  margin-top: 14px;
}

.qg-setup-qr-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(15, 23, 42, 0.55);
  border-radius: 18px;
  padding: 14px 16px;
}

.qg-qr-init-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.qg-setup-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.qg-team-mini-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.qg-midgame-qr-bar {
  margin-bottom: 14px;
}

.qg-midgame-qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.38);
}

.qg-midgame-qr-svg svg {
  display: block;
  border-radius: 10px;
  background: #ffffff;
  padding: 4px;
}

.qg-midgame-qr-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 190px;
}

.qg-midgame-qr-title {
  font-weight: 800;
  font-size: 0.96rem;
  color: #f8fafc;
}

.qg-midgame-qr-code {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.qg-midgame-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.qg-host-buzzer-banner {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.16);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.qg-actor-live-card {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(56, 189, 248, 0.16));
  border: 1.5px solid rgba(167, 139, 250, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.qg-actor-live-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.qg-actor-live-note {
  font-size: 0.84rem;
  color: #ddd6fe;
  font-weight: 600;
}

/* وضع العرض الكامل النظيف (Full Display Mode) للألعاب الثلاث */
.modal-overlay.is-full-display-mode {
  padding: 0;
  background: #060a14;
}

.modal-overlay.is-full-display-mode > .modal-card {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  padding: 20px 28px;
}

.modal-overlay.is-full-display-mode .side-mode-header,
.modal-overlay.is-full-display-mode .bank-modal-header {
  display: none !important;
}

.modal-overlay.is-full-display-mode .blitz-judge-actions,
.modal-overlay.is-full-display-mode #btn-blitz-pause,
.modal-overlay.is-full-display-mode #btn-csolo-pause,
.modal-overlay.is-full-display-mode #blitz-answer-cockpit,
.modal-overlay.is-full-display-mode #csolo-host-secret-box,
.modal-overlay.is-full-display-mode #csolo-hold-stage {
  display: none !important;
}

.modal-overlay.is-full-display-mode .blitz-q-text {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.45;
  padding: 24px 16px;
}

.modal-overlay.is-full-display-mode .timer-display {
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
}

/* =========================================================
   واجهة هاتف اللاعب التفاعلية للألعاب السريعة (quickGamePlayerView.js)
   ========================================================= */
body.quick-player-mode {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at top, #13203d 0%, #070b14 75%);
  color: #f8fafc;
  min-height: 100vh;
}

.qg-player-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
}

.qg-player-shell.qg-theme-blitz {
  --qg-accent: #f59e0b;
  --qg-accent-soft: rgba(245, 158, 11, 0.18);
}

.qg-player-shell.qg-theme-mgk {
  --qg-accent: #a78bfa;
  --qg-accent-soft: rgba(167, 139, 250, 0.18);
}

.qg-player-shell.qg-theme-audio {
  --qg-accent: #34d399;
  --qg-accent-soft: rgba(52, 211, 153, 0.18);
}

.qg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.qg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.qg-brand-ico {
  font-size: 1.7rem;
  line-height: 1;
}

.qg-brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
}

.qg-brand-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}

.qg-header-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.qg-role-pill,
.qg-conn-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.qg-role-pill.is-judge {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.qg-role-pill.is-actor {
  background: rgba(167, 139, 250, 0.24);
  color: #ede9fe;
  border: 1px solid rgba(167, 139, 250, 0.55);
}

.qg-conn-pill.is-online {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.qg-conn-pill.is-offline {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

.qg-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qg-card {
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  max-width: 100%;
}

.qg-join-hero,
.qg-wait-card,
.qg-finish-card {
  text-align: center;
  align-items: center;
}

.qg-join-avatar-preview,
.qg-wait-icon,
.qg-finish-trophy {
  font-size: 2.8rem;
  line-height: 1.1;
}

.qg-join-hero h2,
.qg-wait-card h2,
.qg-finish-card h2 {
  margin: 4px 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.qg-join-hero p,
.qg-wait-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.qg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.qg-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: #e2e8f0;
}

.qg-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(2, 6, 23, 0.65);
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.qg-code-row {
  display: flex;
  gap: 8px;
}

.qg-code-input {
  flex: 1;
  text-align: center;
  letter-spacing: 0.18em;
  font-weight: 900;
  text-transform: uppercase;
}

.qg-btn,
.qg-btn-lg {
  min-height: 48px !important;
  font-weight: 800;
  border-radius: 14px;
}

.qg-btn-lg {
  width: 100%;
  font-size: 1.05rem;
}

.qg-avatars-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.qg-avatar-opt {
  min-height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.7);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qg-avatar-opt.active {
  border-color: var(--qg-accent, #38bdf8);
  background: var(--qg-accent-soft, rgba(56, 189, 248, 0.2));
  transform: scale(1.05);
}

.qg-teams-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qg-team-pick-btn {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.65);
  color: #f8fafc;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.qg-team-pick-btn.active {
  border-color: var(--team-c, var(--qg-accent, #38bdf8));
  background: var(--qg-accent-soft, rgba(56, 189, 248, 0.22));
  color: #ffffff;
}

.qg-alert {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.qg-alert.is-error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.qg-alert.is-info {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.qg-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qg-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.qg-pill.is-streak {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border: none;
}

.qg-timer-box {
  text-align: center;
}

.qg-timer-val {
  font-size: 2.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #ffffff;
}

.qg-timer-val.is-danger {
  color: #f87171;
}

.qg-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  width: 100%;
}

.qg-score-pill {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.qg-score-pill.is-active {
  border-color: var(--qg-accent, #f59e0b);
  background: var(--qg-accent-soft, rgba(245, 158, 11, 0.16));
}

.qg-score-name {
  font-size: 0.84rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qg-score-val {
  font-size: 1rem;
  font-weight: 900;
  color: #38bdf8;
}

.qg-question-card,
.qg-guesser-card {
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-cat-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fde68a;
}

.qg-question-text {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.55;
  color: #ffffff;
}

.qg-buzzer-btn {
  width: 100%;
  min-height: 92px;
  border-radius: 20px;
  border: 2px solid rgba(251, 191, 36, 0.75);
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.38);
}

.qg-buzzer-btn.is-audio {
  background: linear-gradient(135deg, #10b981, #0284c7);
  border-color: rgba(52, 211, 153, 0.8);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35);
}

.qg-buzzer-btn.is-locked,
.qg-buzzer-btn:disabled {
  opacity: 0.55;
  filter: grayscale(0.5);
  cursor: not-allowed;
  box-shadow: none;
}

.qg-buzzer-ico {
  font-size: 2rem;
  line-height: 1;
}

.qg-buzz-result {
  padding: 14px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid rgba(251, 191, 36, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 800;
}

.qg-buzz-result.is-mine {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.75);
  color: #d1fae5;
}

.qg-audio-status-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qg-audio-status-box.is-playing {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(16, 185, 129, 0.14);
}

.qg-audio-status-text {
  font-size: 1rem;
  font-weight: 900;
}

.qg-prog-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.qg-prog-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qg-prog-pill.active {
  background: rgba(245, 158, 11, 0.24);
  color: #fef3c7;
  border-color: rgba(251, 191, 36, 0.65);
}

.qg-actor-banner {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
}

.qg-actor-secret-stage {
  padding: 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.72);
  border: 1.5px solid rgba(167, 139, 250, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.qg-actor-decoy,
.qg-actor-secret {
  padding: 16px 10px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.qg-actor-secret {
  background: rgba(16, 185, 129, 0.18);
  border: 1.5px solid rgba(52, 211, 153, 0.55);
}

.qg-decoy-ico {
  font-size: 2rem;
}

.qg-secret-word-val {
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
}

.qg-secret-hint {
  font-size: 0.86rem;
  color: #d1fae5;
}

.qg-hold-btn {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.qg-actor-controls-grid,
.qg-judge-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qg-judge-panel {
  padding: 12px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-judge-head {
  font-size: 0.86rem;
  font-weight: 900;
  color: #fde68a;
  text-align: center;
}

.qg-secret-answer-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(52, 211, 153, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.qg-secret-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6ee7b7;
}

.qg-secret-answer-val,
.qg-revealed-answer-val {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
}

.qg-revealed-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.18);
  border: 1.5px solid rgba(52, 211, 153, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qg-revealed-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  margin: 4px auto 0;
}

.qg-past-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qg-section-sub {
  font-size: 0.84rem;
  font-weight: 800;
  color: #94a3b8;
}

.qg-past-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.52);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}

.qg-roster-box {
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.5);
}

.qg-roster-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 6px;
}

.qg-roster-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qg-roster-chip {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
}

.qg-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qg-word-count-big {
  font-size: 1.15rem;
  font-weight: 900;
  color: #38bdf8;
}

.qg-guesser-note {
  margin: 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.qg-ready-banner {
  padding: 14px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  text-align: center;
  font-weight: 800;
}


/* =========================================================
   الحزمة الثامنة عشرة: بطاقات الفئات الرئيسية/الفرعية، خطوات الإعداد الـ 3، وتحسينات لوحة اللعب (Pack 18)
   ========================================================= */
.sj-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sj-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sj-step-pill:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.sj-step-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(37, 99, 235, 0.28));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}

.sj-step-pill.is-done {
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.sj-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.sj-step-pill.active .sj-step-num {
  background: #38bdf8;
  color: #06101f;
}

.sj-step-pill.is-done .sj-step-num {
  background: #10b981;
  color: #042116;
}

.sj-step-arrow {
  color: #64748b;
  font-weight: 900;
}

.sj-presets-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sj-preset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sj-preset-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5);
}

.sj-preset-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(59, 130, 246, 0.24));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.22);
}

.sj-preset-btn.is-surprise {
  border-color: rgba(251, 191, 36, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(236, 72, 153, 0.14));
}

.sj-preset-ico {
  font-size: 1.5rem;
}

.sj-preset-text {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.25;
}

.sj-preset-text strong {
  font-size: 0.96rem;
  font-weight: 900;
}

.sj-preset-text small {
  font-size: 0.76rem;
  color: #94a3b8;
}

.category-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.quick-filter-chip.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
}

.fav-filter-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.25);
  color: #fde68a;
  font-size: 0.74rem;
}

.category-breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.breadcrumb-sep {
  color: #64748b;
  font-weight: 800;
}

.breadcrumb-current {
  font-size: 1.02rem;
  font-weight: 900;
  color: #f8fafc;
}

/* المستوى الأول: بطاقات الفئات الرئيسية */
.setup-categories-grid.is-main-level {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px;
}

.main-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1.5px solid color-mix(in srgb, var(--main-color, #38bdf8) 38%, rgba(255, 255, 255, 0.12));
  background: linear-gradient(155deg, color-mix(in srgb, var(--main-color, #38bdf8) 16%, rgba(15, 23, 42, 0.9)), rgba(15, 23, 42, 0.92));
  color: #ffffff;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.main-cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--main-color, #38bdf8);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--main-color, #38bdf8) 26%, transparent);
}

.main-cat-card.has-selections {
  border-color: #34d399;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 10px 24px rgba(16, 185, 129, 0.2);
}

.main-cat-sel-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.main-cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  background: color-mix(in srgb, var(--main-color, #38bdf8) 22%, rgba(255, 255, 255, 0.08));
  border: 1px solid color-mix(in srgb, var(--main-color, #38bdf8) 45%, transparent);
}

.main-cat-title {
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.3;
  color: #ffffff;
}

.main-cat-meta {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* المستوى الثاني: تحسينات بطاقات الفئات الفرعية (نجمة المفضلة + شارات المحتوى + الجاهزية) */
.setup-cat-card.is-completed-cat {
  opacity: 0.74;
}

.setup-cat-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.setup-cat-fav-btn:hover {
  transform: scale(1.12);
  color: #fbbf24;
}

.setup-cat-fav-btn.is-fav {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fbbf24;
}

.setup-cat-parent-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: -2px;
}

.setup-cat-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.cat-content-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

/* شريط السلة السفلي الثابت مع رقائق الحذف السريع */
.dock-selected-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.dock-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.dock-chip-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dock-chip-remove:hover {
  background: rgba(239, 68, 68, 0.65);
  color: #ffffff;
}

/* الخطوة 2 و3: ألوان الفرق (2-6) + المراجعة والانطلاق */
.team-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.team-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.team-color-swatch:hover {
  transform: scale(1.14);
}

.team-color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  transform: scale(1.15);
}

.teams-inputs-grid[data-team-count="5"],
.teams-inputs-grid[data-team-count="6"] {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-5-dot { background: #f43f5e; box-shadow: 0 0 8px rgba(244, 63, 94, 0.6); }
.team-6-dot { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }

.sj-step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.sj-review-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.sj-review-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sj-review-box h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  font-weight: 900;
  color: #38bdf8;
}

.sj-review-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sj-review-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sj-review-companions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================================
   تحسينات لوحة اللعب وشاشة العرض (Pack 18 Section 3)
   ========================================================= */
.score-team-card.active-turn,
.tv-team-card.active-turn {
  position: relative;
  border-width: 2.5px !important;
  border-color: var(--team-accent, #38bdf8) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--team-accent, #38bdf8) 32%, transparent),
              0 10px 28px color-mix(in srgb, var(--team-accent, #38bdf8) 38%, transparent) !important;
  transform: translateY(-2px);
}

.active-turn-pointer,
.tv-active-turn-pointer {
  position: absolute;
  top: -13px;
  right: 50%;
  transform: translateX(50%);
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--team-accent, #38bdf8);
  color: #05101f;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 4;
}

.tv-active-turn-pointer {
  font-size: 0.92rem;
  padding: 3px 16px;
  top: -16px;
}

.scoreboard-teams-grid[data-team-count="5"],
.scoreboard-teams-grid[data-team-count="6"],
.tv-scoreboard-teams-grid[data-team-count="5"],
.tv-scoreboard-teams-grid[data-team-count="6"] {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* تباين وقراءة أوضح لأرقام النقاط على لوحة اللعب والتلفزيون */
.q-point-btn {
  font-size: clamp(1.22rem, 1.8vw, 1.55rem) !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em;
  position: relative;
}

.tv-point-tile {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem) !important;
  font-weight: 900 !important;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.q-point-btn.played,
.tv-point-tile.played {
  opacity: 0.34 !important;
  filter: saturate(0.45);
}

.tile-played-check {
  font-size: 0.78em;
  opacity: 0.85;
  margin-left: 2px;
}

/* شريط علوي أكثر إحكاماً لمنح لوحة الأسئلة أكبر مساحة ممكنة */
.game-screen .scoreboard-bar {
  padding-top: 8px;
  padding-bottom: 10px;
}

.game-screen .scoreboard-top-controls {
  gap: 6px;
}

.game-board-grid[data-cat-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .sj-presets-bar {
    grid-template-columns: 1fr;
  }
  .setup-categories-grid.is-main-level {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .setup-dock-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .game-board-grid[data-cat-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hub-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .hub-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
  }
}

/* =========================================================
   الحزمة التاسعة عشرة: توسيع المافيا وبرا السالفة + طور «تحدي الكل»
   ========================================================= */

/* 1) توسيع المافيا: دليل القواعد + شارات العمدة (🎖️ / ×2) + بطاقة التأكيد */
.mafia-intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mafia-rules-guide-panel {
  border-color: rgba(251, 191, 36, 0.38);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
}
.mafia-guide-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mafia-guide-role-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mafia-guide-role-card.team-mafia {
  border-color: rgba(244, 63, 94, 0.45);
}
.mafia-guide-role-card.team-jester {
  border-color: rgba(192, 132, 252, 0.45);
}
.mafia-guide-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mafia-guide-team-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.mafia-guide-role-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mafia-guide-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 0.84rem;
  color: var(--text-primary);
}
.mafia-mayor-banner,
.mp-mayor-banner,
.tv-mafia-mayor-banner {
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(251, 191, 36, 0.1));
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-weight: 800;
  font-size: 0.94rem;
  text-align: center;
  margin-bottom: 12px;
}
.mafia-x2-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  margin-inline-start: 4px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.24);
  border: 1px solid rgba(251, 191, 36, 0.7);
  color: #fde68a;
  font-size: 0.75rem;
  font-weight: 900;
}
.mp-rules-guide-card {
  border-color: rgba(251, 191, 36, 0.45);
  margin-bottom: 12px;
}
.mp-rules-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mp-rules-roles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.mp-rules-role-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.84rem;
}
.mp-rules-role-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.mp-rules-summary-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.08);
  font-size: 0.8rem;
  line-height: 1.5;
}
.mp-mayor-action-wrap,
.mp-mayor-confirm-box {
  margin: 12px 0;
}
.mp-mayor-confirm-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.14);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
}
.mp-mayor-confirm-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.mp-intel-banner.is-mayor {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.6);
  color: #fde68a;
}

/* 2) توسيع «برا السالفة» — وضع متسلّلين اثنين + شريك المتسلّل */
.bs-two-imposter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.bs-ideal-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
  font-size: 0.78rem;
  font-weight: 800;
}
.bs-partner-box,
.bp-partner-pill {
  margin: 10px auto;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: 0.94rem;
  font-weight: 800;
}
.bs-catch-summary {
  margin: 10px 0 14px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.94rem;
  text-align: center;
}
.bs-catch-summary.is-both {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}
.bs-catch-summary.is-one,
.bs-catch-summary.is-partial {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}
.bs-catch-summary.is-none {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.55);
  color: #fda4af;
}

/* 3) بطاقة «🏁 تحدي الكل» في بوابة الألعاب + نافذة السباق */
.hub-game-card.mode-quiz-race {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(155deg, rgba(245, 158, 11, 0.18), rgba(236, 72, 153, 0.12), rgba(15, 23, 42, 0.88));
}
.hub-game-card.mode-quiz-race:hover {
  border-color: #fbbf24;
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.28);
}
.quiz-race-modal-card {
  width: min(1060px, 96vw);
  max-height: 92vh;
}
.quiz-race-overlay.is-full-display-mode {
  padding: 0;
  background: #060b19;
}
.quiz-race-overlay.is-full-display-mode .quiz-race-modal-card {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
}
.quiz-race-overlay.is-full-display-mode .bank-modal-header {
  display: none !important;
}
.qr-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qr-center-stage {
  align-items: center;
  text-align: center;
}
.qr-intro-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.qr-intro-banner p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.qr-ready-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
  font-weight: 800;
  font-size: 0.86rem;
}
.qr-open-room-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
}
.qr-config-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qr-sub-picker {
  margin-top: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
}
.qr-giant-countdown {
  font-size: clamp(4.5rem, 12vw, 7.5rem);
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 36px rgba(251, 191, 36, 0.55);
  line-height: 1;
}
.qr-live-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qr-answered-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-weight: 800;
}
.qr-timer-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.88);
  border: 3px solid #38bdf8;
  color: #ffffff;
}
.qr-timer-circle.danger {
  border-color: #f43f5e;
  color: #fda4af;
}
.qr-timer-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.qr-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
  transition: width 0.15s linear;
}
.qr-question-hero {
  padding: 20px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}
.qr-question-text {
  margin: 0;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 900;
  line-height: 1.5;
}
.qr-question-text.is-compact {
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  text-align: center;
}
.qr-question-img,
.qr-answer-img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 14px;
  margin-top: 12px;
}
.qr-options-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.qr-option-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.08rem;
  color: #ffffff;
  border: 2px solid transparent;
}
.qr-option-tile.is-red,
.qrp-opt-btn.is-red,
.qr-bar-fill.is-red,
.qr-bar-shape.is-red,
.qrp-picked-pill.is-red {
  background: linear-gradient(135deg, #e11d48, #be123c);
}
.qr-option-tile.is-blue,
.qrp-opt-btn.is-blue,
.qr-bar-fill.is-blue,
.qr-bar-shape.is-blue,
.qrp-picked-pill.is-blue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.qr-option-tile.is-amber,
.qrp-opt-btn.is-amber,
.qr-bar-fill.is-amber,
.qr-bar-shape.is-amber,
.qrp-picked-pill.is-amber {
  background: linear-gradient(135deg, #d97706, #b45309);
}
.qr-option-tile.is-green,
.qrp-opt-btn.is-green,
.qr-bar-fill.is-green,
.qr-bar-shape.is-green,
.qrp-picked-pill.is-green {
  background: linear-gradient(135deg, #059669, #047857);
}
.qr-option-tile.is-revealed-correct {
  border-color: #ffffff;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.55);
  transform: scale(1.015);
}
.qr-option-tile.is-revealed-wrong {
  opacity: 0.42;
}
.qr-option-shape {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.qr-bars-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  align-items: end;
}
.qr-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-bar-col.is-dim {
  opacity: 0.55;
}
.qr-bar-count {
  font-weight: 900;
  font-size: 1rem;
}
.qr-bar-track {
  width: 100%;
  height: 110px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.qr-bar-fill {
  width: 100%;
  border-radius: 10px 10px 0 0;
  transition: height 0.4s ease;
}
.qr-bar-shape {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ffffff;
}
.qr-explanation-box {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-align: center;
}
.qr-leaderboard-list {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr-lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.qr-lb-row.is-first {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(15, 23, 42, 0.85));
  border-color: rgba(251, 191, 36, 0.65);
}
.qr-lb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.qr-lb-rank {
  font-size: 1.25rem;
  font-weight: 900;
}
.qr-lb-name {
  font-weight: 800;
  font-size: 1.05rem;
}
.qr-lb-score {
  font-size: 1.25rem;
  color: #fbbf24;
}
.qr-streak-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.25);
  color: #fdba74;
  font-size: 0.78rem;
  font-weight: 900;
}
.qr-rank-up {
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 800;
}
.qr-rank-down {
  color: #fb7185;
  font-size: 0.8rem;
  font-weight: 800;
}
.qr-rank-same {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.qr-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 12px auto 6px;
  width: min(680px, 100%);
}
.qr-podium-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-podium-avatar {
  font-size: 2rem;
}
.qr-podium-name {
  font-weight: 900;
  font-size: 1rem;
  text-align: center;
}
.qr-podium-block {
  width: 100%;
  border-radius: 18px 18px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  font-weight: 900;
}
.qr-podium-col.is-first .qr-podium-block {
  min-height: 150px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.34), rgba(245, 158, 11, 0.14));
  border: 2px solid #fbbf24;
}
.qr-podium-col.is-second .qr-podium-block {
  min-height: 118px;
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.25), rgba(148, 163, 184, 0.1));
  border: 1.5px solid #cbd5e1;
}
.qr-podium-col.is-third .qr-podium-block {
  min-height: 96px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.26), rgba(234, 88, 12, 0.1));
  border: 1.5px solid #fb923c;
}
.qr-podium-medal {
  font-size: 1.8rem;
}
.qr-standings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qr-standing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.qr-standing-row.is-first {
  border-color: rgba(251, 191, 36, 0.55);
}
.qr-standing-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* 4) واجهة هاتف اللاعب لطور «تحدي الكل» (?mode=quiz-race-player) */
.qrp-shell {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  overflow-x: hidden;
}
.qrp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.qrp-brand {
  font-weight: 900;
  font-size: 1.05rem;
}
.qrp-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qrp-code-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-weight: 900;
  font-size: 0.8rem;
}
.qrp-conn-dot {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.qrp-error-banner,
.qrp-locked-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #fecdd3;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}
.qrp-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qrp-center {
  align-items: center;
  text-align: center;
}
.qrp-big-emoji {
  font-size: 3rem;
  line-height: 1;
}
.qrp-muted {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.qrp-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.qrp-input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}
.qrp-big-btn {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 900;
}
.qrp-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.qrp-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
  font-weight: 700;
}
.qrp-chip.is-me {
  background: rgba(34, 211, 238, 0.22);
  border: 1px solid rgba(34, 211, 238, 0.55);
}
.qrp-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.qrp-phase-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  font-weight: 800;
  font-size: 0.82rem;
}
.qrp-timer-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  font-weight: 900;
  font-size: 0.95rem;
}
.qrp-timer-pill.is-urgent {
  background: rgba(244, 63, 94, 0.26);
  color: #fda4af;
}
.qrp-q-prompt {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}
.qrp-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.qrp-opt-btn {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.qrp-opt-btn:active {
  transform: scale(0.98);
}
.qrp-opt-shape {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.qrp-opt-text {
  flex: 1;
  line-height: 1.35;
}
.qrp-countdown-num {
  font-size: 4.5rem;
  font-weight: 900;
  color: #fbbf24;
}
.qrp-picked-pill {
  padding: 10px 18px;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 900;
}
.qrp-result-card.is-correct {
  border-color: #34d399;
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.22), rgba(15, 23, 42, 0.92));
}
.qrp-result-card.is-wrong {
  border-color: #fb7185;
  background: linear-gradient(155deg, rgba(244, 63, 94, 0.2), rgba(15, 23, 42, 0.92));
}
.qrp-points-earned {
  font-size: 2rem;
  font-weight: 900;
  color: #34d399;
}
.qrp-points-earned.is-zero {
  color: #fda4af;
}
.qrp-correct-hint {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}
.qrp-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.qrp-stat-pill {
  flex: 1 1 88px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.qrp-stat-pill span {
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.qrp-stat-pill strong {
  font-size: 1.1rem;
}
.qrp-mini-standings {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qrp-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}
.qrp-mini-row.is-me {
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.55);
}

@media (max-width: 720px) {
  .qr-options-board {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   الحزمة العشرون: هوية الدول العربية والفئات الموسّعة، بحث الفئات الفرعية، وحماية الصور
   ========================================================= */

/* 1) التدرّج المتناسق لبطاقات الفئات الرئيسية والدول العربية عبر الثيمات الثلاثة */
.main-cat-card {
  background-image: var(--main-gradient, none);
}
.main-cat-card.is-country-card .main-cat-icon {
  font-size: 2.35rem;
  line-height: 1.1;
}

/* 2) شريط البحث والتصفية المدمج داخل شاشة الفئات الفرعية */
.category-sub-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.category-sub-toolbar[hidden] {
  display: none !important;
}
.subcat-search-wrap {
  width: 100%;
}
.subcat-quick-filters {
  margin-bottom: 0;
}

/* شريط فرز وتصفية مجموعة «الدول العربية» وبطاقات الدول قريباً */
.arab-countries-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.arab-countries-controls[hidden] {
  display: none !important;
}
.arab-sort-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.arab-controls-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-inline-end: 2px;
}
.arab-coming-toggle.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}

.setup-cat-card.is-arab-country-card .setup-cat-icon {
  font-size: 2.35rem;
  line-height: 1.1;
}

.setup-cat-card.is-coming-soon-cat {
  opacity: 0.82;
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.32);
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.56));
}
.setup-cat-card.is-coming-soon-cat:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(245, 158, 11, 0.45);
}
.setup-cat-soon-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.48);
  backdrop-filter: blur(4px);
}
.setup-cat-coming-soon-msg {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  text-align: center;
  width: 100%;
}

[data-theme="high-contrast"] .setup-cat-card.is-coming-soon-cat {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.45);
}
[data-theme="high-contrast"] .setup-cat-coming-soon-msg {
  color: #fef08a;
  background: rgba(250, 204, 21, 0.18);
  border-color: #facc15;
}
[data-theme="royal-gold"] .setup-cat-coming-soon-msg {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
}

/* 3) تحسين تحميل صور المشاهد (Shimmer + Safe Error Fallback) */
.qr-img-stage {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-top: 12px;
  border-radius: 14px;
  overflow: hidden;
}
.qr-img-stage.is-loading::before,
.multi-img-card.is-loading::before,
.tv-multi-img-card.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: sjImgShimmer 1.35s linear infinite;
  pointer-events: none;
  border-radius: inherit;
}
@keyframes sjImgShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.safe-img-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.92rem;
}
.safe-img-error-card[hidden],
.img-fallback-inline[hidden] {
  display: none !important;
}
.img-fallback-inline {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #fecdd3;
  font-size: 0.84rem;
  font-weight: 700;
}

/* ثيم التباين العالي والملكي الذهبي لشريط البحث الفرعي */
[data-theme="high-contrast"] .category-sub-toolbar {
  background: rgba(0, 0, 0, 0.86);
  border-color: rgba(255, 255, 255, 0.35);
}
[data-theme="royal-gold"] .category-sub-toolbar {
  background: rgba(20, 14, 4, 0.72);
  border-color: rgba(251, 191, 36, 0.32);
}

/* =========================================================
   بطاقة أفلام ومسلسلات المجمّعة (التبويبات) + تعميم صور الغطاء لجميع البطاقات
   ========================================================= */

/* شريط التبويبات الفرعية داخل البطاقة الرئيسية المجمّعة (الفن المصري، الفن السوري، مسلسلات وأفلام أجنبية) */
.category-subgroup-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.category-subgroup-tabs[hidden] {
  display: none !important;
}

.subgroup-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.subgroup-tab-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--tab-color, #ec4899) 70%, rgba(255, 255, 255, 0.2));
  background: color-mix(in srgb, var(--tab-color, #ec4899) 18%, rgba(15, 23, 42, 0.88));
  color: #ffffff;
}

.subgroup-tab-btn.active {
  border-color: var(--tab-color, #ec4899);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--tab-color, #ec4899) 82%, #0f172a),
    color-mix(in srgb, var(--tab-color, #ec4899) 55%, #0f172a)
  );
  color: #ffffff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tab-color, #ec4899) 36%, transparent);
}

.subgroup-tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.subgroup-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.subgroup-tab-btn.active .subgroup-tab-count {
  background: rgba(2, 6, 23, 0.35);
}

.subgroup-tab-sel {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

[data-theme="high-contrast"] .category-subgroup-tabs {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}
[data-theme="royal-gold"] .category-subgroup-tabs {
  background: rgba(20, 14, 4, 0.78);
  border-color: rgba(251, 191, 36, 0.35);
}

/* شارات معاينة التبويبات على البطاقة الرئيسية المجمّعة (أفلام ومسلسلات) */
.main-cat-subgroups-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.main-cat-subgroup-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #f1f5f9;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* تغليف محتوى البطاقات لضمان الترتيب الطبقي السليم فوق صور الغطاء */
.main-cat-card {
  overflow: hidden;
}

.main-cat-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  flex: 1;
}

.setup-cat-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  flex: 1;
}

.board-cat-header,
.tv-board-cat-header {
  position: relative;
  overflow: hidden;
}

.board-cat-header-content,
.tv-board-cat-header-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  width: 100%;
  flex: 1;
}

/* طبقة صورة الغطاء الكاملة (object-cover) + التدرج اللوني الداكن من الأسفل */
.cat-card-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.38s ease;
}

.cat-card-cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(2, 6, 23, 0.96) 0%,
    rgba(2, 6, 23, 0.8) 42%,
    rgba(2, 6, 23, 0.32) 74%,
    rgba(2, 6, 23, 0.14) 100%
  );
  transition: opacity 0.28s ease;
}

.has-cover-image > .cat-card-cover-img,
.has-cover-image > .cat-card-cover-overlay {
  opacity: 1;
}

/* رفع الشارات وأزرار المفضلة والاختيار فوق الصورة والتدرج */
.main-cat-sel-badge,
.setup-cat-check,
.setup-cat-fav-btn {
  z-index: 4;
}

.setup-cat-card::after {
  z-index: 3;
}

/* بطاقة المجموعة الرئيسية عند توفر صورة غطاء */
.main-cat-card.has-cover-image {
  min-height: 182px;
  background-image: none;
  background-color: #0b1228;
}

.main-cat-card.has-cover-image .main-cat-icon {
  display: none;
}

.main-cat-card.has-cover-image .main-cat-body {
  justify-content: flex-end;
  padding-top: 36px;
}

.main-cat-card.has-cover-image .main-cat-title {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.88);
}

.main-cat-card.has-cover-image .main-cat-meta {
  color: #f1f5f9;
  border-top-color: rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.main-cat-card.has-cover-image .main-cat-subgroup-pill {
  background: rgba(2, 6, 23, 0.68);
  border-color: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(4px);
}

/* بطاقة الفئة الفرعية عند توفر صورة غطاء */
.setup-cat-card.has-cover-image {
  min-height: 204px;
  padding: 14px 11px 12px;
  background-color: #0b1228;
}

.setup-cat-card.has-cover-image::before {
  opacity: 0;
}

.setup-cat-card.has-cover-image .setup-cat-icon {
  display: none;
}

.setup-cat-card.has-cover-image .setup-cat-body {
  justify-content: flex-end;
  padding-top: 44px;
}

.setup-cat-card.has-cover-image .setup-cat-name {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.92);
}

.setup-cat-card.has-cover-image .setup-cat-desc {
  color: #e2e8f0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  min-height: 0;
}

.setup-cat-card.has-cover-image .setup-cat-parent-tag {
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.62);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 0;
}

.setup-cat-card.has-cover-image .cat-content-badge {
  background: rgba(2, 6, 23, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.setup-cat-card.has-cover-image .setup-cat-count {
  margin-top: 2px;
  color: #f8fafc;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.setup-cat-card.has-cover-image .setup-cat-fav-btn,
.setup-cat-card.has-cover-image .setup-cat-check {
  backdrop-filter: blur(6px);
  background: rgba(2, 6, 23, 0.78);
}

.setup-cat-card.selected.has-cover-image .setup-cat-check {
  background: var(--cat-color, #10b981);
}

/* ترويسة بطاقة الفئة على لوحة اللعب وشاشة العرض التلفزيوني عند توفر صورة غطاء */
.board-cat-header.has-cover-image,
.tv-board-cat-header.has-cover-image {
  background-color: #0b1228;
  border-color: color-mix(in srgb, var(--cat-color, #06b6d4) 55%, rgba(255, 255, 255, 0.22));
}

.board-cat-header.has-cover-image .board-cat-icon-badge,
.tv-board-cat-header.has-cover-image .tv-board-cat-icon {
  display: none;
}

.board-cat-header.has-cover-image .board-cat-header-content,
.tv-board-cat-header.has-cover-image .tv-board-cat-header-content {
  justify-content: flex-end;
  padding-top: 26px;
}

.board-cat-header.has-cover-image .board-cat-title,
.tv-board-cat-header.has-cover-image .tv-board-cat-title {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.board-cat-header.has-cover-image .board-cat-progress,
.tv-board-cat-header.has-cover-image .tv-board-cat-progress {
  color: #f1f5f9;
  background: rgba(2, 6, 23, 0.68);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* تأثير تكبير ناعم للصورة عند التحويم */
@media (hover: hover) {
  .main-cat-card.has-cover-image:hover > .cat-card-cover-img,
  .setup-cat-card.has-cover-image:hover > .cat-card-cover-img {
    transform: scale(1.06);
  }
}

@media (max-width: 640px) {
  .category-subgroup-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-subgroup-tabs::-webkit-scrollbar {
    display: none;
  }

  .subgroup-tab-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .setup-cat-card.has-cover-image {
    min-height: 176px;
  }

  .main-cat-card.has-cover-image {
    min-height: 158px;
  }
}

/* =========================================================
   تلميح تثبيت تطبيق الويب التقدمي (PWA) لأجهزة iOS (Safari)
   ========================================================= */
.ios-pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.86));
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(10px);
}

.ios-pwa-install-banner[hidden] {
  display: none !important;
}

.ios-pwa-install-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ios-pwa-install-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ios-pwa-install-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.ios-pwa-install-text strong {
  color: #ffffff;
  font-weight: 800;
}

.ios-share-glyph {
  display: inline-block;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.ios-pwa-dismiss-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.ios-pwa-dismiss-btn:hover {
  background: rgba(244, 63, 94, 0.24);
  color: #ffffff;
}

[data-theme="high-contrast"] .ios-pwa-install-banner {
  background: rgba(0, 0, 0, 0.94);
  border-color: #fbbf24;
}

[data-theme="royal-gold"] .ios-pwa-install-banner {
  background: linear-gradient(135deg, rgba(24, 16, 5, 0.94), rgba(38, 25, 8, 0.88));
  border-color: rgba(251, 191, 36, 0.65);
}

/* =========================================================
   تطويرات «برا السالفة»: الكلمة المزدوجة، جولة المفاجأة، ومنظّم الأسئلة والمؤقت
   ========================================================= */
.bs-opt-wide {
  grid-column: 1 / -1;
}

.bs-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bs-variant-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.bs-variant-card strong {
  font-size: 0.94rem;
  font-weight: 900;
  color: #ffffff;
}

.bs-variant-card span {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.bs-variant-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.55);
}

.bs-variant-card.active {
  border-color: #a855f7;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(15, 23, 42, 0.9));
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.22);
}

.bs-surprise-toggle-row {
  margin-top: 8px;
}

.bs-surprise-toggle {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px dashed rgba(251, 191, 36, 0.35);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  transition: all 0.18s ease;
}

.bs-surprise-toggle.active {
  border-style: solid;
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.2);
}

.bs-surprise-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
}

.bs-surprise-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bs-word-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 0.82rem;
  color: #e2e8f0;
}

.bs-word-counter-bar.is-depleted {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fef3c7;
}

.bs-cat-chip.is-depleted {
  border-color: rgba(245, 158, 11, 0.45);
  opacity: 0.82;
}

/* شاشة النقاش ومنظّم الأسئلة الموحّدة */
.bs-discussion-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr);
  gap: 14px;
  width: 100%;
  margin: 12px 0 6px;
}

.bs-organizer-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.bs-organizer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 800;
  color: #94a3b8;
}

.bs-organizer-progress {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.75rem;
}

.bs-organizer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* كشف الكلمتين في طور الكلمة المزدوجة */
.bs-undercover-words-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 10px 0;
}

.bs-uc-word-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.bs-uc-word-pill span {
  font-size: 0.76rem;
  color: #cbd5e1;
  font-weight: 700;
}

.bs-uc-word-pill strong {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
}

.bs-uc-word-pill.is-main {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
}

.bs-uc-word-pill.is-decoy {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(192, 132, 252, 0.5);
}

.bs-secret-undercover-sub {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #e9d5ff;
}

.bs-secret-undercover-sub strong {
  font-size: 1.15rem !important;
  color: #f5d0fe !important;
}

@media (max-width: 720px) {
  .bs-variant-grid,
  .bs-discussion-split,
  .bs-undercover-words-box {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   طور «تحدي الجمهور» (Family Feud / مين الأطليسي)
   ========================================================= */
.hub-game-card.mode-family-feud {
  --hub-accent: #f59e0b;
  border-color: rgba(251, 191, 36, 0.36);
}

.family-feud-modal-card {
  width: min(1140px, 96vw);
  max-height: 94vh;
}

.ff-setup-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ff-entry-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ff-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ff-setting-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ff-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #e2e8f0;
}

.ff-code-input {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 900;
  text-align: center;
  font-size: 1.2rem;
}

.ff-lobby-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ff-lobby-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(6, 10, 26, 0.78);
  border: 1.5px solid rgba(251, 191, 36, 0.42);
}

.ff-room-code-big {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}

.ff-teams-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ff-roster-box {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ff-roster-box.is-team-0 { border-color: rgba(56, 189, 248, 0.45); }
.ff-roster-box.is-team-1 { border-color: rgba(251, 146, 60, 0.45); }

.ff-roster-box h4 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: #ffffff;
}

.ff-roster-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ff-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 700;
}

.ff-inline-team-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ff-inline-team-btn.active {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
}

.ff-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

/* لوحة استوديو المسابقات الرئيسية */
.ff-studio-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at top center, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(ellipse at bottom center, rgba(245, 158, 11, 0.14), transparent 55%),
    linear-gradient(160deg, #070d22 0%, #0f172a 52%, #090e20 100%);
  border: 2px solid rgba(251, 191, 36, 0.42);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.12), inset 0 0 36px rgba(56, 189, 248, 0.08);
  overflow: hidden;
}

.ff-studio-stage.is-steal-mode {
  border-color: rgba(244, 63, 94, 0.72);
  box-shadow: 0 0 45px rgba(244, 63, 94, 0.25);
}

.ff-studio-stage.is-shaking {
  animation: ffBoardShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes ffBoardShake {
  10%, 90% { transform: translate3d(-4px, 0, 0); }
  20%, 80% { transform: translate3d(7px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-9px, 0, 0); }
  40%, 60% { transform: translate3d(9px, 0, 0); }
}

.ff-scoreboard-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.ff-team-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ff-team-pillar.is-team-0.has-spotlight {
  border-color: #38bdf8;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.34), rgba(15, 23, 42, 0.92) 75%);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.45), inset 0 0 20px rgba(56, 189, 248, 0.2);
  transform: scale(1.03);
}

.ff-team-pillar.is-team-1.has-spotlight {
  border-color: #fb923c;
  background: radial-gradient(circle at top, rgba(251, 146, 60, 0.34), rgba(15, 23, 42, 0.92) 75%);
  box-shadow: 0 0 28px rgba(251, 146, 60, 0.45), inset 0 0 20px rgba(251, 146, 60, 0.2);
  transform: scale(1.03);
}

.ff-team-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: #e2e8f0;
}

.ff-team-score {
  font-size: 2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  line-height: 1.1;
}

.ff-spot-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.24);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 900;
}

.ff-pot-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.28), rgba(15, 23, 42, 0.95));
  border: 2px solid #fbbf24;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.28);
}

.ff-pot-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fde68a;
}

.ff-pot-value {
  font-size: 2.35rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(251, 191, 36, 0.55);
  line-height: 1.05;
}

.ff-double-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.ff-round-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: #cbd5e1;
}

/* مرحلة المواجهة (Face-Off) */
.ff-faceoff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 18px 14px;
}

.ff-phase-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  font-size: 0.84rem;
  font-weight: 900;
}

.ff-question-banner {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.45;
  max-width: 780px;
}

.ff-buzz-waiting-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 24px;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px dashed rgba(56, 189, 248, 0.55);
}

.ff-buzz-pulse-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.24);
  border: 2px solid #f43f5e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  animation: ffBuzzPulse 1.2s ease-in-out infinite;
}

@keyframes ffBuzzPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 18px rgba(244, 63, 94, 0); }
}

.ff-buzz-winner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 28px;
  border-radius: 20px;
  border: 2px solid #fbbf24;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.24), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 32px rgba(251, 191, 36, 0.35);
}

.ff-buzz-winner-icon { font-size: 2.2rem; }
.ff-buzz-winner-eyebrow { font-size: 0.85rem; color: #fde68a; font-weight: 800; }
.ff-buzz-winner-name { font-size: 1.9rem; font-weight: 900; color: #ffffff; }
.ff-buzz-winner-team { font-size: 1rem; font-weight: 800; color: #e2e8f0; }

.ff-faceoff-actions,
.ff-manual-team-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ff-local-hint {
  color: #cbd5e1;
  font-size: 0.92rem;
  margin: 0;
}

/* شريط السؤال + علامات الأخطاء */
.ff-question-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 15px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ff-question-text {
  margin: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.38rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.4;
}

.ff-strikes-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ff-strikes-strip.is-compact {
  justify-content: center;
  margin: 4px 0;
}

.ff-strike-slot {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(148, 163, 184, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  transition: all 0.22s ease;
}

.ff-strike-slot.is-hit {
  border-color: #f43f5e;
  background: rgba(225, 29, 72, 0.28);
  color: #fb7185;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.55);
  transform: scale(1.08);
}

.ff-steal-banner {
  padding: 11px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.3), rgba(245, 158, 11, 0.26));
  border: 1.5px solid #fb7185;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.96rem;
  text-align: center;
}

.ff-awarded-banner {
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.22);
  border: 1.5px solid #34d399;
  color: #ecfdf5;
  font-weight: 900;
  text-align: center;
}

/* بطاقات الإجابات بحركة 3D Flip */
.ff-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ff-answer-card {
  position: relative;
  height: 76px;
  padding: 0;
  border: none;
  background: transparent;
  perspective: 1000px;
  cursor: pointer;
  font-family: inherit;
}

.ff-answer-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ff-answer-card.is-flipped .ff-answer-inner {
  transform: rotateX(180deg);
}

.ff-answer-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
}

.ff-answer-front {
  background: linear-gradient(145deg, #1e3a8a, #0f172a);
  border: 2px solid rgba(56, 189, 248, 0.45);
  box-shadow: inset 0 0 18px rgba(56, 189, 248, 0.18), 0 6px 16px rgba(2, 6, 23, 0.45);
  color: #e2e8f0;
}

.ff-answer-card:hover:not(.is-flipped) .ff-answer-front {
  border-color: #fbbf24;
  background: linear-gradient(145deg, #1d4ed8, #1e293b);
}

.ff-rank-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #0b1228;
  font-size: 1.25rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
}

.ff-front-dots {
  letter-spacing: 0.25em;
  opacity: 0.5;
  font-weight: 900;
}

.ff-front-hint {
  font-size: 0.76rem;
  font-weight: 800;
  color: #93c5fd;
}

.ff-answer-back {
  transform: rotateX(180deg);
  background: linear-gradient(145deg, #065f46, #0f172a);
  border: 2px solid #34d399;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

.ff-back-rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  flex-shrink: 0;
}

.ff-back-text {
  flex: 1;
  text-align: right;
  font-size: 1.02rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.ff-back-pts {
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0b1228;
  font-size: 1.28rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* طبقة علامة ❌ الحمراء الكبيرة وسط الشاشة */
.ff-strike-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(2, 6, 23, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: ffStrikePop 0.25s ease-out;
}

.ff-strike-x-row {
  font-size: clamp(5rem, 12vw, 8.5rem);
  font-weight: 900;
  color: #f43f5e;
  letter-spacing: 0.12em;
  text-shadow: 0 0 36px rgba(244, 63, 94, 0.9), 0 8px 24px rgba(0, 0, 0, 0.9);
  padding: 18px 34px;
  border-radius: 26px;
  border: 5px solid #f43f5e;
  background: rgba(15, 23, 42, 0.92);
}

@keyframes ffStrikePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ff-host-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ff-strike-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  border: 1px solid rgba(251, 113, 133, 0.6);
  font-weight: 900;
}

/* شاشة نهاية المباراة */
.ff-gameover-stage {
  align-items: center;
  text-align: center;
  padding: 28px 20px;
}

.ff-trophy-hero { font-size: 3.6rem; }
.ff-winner-title { font-size: clamp(1.4rem, 2.5vw, 2.1rem); margin: 0; color: #ffffff; }

.ff-final-scores-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(560px, 100%);
}

.ff-final-team-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.ff-final-team-card.is-winner {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.35);
}

.ff-final-team-card strong {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
}

/* واجهة هاتف اللاعب (?mode=feud-player) */
.fp-team-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.fp-team-opt.active.is-team-0 {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
}

.fp-team-opt.active.is-team-1 {
  border-color: #fb923c;
  background: rgba(251, 146, 60, 0.24);
  color: #ffffff;
}

.fp-faceoff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.fp-question-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.45;
}

.fp-question-title.is-sm {
  font-size: 1rem;
  text-align: center;
}

.fp-big-buzz-btn {
  width: min(240px, 72vw);
  height: min(240px, 72vw);
  border-radius: 50%;
  border: 6px solid #fda4af;
  background: radial-gradient(circle at 35% 30%, #fb7185, #e11d48 55%, #881337 100%);
  color: #ffffff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(225, 29, 72, 0.55), inset 0 6px 14px rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.fp-big-buzz-btn:active {
  transform: scale(0.93);
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
}

.fp-buzz-emoji { font-size: 2.6rem; }
.fp-big-buzz-btn strong { font-size: 2rem; font-weight: 900; letter-spacing: 0.08em; }
.fp-big-buzz-btn span { font-size: 0.85rem; font-weight: 800; opacity: 0.95; }

.fp-buzz-result {
  width: 100%;
  padding: 20px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fp-buzz-result.is-win {
  background: rgba(16, 185, 129, 0.22);
  border: 2px solid #34d399;
}

.fp-buzz-result.is-locked {
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.fp-buzz-res-ico { font-size: 2.4rem; }
.fp-buzz-result strong { font-size: 1.35rem; color: #ffffff; }

.fp-mini-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.fp-mini-team,
.fp-mini-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
}

.fp-mini-team.is-active {
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

.fp-mini-pot {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.16);
}

.fp-mini-team strong,
.fp-mini-pot strong {
  font-size: 1.25rem;
  color: #ffffff;
}

.fp-answers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.fp-ans-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 58, 138, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.fp-ans-row.is-revealed {
  background: rgba(6, 95, 70, 0.55);
  border-color: #34d399;
}

.fp-ans-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fbbf24;
  color: #0b1228;
  font-weight: 900;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fp-ans-text {
  flex: 1;
  font-weight: 800;
  color: #ffffff;
  font-size: 0.92rem;
}

.fp-ans-pts {
  font-weight: 900;
  color: #fde68a;
  font-size: 0.98rem;
}

@media (max-width: 780px) {
  .ff-entry-tabs,
  .ff-settings-grid,
  .ff-lobby-grid,
  .ff-teams-roster-grid,
  .ff-answers-grid,
  .ff-scoreboard-bar {
    grid-template-columns: 1fr;
  }

  .ff-question-strip {
    flex-direction: column;
    text-align: center;
  }
}


/* =========================================================
   تذييل الصفحة الرئيسية + نافذة الإعلان الكامل (AdInterstitialModal)
   ========================================================= */
.hub-site-footer {
  margin-top: 28px;
  padding: 16px 12px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(203, 213, 225, 0.82);
  text-align: center;
}

.hub-footer-sep {
  opacity: 0.45;
}

.hub-footer-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.hub-footer-link:hover,
.hub-footer-link:focus-visible {
  color: #fde68a;
  text-decoration: underline;
}

.ad-interstitial-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.ad-interstitial-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ad-interstitial-card {
  width: min(560px, 100%);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 40, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 24px;
  padding: 22px 22px 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.ad-interstitial-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ad-interstitial-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 800;
}

.ad-countdown-pill {
  font-size: 0.85rem;
  color: #fde68a;
  font-weight: 700;
}

.ad-interstitial-title {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 900;
  color: #ffffff;
}

.ad-interstitial-sub {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

.ad-slot {
  min-height: 220px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.ad-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 380px;
}

.ad-slot-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.ad-slot-brand {
  font-size: 1.08rem;
  font-weight: 800;
  color: #f8fafc;
}

.ad-slot-note {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.65;
}

.ad-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.ad-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #38bdf8, #fbbf24);
  transition: width 0.9s linear;
}

.ad-interstitial-actions {
  display: flex;
  justify-content: center;
}

.ad-continue-btn {
  min-width: 220px;
  font-weight: 800;
}

.ad-continue-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ad-continue-btn.is-ready {
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.45);
}


/* =========================================================
   إضافات الإطلاق التجاري لمنصة الميدان (كليك، مانع الإعلانات، الإشعارات، البلاغات، ولوحة الأدمن)
   ========================================================= */
.hub-quick-link-card {
  text-decoration: none;
  color: inherit;
}

.hub-site-footer {
  flex-direction: column;
  gap: 8px;
}

.hub-footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hub-footer-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.hub-footer-copy {
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.78);
}

.notif-bell-btn {
  position: relative;
}

.notif-unread-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.55);
}

.credits-header-pill {
  gap: 5px;
  font-weight: 800;
}

.floating-bug-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.92);
  color: #e0f2fe;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, background 0.18s ease;
}

.floating-bug-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.98);
}

@media (max-width: 600px) {
  .floating-bug-label {
    display: none;
  }
  .floating-bug-btn {
    padding: 11px 13px;
  }
}

.ad-choice-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}

.ad-choice-btn {
  width: 100%;
  font-weight: 800;
}

.ad-choice-footnote {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* شاشة حظر مانع الإعلانات (z-index أعلى من كل شيء ولا يمكن إغلاقها) */
.adblock-blocking-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.98);
  backdrop-filter: blur(18px);
}

.adblock-blocking-card {
  width: min(520px, 100%);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  border: 2px solid rgba(239, 68, 68, 0.55);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
}

.adblock-blocking-icon {
  font-size: 3.2rem;
  margin-bottom: 10px;
}

.adblock-blocking-title {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fecaca;
}

.adblock-blocking-desc,
.adblock-blocking-hint {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 0.96rem;
  line-height: 1.75;
}

.adblock-reload-btn {
  margin-top: 8px;
  width: 100%;
  font-weight: 900;
}

/* نوافذ كليك والبلاغات والاقتراحات والإشعارات ولوحة الأدمن */
.platform-modal-card {
  width: min(620px, 96vw);
  max-height: 90vh;
}

.admin-dash-card {
  width: min(860px, 96vw);
}

.platform-modal-body {
  padding: 18px 20px 22px;
}

.platform-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.platform-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.platform-muted-note {
  font-size: 0.82rem;
  color: #94a3b8;
}

.platform-empty-box {
  padding: 20px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  text-align: center;
  color: #94a3b8;
  font-size: 0.92rem;
}

.platform-success-box {
  text-align: center;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.platform-success-ico {
  font-size: 3rem;
}

.cliq-step-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fde68a;
  margin: 14px 0 8px;
}

.cliq-step-title:first-child {
  margin-top: 0;
}

.cliq-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.cliq-pkg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.cliq-pkg-card.is-selected {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}

.cliq-pkg-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

.cliq-pkg-name {
  font-size: 0.98rem;
  font-weight: 800;
}

.cliq-pkg-price {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fde68a;
}

.cliq-info-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cliq-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cliq-info-label {
  color: #94a3b8;
  font-size: 0.88rem;
}

.cliq-alias-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cliq-alias-val {
  font-size: 1.05rem;
  color: #38bdf8;
  letter-spacing: 0.04em;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.notif-item.is-unread {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
}

.notif-item-ico {
  font-size: 1.4rem;
}

.notif-item-msg {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.94rem;
}

.notif-item-date {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 3px;
}

.profile-credits-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.profile-credits-bar strong {
  font-size: 1.35rem;
  color: #fde68a;
  margin-left: 6px;
}

.profile-admin-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-dash-tab {
  padding: 9px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.admin-dash-tab.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-kpi-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.24);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.admin-kpi-card span {
  font-size: 0.8rem;
  color: #94a3b8;
}

.admin-kpi-card strong {
  font-size: 1.35rem;
  color: #fde68a;
  font-weight: 900;
}

.admin-subhead {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #7dd3fc;
  font-weight: 800;
}

.admin-records-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-record-card.is-processed {
  opacity: 0.8;
}

.admin-record-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 260px;
}

.admin-record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
