/* 
  Global variables, reset, and core components have been moved 
  to /public/css/core/ (base.css, components.css, animations.css).
*/

/* ==================== HOMEPAGE ==================== */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

/* ==================== JOIN SCREEN (Player) ==================== */
/* ==================== JOIN SCREEN (TECH BLUE) ==================== */
.join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(77, 201, 246, 0.18) 0%, rgba(77, 201, 246, 0) 60%),
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(30, 144, 255, 0.18) 0%, rgba(30, 144, 255, 0) 70%),
    linear-gradient(180deg, #072863 0%, #1660c5 50%, #072863 100%);
  position: relative;
}

.join-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.join-box {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.3), rgba(0, 60, 130, 0.15));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  border: 1px solid rgba(0, 191, 255, 0.15);
  box-shadow: 0 0 40px rgba(0, 100, 200, 0.1), inset 0 1px 0 rgba(0, 191, 255, 0.08);
  position: relative;
  z-index: 1;
}

.join-box h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.2);
}

.join-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(0, 191, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 30, 80, 0.4);
  color: #fff;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.join-input:focus {
  border-color: rgba(0, 191, 255, 0.5);
  background: rgba(0, 30, 80, 0.6);
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.1);
}

.join-input::placeholder {
  color: rgba(77, 201, 246, 0.4);
  font-weight: 600;
}

.join-input {
  text-transform: uppercase;
  pointer-events: auto !important;
}

.join-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0a4aad, #1e90ff, #00bfff);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 100, 200, 0.25), 0 4px 15px rgba(10, 74, 173, 0.3);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.join-btn:hover {
  background: linear-gradient(135deg, #1050a8, #2196f3, #4dc9f6);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.3), 0 8px 25px rgba(10, 74, 173, 0.3);
}

.join-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ==================== PLAYER WAITING (TECH BLUE) ==================== */
.waiting-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(77, 201, 246, 0.18) 0%, rgba(77, 201, 246, 0) 60%),
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(30, 144, 255, 0.18) 0%, rgba(30, 144, 255, 0) 70%),
    linear-gradient(180deg, #072863 0%, #1660c5 50%, #072863 100%);
  text-align: center;
  padding: 2rem;
  position: relative;
}

.waiting-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.waiting-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 2.5px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
  animation: bounceIn 0.6s ease;
}

.waiting-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 191, 255, 0.15);
  border-top-color: #4dc9f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-top: 2rem;
}

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

.waiting-name {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.2);
}

.waiting-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(77, 201, 246, 0.5);
  line-height: 1.6;
}

.waiting-box {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.25), rgba(0, 60, 130, 0.1));
  border: 1px solid rgba(0, 191, 255, 0.12);
  padding: 3rem 4rem;
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 0 30px rgba(0, 100, 200, 0.08);
  position: relative;
  z-index: 1;
}

/* ==================== QUESTION SCREEN (ADMIN - TECH BLUE) ==================== */
.question-screen-admin {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #041436 0%, #0a4aad 50%, #041436 100%);
  position: relative;
}

/* Subtle grid overlay on question screen */
.question-screen-admin::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.question-screen-admin>* {
  position: relative;
  z-index: 1;
}

.question-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0, 30, 80, 0.5);
  border-bottom: 1px solid rgba(0, 191, 255, 0.1);
}

.question-counter {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4dc9f6;
}

.answers-counter {
  background: rgba(0, 191, 255, 0.1);
  border: 1px solid rgba(0, 191, 255, 0.15);
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.question-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  min-height: 0;
}

