﻿* { font-family: 'Tajawal', sans-serif; }

    body {
      margin: 0;
      overflow: hidden;
      background: linear-gradient(135deg, #4a2c8a 0%, #5b3dbf 30%, #4338ca 60%, #4f46e5 100%);
    }

    .bg-main {
      min-height: calc(100 * min(var(--vh, 1vh), 1vh));
      background: linear-gradient(135deg, #4a2c8a 0%, #5b3dbf 30%, #4338ca 60%, #4f46e5 100%);
    }
    
    @keyframes glow {
      0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3); }
      50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5); }
    }
    
    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
    
    @keyframes pulse-border {
      0%, 100% { border-color: rgba(255, 215, 0, 0.5); }
      50% { border-color: rgba(255, 215, 0, 1); }
    }
    
    @keyframes shine {
      0% { background-position: -200% center; }
      100% { background-position: 200% center; }
    }
    
    @keyframes confetti-fall {
      0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
      100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
    }
    
    @keyframes star-burst {
      0% { transform: scale(0) rotate(0deg); opacity: 1; }
      50% { transform: scale(1.5) rotate(180deg); opacity: 0.8; }
      100% { transform: scale(0) rotate(360deg); opacity: 0; }
    }
    
    @keyframes crack {
      0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
      100% { clip-path: polygon(20% 0, 80% 0, 90% 50%, 80% 100%, 20% 100%, 10% 50%); }
    }
    
    .game-title {
      background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
      background-size: 200% auto;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      animation: shine 3s linear infinite;

      line-height: 1.3;
      padding-top: 8px;
    }
    
    .glow-button {
      background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
      box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 165, 0, 0.2);
      transition: all 0.3s ease;
    }
    
    .glow-button:hover {
      transform: scale(1.05);
      box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6), 0 0 50px rgba(255, 165, 0, 0.4);
    }

    .card-3d {
      transform-style: preserve-3d;
      transition: all 0.3s ease;
    }
    
    .card-3d:hover {
      transform: translateY(-5px) rotateX(5deg);
    }

    #game-board div {
  transform: none !important;
}

#game-board div:hover {
  transform: none !important;
  scale: 1 !important;
}
    
    .cell-beige { background: linear-gradient(145deg, #F5F5DC, #E8E4C9); }
    .cell-green { background: linear-gradient(145deg, #22C55E, #16A34A); }
    .cell-orange { background: linear-gradient(145deg, #F97316, #EA580C); }
    .cell-red { background: linear-gradient(145deg, #EF4444, #DC2626); }
    .cell-gold { 
      background: linear-gradient(145deg, #FFD700, #FFA500); 
      animation: glow 2s ease-in-out infinite;
    }
    .cell-fun { background: linear-gradient(145deg, #8B5CF6, #7C3AED); }
    
    .cracked {
      position: relative;
      border-color: #ffffff !important;
      outline: 4px solid rgba(2, 6, 23, 0.86);
      outline-offset: -2px;
      box-shadow:
        inset 0 0 0 999px rgba(2, 6, 23, 0.16),
        inset 0 0 0 3px rgba(255, 255, 255, 0.72),
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 0 22px rgba(255, 255, 255, 0.36) !important;
    }

    #game-board .cracked.team-border-red {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #EF4444, 0 0 26px rgba(239, 68, 68, 0.72) !important;
    }

    #game-board .cracked.team-border-blue {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #3B82F6, 0 0 26px rgba(59, 130, 246, 0.72) !important;
    }

    #game-board .cracked.team-border-green {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #22C55E, 0 0 26px rgba(34, 197, 94, 0.72) !important;
    }

    #game-board .cracked.team-border-yellow {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #EAB308, 0 0 26px rgba(234, 179, 8, 0.72) !important;
    }

    #game-board .cracked.team-border-orange {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #F97316, 0 0 26px rgba(249, 115, 22, 0.72) !important;
    }

    #game-board .cracked.team-border-purple {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #A855F7, 0 0 26px rgba(168, 85, 247, 0.72) !important;
    }

    #game-board .cracked.team-border-black {
      box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.18), inset 0 0 0 3px rgba(255,255,255,0.82), 0 0 0 4px #ffffff, 0 0 0 8px #1F2937, 0 0 26px rgba(31, 41, 55, 0.72) !important;
    }

    #game-board .cracked.team-border-pink {
      box-shadow: inset 0 0 0 999px rgba(2, 6, 23, 0.18), inset 0 0 0 3px rgba(255,255,255,0.78), 0 0 0 4px #ffffff, 0 0 0 8px #EC4899, 0 0 26px rgba(236, 72, 153, 0.72) !important;
    }

    #game-board {
  grid-auto-rows: 1fr;
}

#game-board div {
  min-height: 70px;
}
    
    .cracked::after {
  content: none;
}
    
    .team-border-red { border-color: #EF4444 !important; box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
    .team-border-blue { border-color: #3B82F6 !important; box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }
    .team-border-green { border-color: #22C55E !important; box-shadow: 0 0 15px rgba(34, 197, 94, 0.5); }
    .team-border-yellow { border-color: #EAB308 !important; box-shadow: 0 0 15px rgba(234, 179, 8, 0.5); }
    .team-border-orange { border-color: #F97316 !important; box-shadow: 0 0 15px rgba(249, 115, 22, 0.5); }
    .team-border-purple { border-color: #A855F7 !important; box-shadow: 0 0 15px rgba(168, 85, 247, 0.5); }
    .team-border-black { border-color: #1F2937 !important; box-shadow: 0 0 15px rgba(31, 41, 55, 0.5); }
    .team-border-pink { border-color: #EC4899 !important; box-shadow: 0 0 15px rgba(236, 72, 153, 0.5); }
    
    .confetti {
      position: fixed;
      width: 10px;
      height: 10px;
      animation: confetti-fall 3s linear forwards;
    }
    
    .spotlight {
      background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    }

    .category-card {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 20px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  transform-style: preserve-3d;
}

/* الصورة */
.category-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 15px;
  margin: auto;
  transition: all 0.3s ease;
}

/* العنوان */
.category-title {
  margin-top: 10px;
  font-weight: bold;
  color: white;
}

/* 🔥 Hover رهيب */
.category-card:hover {
  transform: translateY(-8px) scale(1.05) rotateX(5deg);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

/* Glow عند المرور */
.category-card:hover .category-img {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* ✨ الكاتوجري المختار */
.category-card.selected {
  border: 2px solid #FFD700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
  transform: scale(1.05);
}

.category-card.selected {
  animation: glowPulse 1.5s infinite alternate;
}

.category-card.selected img {
  transform: scale(1.15);
  filter: drop-shadow(0 0 20px gold);
}

.game-title {
  line-height: 1.1;
  padding-top: 0;
}
/* ===== Activation Form (PRO VERSION) ===== */

.activation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;

  padding: 70px 50px; /* 🔥 أكبر */
  border-radius: 25px;

  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);

  width: 100%;
  max-width: 480px; /* 🔥 أكبر */

  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    inset 2px 2px 10px rgba(0,0,0,0.8),
    inset -1px -1px 5px rgba(255,255,255,0.05);
}

/* العنوان */
.activation-title {
  font-size: 36px; /* 🔥 أكبر */
  font-weight: 800;
  color: #e2e8f0; /* 🔥 بدل الذهبي */
}

/* الوصف */
.activation-desc {
  color: #94a3b8;
  text-align: center;
  font-size: 17px;
}

/* input */
.activation-input {
  width: 100%;
  height: 60px; /* 🔥 أكبر */

  background: #0f172a;
  border: 2px solid #1e293b;
  border-radius: 14px;

  color: white;
  text-align: center;
  font-size: 18px;

  transition: 0.3s;

  box-shadow:
    inset 2px 2px 8px rgba(0,0,0,0.9),
    0 5px 15px rgba(0,0,0,0.5);
}

.activation-input:focus {
  border-color: #6366f1; /* 🔥 بنفسجي */
  transform: scale(1.03);

  box-shadow:
    0 0 20px rgba(99,102,241,0.5),
    inset 2px 2px 8px rgba(0,0,0,1);
}

/* الزر */
.activation-btn {
  width: 100%;
  padding: 16px;

  border-radius: 14px;
  border: none;

  font-size: 20px;
  font-weight: bold;

 background: linear-gradient(135deg, #111827, #000000); /* 🔥 بنفسجي */
  color: white;

  cursor: pointer;
  transition: 0.3s;

  box-shadow: 0 10px 30px rgba(99,102,241,0.5);
}

.activation-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(99,102,241,0.8);
}

/* ===== TEAM BOX UPGRADE ===== */

/* الكرت كامل */
.team-card {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);

  border-radius: 20px;
  padding: 25px;

  box-shadow:
    0 20px 50px rgba(0,0,0,0.6),
    inset 2px 2px 10px rgba(0,0,0,0.8),
    inset -1px -1px 5px rgba(255,255,255,0.05);

  transition: 0.3s;
}

/* حركة خفيفة */
.team-card:hover {
  transform: translateY(-5px) scale(1.01);
}

/* عنوان الفريق */
.team-card h3 {
  font-size: 22px;
  font-weight: bold;
  color: #e2e8f0;
}

/* input */
.team-card input {
  background: #0f172a;
  border: 2px solid #1e293b;
  border-radius: 12px;

  color: white;
  text-align: center;

  transition: 0.3s;
}

.team-card input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99,102,241,0.5);
}

/* الدوائر */
.team-card .color-circle {
  transition: 0.25s;
}

/* ===== TEAM BOX PRO DESIGN ===== */

.team-box {
  position: relative;
  border-radius: 25px;
  padding: 30px;

  background: linear-gradient(145deg, #1e293b, #0f172a);

  box-shadow:
    0 20px 50px rgba(0,0,0,0.7),
    inset 0 0 20px rgba(255,255,255,0.03);

  transition: 0.3s;
  overflow: hidden;
}

/* Glow خلفي خفيف */
.team-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 25px;

  background: radial-gradient(circle at top, rgba(99,102,241,0.2), transparent 60%);
  opacity: 0;
  transition: 0.3s;
}

/* Hover */
.team-box:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 30px 70px rgba(0,0,0,0.9),
    0 0 30px rgba(99,102,241,0.3);
}

.team-box:hover::before {
  opacity: 1;
}

/* عنوان الفريق */
.team-box h3 {
  font-size: 24px;
  font-weight: bold;
  color: #e2e8f0;
  margin-bottom: 15px;
}

/* input */
.team-box input {
  background: #020617;
  border-radius: 12px;
  border: 2px solid #1e293b;
  height: 50px;
  color: white;
  text-align: center;
  transition: 0.3s;
}

.team-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99,102,241,0.5);
}

.team-card .color-circle:hover {
  transform: scale(1.2);
}

/* الدائرة المختارة */
.team-card .color-circle.selected {
  outline: 3px solid #6366f1;
  box-shadow: 0 0 10px rgba(99,102,241,0.7);
}

/* أزرار المساعدة */
.team-card button {
  border-radius: 10px;
  transition: 0.3s;
}

.team-card button:hover {
  transform: scale(1.05);
}

/* الصف الكامل */
.category-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

/* اسم القسم */
.category-title {
  width: 120px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-align: right;
  margin-left: 15px;
}

/* الكاتوجريات */
.category-list {
  display: flex;
  gap: 25px;
  overflow-x: auto;
  padding: 10px 0;
}

/* الكارد */
.category-card {
  min-width: 120px;
  height: 60px;
  border-radius: 12px;
  background: #111;
  border: 2px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

/* hover */
.category-card:hover {
  transform: scale(1.05);
  border-color: white;
}

/* selected */
.category-card.selected {
  background: white;
  color: black;
  border-color: white;
}

.categories-scroll-box {
  max-height: 605px;
  overflow-y: auto;
  padding: 15px;
  border-radius: 20px;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.8) rgba(15, 23, 42, 0.45);
}

.categories-scroll-box::-webkit-scrollbar {
  width: 8px;
}

.categories-scroll-box::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 999px;
}

