/* ============ ENHANCED UI/UX V4 - PROFESSIONAL UPGRADE ============ */

/* ============ IMPROVED GAME CARDS ============ */
.game-card {
  background: linear-gradient(165deg, rgba(22, 16, 58, 0.95) 0%, rgba(10, 7, 20, 0.98) 100%);
  border: 1px solid rgba(232, 183, 48, 0.06);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(10px);
}
.game-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, rgba(232,183,48,0.2) 50%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}
.game-card:hover::before { opacity: 1; }
.game-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(232, 183, 48, 0.3);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5), 
    0 0 50px rgba(232, 183, 48, 0.06),
    inset 0 0 30px rgba(232, 183, 48, 0.02);
}

.game-card .game-image {
  width: 100%; height: 240px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.3), rgba(22, 16, 58, 0.9));
}
.game-card .game-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease, filter 0.5s ease;
  filter: brightness(0.85) saturate(1.1);
}
.game-card:hover .game-image img { 
  transform: scale(1.08); 
  filter: brightness(0.95) saturate(1.2);
}

.game-card .game-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,7,20,1) 0%, rgba(10,7,20,0.4) 35%, transparent 65%);
  z-index: 1;
}

.game-card .game-info {
  padding: 18px 22px 22px;
  position: relative;
}
.game-card .game-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.game-card .game-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card .game-tags {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.game-card .game-tag {
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(232, 183, 48, 0.06);
  border: 1px solid rgba(232, 183, 48, 0.12);
  color: var(--benrati-light);
  display: flex; align-items: center; gap: 5px;
  transition: all 0.3s;
}
.game-card:hover .game-tag {
  background: rgba(232, 183, 48, 0.1);
  border-color: rgba(232, 183, 48, 0.2);
}
.game-card .game-tag i { font-size: 0.6rem; }

/* Badge improvements */
.game-card .game-badge-new {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  font-size: 0.68rem;
  padding: 5px 14px;
  border-radius: 50px;
  font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  box-shadow: 0 3px 15px rgba(16,185,129,0.3);
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 3px 15px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 3px 25px rgba(16,185,129,0.5); }
}

.game-card .game-badge-ramadan {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: white;
  font-size: 0.68rem;
  padding: 5px 14px;
  border-radius: 50px;
  font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  box-shadow: 0 3px 15px rgba(124,58,237,0.3);
}

/* Platform icons enhancement */
.game-card .platform-icons {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  display: flex; gap: 5px;
}
.game-card .platform-icon {
  width: 30px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  backdrop-filter: blur(12px);
  transition: transform 0.3s;
}
.game-card:hover .platform-icon { transform: scale(1.1); }

/* ============ ENHANCED CHAT ANSWERS DISPLAY ============ */
.chat-answers-panel {
  background: linear-gradient(165deg, rgba(22, 16, 58, 0.6), rgba(10, 7, 20, 0.8));
  border: 1px solid rgba(232, 183, 48, 0.1);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(15px);
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,183,48,0.2) transparent;
}
.chat-answers-panel::-webkit-scrollbar { width: 4px; }
.chat-answers-panel::-webkit-scrollbar-track { background: transparent; }
.chat-answers-panel::-webkit-scrollbar-thumb { 
  background: rgba(232,183,48,0.2); 
  border-radius: 4px; 
}

.chat-answer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
  transition: all 0.3s ease;
  animation: answer-slide-in 0.4s ease-out;
}
.chat-answer-item:last-child { margin-bottom: 0; }
.chat-answer-item:hover {
  background: rgba(232,183,48,0.06);
  border-color: rgba(232,183,48,0.1);
}
.chat-answer-item.latest {
  background: rgba(232,183,48,0.08);
  border-color: rgba(232,183,48,0.2);
  box-shadow: 0 0 15px rgba(232,183,48,0.05);
}
.chat-answer-item.correct {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
}
.chat-answer-item.wrong {
  background: rgba(239,68,68,0.05);
  border-color: rgba(239,68,68,0.1);
}

