/* VIDA GAMES CSS STYLESHEET */
/* Premium Royal Blue & Gold Theme */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
  --bg-primary: #040d1a;
  --bg-secondary: #0a192f;
  --bg-card: rgba(16, 33, 65, 0.7);
  --gold-primary: #d4af37;
  --gold-gradient: linear-gradient(135deg, #f3e5ab 0%, #d4af37 50%, #aa7c11 100%);
  --blue-gradient: linear-gradient(135deg, #172a45 0%, #0a192f 100%);
  --text-light: #f4f6f9;
  --text-muted: #8892b0;
  --gold-glow: 0 0 15px rgba(212, 175, 55, 0.4);
  --blue-glow: 0 0 15px rgba(23, 42, 69, 0.5);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-gold: 1px solid rgba(212, 175, 55, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, #0e223f 0%, #040d1a 100%);
  color: var(--text-light);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--gold-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aa7c11;
}

/* Typography & Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
}

.header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 13, 26, 0.8);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: var(--gold-glow);
  letter-spacing: 1.5px;
}

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

/* Main Content Views */
.view-pane {
  display: none;
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-pane.active {
  display: block;
}

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

/* Global Buttons */
.btn {
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #040d1a;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}

.btn-blue {
  background: rgba(23, 42, 69, 0.8);
  color: var(--text-light);
  border: 1px solid var(--gold-primary);
}

.btn-blue:hover {
  background: var(--gold-gradient);
  color: #040d1a;
  transform: translateY(-2px);
}

.btn-danger {
  background: #d9534f;
  color: white;
}

.btn-danger:hover {
  background: #c9302c;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.btn-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  padding: 0;
}

/* Landing / Home Page Grid */
.hero-section {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
}

.hero-subtitle {
  color: var(--gold-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.game-card {
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  backdrop-filter: blur(8px);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--gold-glow);
  background: rgba(16, 33, 65, 0.95);
}

.game-icon-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--gold-primary);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
  transition: var(--transition);
}

.game-card:hover .game-icon-box {
  background: var(--gold-gradient);
  color: #040d1a;
  transform: scale(1.1);
  box-shadow: var(--gold-glow);
}

.game-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.game-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Play Setup Screen & Custom Panels */
.setup-container {
  max-width: 600px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.setup-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--gold-primary);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: rgba(10, 25, 47, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-light);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Categories View Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.category-card {
  background: rgba(16, 33, 65, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.category-card:hover {
  background: var(--gold-gradient);
  color: #040d1a;
  transform: scale(1.05);
  box-shadow: var(--gold-glow);
}

.category-card.selected {
  background: var(--gold-gradient);
  color: #040d1a;
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
}

/* Timer Ring Styling */
.timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.timer-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-primary);
  animation: spin 1s linear infinite;
  animation-play-state: paused;
}

.timer-ring.pulse {
  animation-play-state: running;
  animation: pulseGlow 1s infinite alternate;
}

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

@keyframes pulseGlow {
  from { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
  to { box-shadow: 0 0 20px rgba(212, 175, 55, 0.7); }
}

/* Question Modal & Overlay Panels */
.question-overlay {
  background: rgba(4, 13, 26, 0.85);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--gold-glow);
  backdrop-filter: blur(10px);
}

.question-title {
  color: var(--gold-primary);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.question-text {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 1.5rem 0;
  color: var(--text-light);
}

.answer-text-box {
  background: rgba(10, 25, 47, 0.8);
  border: 1px dashed var(--gold-primary);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #00ff88;
  display: none; /* revealed by referee */
}

/* Buzzer Styles */
.buzzers-row {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin: 2rem 0;
}

.buzzer-btn {
  flex: 1;
  max-width: 250px;
  height: 90px;
  border-radius: 50px;
  font-family: 'Cairo', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-light);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.buzzer-blue {
  background: linear-gradient(135deg, #104f9b 0%, #0d3869 100%);
  border: 2px solid #00c3ff;
  box-shadow: 0 4px 15px rgba(0, 195, 255, 0.3);
}

.buzzer-blue:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(0, 195, 255, 0.6);
}

.buzzer-gold {
  background: linear-gradient(135deg, #b8860b 0%, #8b6508 100%);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.buzzer-gold:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
}

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

.buzzer-btn.buzzed-first {
  animation: buzzPulse 0.4s infinite alternate;
  transform: scale(1.1);
  z-index: 10;
}

@keyframes buzzPulse {
  from { box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); border-color: #ff0000; }
  to { box-shadow: 0 0 30px rgba(255, 0, 0, 0.9); border-color: #ff0000; }
}

.buzz-announcement {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff3333;
  margin: 1rem 0;
  min-height: 2rem;
}

/* Game Interface Structures */
.game-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: var(--border-gold);
}

.team-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-name {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.score-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-primary);
}

/* XO Grid Board */
.xo-board-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.xo-grid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 10px;
  background: var(--gold-gradient);
  padding: 8px;
  border-radius: 16px;
  box-shadow: var(--gold-glow);
}

.xo-cell {
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.xo-cell:hover:not(.filled) {
  background: rgba(23, 42, 69, 0.8);
}

.xo-cell.filled {
  cursor: not-allowed;
}

.xo-cell.x-mark {
  color: #00c3ff;
  text-shadow: 0 0 10px rgba(0, 195, 255, 0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.xo-cell.o-mark {
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Connect 4 Grid Board */
.c4-board-container {
  display: flex;
  justify-content: center;
  position: relative;
  margin: 1.5rem 0;
}

.c4-board {
  background: linear-gradient(135deg, #0e2b54 0%, #061936 100%);
  border: 4px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  padding: 12px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-width: 500px;
  width: 100%;
}

.c4-cell {
  aspect-ratio: 1;
  background: var(--bg-primary);
  border-radius: 50%;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.c4-token {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: tokenFall 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

.c4-token.team-a {
  background: radial-gradient(circle at 30% 30%, #00d2ff 0%, #006699 100%);
  box-shadow: 0 0 10px rgba(0, 195, 255, 0.6);
}

.c4-token.team-b {
  background: radial-gradient(circle at 30% 30%, #ffea88 0%, #aa7c11 100%);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

@keyframes tokenFall {
  0% { transform: translateY(-300px); }
  100% { transform: translateY(0); }
}

/* Letter Hive Layout (Staggered Hex Grid) */
.hive-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0;
}

.hive-board-wrapper {
  position: relative;
  width: 500px;
  height: 400px;
  overflow: hidden;
  border-radius: 16px;
  border: var(--border-gold);
  background-color: var(--bg-primary);
  box-shadow: var(--gold-glow);
  transform-origin: center;
  transition: transform 0.2s ease;
}

@media (max-width: 540px) {
  .hive-board-wrapper {
    transform: scale(0.8);
    margin: -40px 0;
  }
}
@media (max-width: 440px) {
  .hive-board-wrapper {
    transform: scale(0.68);
    margin: -60px 0;
  }
}
@media (max-width: 375px) {
  .hive-board-wrapper {
    transform: scale(0.58);
    margin: -80px 0;
  }
}

.hive-svg-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hive-label {
  position: absolute;
  z-index: 2;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  pointer-events: none;
  white-space: nowrap;
}

.label-top {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #040d1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.label-bottom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #040d1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.label-left {
  left: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.label-right {
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.hive-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: fit-content;
  position: absolute;
  z-index: 3;
  top: 69px;
  left: 90px;
}

.hive-row {
  display: flex;
  gap: 0;
  margin-bottom: -17px; /* tightly pack overlapping pointy-topped hexagons */
}

/* Shift alternate rows right by exactly half hex width */
.hive-row:nth-child(even) {
  transform: translateX(29px);
}

.hive-hex {
  width: 58px;
  height: 66px;
  background: #000000; /* Outer black border */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.hive-hex::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: #ffffff; /* White background by default */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: 1;
  transition: var(--transition);
}

.hive-hex:hover:not(.owned)::before {
  background: #e6e6e6; /* Light gray on hover */
}

.hive-hex:hover:not(.owned) {
  transform: scale(1.08);
  z-index: 5;
}

.hex-letter {
  font-size: 1.5rem;
  font-weight: 800;
  color: #000000; /* Black letter text by default */
  position: relative;
  z-index: 2; /* Keep above inner background */
  transition: var(--transition);
}

.hive-hex.owned-a::before {
  background: radial-gradient(circle, #00d2ff 0%, #005580 100%);
}

.hive-hex.owned-a .hex-letter {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hive-hex.owned-b::before {
  background: radial-gradient(circle, #ffe066 0%, #aa7a00 100%);
}

.hive-hex.owned-b .hex-letter {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hive-hex.active-hex::before {
  background: #ff3333 !important;
  animation: activeHexPulse 0.6s infinite alternate;
}

.hive-hex.active-hex .hex-letter {
  color: #ffffff;
}

@keyframes activeHexPulse {
  from { transform: scale(1); }
  to { transform: scale(0.92); }
}

/* Mafia Interface */
.mafia-setup-list {
  background: rgba(10, 25, 47, 0.5);
  border-radius: 8px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(212, 175, 55, 0.1);
}

.mafia-setup-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
}

.mafia-role-card-reveal {
  perspective: 1000px;
  width: 250px;
  height: 350px;
  margin: 2rem auto;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.mafia-role-card-reveal.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 2px solid var(--gold-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.card-front {
  background: linear-gradient(135deg, #0f1c30 0%, #070e17 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.card-back {
  background: radial-gradient(circle at center, #1b2e4b 0%, #0d1827 100%);
  transform: rotateY(180deg);
  box-shadow: var(--gold-glow);
}

.card-icon {
  font-size: 3.5rem;
  color: var(--gold-primary);
  margin-bottom: 1.5rem;
}

.role-reveal-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 1rem;
}

.role-reveal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.night-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 1.5rem 0;
}

.player-action-card {
  background: rgba(16, 33, 65, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.player-action-card.selected {
  background: var(--gold-gradient);
  color: #040d1a;
  box-shadow: var(--gold-glow);
}

.player-action-card.dead {
  opacity: 0.3;
  cursor: not-allowed;
}

.mafia-history-log {
  background: rgba(4, 13, 26, 0.6);
  border-radius: 8px;
  padding: 1rem;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 0.9rem;
}

.log-entry {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Admin Question Bank Layout */
.admin-tab-row {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 10px;
  margin-bottom: 1.5rem;
}

.admin-tab-btn {
  font-family: 'Cairo', sans-serif;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.admin-tab-btn.active {
  color: var(--gold-primary);
  border-bottom: 2px solid var(--gold-primary);
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
}

.admin-flex-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .admin-flex-container {
    flex-direction: row;
  }
  .admin-left-col {
    flex: 1;
  }
  .admin-right-col {
    flex: 1;
  }
}

.admin-list-container {
  background: rgba(10, 25, 47, 0.5);
  border-radius: 12px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.admin-question-card {
  background: rgba(16, 33, 65, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.admin-question-card .q-meta {
  margin-bottom: 0.5rem;
}

.admin-question-card .badge {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.admin-question-card .q-text {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.admin-question-card .q-answer {
  font-size: 0.95rem;
  color: #00ff88;
  margin-bottom: 1rem;
}

/* Referee Console Panel */
.referee-console {
  background: rgba(212, 175, 55, 0.05);
  border: 1px dashed var(--gold-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.referee-console h4 {
  color: var(--gold-primary);
  margin-bottom: 1rem;
}

.referee-btn-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Multi-Player Online Indicators */
.peer-status-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Screens / Layout Helpers */
.text-center { text-align: center; }
.m-y-1 { margin-top: 1rem; margin-bottom: 1rem; }
.m-y-2 { margin-top: 2rem; margin-bottom: 2rem; }
.opacity-60 { opacity: 0.6; }
.bold { font-weight: 700; }
.text-gold { color: var(--gold-primary); }

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

/* AUTHENTICATION & REGISTRATION SCREENS */
.auth-container {
  max-width: 450px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--gold-glow);
}

.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 10px;
}

.auth-tab-btn {
  font-family: 'Cairo', sans-serif;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  padding: 5px 10px;
}

.auth-tab-btn.active {
  color: var(--gold-primary);
  border-bottom: 2.5px solid var(--gold-primary);
}

.auth-form {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.auth-form.active {
  display: block;
}

/* VIP CROWNS & BADGES */
.vip-badge {
  background: linear-gradient(135deg, #ffe066 0%, #aa7a00 100%);
  color: #040d1a !important;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 0.9rem;
}

.upgrade-vip-btn {
  animation: pulseGlow 1.5s infinite alternate;
}

.payment-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 13, 26, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* USER ACCOUNTS TABLE */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: rgba(10, 25, 47, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table th, .admin-table td {
  padding: 0.9rem 1rem;
  text-align: right;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.admin-table th {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-primary);
  font-weight: 700;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* QUESTION VIP BADGES */
.question-vip-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.category-card.vip-locked {
  position: relative;
  opacity: 0.8;
  border-color: rgba(212, 175, 55, 0.4);
}

.category-card.vip-locked::after {
  content: '🔒 VIP';
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.75rem;
  background: #ff3333;
  color: white;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* QUESTION FEEDBACK AND PLAY MODE SELECTOR STYLES */
.feedback-trigger-btn {
  background: none;
  border: none;
  color: var(--gold-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  opacity: 0.8;
  transition: opacity 0.2s ease-in-out;
  padding: 0.2rem 0;
}

.feedback-trigger-btn:hover {
  opacity: 1;
}

#question-mode-modal .btn {
  margin: 5px 0;
  font-weight: 700;
  transition: transform 0.2s ease;
}

#question-mode-modal .btn:hover {
  transform: translateY(-2px);
}

#qna-score-a, #qna-score-b {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-light);
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

#view-qna .question-overlay {
  margin-top: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ================= SEEN JEEM (Q&A) STYLES ================= */
.qna-board-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.qna-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

.qna-cat-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--blue-glow);
  transition: var(--transition);
}

.qna-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--gold-glow);
}

.qna-points-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  background: rgba(4, 13, 26, 0.4);
  padding: 0.5rem;
  gap: 0.5rem;
  width: 70px;
}

.team-b-col {
  border-left: 1px solid rgba(212, 175, 55, 0.15);
}

.team-a-col {
  border-right: 1px solid rgba(212, 175, 55, 0.15);
}

.qna-point-btn {
  font-family: 'Cairo', sans-serif;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-radius: 6px;
  padding: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

/* Team colors for point buttons on hover/action */
.team-a-col .qna-point-btn:hover:not(:disabled) {
  background: #00c3ff;
  color: #040d1a;
  border-color: #00c3ff;
  box-shadow: 0 0 10px rgba(0, 195, 255, 0.4);
}

.team-b-col .qna-point-btn:hover:not(:disabled) {
  background: var(--gold-primary);
  color: #040d1a;
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
}

.qna-point-btn:disabled {
  background: rgba(255, 255, 255, 0.02) !important;
  color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  text-decoration: line-through;
  cursor: not-allowed;
}

.qna-cat-title-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 1rem;
  text-align: center;
  gap: 0.5rem;
}

.qna-cat-emoji {
  font-size: 2rem;
}

.qna-cat-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-primary);
}

/* Bottom Bar Scoreboard */
.qna-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--gold-glow);
  gap: 1rem;
}

@media (max-width: 768px) {
  .qna-bottom-bar {
    flex-direction: column;
    align-items: center;
  }
}

.qna-team-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(4, 13, 26, 0.3);
  border-radius: 8px;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#qna-team-box-a {
  border-right: 3px solid #00c3ff;
}

#qna-team-box-b {
  border-right: 3px solid var(--gold-primary);
}

.qna-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.qna-team-name {
  font-size: 1.05rem;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qna-score-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-adj-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-light);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.score-adj-btn:hover {
  background: var(--gold-primary);
  color: #040d1a;
}

.qna-score-val {
  font-size: 1.8rem;
  font-weight: 800;
  min-width: 40px;
  text-align: center;
}

.qna-lifelines {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lifeline-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  white-space: nowrap;
}

.lifeline-btn:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.lifeline-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02) !important;
}

.qna-center-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 180px;
}

.qna-turn-badge {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.qna-target-indicator {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Call lifeline overlay countdown */
.lifeline-countdown-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 13, 26, 0.95);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 800;
  color: var(--gold-primary);
  text-shadow: var(--gold-glow);
  margin-bottom: 2rem;
  animation: countdownPulse 1s infinite;
}

@keyframes countdownPulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* Game visibility toggles styling */
.game-card.game-hidden {
  opacity: 0.5;
  position: relative;
}

.game-card.game-hidden::before {
  content: 'مخفية 👁️';
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ff3333;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ================= MEMBER PROFILE STYLES ================= */
.profile-pic-container {
  position: relative;
  display: inline-block;
  margin: 1.5rem auto;
}

#profile-display-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  object-fit: cover;
  transition: transform 0.3s ease;
}

#profile-display-pic:hover {
  transform: scale(1.05);
}

#profile-edit-pic-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

#profile-edit-pic-btn:hover {
  transform: scale(1.1);
}

#profile-avatars-grid img {
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#profile-avatars-grid img:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(212, 175, 55, 0.5);
}

.level-system-box {
  background: rgba(10, 25, 47, 0.4);
  border: var(--border-gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: right;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#profile-level-progress-bar {
  background: var(--gold-gradient);
  box-shadow: var(--gold-glow);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= NAVIGATION BAR AND TABS ================= */
.app-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  background: rgba(10, 25, 47, 0.6);
  border-bottom: 2px solid rgba(212, 175, 55, 0.2);
  padding: 0.8rem 1rem;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 70px;
  z-index: 100;
}

.nav-tab-btn {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-tab-btn:hover {
  color: var(--text-light);
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.05);
}

.nav-tab-btn.active {
  background: var(--gold-gradient);
  color: #040d1a !important;
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
}

/* ================= GLOBAL & SESSION CHAT STYLES ================= */
.chat-container {
  max-width: 800px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--blue-glow);
  display: flex;
  flex-direction: column;
  height: 60vh;
}

.chat-messages-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(4, 13, 26, 0.5);
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 80%;
  animation: fadeIn 0.25s ease-out;
}

.chat-msg.self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  object-fit: cover;
}

.msg-body-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg.self .msg-body-wrapper {
  align-items: flex-end;
}

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

.msg-text {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg.self .msg-text {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
}

.chat-input-row {
  display: flex;
  gap: 10px;
}

/* ================= PRIVATE VOICE ROOMS & CHATS ================= */
.sub-choice-card:hover {
  transform: translateY(-2px);
}

.sub-choice-card.active {
  border-color: var(--gold-primary) !important;
  background: rgba(212, 175, 55, 0.1) !important;
  box-shadow: var(--gold-glow);
}

#sub-choice-diamond.active {
  border-color: #00c3ff !important;
  background: rgba(0, 195, 255, 0.1) !important;
  box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
}

/* Room Session Layout */
.room-session-layout {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 1.5rem auto;
  height: 72vh;
  width: 100%;
}

@media (max-width: 992px) {
  .room-session-layout {
    flex-direction: column;
    height: auto;
  }
}

.room-stage-area {
  flex: 1.6;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.room-visual-lounge {
  position: relative;
  background-image: url('lounge_bg.png');
  background-size: cover;
  background-position: center;
  aspect-ratio: 16 / 11;
  border-radius: 16px;
  border: var(--border-gold);
  box-shadow: var(--gold-glow);
  overflow: hidden;
}

/* 12 Seats styling */
.room-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  width: 72px;
  transform: translate(-50%, -50%);
}

.seat-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(4, 13, 26, 0.85);
  border: 2px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  overflow: hidden;
}

.seat-circle.empty {
  border: 2px dashed rgba(212, 175, 55, 0.4);
  box-shadow: none;
  background: rgba(4, 13, 26, 0.6);
}

.seat-circle:not(.empty):hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--gold-primary);
}

.seat-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seat-circle.speaking {
  animation: speakingRipple 1.2s infinite ease-out;
  border-color: #00ff88;
}

@keyframes speakingRipple {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.seat-plus {
  font-size: 1.5rem;
  color: rgba(212, 175, 55, 0.4);
  font-weight: 300;
}

.seat-name {
  font-size: 0.75rem;
  color: #ffffff;
  background: rgba(4, 13, 26, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.seat-circle .mute-icon-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #ff3333;
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
}

.room-branding-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(4, 13, 26, 0.85);
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 10;
}

/* Controls Bar */
.room-control-bar {
  background: rgba(10, 25, 47, 0.8);
  border: var(--border-gold);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--blue-glow);
}

.control-icon-btn {
  font-weight: 700;
  padding: 0.5rem;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.control-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.control-icon-btn:active {
  transform: translateY(0);
}

.room-code-display {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Sidebar Chat */
.room-chat-sidebar {
  flex: 0.7;
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--blue-glow);
}

@media (max-width: 992px) {
  .room-chat-sidebar {
    height: auto !important;
    min-height: 420px !important;
    width: 100% !important;
    flex: none !important;
  }
  .private-chat-messages {
    height: 280px !important;
    flex: none !important;
  }
}

.private-chat-messages {
  flex: 1;
  overflow-y: auto;
  background: rgba(4, 13, 26, 0.5);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.private-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 90%;
  line-height: 1.3;
  word-break: break-word;
}

.private-msg-bubble.self {
  background: rgba(212, 175, 55, 0.12);
  align-self: flex-end;
}

/* Context Menus */
.room-context-menu {
  background: #0d1e36;
  border: 1px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  border-radius: 6px;
  overflow: hidden;
  min-width: 120px;
}

.context-menu-item {
  padding: 0.5rem 1rem;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: right;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
}

.context-menu-item:hover {
  background: var(--gold-gradient);
  color: #040d1a;
}

/* Game Overlay */
.room-game-workspace-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 13, 26, 0.98);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.game-overlay-header {
  background: rgba(10, 25, 47, 0.9);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-overlay-title {
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 1rem;
}

.game-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Override styling to make game frames fit nicely inside rooms */
.game-overlay-body > div {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Mic Request Badge for Official Admin Room */
.seat-circle .mic-request-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--gold-primary);
  color: #040d1a;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
  animation: countdownPulse 1.5s infinite;
  box-shadow: 0 0 6px var(--gold-primary);
  z-index: 5;
}

/* Zoom-style horizontal minimized lounge */
.room-visual-lounge.minimized {
  aspect-ratio: auto;
  height: 110px;
  background: rgba(4, 13, 26, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  padding: 0 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
}

.room-visual-lounge.minimized .room-branding-badge {
  display: none !important;
}

.room-visual-lounge.minimized .room-seat {
  position: static !important;
  transform: none !important;
  width: auto !important;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: none !important;
}

.room-visual-lounge.minimized .seat-circle {
  width: 44px;
  height: 44px;
  border-width: 1.5px;
}

.room-visual-lounge.minimized .seat-name {
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Game Workspace Panel (outside the lounge stage) */
.room-game-workspace-panel {
  display: flex;
  flex-direction: column;
  background: rgba(4, 13, 26, 0.98);
  border: var(--border-gold);
  box-shadow: var(--gold-glow);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  width: 100%;
}

/* Active game layout for private room session */
#room-active-game-layout {
  display: none;
  width: 100%;
  gap: 15px;
  align-items: stretch;
  aspect-ratio: 16 / 11;
}

.room-team-panel {
  width: 180px;
  background: rgba(10, 25, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--blue-glow);
}

.room-team-panel.gold-team {
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.room-team-panel.blue-team {
  border-color: rgba(0, 195, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 195, 255, 0.15);
}

/* iOS/Mobile responsive split screen when game starts */
@media (max-width: 768px) {
  #room-active-game-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 45vh auto;
    grid-template-areas:
      "game game"
      "blue gold";
    aspect-ratio: auto !important;
    height: auto;
    gap: 10px;
  }
  
  #room-game-workspace-center {
    grid-area: game;
    height: 100%;
    min-height: 250px;
  }
  
  .room-team-panel.gold-team {
    grid-area: gold;
    width: auto !important;
    padding: 10px !important;
  }
  
  .room-team-panel.blue-team {
    grid-area: blue;
    width: auto !important;
    padding: 10px !important;
  }
}

.team-speakers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.speaker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.speaker-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.speaker-item .seat-circle {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  margin: 0 !important;
  box-shadow: none !important;
  position: static !important;
  transform: none !important;
}

.speaker-item .speaker-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#room-game-workspace-center .room-game-workspace-panel {
  aspect-ratio: auto !important;
  height: 100% !important;
  border: none !important;
  box-shadow: none !important;
}

/* ================= COLD CASES STYLE ================= */
.case-tabs-container {
  min-height: 400px;
  margin-top: 1.5rem;
}

.case-tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.case-tab-pane.active-pane {
  display: block;
}

.case-card {
  background: var(--bg-card);
  border: var(--border-blue);
  border-radius: 16px;
  padding: 20px;
  text-align: right;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--blue-glow);
}

.case-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
}

.case-card.solved {
  border-color: #00ff88;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}

.case-card-title {
  color: var(--text-light);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.case-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
  flex: 1;
}

.suspect-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  transition: all 0.25s ease;
}

.suspect-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.2);
}

.suspect-portrait {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--blue-primary);
  box-shadow: var(--blue-glow);
  object-fit: cover;
}

.suspect-name {
  color: var(--gold-primary);
  font-weight: bold;
  font-size: 1.1rem;
}

.suspect-testimony-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-light);
  width: 100%;
}