.categories-scroll-box::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.85);
  border-radius: 999px;
}

#categories-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  direction: rtl;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.category-title {
  flex: 0 0 132px;
  width: 132px;
  margin: 0;
  color: #fbbf24;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.category-list {
  flex: 1 1 auto;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px 10px;
  direction: rtl;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.8) rgba(15, 23, 42, 0.6);
}

.category-list::-webkit-scrollbar {
  height: 8px;
}

.category-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
}

.category-list::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.85);
  border-radius: 999px;
}

.category-card {
  flex: 0 0 auto;
  min-width: 130px;
  min-height: 130px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, #111827, #020617);
  border: 2px solid rgba(148, 163, 184, 0.22);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
}
.category-btn {
  min-width: 130px;
  min-height: 130px;
  padding: 14px;
  border-radius: 16px;
}

.category-card .category-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.category-card span {
  display: block;
}

.category-card:hover {
  transform: scale(1.05);
  border-color: #fbbf24;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.45), 0 14px 28px rgba(0, 0, 0, 0.45);
}

.category-card.selected {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.75), 0 0 38px rgba(251, 191, 36, 0.55);
  transform: scale(1.04);
  animation: none;
}

@media (max-width: 640px) {
  .category-row {
    gap: 10px;
    padding: 12px;
  }

  .category-title {
    flex-basis: 88px;
    width: 88px;
    font-size: 17px;
  }

  .category-card {
    min-width: 128px;
    min-height: 118px;
    font-size: 15px;
    padding: 10px 14px;
  }

  .category-card .category-img {
    width: 52px;
    height: 52px;
  }
}

.category-card .category-img,
.category-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 14px;
  margin: 0 auto 8px;
}

#categories-screen {
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

#categories-screen > .w-full {
  width: 80vw !important;
  max-width: 1400px !important;
  height: min(86vh, 920px);
  margin: 0 auto !important;
  display: flex;
  flex-direction: column;
}

#categories-screen .categories-scroll-box {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 20px;
}

#categories-screen .setup-action-row {
  flex: 0 0 auto;
  margin: 18px 0 0;
}

#categories-screen .setup-footer-actions {
  flex: 0 0 auto;
  margin-top: 10px;
}

.selected-mode-label {
  position: fixed;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fde68a;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.42);
  box-shadow: none;
  line-height: 1;
  white-space: nowrap;
}

.current-mode-label {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: #fde68a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.42);
  pointer-events: none;
}

.current-turn-panel .current-mode-label {
  color: #fde68a;
  font-size: 24px;
}

.winner-results-shell {
  position: relative;
  z-index: 10;
  width: min(94vw, 1120px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  padding: 120px 0 110px;
}

.winner-results-title {
  position: fixed;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  color: #fbbf24;
  font-size: clamp(44px, 6vw, 82px);
  font-weight: 1000;
  line-height: 1.1;
  margin-bottom: 18px;
  text-shadow: 0 0 42px rgba(251, 191, 36, 0.58);
}

.result-cards {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(44px, 6vw, 86px);
  flex-wrap: nowrap;
  width: 100%;
  direction: ltr;
}

.result-card {
  position: relative;
  width: min(330px, 88vw);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.42), 0 0 34px rgba(251, 191, 36, 0.16);
  animation: slide-in-top 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) both;
}