.question-timer-big {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  border: 3px solid rgba(0, 191, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.15), inset 0 0 20px rgba(0, 191, 255, 0.05);
  transition: all 0.3s;
  text-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.question-timer-big.warning {
  border-color: rgba(255, 200, 0, 0.6);
  color: #ffc800;
  box-shadow: 0 0 20px rgba(255, 200, 0, 0.2), inset 0 0 20px rgba(255, 200, 0, 0.05);
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

.question-timer-big.danger {
  border-color: rgba(255, 60, 60, 0.6);
  color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 60, 60, 0.3), inset 0 0 20px rgba(255, 60, 60, 0.05);
  text-shadow: 0 0 10px rgba(255, 60, 60, 0.4);
}

.dash-timer-box-mini {
  background: rgba(0, 191, 255, 0.2);
  border: 1px solid rgba(0, 191, 255, 0.4);
  padding: 5px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.dash-timer-box-mini.puzzle {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.4);
}

.dash-timer-box-mini.puzzle .timer-label-mini {
  color: #ff6b6b;
}

.dash-timer-val-mini {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.timer-label-mini {
  font-size: 0.7rem;
  font-weight: 800;
  color: #4dc9f6;
}

@keyframes timerUrgent {

  0%,
  100% {
    transform: scale(1);
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
  }

  50% {
    transform: scale(1.1);
    background: rgba(239, 68, 68, 0.6);
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  }
}

.urgent-blink {
  animation: timerUrgent 0.4s ease-in-out infinite !important;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.question-text-display {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.4), rgba(0, 60, 130, 0.25));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  padding: 2vh 3vw;
  border-radius: 16px;
  font-size: clamp(1rem, 2.8vh, 1.6rem);
  font-weight: 800;
  text-align: center;
  max-width: 1200px;
  width: 100%;
  border: 1px solid rgba(0, 191, 255, 0.15);
  box-shadow: 0 0 30px rgba(0, 100, 200, 0.1), inset 0 1px 0 rgba(0, 191, 255, 0.1);
  line-height: 1.1;
  margin-bottom: 2vh;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  word-break: break-word;
}

/* Tech Blue 4-color answer grid */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 0.8rem;
}

.answer-block {
  padding: 1vh 1.5vw;
  border-radius: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  /* Fixed minimum height */
  max-height: 15vh;
  /* Prevent pushing other elements */
  color: var(--white);
  cursor: default;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  /* Default hide */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
}

.answer-block span {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  /* Fallback ellipsis after 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Emergency scroll if needed */
.answer-block.text-overflowing span {
  -webkit-line-clamp: unset;
  overflow-y: auto;
  max-height: 100%;
}

/* Shimmer effect on answer blocks */
.answer-block::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.5s ease;
}

.answer-block:hover::after {
  left: 100%;
}

.answer-block .shape {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

/* Tech blue gradient answers - 4 distinct blue tones */
.answer-0 {
  background: linear-gradient(135deg, #0a4da1, #0d6edb);
  border-color: rgba(13, 110, 219, 0.4);
  box-shadow: 0 4px 15px rgba(13, 77, 161, 0.3);
}

.answer-1 {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 4px 15px rgba(3, 105, 161, 0.3);
}

.answer-2 {
  background: linear-gradient(135deg, #075985, #06b6d4);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 15px rgba(7, 89, 133, 0.3);
}

.answer-3 {
  background: linear-gradient(135deg, #155e75, #22d3ee);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 4px 15px rgba(21, 94, 117, 0.3);
}

.answer-block.correct-highlight {
  outline: 3px solid #4dc9f6;
  outline-offset: -3px;
  animation: correctPulse 0.6s ease;
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

.answer-block.faded {
  opacity: 0.6;
  filter: grayscale(1) blur(1px);
}

/* ==================== QUESTION SCREEN (PLAYER - SAME AS ADMIN) ==================== */
.question-screen-player {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #041436 0%, #0a4aad 50%, #041436 100%);
  position: relative;
}

.question-screen-player::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.question-screen-player>* {
  position: relative;
  z-index: 1;
}

.player-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0, 30, 80, 0.5);
  border-bottom: 1px solid rgba(0, 191, 255, 0.1);
}

.player-q-header .q-num {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4dc9f6;
}

/* Center area - timer + question, same as admin .question-center */
.player-center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  min-height: 0;
}

.player-timer-row {
  text-align: center;
  margin-bottom: 1.5rem;
}

.player-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  border: 3px solid rgba(0, 191, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.15), inset 0 0 20px rgba(0, 191, 255, 0.05);
  text-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.player-timer.warning {
  border-color: rgba(255, 200, 0, 0.6);
  color: #ffc800;
  box-shadow: 0 0 20px rgba(255, 200, 0, 0.2), inset 0 0 20px rgba(255, 200, 0, 0.05);
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

.player-timer.danger {
  border-color: rgba(255, 60, 60, 0.6);
  color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 60, 60, 0.3), inset 0 0 20px rgba(255, 60, 60, 0.05);
  text-shadow: 0 0 10px rgba(255, 60, 60, 0.4);
  animation: pulse 0.5s ease-in-out infinite;
}

/* Question text - same glass box as admin .question-text-display */
.player-q-text {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.4), rgba(0, 60, 130, 0.25));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  padding: 1.5vh 2.5vw;
  border-radius: 16px;
  font-weight: 800;
  text-align: center;
  max-width: 1200px;
  width: 100%;
  border: 1px solid rgba(0, 191, 255, 0.15);
  box-shadow: 0 0 30px rgba(0, 100, 200, 0.1), inset 0 1px 0 rgba(0, 191, 255, 0.1);
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  word-break: break-word;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20vh;
  max-height: 40vh;
  /* Protect layout */
}