.suspect-suspicion-box {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ff5e5e;
  width: 100%;
}

.evidence-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.evidence-card:hover {
  border-color: rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.evidence-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.evidence-body {
  padding: 12px;
  text-align: right;
}

.evidence-title {
  color: var(--gold-primary);
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.evidence-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.temp-item-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.temp-item-badge button {
  padding: 2px 8px;
  font-size: 0.75rem;
}

.correct-banner {
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid #00ff88;
  color: #00ff88;
}

.incorrect-banner {
  background: rgba(255, 51, 51, 0.12);
  border: 1px solid #ff3333;
  color: #ff9999;
}

/* ================= VIRTUAL ECONOMY & GIFTS SYSTEM ================= */
.gold-username {
  color: var(--gold-primary) !important;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  font-weight: 800;
}

.diamond-username {
  background: linear-gradient(120deg, #00c3ff 30%, #ff00ff 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(0, 195, 255, 0.4);
  font-weight: 800;
}

.gift-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gift-card:hover {
  background: rgba(212, 175, 55, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-3px);
}

.gift-card.selected {
  background: rgba(212, 175, 55, 0.12) !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

.gift-card .gift-icon {
  font-size: 2.2rem;
  margin-bottom: 5px;
  display: block;
}

.gift-card .gift-name {
  font-weight: bold;
  display: block;
  font-size: 0.9rem;
  color: #ffffff;
}

.gift-card .gift-price {
  font-size: 0.8rem;
  color: var(--gold-primary);
  display: block;
  margin-top: 3px;
  font-weight: 600;
}

/* Gift Animation & Announcement Banner */
.gift-announcement {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(4, 13, 26, 0.95);
  border: 2px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  padding: 12px 24px;
  border-radius: 30px;
  color: white;
  z-index: 9999;
  text-align: center;
  font-weight: bold;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  direction: rtl;
  opacity: 0;
  animation: giftPopupAnim 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes giftPopupAnim {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 1;
  }
  20% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  85% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -30%) scale(0.9);
    opacity: 0;
  }
}

/* Floating screen animations for special gifts */
.car-animation-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.sports-car-floating {
  position: absolute;
  font-size: 5rem;
  bottom: 10%;
  right: -100px;
  animation: driveCar 5s linear forwards;
}

@keyframes driveCar {
  0% {
    right: -150px;
    transform: scaleX(1);
  }
  45% {
    right: 50%;
    transform: scaleX(1) translateY(0px);
  }
  50% {
    right: 50%;
    transform: scaleX(1) translateY(-20px);
  }
  55% {
    right: 50%;
    transform: scaleX(1) translateY(0px);
  }
  100% {
    right: 120%;
    transform: scaleX(1);
  }
}

.castle-floating {
  position: absolute;
  font-size: 7rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  animation: castleRise 6s ease-in-out forwards;
}

@keyframes castleRise {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
  }
  30% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
}




/* Homepage Footer Section Styles */
.homepage-footer-section {
  backdrop-filter: blur(10px);
}
.homepage-footer-social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 8px 16px;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.homepage-footer-social-link:hover {
  background: var(--gold-gradient);
  color: #040d1a !important;
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}
@media (max-width: 768px) {
  .homepage-footer-section > div {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .homepage-footer-section .homepage-social-col {
    border-right: none !important;
    padding-right: 0 !important;
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding-top: 20px;
  }
}


/* ================= RESPONSIVE ROOM STYLING FOR MOBILE / IPHONE ================= */
@media (max-width: 768px) {
  .room-seat {
    width: 50px !important;
  }
  .seat-circle {
    width: 40px !important;
    height: 40px !important;
  }
  .seat-name {
    font-size: 0.65rem !important;
    max-width: 60px !important;
  }
  .seat-circle .mic-request-badge {
    width: 15px !important;
    height: 15px !important;
    font-size: 0.6rem !important;
  }
  .seat-circle .mute-icon-overlay {
    width: 15px !important;
    height: 15px !important;
    font-size: 0.6rem !important;
  }
  .room-control-bar {
    padding: 0.5rem 0.8rem !important;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center !important;
  }
  .room-code-display {
    font-size: 0.75rem !important;
    width: 100%;
    justify-content: center;
  }
  .control-icon-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 480px) {
  .room-seat {
    width: 42px !important;
  }
  .seat-circle {
    width: 32px !important;
    height: 32px !important;
  }
  .seat-name {
    font-size: 0.58rem !important;
    max-width: 50px !important;
    margin-top: 1px !important;
  }
  .seat-plus {
    font-size: 0.8rem !important;
  }
  .room-branding-badge {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
  }
  .room-stage-area {
    gap: 8px !important;
  }
  
  /* Top bar nav buttons responsiveness on iPhone */
  #header-user-profile {
    display: flex;
    flex-wrap: wrap;
    gap: 4px !important;
    justify-content: flex-end;
  }
  #header-user-profile button,
  #header-user-profile a,
  .header-actions button {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.72rem !important;
  }
  .header-container {
    padding: 0.5rem !important;
    gap: 10px;
  }
  .logo-title {
    font-size: 1.1rem !important;
  }
}


/* ============================================================
   MAFIA ONLINE PANEL - Phase screens animations & utilities
   ============================================================ */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

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

#mafia-online-panel {
  font-family: inherit;
  color: white;
  box-sizing: border-box;
}

#mafia-online-panel .night-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 0.5rem;
}

#mafia-online-panel .player-action-card {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(212,175,55,0.25);
  border-radius: 12px;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1.3;
}

#mafia-online-panel .player-action-card:hover {
  background: rgba(212,175,55,0.12);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

#mafia-online-panel .player-action-card.selected {
  background: rgba(212,175,55,0.22);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(212,175,55,0.4);
}

#mafia-discussion-timer {
  transition: color 0.5s ease;
}

/* Mafia chat box scroll */
#mafia-chat-box::-webkit-scrollbar { width: 4px; }
#mafia-chat-box::-webkit-scrollbar-track { background: transparent; }
#mafia-chat-box::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

/* Lobby player chips */
#mafia-lobby-players > div:hover {
  background: rgba(212,175,55,0.2) !important;
  border-color: rgba(212,175,55,0.5) !important;
}