.chat-answer-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(232,183,48,0.2);
  flex-shrink: 0;
}
.chat-answer-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(232,183,48,0.2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--benrati-light);
  flex-shrink: 0;
  border: 2px solid rgba(232,183,48,0.15);
}

.chat-answer-username {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--benrati-light);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-answer-text {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-answer-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.chat-answer-platform {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.chat-answer-platform.twitch {
  background: rgba(145,70,255,0.15);
  color: #9146FF;
}
.chat-answer-platform.kick {
  background: rgba(83,252,24,0.1);
  color: #53FC18;
}

.chat-answers-empty {
  text-align: center;
  padding: 24px 16px;
  color: rgba(255,255,255,0.25);
  font-size: 0.85rem;
}
.chat-answers-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.3;
}

@keyframes answer-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ IMPROVED SECTION HEADER ============ */
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header h2 {
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.section-header .gold-text { 
  color: var(--benrati); 
  text-shadow: 0 0 20px rgba(232,183,48,0.2);
}
.section-header p {
  color: rgba(255,255,255,0.45);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}
.section-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--benrati), transparent);
  margin: 12px auto;
  border-radius: 2px;
}

/* ============ IMPROVED FILTER BUTTONS ============ */
.filter-btn {
  transition: all 0.3s ease;
  border-radius: 12px !important;
}
.filter-btn.active {
  background: rgba(232,183,48,0.1) !important;
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  box-shadow: 0 0 15px rgba(232,183,48,0.1);
}
.filter-btn:not(.active):hover {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* ============ GLASS BUTTON IMPROVEMENTS ============ */
.glass-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.glass-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.glass-btn-primary {
  background: linear-gradient(135deg, rgba(232,183,48,0.15), rgba(232,183,48,0.08));
  border: 1px solid rgba(232,183,48,0.25);
  border-radius: 12px;
  color: var(--benrati-light);
  transition: all 0.3s ease;
  cursor: pointer;
}
.glass-btn-primary:hover {
  background: linear-gradient(135deg, rgba(232,183,48,0.25), rgba(232,183,48,0.15));
  border-color: rgba(232,183,48,0.4);
  box-shadow: 0 0 20px rgba(232,183,48,0.1);
  transform: translateY(-1px);
}

/* ============ QA OPTION IMPROVEMENTS ============ */
.qa-option {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}
.qa-option:hover {
  background: rgba(232,183,48,0.08);
  border-color: rgba(232,183,48,0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.qa-option.correct {
  background: rgba(16,185,129,0.15) !important;
  border-color: rgba(16,185,129,0.4) !important;
  color: #10B981;
}
.qa-option.wrong {
  background: rgba(239,68,68,0.1) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #EF4444;
}

/* ============ IMPROVED NAVIGATION ============ */
.glass-nav {
  background: rgba(10,7,20,0.85) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(232,183,48,0.06) !important;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.nav-btn:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.04);
}
.nav-btn.active {
  color: var(--benrati) !important;
  background: rgba(232,183,48,0.08);
  border-color: rgba(232,183,48,0.15);
}

/* ============ SPIN WHEEL STYLES ============ */
.wheel-container {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .wheel-container { width: 300px; height: 300px; }
}
.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 
    0 0 0 8px rgba(232,183,48,0.3),
    0 0 0 12px rgba(10,7,20,0.8),
    0 0 40px rgba(232,183,48,0.15),
    inset 0 0 30px rgba(0,0,0,0.3);
  transition: filter 0.3s;
}
.wheel-spinning .wheel-canvas {
  filter: drop-shadow(0 0 20px rgba(232,183,48,0.3));
}
.wheel-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 35px solid var(--benrati);
  filter: drop-shadow(0 3px 10px rgba(232,183,48,0.5));
  z-index: 10;
}
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--benrati) 0%, var(--benrati-dark) 100%);
  border: 4px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  z-index: 5;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(232,183,48,0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}
.wheel-center:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 35px rgba(232,183,48,0.6);
}