.player-q-text.text-overflowing {
  overflow-y: auto;
  display: block;
  /* Change from flex to allow scrolling */
}

/* Answers grid - same as admin .answers-grid */
.player-answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
  flex: 1;
  min-height: 0;
}

.player-answer-btn {
  height: 100%;
  padding: 1vh 1.5vw;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  /* Stronger min-height for mobile */
  max-height: 25vh;
  color: var(--white);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1.1;
}

.player-answer-btn span {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.player-answer-btn.text-overflowing span {
  -webkit-line-clamp: unset;
  overflow-y: auto;
}

/* Shimmer effect */
.player-answer-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.5s ease;
}

.player-answer-btn:hover::after {
  left: 100%;
}

.player-answer-btn:hover {
  filter: brightness(1.12);
}

.player-answer-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.player-answer-btn .shape-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.player-answer-btn.ans-0 {
  background: linear-gradient(135deg, #0a4da1, #0d6edb);
  border-color: rgba(13, 110, 219, 0.4);
  box-shadow: 0 4px 15px rgba(13, 77, 161, 0.3);
}

.player-answer-btn.ans-1 {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 4px 15px rgba(3, 105, 161, 0.3);
}

.player-answer-btn.ans-2 {
  background: linear-gradient(135deg, #075985, #06b6d4);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 15px rgba(7, 89, 133, 0.3);
  color: var(--white);
}

.player-answer-btn.ans-3 {
  background: linear-gradient(135deg, #155e75, #22d3ee);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 4px 15px rgba(21, 94, 117, 0.3);
}

.player-answer-btn.selected {
  transform: scale(1.03);
  outline: 3px solid #4dc9f6;
  outline-offset: -3px;
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.player-answer-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ==================== ANSWERED FEEDBACK (TECH BLUE) ==================== */
.answered-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #041436 0%, #0a4aad 50%, #041436 100%);
  text-align: center;
  padding: 2rem;
}

.answered-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 1.5rem;
  animation: bounceIn 0.5s ease;
  border: 2px solid transparent;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.answered-icon.correct {
  background: linear-gradient(135deg, #064e3b, #10b981);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.answered-icon.wrong {
  background: linear-gradient(135deg, #7f1d1d, #ef4444);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.answered-icon.neutral {
  background: rgba(0, 191, 255, 0.1);
  border-color: rgba(0, 191, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.1);
}

.answered-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(0, 191, 255, 0.2);
}

.answered-sub {
  font-size: 1.1rem;
  color: rgba(77, 201, 246, 0.6);
  font-weight: 600;
}

.points-big {
  font-size: 4rem;
  font-weight: 900;
  margin-top: 1rem;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
  color: #4dc9f6;
}

/* ==================== RESULT PLAYER SCREEN (NEW UI) ==================== */
.result-player-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #020b1e 0%, #072863 40%, #0a4aad 60%, #041436 100%);
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  gap: 0;
}

/* Subtle grid */
.result-player-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.result-player-screen>* {
  position: relative;
  z-index: 1;
}

/* Icon */
.result-player-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  animation: bounceIn 0.5s ease;
  border: 3px solid transparent;
}

.result-player-icon svg {
  width: 50px;
  height: 50px;
}

.result-player-icon.correct {

  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.25), 0 0 80px rgba(16, 185, 129, 0.1);
}

.result-player-icon.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.25), 0 0 80px rgba(239, 68, 68, 0.1);
}

.result-player-icon.neutral {
  background: rgba(0, 191, 255, 0.08);
  border-color: rgba(0, 191, 255, 0.3);
  color: #4dc9f6;
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.15);
}

/* Title */
.result-player-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 10px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: resultTitleIn 0.6s ease both 0.2s;
}

.result-player-title.correct {
  background: linear-gradient(180deg, #6ee7b7, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.4));
}

.result-player-title.wrong {
  background: linear-gradient(180deg, #fca5a5, #ef4444, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.4));
}

.result-player-title.neutral {
  color: rgba(255, 255, 255, 0.6);
}

@keyframes resultTitleIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Streak badge */
.result-player-streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  animation: resultTitleIn 0.5s ease both 0.4s;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

/* Stats cards */
.result-player-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin-bottom: 1.5rem;
  animation: resultTitleIn 0.5s ease both 0.5s;
}

.result-stat-card {
  background: rgba(0, 30, 80, 0.35);
  border: 1px solid rgba(0, 191, 255, 0.12);
  border-radius: 16px;
  padding: 1.5rem 1.3rem;
  text-align: left;
}

.result-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.8rem;
}