.result-card:nth-child(2) {
  animation-delay: 0.12s;
}

.result-card-main {
  min-height: 185px;
  padding: 26px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: right;
}

.result-card-detail {
  background: #ffffff;
  padding: 20px 24px 22px;
  color: #111827;
}

.result-card.winner .result-card-main {
  background: linear-gradient(45deg, #fff7d6, #ffdd87 48%, #f59e0b);
}

.result-card.loser .result-card-main {
  background: linear-gradient(45deg, #f8fafc, #cbd5e1);
}

.result-card.tie {
  width: min(620px, 90vw);
}

.result-card.tie .result-card-main {
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, #fff7d6, #ffffff 45%, #c7d2fe);
}

.result-rank {
  font-size: 68px;
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.78);
  line-height: 1;
}

.result-rank-label,
.result-score-label {
  color: #424c50;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 2px;
}

.result-team-name {
  margin-top: 8px;
  color: #111827;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1.2;
}

.result-score {
  color: #ea9518;
  font-size: 38px;
  font-weight: 1000;
  line-height: 1;
}

.result-card.loser .result-score {
  color: #475569;
}

.result-trophy {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 58px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.tie-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tie-team-box {
  border-radius: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.07);
}

.winner-restart-btn {
  position: fixed;
  bottom: 124px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  border: 0;
  border-radius: 16px;
  padding: 16px 42px;
  margin-top: 22px;
  color: #111827;
  font-size: 20px;
  font-weight: 1000;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
  box-shadow: 0 14px 34px rgba(251, 191, 36, 0.34), 0 0 36px rgba(251, 191, 36, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.winner-restart-btn:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.03);
  box-shadow: 0 20px 42px rgba(251, 191, 36, 0.42), 0 0 48px rgba(251, 191, 36, 0.25);
}

@keyframes slide-in-top {
  0% {
    transform: translateY(-100px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .result-cards {
    gap: 18px;
    flex-wrap: wrap;
  }

  .result-card-main {
    min-height: 160px;
  }

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

.leaderboard-card {
  position: relative;
  width: 390px;
  height: 350px;
  transition-duration: 0.5s;
  background: none;
  overflow: hidden;
  animation: slide-in-top 1s cubic-bezier(0.65, 0.05, 0.36, 1) both;
}

.leaderboard-card:nth-child(2) {
  animation-delay: 0.14s;
}

.leaderboard-card.winner-card {
  order: 1;
  width: 440px;
  height: 390px;
}

.leaderboard-card.loser-card {
  order: 2;
}

.leaderboard-card.winner-card .outlinePage {
  width: 440px;
  height: 230px;
}

.leaderboard-card.winner-card .detailPage {
  width: 440px;
  height: 180px;
}

.leaderboard-card.winner-card .ranking_number {
  font-size: 122px;
}

.leaderboard-card.winner-card .ranking_word {
  font-size: 58px;
}

.leaderboard-card.winner-card .trophy {
  font-size: 104px;
}

.leaderboard-card.winner-card .userName {
  font-size: 25px;
}

.leaderboard-card.winner-card .gradesBoxNum {
  font-size: 48px;
}

.leaderboard-card .outlinePage {
  position: relative;
  width: 390px;
  height: 205px;
  border-radius: 32px;
  transition-duration: 0.5s;
  z-index: 2;
  box-shadow: 0 10px 15px rgba(177, 152, 94, 0.9);
}

.leaderboard-card.winner-card .outlinePage {
  background: linear-gradient(45deg, #fffbf0, #ffdd87);
}

.leaderboard-card.loser-card .outlinePage {
  background: linear-gradient(45deg, #f8fafc, #cbd5e1);
}

.leaderboard-card .detailPage {
  position: relative;
  display: flex;
  width: 390px;
  height: 165px;
  background: #ffffff;
  top: -20px;
  z-index: 1;
  transition-duration: 1s;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
}

.leaderboard-card .splitLine {
  position: absolute;
  width: 260px;
  height: 12px;
  top: 136px;
  left: 28px;
  background-image: linear-gradient(to right, transparent 10%, #ffe8a0 20%, #f7b733 50%, #ffe8a0 70%, transparent 90%);
  z-index: 1;
}

.leaderboard-card .trophy {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 2;
  font-size: 104px;
  line-height: 1;
  filter: drop-shadow(0 14px 18px rgba(106, 75, 22, 0.28));
}

.leaderboard-card .ranking_number {
  position: relative;
  color: #ffc64b;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 800;
  font-size: 105px;
  left: 26px;
  padding: 0;
  margin: 0;
  top: -5px;
  line-height: 1;
  direction: ltr;
  text-align: left;
}

.leaderboard-card .ranking_word {
  position: relative;
  font-size: 52px;
  color: #424c50;
}

.leaderboard-card .userAvatar {
  position: absolute;
  bottom: 19px;
  left: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #8a8f92;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7578;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.58);
}

.leaderboard-card .userName {
  position: absolute;
  font-weight: 800;
  color: #6b7578;
  left: 82px;
  right: 22px;
  bottom: 23px;
  font-size: 23px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
}

.leaderboard-card .medals {
  position: absolute;
  top: 13px;
  right: 8px;
  font-size: 70px;
  line-height: 1;
}

.leaderboard-card .gradesBox {
  position: relative;
  height: 105px;
  top: 18px;
  margin-right: 16px;
  margin-left: 28px;
}

.leaderboard-card .gradesIcon {
  position: absolute;
  top: 14px;
  left: 0;
  color: #dea13a;
  font-size: 54px;
  line-height: 1;
}

.leaderboard-card .gradesBoxLabel {
  position: relative;
  display: block;
  margin-left: 76px;
  color: #424c50;
  letter-spacing: 6px;
  font-family: Arial, Helvetica, sans-serif;
  margin-top: 28px;
  font-weight: 800;
  font-size: 16px;
}

.leaderboard-card .gradesBoxNum {
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  display: block;
  font-size: 42px;
  font-weight: 900;
  margin-left: 76px;
  color: #ea9518;
  top: -5px;
}

.leaderboard-card.loser-card .ranking_number,
.leaderboard-card.loser-card .gradesBoxNum {
  color: #64748b;
}

.leaderboard-card.loser-card .splitLine {
  background-image: linear-gradient(to right, transparent 10%, #e5e7eb 20%, #94a3b8 50%, #e5e7eb 70%, transparent 90%);
}

.tie-leaderboard-card {
  width: min(620px, 90vw);
  height: auto;
  border-radius: 25px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  animation: slide-in-top 1s cubic-bezier(0.65, 0.05, 0.36, 1) both;
}

.tie-leaderboard-card .outlinePage {
  width: 100%;
  min-height: 160px;
  border-radius: 25px 25px 0 0;
  background: linear-gradient(45deg, #fffbf0, #ffdd87);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tie-leaderboard-card .tie-title {
  color: #ffc64b;
  font-size: 72px;
  font-weight: 1000;
  line-height: 1;
}

.tie-leaderboard-card .tie-subtitle {
  color: #424c50;
  font-size: 24px;
  font-weight: 900;
}

.tie-leaderboard-card .detailPage {
  display: block;
  width: 100%;
  height: auto;
  top: 0;
  border-radius: 0 0 25px 25px;
  background: #ffffff;
  padding: 22px;
}

#categories-screen #categories-container {
  gap: 22px;
}

#categories-screen .category-row {
  min-height: 165px;
  padding: 16px;
}

#categories-screen .category-list {
  gap: 16px;
  padding: 10px 6px 12px;
}

#categories-screen .category-card,
#categories-screen .category-btn {
  min-width: 148px;
  min-height: 148px;
  padding: 16px;
  font-size: 18px;
}

#categories-screen .category-card .category-img,
#categories-screen .category-img {
  width: 78px;
  height: 78px;
}

#categories-screen .category-card.locked,
#categories-screen .category-btn.locked {
  opacity: 0.34;
  filter: grayscale(1) brightness(0.55);
  cursor: not-allowed;
  pointer-events: none;
  background: linear-gradient(145deg, #0b1020, #050816) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.35) !important;
  transform: none !important;
}

#categories-screen .category-card.locked .category-img,
#categories-screen .category-btn.locked .category-img {
  opacity: 0.45;
  filter: grayscale(1);
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  #categories-screen > .w-full {
    width: 92vw !important;
    height: 90vh;
  }

  #categories-screen .categories-scroll-box {
    padding: 16px;
  }

  #categories-screen .category-row {
    min-height: 150px;
    gap: 12px;
  }

  #categories-screen .category-card,
  #categories-screen .category-btn {
    min-width: 138px;
    min-height: 138px;
    font-size: 16px;
  }
}

