/**
 * Game Overlay Styles
 * Semi-transparent overlay for "Know Each Other" social trivia game
 * Uses fixed positioning relative to viewport for layout mode agnostic behavior
 * Appears consistently in both PIP and split mode when games button is clicked
 */

/* ==========================================
   GAME OVERLAY CONTAINER (fixed to viewport)
   ========================================== */
#game-overlay {
  position: fixed;
  /* Use left/top for viewport-relative positioning */
  right: auto;
  /* Will be positioned by JS via _clampToViewport */
  z-index: 900;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

#game-overlay.visible {
  display: flex;
  animation: slideInOverlay 0.3s ease-out;
}

@keyframes slideInOverlay {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   GAME INSTRUCTIONS STATE
   ========================================== */
.game-instructions-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.game-instructions-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.game-instructions-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(91, 192, 190, 0.2);
}

.game-instructions-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.game-instructions-list {
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.game-instructions-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game-instructions-list li strong {
  color: var(--accent-primary);
}

.game-instructions-tip {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  padding: 8px;
  background: rgba(91, 192, 190, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

/* ==========================================
   GAME LIST STYLES
   ========================================== */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(26, 34, 44, 0.6);
  border: 1px solid rgba(91, 192, 190, 0.15);
  border-radius: 12px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.game-item:hover {
  background: rgba(91, 192, 190, 0.1);
  border-color: rgba(91, 192, 190, 0.3);
}

.game-item-icon {
  width: 40px;
  height: 40px;
  background: rgba(91, 192, 190, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.game-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.game-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.game-item-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.game-item-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
}

/* ========================================== */
#game-overlay {
  position: fixed;
  right: 20px;
  top: 80px;
  width: 380px;
  max-height: calc(100vh - 120px);
  background: rgba(19, 25, 32, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(91, 192, 190, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

#game-overlay.visible {
  display: flex;
  animation: slideInOverlay 0.3s ease-out;
}

@keyframes slideInOverlay {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   GAME OVERLAY HEADER (drag handle)
   ========================================== */
.game-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(91, 192, 190, 0.1);
  border-bottom: 1px solid rgba(91, 192, 190, 0.2);
  cursor: grab;
  flex-shrink: 0;
}

.game-overlay-header:active {
  cursor: grabbing;
}

.game-overlay-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.game-overlay-title svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-primary);
}

.game-overlay-controls {
  display: flex;
  gap: 8px;
}

.game-overlay-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-overlay-btn:hover {
  background: rgba(91, 192, 190, 0.15);
  color: var(--accent-primary);
}

.game-quit-btn {
  color: #e74c3c;
}

.game-quit-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* ==========================================
   GAME OVERLAY CONTENT
   ========================================== */
.game-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-overlay-content::-webkit-scrollbar {
  width: 6px;
}

.game-overlay-content::-webkit-scrollbar-track {
  background: transparent;
}

.game-overlay-content::-webkit-scrollbar-thumb {
  background: rgba(91, 192, 190, 0.3);
  border-radius: 3px;
}

.game-overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(91, 192, 190, 0.5);
}

/* ==========================================
   GAME IDLE STATE
   ========================================== */
.game-idle-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.game-icon-large {
  width: 64px;
  height: 64px;
  background: rgba(91, 192, 190, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.game-icon-large svg {
  width: 32px;
  height: 32px;
  fill: var(--accent-primary);
}

.game-idle-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.game-idle-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.game-start-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
}

.game-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 192, 190, 0.4);
}

.game-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   GAME QUESTION STATE
   ========================================== */
.game-question-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-round-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.game-dots {
  display: flex;
  gap: 4px;
}

.game-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(91, 192, 190, 0.3);
  transition: background 0.3s ease;
}

.game-dot.completed {
  background: var(--accent-primary);
}

.game-dot.current {
  background: var(--accent-warning);
}