.wheel-winner-popup {
  animation: winner-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes winner-pop {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.wheel-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.wheel-history-item .round-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(232,183,48,0.1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--benrati);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Participant list */
.participant-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s ease;
  animation: answer-slide-in 0.3s ease-out;
}
.participant-item:hover {
  background: rgba(232,183,48,0.06);
}
.participant-item .remove-btn {
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  color: rgba(239,68,68,0.6);
  font-size: 0.75rem;
}
.participant-item:hover .remove-btn { opacity: 1; }

/* ============ NEW GAME STYLES ============ */
/* Hangman */
.hangman-letter {
  width: 42px; height: 50px;
  border-radius: 10px;
  background: rgba(232,183,48,0.06);
  border: 2px solid rgba(232,183,48,0.15);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
  color: var(--benrati);
  margin: 3px;
  transition: all 0.3s;
}
.hangman-letter.revealed {
  background: rgba(232,183,48,0.15);
  border-color: rgba(232,183,48,0.3);
  animation: letter-reveal 0.4s ease;
}
.hangman-keyboard-key {
  width: 38px; height: 42px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 2px;
}
.hangman-keyboard-key:hover {
  background: rgba(232,183,48,0.1);
  border-color: rgba(232,183,48,0.2);
  transform: translateY(-2px);
}
.hangman-keyboard-key.used {
  opacity: 0.2;
  pointer-events: none;
}
.hangman-keyboard-key.correct {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.3);
  color: #10B981;
}
.hangman-keyboard-key.wrong {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.2);
  color: #EF4444;
}

@keyframes letter-reveal {
  0% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}

/* Number Guess */
.number-guess-input {
  font-size: 2.5rem;
  text-align: center;
  width: 140px;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(232,183,48,0.15);
  border-radius: 16px;
  color: var(--benrati);
  padding: 10px;
  font-weight: 800;
}
.number-guess-input:focus {
  border-color: rgba(232,183,48,0.4);
  outline: none;
  box-shadow: 0 0 20px rgba(232,183,48,0.1);
}

.guess-history-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}
.guess-history-item.higher {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
  color: #F87171;
}
.guess-history-item.lower {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  color: #60A5FA;
}
.guess-history-item.correct {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  color: #34D399;
}

/* ============ CONFETTI ANIMATION ============ */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 9999;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}
@keyframes confetti-fall {
  0% { top: -10px; opacity: 1; transform: rotateZ(0deg); }
  100% { top: 110vh; opacity: 0; transform: rotateZ(720deg); }
}

/* ============ RESPONSIVE IMPROVEMENTS ============ */
@media (max-width: 1024px) {
  .game-card .game-image { height: 200px; }
  .section-header h2 { font-size: 2rem; }
}
@media (max-width: 768px) {
  .game-card .game-image { height: 180px; }
  .section-header h2 { font-size: 1.7rem; }
  .section-header p { font-size: 0.9rem; }
  .chat-answers-panel { max-height: 250px; }
  .wheel-container { width: 280px; height: 280px; }
  .qa-option { padding: 12px 14px; font-size: 0.88rem; }
}
@media (max-width: 480px) {
  .game-card .game-image { height: 160px; }
  .game-card .game-info { padding: 14px 16px 18px; }
  .game-card .game-title { font-size: 1.05rem; }
  .wheel-container { width: 250px; height: 250px; }
  .hangman-letter { width: 34px; height: 42px; font-size: 1.1rem; }
  .hangman-keyboard-key { width: 30px; height: 36px; font-size: 0.8rem; }
}

/* ============ IMPROVED GAME PAGE LAYOUT ============ */
.game-page-header {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 24px;
}
.game-page-controls {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
@media (max-width: 1024px) {
  .game-page-controls {
    grid-template-columns: 1fr;
  }
}

/* ============ ADMIN PANEL IMPROVEMENTS ============ */
.admin-game-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.toggle-switch.active {
  background: rgba(16,185,129,0.3);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.3s;
}
.toggle-switch.active::after {
  transform: translateX(20px);
}