.setup-action-row {
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
}

.setup-footer-actions {
  margin-top: 8px;
}

.team-name-input {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.team-color-btn {
  position: relative;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.team-color-btn.selected,
.team-color-btn.border-white {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 0 18px rgba(255, 215, 0, 0.65);
  transform: scale(1.12);
}

.button-with-icon {
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f988e;
  font-family: "Tajawal", "Istok Web", sans-serif;
  letter-spacing: 0;
  padding: 0 12px;
  text-align: center;
  width: 150px;
  height: 44px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 8px;
  outline: none;
  user-select: none;
  cursor: pointer;
  transform: translateY(0px);
  position: relative;
  box-shadow:
    inset 0 30px 30px -15px rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 1px 20px rgba(0, 0, 0, 0),
    0 3px 0 #0f988e,
    0 3px 2px rgba(0, 0, 0, 0.2),
    0 5px 10px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.1);
  background: #15ccbe;
  color: white;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  transition: 150ms all ease-in-out;
}

.button-with-icon-dark {
  border-color: #111827;
  background: linear-gradient(135deg, #111827, #020617);
  color: #ffffff;
  box-shadow:
    inset 0 30px 30px -15px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 3px 0 #020617,
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 26px rgba(99, 102, 241, 0.35);
}

.button-with-icon-dark:hover:not(:disabled) {
  box-shadow:
    inset 0 30px 30px -15px rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 3px 0 #020617,
    0 10px 30px rgba(0, 0, 0, 0.55),
    0 0 34px rgba(99, 102, 241, 0.55);
}

.button-with-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-with-icon .icon {
  margin-left: 8px;
  width: 24px;
  height: 24px;
  transition: all 0.5s ease-in-out;
}

.button-with-icon:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 16px 2px -15px rgba(0, 0, 0, 0),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 1px 20px rgba(0, 0, 0, 0.1),
    0 0 0 #0f988e,
    0 0 0 2px rgba(255, 255, 255, 0.5);
}

.button-with-icon:hover .text {
  transform: translateX(-80px);
}

.button-with-icon:hover .icon {
  transform: translateX(-23px);
}

.button-with-icon .text {
  transition: all 0.5s ease-in-out;
}

.setup-nav-button {
  min-width: 130px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.setup-nav-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.setup-nav-button:disabled {
  cursor: not-allowed;
}

.setup-nav-button-primary {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
  color: #0f172a;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

.setup-nav-button-secondary {
  background: #475569;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}

.social-icon-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.social-icon-button {
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.setup-action-button {
  background: linear-gradient(135deg, #111827, #020617);
  border-color: #020617;
  box-shadow:
    inset 0 30px 30px -15px rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.12),
    0 3px 0 #020617,
    0 8px 24px rgba(0,0,0,0.45),
    0 0 26px rgba(99,102,241,0.35);
}

.random-no-animation,
.random-no-animation:hover,
.random-no-animation:active {
  transform: none !important;
  transition: none !important;
  box-shadow:
    inset 0 30px 30px -15px rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.12),
    0 3px 0 #020617,
    0 8px 24px rgba(0,0,0,0.45),
    0 0 26px rgba(99,102,241,0.35) !important;
}

.random-no-animation:hover .text,
.random-no-animation:hover .icon,
.random-no-animation:active .text,
.random-no-animation:active .icon {
  transform: none !important;
  transition: none !important;
}
.social-icon-button:hover {
  transform: translateY(-3px) scale(1.12);
  color: #111827;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(255, 255, 255, 0.55);
}

.social-icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 6px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.canva-animated-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, #4a2c8a 0%, #5b3dbf 30%, #4338ca 60%, #4f46e5 100%);
  overflow: hidden;
  height: 100vh;
}

.canva-animated-bg > .fixed {
  height: 100vh;
}

.static-square-grid {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fill, 100px);
  grid-auto-rows: 100px;
  justify-content: center;
  align-content: center;
  gap: 0;
}

.square {
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

.social-icon-button:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mode-screen-inner {
  width: 100%;
  max-width: 980px;
  text-align: center;
  direction: rtl;
}

.mode-title {
  color: #fbbf24;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  margin-bottom: 10px;
}

.mode-subtitle {
  color: rgba(253, 230, 138, 0.82);
  font-size: 20px;
  margin-bottom: 34px;
}

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

.mode-card {
  min-height: 230px;
  padding: 30px;
  border: 2px solid rgba(251, 191, 36, 0.24);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  color: #ffffff;
  text-align: right;
  cursor: pointer;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.38), inset 0 0 22px rgba(255, 255, 255, 0.035);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mode-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.48), 0 0 34px rgba(251, 191, 36, 0.28);
}

.mode-card.selected {
  border-color: #ffffff;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 0 36px rgba(251, 191, 36, 0.55);
  transform: translateY(-4px) scale(1.02);
}

.mode-card.selected h3 {
  color: #ffffff;
}

.mode-card h3 {
  color: #fbbf24;
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 14px;
}

.mode-card p {
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

.mode-back-btn {
  margin-top: 34px;
  min-width: 150px;
  padding: 13px 24px;
  border: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.86);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-back-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.mode-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.mode-actions .mode-back-btn,
.mode-actions .mode-confirm-btn {
  margin-top: 0;
}

.mode-confirm-btn {
  min-width: 170px;
  padding: 13px 24px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-confirm-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.42);
}

.splash-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: rgba(253, 230, 138, 0.88);
  font-size: 18px;
  font-weight: 900;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-dots {
  display: flex;
  gap: 10px;
  direction: ltr;
}

.splash-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.65);
  animation: loadingPulse 0.9s ease-in-out infinite alternate;
}

.splash-dots span:nth-child(2) { animation-delay: 0.15s; }
.splash-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingPulse {
  from { opacity: 0.35; transform: translateY(0) scale(0.8); }
  to { opacity: 1; transform: translateY(-8px) scale(1.1); }
}

.main-menu-buttons {
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
}