.result-stat-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
}

.result-stat-value svg {
  color: #4dc9f6;
  width: 24px;
  height: 24px;
}

.result-stat-rank {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.8rem;
}

.result-stat-rank svg {
  color: rgba(255, 255, 255, 0.3);
}

.result-rank-change {
  font-size: 0.8rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 12px;
  border-radius: 8px;
  margin-left: auto;
}

.result-rank-change.down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.result-rank-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.result-rank-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0369a1, #4dc9f6);
  border-radius: 6px;
  transition: width 1s ease 0.8s;
  width: 0%;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

/* Total */
.result-player-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
  animation: resultTitleIn 0.5s ease both 0.6s;
}

/* Hint */
.result-player-hint {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0, 191, 255, 0.25);
  margin-top: 1.5rem;
  animation: resultTitleIn 0.5s ease both 0.8s;
}

.streak-badge {
  background: rgba(0, 191, 255, 0.1);
  border: 1px solid rgba(0, 191, 255, 0.15);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== RANKING / PODIUM ==================== */
.ranking-screen {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #020b1e 0%, #041436 25%, #0a4aad 50%, #072863 75%, #020b1e 100%);
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
}

.ranking-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.ranking-screen>* {
  position: relative;
  z-index: 1;
}

.ranking-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  flex-shrink: 0;
}

.ranking-title {
  font-size: 2.5rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, #4dc9f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 191, 255, 0.4));
}

.ranking-sub {
  font-size: 0.9rem;
  color: rgba(77, 201, 246, 0.6);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: 0.8rem;
}

/* Podium for top 3 */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 1rem 1rem 0;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
}

.podium-name {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-size: 0.9rem;
  font-weight: 800;
  color: #4dc9f6;
  margin-bottom: 0.8rem;
}

.podium-bar {
  width: 100%;
  border-radius: 16px 16px 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 950;
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.podium-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  animation: podiumShine 4s infinite;
}

@keyframes podiumShine {
  to {
    left: 200%;
  }
}

.podium-item:nth-child(1) .podium-bar {
  background: linear-gradient(180deg, #94a3b8, #475569);
  height: 130px;
  box-shadow: 0 0 40px rgba(148, 163, 184, 0.15);
}

.podium-item:nth-child(2) .podium-bar {
  background: linear-gradient(180deg, #fbbf24, #b45309);
  height: 180px;
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.3);
}

.podium-item:nth-child(3) .podium-bar {
  background: linear-gradient(180deg, #d97706, #78350f);
  height: 95px;
  box-shadow: 0 0 30px rgba(217, 119, 6, 0.15);
}

.podium-empty {
  visibility: hidden;
}

/* Standings Board */
.standings-board {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

/* Ranking list below podium */
.ranking-list {
  padding: 0 1.5rem 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ranking-list::-webkit-scrollbar {
  width: 4px;
}

.ranking-list::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.3);
  border-radius: 10px;
}

.ranking-row {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 30, 80, 0.3);
  backdrop-filter: blur(10px);
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 191, 255, 0.1);
  transition: all 0.3s;
  animation: slideInUp 0.5s ease backwards;
}

.ranking-row:hover {
  background: rgba(0, 100, 200, 0.2);
  border-color: rgba(0, 191, 255, 0.3);
  transform: translateX(5px);
}

.ranking-row.is-me {
  background: rgba(0, 191, 255, 0.15);
  border: 2px solid #00bfff;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.2);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rank-num {
  width: 36px;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
  flex-shrink: 0;
}

.rank-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  margin-left: 12px;
}

.rank-score {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}

/* ==================== ADMIN CONTROLS BOTTOM BAR ==================== */
.admin-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 30, 80, 0.4);
  border-top: 1px solid rgba(0, 191, 255, 0.08);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ==================== PUZZLE GAME ==================== */
.puzzle-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, #041436 0%, #0a4aad 50%, #041436 100%);
}

.puzzle-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.puzzle-header h1 {
  font-size: 2.5rem;
  font-weight: 900;
}

.puzzle-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==================== PUZZLE SCREEN — FULL-VIEWPORT LAYOUT ==================== */

/* Outer container: locks puzzle to exactly one viewport height */
.puzzle-screen-wrapper {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

/* Inner flex column: header bar + board area fill 100% height */
.puzzle-screen-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #041436 0%, #0a4aad 60%, #041436 100%);
  position: relative;
}

.puzzle-screen-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 191, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 191, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.puzzle-screen-inner>* {
  position: relative;
  z-index: 1;
}