.game-difficulty-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-difficulty-badge.easy {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.game-difficulty-badge.medium {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.game-difficulty-badge.hard {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.game-question-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  text-align: center;
  margin: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
}

.game-timer-bar {
  flex: 1;
  height: 6px;
  background: rgba(91, 192, 190, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.game-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width 1s linear;
}

.game-timer-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 24px;
  text-align: right;
}

.game-answer-input-container {
  position: relative;
}

.game-answer-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(26, 34, 44, 0.8);
  border: 1px solid rgba(91, 192, 190, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.game-answer-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(91, 192, 190, 0.15);
}

.game-answer-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.game-submit-btn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.game-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
}

.game-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   ANSWER REVEAL STATE
   ========================================== */
.game-reveal-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-reveal-question {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.game-answer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 10px;
  border-left: 3px solid var(--accent-primary);
}

.game-answer-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  min-width: 60px;
}

.game-answer-text {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

/* No answer / system message styling */
.game-answer-row.no-answer {
  border-left-color: var(--text-secondary);
  opacity: 0.7;
}

.game-answer-text.system-message {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 400;
}

.game-player-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: rgba(91, 192, 190, 0.1);
  border-radius: 10px;
}

.game-player-name {
  font-size: 11px;
  color: var(--text-secondary);
}

.game-player-points {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ==========================================
   RATING STATE
   ========================================== */
.game-rating-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-rating-question {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.game-rating-buttons {
  display: flex;
  gap: 8px;
}

.game-rating-btn {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.game-rating-btn .rating-icon {
  font-size: 18px;
}

.game-rating-btn.correct {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.3);
}

.game-rating-btn.correct:hover {
  background: rgba(46, 204, 113, 0.25);
}

.game-rating-btn.almost {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.game-rating-btn.almost:hover {
  background: rgba(52, 152, 219, 0.25);
}

.game-rating-btn.kinda {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
  border-color: rgba(243, 156, 18, 0.3);
}

.game-rating-btn.kinda:hover {
  background: rgba(243, 156, 18, 0.25);
}

.game-rating-btn.wrong {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.3);
}

.game-rating-btn.wrong:hover {
  background: rgba(231, 76, 60, 0.25);
}

/* ==========================================
   RESULTS STATE
   ========================================== */
.game-results-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 10px;
}

.game-result-rank {
  width: 28px;
  height: 28px;
  background: rgba(91, 192, 190, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
}

.game-result-item:first-child .game-result-rank {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.game-result-info {
  flex: 1;
}

.game-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.game-result-score {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.game-result-points {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ==========================================
   END GAME STATE
   ========================================== */
.game-end-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.game-winner-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(243, 156, 18, 0.2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.game-end-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.game-end-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.game-final-scores {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.game-play-again-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
  margin-top: 8px;
}

.game-play-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 192, 190, 0.4);
}

/* ==========================================
   SCORES DISPLAY
   ========================================== */
.game-scores-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 10px;
}

.game-score-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  background: rgba(91, 192, 190, 0.1);
  border-radius: 8px;
}

.game-score-name {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.game-score-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ==========================================
   GAME PROMPT MODAL
   ========================================== */
.game-prompt-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.game-prompt-modal.visible {
  display: flex;
}

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

.game-prompt-content {
  background: rgba(19, 25, 32, 0.95);
  border: 1px solid rgba(91, 192, 190, 0.25);
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

.game-prompt-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.game-prompt-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

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

.game-prompt-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.game-prompt-btn.accept {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
}

.game-prompt-btn.accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(91, 192, 190, 0.4);
}

.game-prompt-btn.decline {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.game-prompt-btn.decline:hover {
  background: rgba(231, 76, 60, 0.25);
}

/* ==========================================
   GAME BUTTON (in controls bar)
   ========================================== */
#btn-game {
  /* Inherits base control-btn styles */
}

#btn-game.active {
  background: rgba(91, 192, 190, 0.15);
  color: var(--accent-primary);
  border-color: rgba(91, 192, 190, 0.3);
}

/* ==========================================
   RESPONSIVE - SMALLER SCREENS
   ========================================== */
@media (max-width: 768px) {
  #game-overlay {
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 160px);
  }
  
  .game-question-text {
    font-size: 14px;
  }
  
  .game-rating-buttons {
    flex-wrap: wrap;
  }
}