.main-menu-btn {
  width: 100%;
  min-height: 72px;
  border: 2px solid rgba(251, 191, 36, 0.25);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.94), rgba(2, 6, 23, 0.98));
  color: #ffffff;
  font-size: 24px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), inset 0 0 18px rgba(255, 255, 255, 0.035);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.main-menu-btn:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(251, 191, 36, 0.78);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.48), 0 0 28px rgba(251, 191, 36, 0.28);
}

.customize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}

.board-size-panel {
  margin: 0 auto 28px;
  max-width: 720px;
  padding: 24px;
  border-radius: 24px;
  border: 2px solid rgba(251, 191, 36, 0.18);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.94));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.board-size-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.board-size-btn {
  min-width: 145px;
  min-height: 54px;
  border: 2px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.8);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.board-size-btn:hover,
.board-size-btn.selected {
  transform: translateY(-2px);
  border-color: #fbbf24;
  background: linear-gradient(145deg, #111827, #020617);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.32);
}

.about-modal-card {
  width: min(92vw, 760px);
  padding: 34px;
  border-radius: 28px;
  border: 2px solid rgba(251, 191, 36, 0.32);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  color: #e2e8f0;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5), 0 0 36px rgba(99, 102, 241, 0.24);
  direction: rtl;
}

.about-modal-card h2 {
  color: #fbbf24;
  font-size: 34px;
  font-weight: 1000;
  margin-bottom: 18px;
  text-align: center;
}

.about-modal-card p {
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 16px;
}

.about-mode-title {
  color: #facc15;
  font-weight: 1000;
}

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

  .customize-grid {
    grid-template-columns: 1fr;
  }
}

.game-layout-shell,
.main-layout {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 clamp(14px, 1.5vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(14px, 1.4vw, 26px);
}

.game-team-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  height: calc(100vh - 60px);
  min-height: 0;
  padding: 18px;
  border-radius: 22px;
  border: 4px solid rgba(251, 191, 36, 0.18);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 28px rgba(99, 102, 241, 0.18);
  overflow: hidden;
}

.game-team-header {
  text-align: center;
}

.game-team-label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.game-team-name {
  margin-top: 4px;
  color: #fbbf24;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

.game-score-line {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) 44px;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.game-team-score {
  margin: 0;
  color: #ffffff;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.28);
}

.game-help-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.score-control-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.score-control-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

.score-plus {
  color: #22c55e;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.22);
}

.score-minus {
  color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.22);
}

.helper-chip {
  position: relative;
  border: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  padding: 0;
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

.helper-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  transform: translateX(-50%) translateY(6px);
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.helper-chip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.helper-chip:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 26px rgba(0,0,0,0.22);
}

.helper-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.helper-chip:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.helper-options {
  background: #ffffff;
}

.helper-letters {
  background: #ffffff;
}

.game-team-divider {
  width: 100%;
  margin: 14px 0 12px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.answer-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.3) rgba(15, 23, 42, 0.08);
}

.answer-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 24px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 26px;
  font-weight: 800;
}

.answer-log-points {
  flex: 0 0 auto;
  font-weight: 900;
}

.answer-easy { color: #22c55e; }
.answer-medium { color: #f97316; }
.answer-hard { color: #ef4444; }
.answer-gold { color: #fbbf24; }
.answer-wrong { color: #94a3b8; }

.game-board-area,
.center-area {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 clamp(8px, 1vw, 18px);
}

#game-board {
  direction: ltr;
  width: min(100%, 1050px) !important;
  max-width: 1050px !important;
  gap: 8px !important;
  grid-auto-rows: 1fr !important;
  margin-top: 20px;
  margin-bottom: 20px;
}

#game-board.board-size-18 {
  max-width: 720px !important;
}

#game-board.board-size-24 {
  max-width: 840px !important;
}

#game-board.board-size-36 {
  max-width: 1050px !important;
}

#game-board > div {
  direction: ltr;
  min-height: 130px !important;
  aspect-ratio: 1 / 1;
  font-size: 2.2rem !important;
}



.current-turn-panel {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 34px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(251, 191, 36, 0.26);
  color: #fbbf24;
  font-size: 21px;
  font-weight: 900;
  transform: translateX(-50%) scale(1.08);
  transform-origin: top center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26), 0 0 28px rgba(251, 191, 36, 0.18);
}

.current-turn-panel span {
  color: #cbd5e1;
  font-size: 17px;
}

.game-board-actions {
  position: absolute;
  bottom: 60px;
  left: 50%;
  z-index: 10;
  display: flex;
  justify-content: center;
  transform: translateX(-50%);
  margin-top: 0;
}

.game-actions-segment {
  display: inline-flex;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(145deg, #111827, #020617);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), inset 0 0 16px rgba(255, 255, 255, 0.035);
}

.game-actions-segment .label {
  min-width: 190px;
  padding: 17px 26px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #e5e7eb;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

#remaining-cells {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0 !important;
  color: #fde68a !important;
  font-size: 24px !important;
  font-weight: 1000 !important;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.34);
}

.game-actions-segment .label:first-child {
  border-left: 0;
}

.game-actions-segment .label:hover {
  background: rgba(251, 191, 36, 0.13);
  color: #fbbf24;
}

#question-modal {
  direction: rtl;
  background: rgba(3, 7, 18, 0.62);
}

.question-modal-card {
  --team-color: #f59e0b;
  --team-glow: rgba(245, 158, 11, 0.32);
  position: relative;
  overflow: hidden;
  width: min(90vw, 900px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 80px;
  border-radius: 34px;
  border: 4px solid var(--team-color);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.38), 0 0 42px var(--team-glow);
}

.question-modal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: linear-gradient(90deg, transparent, var(--team-color), transparent);
  opacity: 0.9;
}

.question-modal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.question-meta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

#question-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

#question-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

#question-category {
  color: #475569;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  margin: 0;
}

.question-timer-pill,
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: end;
  min-width: 120px;
  padding: 12px 14px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.85);
}

#question-modal #timer {
  display: inline-flex;
  justify-content: center;
  min-width: 74px;
  text-align: center;
  color: #000000;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
}

#question-modal #timer::after {
  content: " ثانية";
  margin-right: 4px;
  color: #000000;
  font-size: 13px;
  font-weight: 800;
}

.cloader {
  width: 5.8em;
  height: 5.8em;
  border: 4px solid black;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
  padding: 1.08rem;
  background: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.clface {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translateY(-3px);
}

.top {
  height: 8px;
  width: 3px;
  background-color: black;
  border-radius: 5em;
  margin-top: -19px;
  margin-left: 24px;
}

.bottom {
  height: 8px;
  width: 3px;
  background-color: black;
  border-radius: 5em;
  margin-top: 74px;
  margin-left: 24px;
}

.left {
  height: 3px;
  width: 8px;
  background-color: black;
  border-radius: 5em;
  margin-top: -46px;
  margin-left: 62px;
}

.right {
  height: 3px;
  width: 8px;
  background-color: black;
  border-radius: 5em;
  margin-top: -3px;
  margin-left: -21px;
}

.clsface {
  position: absolute;
  width: 24px;
  height: 24px;
  margin-left: 13px;
  margin-top: 8px;
  border-radius: 6em;
  border: 2px solid #636363;
  background-color: #444;
}

.hand {
  width: 65%;
  height: 3px;
  background-color: black;
  border-radius: 3em;
  border: none;
  position: absolute;
  top: 85%;
  left: -15%;
  transform-origin: 100%;
  transform: rotate(90deg);
}

.pin {
  width: 25%;
  height: 25%;
  border-radius: 50%;
  background: black;
  position: absolute;
  top: 86%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#sub {
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: #444;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#h1 {
  animation: rotate 4s linear infinite;
}

#h2 {
  width: 45%;
  left: 5%;
  top: 45%;
  background-color: #444;
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(90deg);
  }

  to {
    transform: rotate(450deg);
  }
}