/* Board wrapper: takes all remaining space; centers the board */
.puzzle-board-wrapper {
  flex: 1;
  min-height: 0;
  /* critical: allows flex child to shrink below content size */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}

/* Board: size itself to fit the available height, capped at 88vw for wide screens */
.puzzle-board {
  display: grid;
  gap: 3px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  /* Use the smaller of: 88% of viewport width OR the available height minus safe margins */
  width: min(88vw, calc(100vh - 80px));
  max-width: 560px;
  aspect-ratio: 4 / 3;
  position: relative;
}

/* Compact inline timer shown in the top bar (replaces the big circle) */
.puzzle-timer-inline {
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  border: 2.5px solid rgba(0, 191, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.15);
  text-shadow: 0 0 8px rgba(0, 191, 255, 0.4);
  transition: all 0.3s;
  padding: 0 6px;
}

.puzzle-piece {
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, opacity 0.2s;
  aspect-ratio: 1;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background-size: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-piece:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.puzzle-piece.selected {
  transform: scale(1.08);
  z-index: 10;
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
  animation: puzzlePieceGlow 1s ease-in-out infinite alternate;
}

.puzzle-piece.correct {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
  cursor: default;
}

.puzzle-piece.dragging {
  opacity: 0.8;
  transform: scale(1.15);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
  transition: none;
}

.puzzle-piece.drag-over {
  transform: scale(1.05);
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
}

.puzzle-piece.swap-anim {
  animation: puzzleSwap 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes puzzlePieceGlow {
  from {
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.5), 0 0 32px rgba(251, 191, 36, 0.2);
  }

  to {
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.7), 0 0 48px rgba(251, 191, 36, 0.3);
  }
}

@keyframes puzzleSwap {
  0% {
    transform: scale(0.85);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.puzzle-complete {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(70, 23, 143, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.puzzle-complete h1 {
  font-size: 4rem;
  font-weight: 900;
  color: var(--kahoot-yellow);
  animation: bounceIn 0.8s ease;
}

.puzzle-complete p {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 1rem 0 2rem;
  font-weight: 600;
}

.puzzle-timer {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  margin-bottom: 1rem;
}

.puzzle-timer span {
  color: var(--white);
  font-weight: 900;
  font-size: 1.3rem;
}

/* ==================== CONFETTI ==================== */
.confetti {
  position: fixed;
  top: -10px;
  z-index: 1001;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ==================== PLAYER MONITOR ==================== */
.monitor-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}

.monitor-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.monitor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.monitor-item.answered {
  background: rgba(38, 137, 12, 0.3);
}

.monitor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.monitor-item.answered .monitor-dot {
  background: var(--kahoot-green);
}

.monitor-name {
  flex: 1;
}

.monitor-score {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}


/* ==================== FINAL SCREEN ==================== */
.final-crown {
  font-size: 5rem;
  animation: bounceIn 0.8s ease;
  margin-bottom: 1rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .logo-section h1 {
    font-size: 2.5rem;
  }

  .nav-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .question-text-display {
    font-size: 1.3rem;
    padding: 1.5rem 2rem;
  }

  .answers-grid {
    gap: 6px;
  }

  .answer-block {
    font-size: 1rem;
    padding: 1rem;
    min-height: 55px;
  }

  .player-answers-grid {
    gap: 8px;
    padding: 8px 10px 14px;
    max-width: 100%;
  }

  .player-answer-btn {
    font-size: 1rem;
    padding: 0.8rem;
  }

  .podium-item {
    width: 100px;
  }

  .podium-item:nth-child(2) .podium-bar {
    height: 120px;
  }

  .podium-item:nth-child(1) .podium-bar {
    height: 90px;
  }

  .podium-item:nth-child(3) .podium-bar {
    height: 70px;
  }

  .lobby-pin {
    font-size: 2.5rem;
  }

  .player-count-big {
    font-size: 3.5rem;
  }
}

/* ==================== STANDINGS BOARD ==================== */
.standings-board {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  max-width: 950px;
  margin: 1.5rem auto;
  animation: fadeIn 0.6s ease-out;
}

.standings-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1.2rem 2.8rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.standings-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-20deg);
  transition: 0.8s;
}

.standings-row:hover::after {
  left: 150%;
}

.standings-row:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.02) translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.standings-rank {
  font-size: 2.8rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.4);
  width: 70px;
  flex-shrink: 0;
  font-style: italic;
}

.standings-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  margin: 0 2.5rem 0 1.5rem;
  padding: 5px;
  border: 4px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.2);
  flex-shrink: 0;
}