/* ==========================================
   QUIT CONFIRMATION MODAL
   ========================================== */
.game-quit-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.game-quit-confirm-content {
  background: rgba(19, 25, 32, 0.95);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.game-quit-confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.game-quit-confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

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

.game-quit-confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.game-quit-confirm-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.game-quit-confirm-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.game-quit-confirm-btn.quit {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.game-quit-confirm-btn.quit:hover {
  background: rgba(231, 76, 60, 0.25);
}

/* ==========================================
   WAITING INDICATOR
   ========================================== */
.game-waiting-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 16px;
  background: rgba(91, 192, 190, 0.05);
  border-radius: 12px;
  border: 1px dashed rgba(91, 192, 190, 0.3);
}

.waiting-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(91, 192, 190, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.waiting-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   OBSERVING VIEW (waiting for active player)
   ========================================== */
.game-observing-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(26, 34, 44, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(91, 192, 190, 0.15);
}

.game-observing-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  font-style: italic;
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   AWAITING CONFIRMATION VIEW
   ========================================== */
.game-awaiting-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(243, 156, 18, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(243, 156, 18, 0.2);
}

.game-awaiting-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   CONFIRMATION VIEW
   ========================================== */
.game-confirmation-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(46, 204, 113, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.game-confirmation-text {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
  font-weight: 500;
}

.game-confirmation-subtext {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ==========================================
   MY RATING DISPLAY (waiting for rating)
   ========================================== */
.game-my-rating-display {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(91, 192, 190, 0.1);
  border-radius: 10px;
  border-left: 3px solid var(--accent-primary);
}

.game-my-rating-display span:first-child {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.game-my-rating-display span:last-child {
  font-size: 16px;
  color: var(--accent-primary);
  font-weight: 600;
  display: block;
}

/* ==========================================
   CONFETTI ANIMATION
   ========================================== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================
    DARE YOU GAME STYLES
    ========================================== */

/* Phase Title */
.game-phase-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.game-phase-description {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ==========================================
    DARE CREATION STATE
    ========================================== */
.game-dare-creation-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

/* Creation Progress */
.game-creation-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.game-progress-count {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
  text-align: right;
}

.game-progress-bar {
  height: 8px;
  background: rgba(91, 192, 190, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.game-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Dare Input */
.game-dare-input-container {
  display: flex;
  gap: 8px;
}

.game-dare-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(26, 34, 44, 0.8);
  border: 1px solid rgba(91, 192, 190, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.game-dare-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(91, 192, 190, 0.15);
}

.game-dare-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.game-dare-submit-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.game-dare-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 192, 190, 0.3);
}

.game-dare-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Dare Timer */
.game-dare-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* My Dares List */
.game-my-dares-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-dares-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  padding: 0 4px;
}

.game-dares-list-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(26, 34, 44, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(91, 192, 190, 0.1);
}

.game-dares-list-content::-webkit-scrollbar {
  width: 4px;
}

.game-dares-list-content::-webkit-scrollbar-track {
  background: transparent;
}

.game-dares-list-content::-webkit-scrollbar-thumb {
  background: rgba(91, 192, 190, 0.3);
  border-radius: 2px;
}

.game-dare-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(91, 192, 190, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.game-dare-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 24px;
}

.game-dare-text {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.4;
}

/* ==========================================
    DARE CHALLENGE STATE
    ========================================== */
.game-dare-challenge-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

/* Challenge Info */
.game-challenge-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-turn-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 10px;
}

.game-turn-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
}

.game-pool-remaining {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Resource Counters */
.game-resource-counters {
  display: flex;
  gap: 8px;
}

.game-resource-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(26, 34, 44, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(91, 192, 190, 0.1);
}

.game-resource-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.game-resource-count {
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 600;
  text-align: center;
}

/* ==========================================
    CARD REVEAL AREA
    ========================================== */
.game-card-reveal-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 180px;
  justify-content: center;
}

.game-card-placeholder {
  width: 100%;
  height: 160px;
  background: rgba(26, 34, 44, 0.4);
  border-radius: 16px;
  border: 2px dashed rgba(91, 192, 190, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card Hand (fanned cards) */
.game-card-hand {
  display: flex;
  justify-content: center;
  gap: 8px;
  perspective: 1000px;
  padding: 16px 0;
}

.game-card {
  width: 60px;
  height: 84px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.game-card:hover {
  transform: translateY(-8px);
}

.game-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.game-card.flipped .game-card-inner {
  transform: rotateY(180deg);
}

.game-card-front,
.game-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid rgba(91, 192, 190, 0.3);
}

.game-card-front {
  background: linear-gradient(135deg, rgba(91, 192, 190, 0.3), rgba(91, 192, 190, 0.1));
  color: var(--accent-primary);
}

.game-card-back {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.3), rgba(243, 156, 18, 0.1));
  color: #f1c40f;
  transform: rotateY(180deg);
}

.game-card.face-down .game-card-front {
  transform: rotateY(180deg);
}

.game-card.face-down .game-card-back {
  transform: rotateY(0deg);
}

.game-card-hint {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Revealed Dare */
.game-revealed-dare {
  width: 100%;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-revealed-card {
  width: 100%;
  perspective: 1000px;
}

.game-revealed-card .game-card-inner {
  transform: rotateY(180deg);
}

.game-card-content {
  padding: 16px;
  background: linear-gradient(135deg, rgba(91, 192, 190, 0.15), rgba(91, 192, 190, 0.05));
  border-radius: 12px;
  border: 2px solid rgba(91, 192, 190, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-dare-owner {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-dare-reveal-text {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
}

.game-reverso-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.game-revealed-dare.reversed {
  animation: scaleIn 0.3s ease, reversoPulse 1s ease;
}

@keyframes reversoPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(155, 89, 182, 0.2);
  }
}

/* ==========================================
    DECISION BUTTONS
    ========================================== */
.game-decision-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-decision-btn {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.game-decision-icon {
  font-size: 18px;
}

.game-decision-text {
  font-size: 11px;
}

.game-decision-btn.do-it-btn {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.3);
}

.game-decision-btn.do-it-btn:hover {
  background: rgba(46, 204, 113, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.game-decision-btn.skip-btn {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.game-decision-btn.skip-btn:hover {
  background: rgba(52, 152, 219, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.game-decision-btn.skip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.game-decision-btn.reverso-btn {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
  border-color: rgba(155, 89, 182, 0.3);
}

.game-decision-btn.reverso-btn:hover {
  background: rgba(155, 89, 182, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.game-decision-btn.reverso-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
    CONFIRMATION STATE
    ========================================== */
.game-confirmation-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.game-confirmation-title {
  font-size: 20px;
  font-weight: 700;
  color: #2ecc71;
  margin: 0;
}

.game-confirmation-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.game-confirm-btn {
  padding: 14px 28px;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.game-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
}

/* ==========================================
    GAME OVER STATE
    ========================================== */
.game-game-over-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.game-over-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
}

.game-over-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ==========================================
    RESPONSIVE - SMALLER SCREENS
    ========================================== */
@media (max-width: 480px) {
  #game-overlay {
    right: 8px;
    left: 8px;
    top: 70px;
  }
  
  .game-overlay-content {
    padding: 12px;
  }
  
  .game-question-text {
    font-size: 13px;
  }
  
  .game-waiting-indicator {
    padding: 16px 12px;
  }
  
  .waiting-spinner {
    width: 24px;
    height: 24px;
  }
  
  .waiting-text {
    font-size: 12px;
  }
}