.question-body-card {
  padding: 32px;
  margin-bottom: 22px;
  border-radius: 26px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#question-text {
  color: #0f172a;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 900;
  line-height: 1.7;
  text-align: center;
}

.question-image {
  width: min(900px, 95%);
  max-height: 500px;
  object-fit: contain;
  margin: 24px auto 0;
  display: block;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

#second-question-title {
  color: #b45309;
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
  margin-bottom: 10px;
}

#options-container {
  gap: 14px;
  margin-bottom: 22px;
}

#options-container button {
  min-height: 58px;
  padding: 14px 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#options-container button:hover {
  transform: translateY(-2px);
  border-color: var(--team-color);
  box-shadow: 0 16px 30px var(--team-glow);
}

#letters-hint {
  margin-bottom: 22px;
}

#letters-hint p:first-child {
  color: #475569;
  font-weight: 900;
}

#hint-letters {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 18px;
  background: #0f172a !important;
  color: #ffffff !important;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 8px;
}

#answer-container {
  padding: 22px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: #ecfdf5 !important;
  border: 2px solid rgba(16, 185, 129, 0.58) !important;
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.12);
}

#answer-container p:first-child {
  color: #047857 !important;
  font-size: 15px;
  font-weight: 900;
}

#answer-text {
  color: #064e3b !important;
  font-size: 30px;
  font-weight: 1000;
}

.question-actions,
.question-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

#question-modal .hidden {
  display: none !important;
}

.question-modal-btn {
  min-width: 170px;
  min-height: 60px;
  padding: 16px 28px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 1000;
  cursor: pointer;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.question-modal-btn:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.03);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.question-modal-btn.show-answer {
  background: linear-gradient(145deg, #f59e0b, #d97706);
}

.question-modal-btn.correct {
  --answer-color: #10b981;
  --answer-color-dark: #059669;
  --answer-glow: rgba(16, 185, 129, 0.34);
  background: linear-gradient(145deg, color-mix(in srgb, var(--answer-color) 72%, white), var(--answer-color) 52%, var(--answer-color-dark));
  box-shadow: 0 14px 30px var(--answer-glow), 0 0 24px color-mix(in srgb, var(--answer-color) 28%, transparent);
}

.question-modal-btn.team-blue {
  --answer-color: #3B82F6;
  --answer-color-dark: #1D4ED8;
  --answer-glow: rgba(59, 130, 246, 0.34);
}

.question-modal-btn.team-red {
  --answer-color: #EF4444;
  --answer-color-dark: #B91C1C;
  --answer-glow: rgba(239, 68, 68, 0.34);
}

.question-modal-btn.wrong {
  background: linear-gradient(145deg, #1f2937, #020617);
  border: 1px solid rgba(248, 113, 113, 0.36);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.42), 0 0 24px rgba(239, 68, 68, 0.22);
}

@media (max-width: 720px) {
  .question-modal-card {
    padding: 26px;
    border-radius: 26px;
  }

  .question-modal-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .question-meta-group,
  .question-timer-pill {
    justify-content: center;
    justify-self: center;
  }

  .cloader {
    width: 5em;
    height: 5em;
    padding: 0.95rem;
  }

  .question-modal-btn {
    width: 100%;
    min-width: 0;
    font-size: 18px;
  }

  #options-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .game-layout-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .game-team-panel {
    width: min(100%, 420px);
    height: 360px;
    justify-self: center;
  }
}
@keyframes glowPulse {
  from {
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
  }
  to {
    box-shadow: 0 0 30px rgba(255,215,0,1);
  }
}
  
.question-meta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#question-type-badge,
#question-points {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  font-weight: 950 !important;
  line-height: 1.2;
}
#question-type-badge { font-size: 24px !important; }
#question-points { font-size: 22px !important; }
.silence-power-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(2, 6, 23, 0.68); backdrop-filter: blur(8px); }
.silence-power-card { width: min(92vw, 520px); border-radius: 28px; padding: 30px; text-align: center; background: linear-gradient(145deg, #ffffff, #eef2ff); color: #111827; border: 2px solid rgba(251, 191, 36, 0.72); box-shadow: 0 24px 70px rgba(0,0,0,0.36), 0 0 34px rgba(251, 191, 36, 0.28); }
.silence-power-card h3 { margin: 0 0 14px; color: #b45309; font-size: 30px; font-weight: 950; }
.silence-power-card p { margin: 0 0 22px; color: #1f2937; font-size: 21px; font-weight: 800; line-height: 1.8; }
.silence-power-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.silence-power-actions button { min-width: 120px; border: 0; border-radius: 16px; padding: 13px 24px; cursor: pointer; font-size: 18px; font-weight: 950; color: white; background: linear-gradient(145deg, #111827, #020617); box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28); }
.silence-power-actions button.primary { background: linear-gradient(145deg, #f59e0b, #d97706); }


.silence-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.silence-progress.hidden {
  display: none;
}

.silence-step {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 2px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.silence-step.active {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(255,255,255,0.65);
}

.silence-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.silence-step.active .silence-icon {
  opacity: 1;
}


/* Silence/helper size polish */
.game-help-controls {
  gap: 16px;
  margin-top: 20px;
}

.helper-chip {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  border-radius: 20px !important;
}

.helper-chip img {
  width: 36px !important;
  height: 36px !important;
}

.silence-progress {
  gap: 10px !important;
  margin-top: 16px !important;
}

.silence-step {
  width: 68px !important;
  height: 68px !important;
  border-radius: 20px !important;
  border: 2px solid rgba(255,255,255,0.45) !important;
  background: rgba(255,255,255,0.08) !important;
}

.silence-step.active {
  background: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 18px rgba(255,255,255,0.7) !important;
}

.silence-icon {
  display: block !important;
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  opacity: 0 !important;
  filter: none !important;
}

.silence-step.active .silence-icon {
  opacity: 1 !important;
}


/* Question modal category emphasis */
#question-category {
  font-size: 28px !important;
  line-height: 1.25 !important;
  font-weight: 950 !important;
}

.silence-progress.earned .silence-icon {
  opacity: 1 !important;
}

/* Customize screen positioning and sizing */
#customize-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 100vh;
  overflow: auto;
}

#customize-screen > .w-full.max-w-5xl {
  width: min(92vw, 1180px);
  max-width: 1180px;
  margin: 0 auto !important;
}

#customize-screen h2 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

#customize-screen p {
  margin-bottom: 34px;
}

#customize-screen .customize-grid {
  gap: 34px;
  margin-bottom: 34px;
}

#customize-screen .team-box {
  padding: 30px !important;
  min-height: 285px;
}

#customize-screen .team-box h3 {
  margin-bottom: 18px !important;
}

#customize-screen .team-name-input {
  min-height: 58px;
  font-size: 22px !important;
  margin-bottom: 20px !important;
}

#customize-screen .team-color-btn {
  width: 46px !important;
  height: 46px !important;
}

#customize-screen .board-size-panel {
  max-width: 800px;
  padding: 28px;
  margin-bottom: 0;
}

#customize-screen .board-size-options {
  gap: 18px;
}

#customize-screen .board-size-btn {
  min-width: 160px;
  min-height: 60px;
  font-size: 19px;
}