.standings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.standings-info {
  flex: 1;
  text-align: left;
}

.standings-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.standings-tag {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-top: 5px;
  display: block;
}

.standings-score-box {
  text-align: right;
}

.standings-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: #0ea5e9;
  text-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
  display: block;
}

.standings-score-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
  display: block;
}

.standings-row:nth-child(1) .standings-score {
  color: #fbbf24;
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
}

.standings-row:nth-child(2) .standings-score {
  color: #cbd5e1;
  text-shadow: 0 0 25px rgba(203, 213, 225, 0.5);
}

.standings-row:nth-child(3) .standings-score {
  color: #f97316;
  text-shadow: 0 0 25px rgba(249, 115, 22, 0.5);
}

.standings-row:nth-child(1) {
  border-left: 8px solid #fbbf24;
}

.standings-row:nth-child(2) {
  border-left: 8px solid #cbd5e1;
}

.standings-row:nth-child(3) {
  border-left: 8px solid #f97316;
}

/* ==================== NEW COMPETITION DASHBOARD LAYOUT ==================== */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  z-index: 10;
  background: transparent;
}

.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(10, 74, 173, 0.6);
  border-bottom: 2px solid rgba(0, 191, 255, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dashboard-event-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dashboard-event-title {
  font-size: 1.4rem;
  font-weight: 950;
  letter-spacing: 3px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(0, 191, 255, 0.5);
  line-height: 1;
}

.dashboard-event-slash {
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, transparent, rgba(0, 191, 255, 0.6), transparent);
  transform: rotate(20deg);
}

.dashboard-event-sub {
  font-size: 0.9rem;
  font-weight: 800;
  color: #4dc9f6;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
  line-height: 1;
}

.dashboard-body {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 0;
  margin-top: 80px;
  /* Offset for fixed header */
}

/* Left Sidebar Ranking — fixed-width flex child, single property animated */
.dashboard-sidebar-left {
  flex: 0 0 20%;
  min-width: 240px;
  background: rgba(4, 20, 54, 0.85);
  border-right: 1px solid rgba(0, 191, 255, 0.2);
  display: flex;
  flex-direction: column;
  padding: 2vh 1.2vw;
  overflow: hidden;
  container-type: inline-size;
  position: relative;
}

.sidebar-title {
  font-size: 1.8rem;
  font-weight: 1000;
  color: #4dc9f6;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
  width: 100%;
}

@container (max-width: 300px) {
  .sidebar-title {
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }

  .sidebar-rank-num {
    font-size: 1.4rem;
    width: 35px;
  }

  .sidebar-rank-logo {
    width: 40px;
    height: 40px;
  }

  .sidebar-rank-name {
    font-size: 1rem;
  }

  .sidebar-rank-score {
    font-size: 0.9rem;
  }

  .sidebar-rank-item {
    padding: 10px 12px;
    gap: 10px;
  }
}

.sidebar-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  padding-right: 5px;
}

/* Custom scrollbar for sidebar */
.sidebar-ranking-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-ranking-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-ranking-list::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.2);
  border-radius: 10px;
}

.sidebar-rank-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.3), rgba(0, 60, 130, 0.15));
  border: 1px solid rgba(0, 191, 255, 0.15);
  padding: 16px 22px;
  border-radius: 16px;
  position: relative;
  /* FLIP Animation support */
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 3s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  will-change: transform, opacity;
}

.sidebar-rank-item.is-answering {
  border-color: rgba(77, 201, 246, 0.5);
  box-shadow: 0 0 20px rgba(77, 201, 246, 0.2);
}

.sidebar-rank-item:hover {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.5), rgba(0, 60, 130, 0.25));
  border-color: rgba(0, 191, 255, 0.4);
  box-shadow: 0 8px 25px rgba(0, 191, 255, 0.15);
}

.sidebar-rank-num {
  font-size: 1.8rem;
  font-weight: 1000;
  color: rgba(255, 255, 255, 0.25);
  width: 45px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  flex-shrink: 0;
}

.sidebar-rank-item:nth-child(1) .sidebar-rank-num {
  color: #facc15;
  text-shadow: 0 0 15px rgba(250, 204, 21, 0.5);
}

.sidebar-rank-item:nth-child(2) .sidebar-rank-num {
  color: #cbd5e1;
  text-shadow: 0 0 15px rgba(203, 213, 225, 0.4);
}

.sidebar-rank-item:nth-child(3) .sidebar-rank-num {
  color: #92400e;
  text-shadow: 0 0 15px rgba(146, 64, 14, 0.4);
  font-size: 1.5rem;
}

.sidebar-rank-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(0, 191, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 191, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-rank-logo img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.sidebar-rank-info {
  flex: 1;
}

.sidebar-rank-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  display: block;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sidebar-rank-score {
  font-size: 1.25rem;
  font-weight: 1000;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
  transition: transform 0.2s ease;
  display: inline-block;
  margin-top: 0;
  text-shadow: 0 0 10px rgba(77, 201, 246, 0.3);
}



.sidebar-rank-score.ticking {
  transform: scale(1.1);
  color: #fff;
  text-shadow: 0 0 10px rgba(77, 201, 246, 0.8);
}


/* Right Main Zone — auto-fills remaining space */
.dashboard-main-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2vh 2.5vw;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.dashboard-question-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 0;
  overflow: hidden;
}

/* Redefined Question Box for Dashboard */
.dash-q-box {
  background: linear-gradient(135deg, rgba(10, 74, 173, 0.45), rgba(0, 100, 200, 0.2));
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 2px solid rgba(0, 191, 255, 0.4);
  padding: 3vh 3vw;
  border-radius: 24px;
  width: 100%;
  text-align: center;
  margin-bottom: 2vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 80px;
  max-height: 25vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-q-box.success-mode {


  max-height: 18vh;
  margin-bottom: 1.5vh;
}

.dash-q-box.success-mode .dash-q-text {
  font-size: clamp(16px, 3vh, 2.5rem);
}

.dash-q-text {
  font-size: clamp(16px, 4vh, 32px);
  font-weight: 950;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 10px;
  transition: padding 0.3s ease;
}

.dash-q-text.text-overflowing {
  overflow-y: auto;
  display: block;
  padding-right: 15px;
}

/* Custom scrollbar for dashboard question and answers */
.dash-q-text::-webkit-scrollbar,
.dash-answer-card span::-webkit-scrollbar {
  width: 6px;
}

.dash-q-text::-webkit-scrollbar-track,
.dash-answer-card span::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.dash-q-text::-webkit-scrollbar-thumb,
.dash-answer-card span::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.3);
  border-radius: 10px;
}

.dash-q-text::-webkit-scrollbar-thumb:hover,
.dash-answer-card span::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 191, 255, 0.5);
}

.dash-q-img {
  max-height: 25vh;
  width: auto;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 1.5vh;
  border: 3px solid rgba(0, 191, 255, 0.5);
  box-shadow: 0 0 40px rgba(0, 191, 255, 0.3);
}

/* Sidebar Integrated Timer */
.dash-sidebar-timer {
  margin-top: auto;
  padding-top: 15px;
  width: 100%;
}

.dash-timer-box {
  background: #00bfff;
  border-radius: 6px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 25px rgba(0, 191, 255, 0.4);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.dash-timer-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

.timer-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: #fff;
  text-transform: uppercase;
}

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

.dash-timer-val {
  font-size: 3rem;
  font-weight: 1000;
  color: #fff;
  line-height: 1;
}

@container (max-width: 300px) {
  .dash-timer-box {
    padding: 8px 10px;
  }

  .timer-label {
    font-size: 0.6rem;
    margin-bottom: 2px;
  }

  .dash-timer-val {
    font-size: 1.8rem;
  }

  .dash-timer-unit {
    font-size: 0.8rem;
  }
}

.dash-timer-unit {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
}

.dash-timer-label {
  display: none;
  /* Replaced by timer-label */
}

.dash-timer-box.warning {
  background: #fbbf24;
  box-shadow: 0 10px 40px rgba(251, 191, 36, 0.4);
}

.dash-timer-box.danger {
  background: #ef4444;
  box-shadow: 0 10px 50px rgba(239, 68, 68, 0.5);
  animation: timerPulseDanger 0.6s infinite alternate;
}

@keyframes timerPulseDanger {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.03);
  }
}

/* Answers Grid for Dashboard */
.dash-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.5vh 1.5vw;
  width: 100%;
  flex: 1.2;
  min-height: 0;
  overflow: hidden;
}

.dash-answer-card {
  height: 100%;
  min-height: 120px;
  padding: 1.5vh 2vw;
  border-radius: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 1vw;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  animation: answerFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
  line-height: 1.2;
}

.dash-answer-card span {
  font-size: clamp(14px, 2.2vh, 24px);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.dash-answer-card.text-overflowing span {
  -webkit-line-clamp: unset;
  overflow-y: auto;
  padding-right: 10px;
  max-height: 100%;
}

@keyframes answerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    transform: translateY(0);
  }
}