#customize-screen .setup-footer-actions {
  margin-top: 0;
  padding-bottom: 0 !important;
  gap: 18px !important;
}

#customize-screen .setup-nav-button {
  min-width: 145px;
  min-height: 50px;
  font-size: 18px;
}

@media (max-width: 900px) {
  #customize-screen {
    justify-content: flex-start;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  #customize-screen > .w-full.max-w-5xl {
    width: min(94vw, 720px);
  }

  #customize-screen .customize-grid {
    gap: 22px;
  }

  #customize-screen .team-box {
    min-height: 0;
    padding: 24px !important;
  }

  #customize-screen .board-size-panel {
    padding: 24px;
  }
}
/* Responsive layout fixes: tablets and small screens only */
@media (max-width: 1180px) {
  #categories-screen > .w-full {
    width: 94vw !important;
    height: min(88vh, 820px);
  }

  #categories-screen .category-row {
    min-height: 145px;
  }

  #categories-screen .category-card,
  #categories-screen .category-btn {
    min-width: 132px;
    min-height: 132px;
    padding: 14px;
  }

  #categories-screen .category-img {
    width: 68px;
    height: 68px;
  }

  .game-layout-shell,
  .main-layout {
    display: grid;
    grid-template-columns: minmax(176px, 230px) minmax(0, 1fr) minmax(176px, 230px);
    gap: 12px;
    padding: 0 12px;
    align-items: center;
  }

  .game-team-panel {
    width: 100%;
    max-width: 230px;
    height: calc(100svh - 34px);
    padding: 12px;
    border-width: 3px;
  }

  .game-team-name {
    font-size: 19px;
  }

  .game-score-line {
    grid-template-columns: 34px minmax(70px, 1fr) 34px;
    gap: 8px;
  }

  .score-control-btn {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .game-team-score {
    font-size: 34px;
  }

  .helper-chip,
  .lifeline-btn,
  .silence-step {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 15px;
  }

  .helper-chip img,
  .lifeline-btn img,
  .silence-icon {
    width: 30px;
    height: 30px;
  }

  .game-help-controls {
    gap: 10px;
    margin-top: 12px;
  }

  .answer-log-row {
    padding: 12px 14px;
    font-size: 17px;
  }

  .game-board-area,
  .center-area {
    height: calc(100svh - 34px);
    padding: 0 6px;
  }

  #game-board {
    width: min(100%, 610px) !important;
    max-width: 610px !important;
    gap: 6px !important;
  }

  #game-board.board-size-18,
  #game-board.board-size-24,
  #game-board.board-size-36 {
    max-width: 610px !important;
  }

  #game-board > div {
    min-height: clamp(72px, 8vw, 94px) !important;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem) !important;
  }

  .current-turn-panel {
    top: 8px;
    padding: 12px 22px;
    gap: 10px;
    font-size: 17px;
    transform: translateX(-50%) scale(1);
  }

  .current-turn-panel span,
  .current-turn-panel .current-mode-label {
    font-size: 15px;
  }

  .game-board-actions {
    bottom: 48px;
  }

  .game-actions-segment .label {
    min-width: 138px;
    padding: 13px 16px;
    font-size: 15px;
  }

  #remaining-cells {
    bottom: 10px;
    font-size: 20px !important;
  }

  .question-modal-card {
    width: min(94vw, 860px);
    max-height: 92svh;
    overflow-y: auto;
    padding: 32px;
  }

  .question-image {
    width: min(590px, 92%);
    max-height: 320px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  #categories-screen {
    padding: 12px !important;
  }

  #categories-screen > .w-full {
    width: 96vw !important;
    height: 86svh;
  }

  #categories-screen .selected-mode-label {
    top: 10px;
    font-size: 26px;
  }

  #categories-screen h2 {
    font-size: 28px !important;
    margin-top: 22px !important;
  }

  #categories-screen .categories-scroll-box {
    padding: 12px;
  }

  #categories-screen #categories-container {
    gap: 14px;
  }

  #categories-screen .category-row {
    min-height: 128px;
    padding: 12px;
    gap: 10px;
  }

  #categories-screen .category-title {
    width: 92px;
    font-size: 17px;
  }

  #categories-screen .category-list {
    gap: 12px;
    padding: 8px 4px 10px;
  }

  #categories-screen .category-card,
  #categories-screen .category-btn {
    min-width: 116px;
    min-height: 116px;
    padding: 12px;
    font-size: 14px;
  }

  #categories-screen .category-img {
    width: 56px;
    height: 56px;
  }

  .setup-action-row,
  .setup-footer-actions {
    gap: 10px !important;
    flex-wrap: wrap;
  }

  .button-with-icon,
  .setup-nav-button {
    min-width: 118px;
  }

  #game-screen {
    overflow: auto;
    padding: 10px !important;
  }

  .game-layout-shell,
  .main-layout {
    min-height: 100svh;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    align-items: start;
    gap: 14px;
    padding: 0;
  }

  .game-board-area,
  .center-area {
    order: 1;
    width: 100%;
    height: min(76svh, 720px);
    min-height: 560px;
    padding: 0 6px;
  }

  #team1-score-box {
    order: 2;
  }

  #team2-score-box {
    order: 3;
  }

  .game-team-panel {
    width: min(100%, 680px);
    max-width: 680px;
    height: 250px;
  }

  .answer-log {
    min-height: 72px;
  }

  .answer-log-row {
    padding: 10px 12px;
    font-size: 15px;
  }

  #game-board {
    width: min(100%, 560px) !important;
    max-width: 560px !important;
    margin-top: 42px;
    margin-bottom: 58px;
  }

  #game-board > div {
    min-height: clamp(56px, 13vw, 86px) !important;
    font-size: clamp(1.15rem, 4vw, 1.65rem) !important;
  }

  .current-turn-panel {
    top: 4px;
    max-width: 94vw;
    padding: 10px 16px;
    gap: 8px;
    font-size: 15px;
    white-space: nowrap;
  }

  .current-turn-panel span,
  .current-turn-panel .current-mode-label {
    font-size: 13px;
  }

  .game-board-actions {
    bottom: 38px;
    width: min(94vw, 560px);
  }

  .game-actions-segment {
    width: 100%;
  }

  .game-actions-segment .label {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 8px;
    font-size: 13px;
  }

  #remaining-cells {
    bottom: 4px;
    font-size: 18px !important;
  }

  .question-modal-card {
    width: min(96vw, 760px);
    max-height: 92svh;
    padding: 24px;
    border-radius: 26px;
  }

  .question-modal-header {
    gap: 12px;
  }

  #question-text {
    font-size: clamp(23px, 4.6vw, 34px);
    line-height: 1.55;
    padding: 22px 18px;
  }

  .question-result-actions,
  .question-actions {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  #categories-screen > .w-full {
    height: 88svh;
  }

  #categories-screen .category-row {
    min-height: 112px;
    padding: 10px;
  }

  #categories-screen .category-title {
    width: 74px;
    font-size: 15px;
  }

  #categories-screen .category-card,
  #categories-screen .category-btn {
    min-width: 98px;
    min-height: 104px;
    font-size: 13px;
    border-radius: 14px;
  }

  #categories-screen .category-img {
    width: 46px;
    height: 46px;
    margin-bottom: 6px;
  }

  #game-screen {
    padding: 8px !important;
  }

  .game-board-area,
  .center-area {
    min-height: 500px;
    height: 68svh;
  }

  #game-board {
    width: min(100%, 390px) !important;
    max-width: 390px !important;
    gap: 5px !important;
    margin-top: 46px;
    margin-bottom: 62px;
  }

  #game-board > div {
    min-height: clamp(44px, 14vw, 62px) !important;
    font-size: clamp(1rem, 5vw, 1.35rem) !important;
    border-radius: 10px !important;
  }

  .game-team-panel {
    height: 230px;
    padding: 10px;
    border-radius: 18px;
  }

  .game-team-name {
    font-size: 17px;
  }

  .game-team-score {
    font-size: 30px;
  }

  .helper-chip,
  .lifeline-btn,
  .silence-step {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 13px;
  }

  .helper-chip img,
  .lifeline-btn img,
  .silence-icon {
    width: 26px;
    height: 26px;
  }

  .game-actions-segment {
    border-radius: 14px;
  }

  .game-actions-segment .label {
    padding: 10px 5px;
    font-size: 11px;
    line-height: 1.25;
  }

  .current-turn-panel {
    transform: translateX(-50%) scale(0.95);
  }

  .question-modal-card {
    width: 96vw;
    padding: 18px;
    border-width: 3px;
  }

  .question-modal-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .question-meta-group,
  .question-timer-pill {
    justify-self: center;
  }

  .question-modal-btn {
    width: 100%;
    min-width: 0;
    padding: 13px 16px;
    font-size: 17px;
  }

  .question-result-actions {
    grid-template-columns: 1fr;
  }

  #options-container {
    grid-template-columns: 1fr;
  }

  .question-image {
    width: min(96%, 420px);
    max-height: 250px;
  }

  .winner-results-title {
    top: 54px;
    font-size: clamp(38px, 13vw, 58px);
  }

  .winner-restart-btn {
    bottom: 42px;
  }
}