.dash-answer-card .shape {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.dash-answer-card .shape {
  transition: all 0.3s ease;
}

/* Result Highlighting */
.dash-answer-card.correct-highlight {
  border-color: #10b981 !important;
  background: linear-gradient(135deg, #064e3b, #10b981) !important;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5), 0 8px 30px rgba(0, 0, 0, 0.3) !important;
  z-index: 10;
}

.dash-answer-card.correct-highlight .shape {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.dash-answer-card.faded {
  opacity: 0.20;
  filter: grayscale(0.2) blur(0.3px);
  box-shadow: none !important;
}

/* Status Bar - REMOVED per user request */
.dashboard-footer {
  display: none;
}

/* Floating Status Item Base */
.status-counter-item {
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 1. Answer Count Box (Floating on the far right) */
.response-status-box {
  position: absolute;
  top: 100px;
  right: 24px;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(4, 13, 34, 0.95), rgba(10, 74, 173, 0.8));
  backdrop-filter: blur(20px);
  padding: 15px 25px;
  border-radius: 16px;
  border: 1px solid rgba(0, 191, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 191, 255, 0.2);
  min-width: 160px;
  align-items: center;
  animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.response-status-box .status-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #4dc9f6;
  letter-spacing: 3px;
  margin-bottom: 5px;
}

.response-status-box .status-val {
  font-size: 1.3rem;
  font-weight: 950;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.response-status-box .status-val span {
  display: none;
  /* Hide redundant "ĐÃ TRẢ LỜI" injected by JS */
}

/* 2. Question Progress (Directly above question text) */
.question-progress-box {
  margin-bottom: 2rem;
  align-items: center;
  animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.question-progress-box .status-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 5px;
  position: relative;
  padding-bottom: 10px;
}

.question-progress-box .status-val::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4dc9f6, transparent);
  box-shadow: 0 0 10px #00bfff;
}

.question-progress-box .status-val span {
  color: #4dc9f6;
  font-size: 1.4rem;
  margin-right: 5px;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Sidebar Ranking List (Used in puzzle spectator) */
.sidebar-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.sidebar-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 74, 173, 0.3);
  border: 1px solid rgba(0, 191, 255, 0.15);
  padding: 10px 15px;
  border-radius: 12px;
  color: #fff;
}

/* STREAK BADGE */
.rank-streak {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  color: #ef4444;
  font-weight: 950;
  font-size: 1.2rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: max-content;
  animation: streakPulse 1.5s infinite ease-in-out;
}

@keyframes streakPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Topbar Integrated "TIẾP TỤC" button */
.btn-focus-continue {
  padding: 10px 22px;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #1e90ff, #0a4aad);
  color: #fff;
  border: 1px solid rgba(77, 201, 246, 0.35);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: 0 4px 14px rgba(0, 191, 255, 0.25);
  display: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  margin-left: 15px;
  font-family: inherit;
}

[data-phase="countdown"] .btn-focus-continue,
[data-phase="question_preview"] .btn-focus-continue,
[data-phase="question"] .btn-focus-continue,
[data-phase="result"] .btn-focus-continue,
[data-phase="ranking"] .btn-focus-continue,
[data-phase="puzzle"] .btn-focus-continue,
[data-phase="playerSelection"] .btn-focus-continue {
  display: inline-block;
}

/* Hide system text when button is active to save space */
[data-phase="countdown"] #topbarSystemText,
[data-phase="question_preview"] #topbarSystemText,
[data-phase="question"] #topbarSystemText,
[data-phase="result"] #topbarSystemText,
[data-phase="ranking"] #topbarSystemText,
[data-phase="puzzle"] #topbarSystemText,
[data-phase="playerSelection"] #topbarSystemText {
  display: none;
}

.btn-focus-continue:hover {
  background: linear-gradient(135deg, #4dc9f6, #1e90ff);
  box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
  transform: translateY(-1px);
}

.btn-focus-continue:active {
  transform: translateY(0);
}

/* ==================== RESPONSIVE REFACTOR ==================== */
@media (max-width: 992px) {
  .dashboard-body {
    flex-direction: column;
  }

  .dashboard-main-right {
    padding: 2vh 3vw;
  }

  .dash-answers-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
  }

  .dash-answer-card {
    height: auto;
    min-height: 60px;
    max-height: 10vh;
  }
}

@media (max-width: 480px) {
  .dashboard-header {
    padding: 0 15px;
    height: 50px;
  }

  .dashboard-event-title {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .dashboard-footer {
    padding: 0 15px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    text-align: center;
  }

  .status-counter-item {
    text-align: center !important;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(40px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}