@media (max-height: 720px) and (max-width: 1180px) {
  .game-team-panel {
    height: calc(100svh - 22px);
  }

  .game-board-area,
  .center-area {
    height: calc(100svh - 22px);
  }

  #game-board > div {
    min-height: clamp(52px, 10vh, 82px) !important;
  }

  .answer-log-row {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
/* Board size 18 layout fix only */
#game-board.board-size-18 {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
  width: min(100%, 900px) !important;
  max-width: 900px !important;
  gap: 10px !important;
  justify-content: center;
  align-content: center;
  margin-left: auto;
  margin-right: auto;
}

#game-board.board-size-18 > div {
  min-height: clamp(112px, 11vw, 145px) !important;
  aspect-ratio: 1 / 1;
  font-size: clamp(1.8rem, 2.8vw, 2.45rem) !important;
}

@media (max-width: 1180px) {
  #game-board.board-size-18 {
    width: min(100%, 700px) !important;
    max-width: 700px !important;
    gap: 8px !important;
  }

  #game-board.board-size-18 > div {
    min-height: clamp(82px, 10vw, 108px) !important;
    font-size: clamp(1.45rem, 2.8vw, 2rem) !important;
  }
}

@media (max-width: 900px) {
  #game-board.board-size-18 {
    width: min(100%, 620px) !important;
    max-width: 620px !important;
    gap: 7px !important;
  }

  #game-board.board-size-18 > div {
    min-height: clamp(68px, 13vw, 94px) !important;
    font-size: clamp(1.25rem, 4vw, 1.75rem) !important;
  }
}

@media (max-width: 640px) {
  #game-board.board-size-18 {
    width: min(100%, 430px) !important;
    max-width: 430px !important;
    gap: 6px !important;
  }

  #game-board.board-size-18 > div {
    min-height: clamp(48px, 14vw, 68px) !important;
    font-size: clamp(1.05rem, 5vw, 1.45rem) !important;
    border-radius: 10px !important;
  }
}

@media (max-height: 720px) and (max-width: 1180px) {
  #game-board.board-size-18 > div {
    min-height: clamp(60px, 12vh, 94px) !important;
  }
}
/* Final 18-square board spacing correction */
#game-board.board-size-18 {
  --board18-cell: clamp(122px, 7vw, 156px);
  display: grid !important;
  grid-template-columns: repeat(6, var(--board18-cell)) !important;
  grid-template-rows: repeat(3, var(--board18-cell)) !important;
  width: max-content !important;
  max-width: calc((var(--board18-cell) * 6) + (12px * 5)) !important;
  gap: 12px !important;
  justify-content: center !important;
  align-content: center !important;
  place-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#game-board.board-size-18 > div {
  width: var(--board18-cell) !important;
  height: var(--board18-cell) !important;
  min-width: var(--board18-cell) !important;
  min-height: var(--board18-cell) !important;
  max-width: var(--board18-cell) !important;
  max-height: var(--board18-cell) !important;
  flex: 0 0 var(--board18-cell) !important;
  aspect-ratio: 1 / 1 !important;
  font-size: clamp(1.9rem, 2.7vw, 2.5rem) !important;
}

@media (max-width: 1180px) {
  #game-board.board-size-18 {
    --board18-cell: clamp(88px, 8.6vw, 118px);
    max-width: calc((var(--board18-cell) * 6) + (10px * 5)) !important;
    gap: 10px !important;
  }
}

@media (max-width: 900px) {
  #game-board.board-size-18 {
    --board18-cell: clamp(72px, 13vw, 100px);
    max-width: calc((var(--board18-cell) * 6) + (8px * 5)) !important;
    gap: 8px !important;
  }
}

@media (max-width: 640px) {
  #game-board.board-size-18 {
    --board18-cell: clamp(48px, 14vw, 66px);
    max-width: calc((var(--board18-cell) * 6) + (6px * 5)) !important;
    gap: 6px !important;
  }

  #game-board.board-size-18 > div {
    font-size: clamp(1rem, 5vw, 1.45rem) !important;
  }
}
.question-image.is-zoomable {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox-img {
  display: block;
  max-width: min(94vw, 1100px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  transform: scale(0.96);
  transition: transform 0.22s ease;
}

.image-lightbox.is-open .image-lightbox-img {
  transform: scale(1);
}

.image-lightbox-close {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #020617;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.image-lightbox-close:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
}

@media (max-width: 720px) {
  .image-lightbox {
    padding: 14px;
  }

  .image-lightbox-img {
    max-width: 96vw;
    max-height: 82vh;
    border-radius: 14px;
  }

  .image-lightbox-close {
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}

.social-icon-button.social-icon-disabled,
.social-icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}

.social-icon-button.social-icon-disabled:hover,
.social-icon-button:disabled:hover {
  transform: none;
  color: #111827;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

#hint-letters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 4px;
  letter-spacing: 0;
  direction: rtl;
  line-height: 1.2;
}

.letter-slot {
  display: inline-flex;
  width: 28px;
  height: 36px;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  border-bottom: 3px solid currentColor;
  font-size: 24px;
  font-weight: 900;
}

.letter-slot.hidden {
  color: transparent;
  border-bottom-color: #ffffff;
  text-shadow: none;
}

.letter-slot.revealed {
  color: #ffffff;
}

.letter-punctuation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 36px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.word-space {
  display: inline-block;
  width: 20px;
  height: 1px;
}

#hint-letters {
  display: inline-block;
  letter-spacing: 0;
  word-spacing: 12px;
  white-space: pre-wrap;
}

#hint-letters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  direction: rtl;
  letter-spacing: 0;
  word-spacing: 0;
  white-space: normal;
}

.hint-word {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  direction: rtl;
}

.hint-char {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  color: #ffffff;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  border: 0 !important;
  text-decoration: none !important;
}

.hint-word-space {
  display: inline-block;
  width: 22px;
}
