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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  overflow-y: auto;
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  padding: 30px 20px;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

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

/* Join Screen */
.logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  color: #00d4ff;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
  line-height: 1.1;
  margin-bottom: 15px;
}

.monster-emoji {
  font-size: 4rem;
  animation: bounce 2s infinite;
}

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

.join-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #a0a0c0;
}

.input-group input {
  padding: 18px 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  background: rgba(15, 52, 96, 0.5);
  border: 2px solid #0f3460;
  border-radius: 15px;
  color: #e0e0e0;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.input-group input::placeholder {
  color: #404060;
  text-transform: none;
}

#playerName {
  font-family: 'Rajdhani', sans-serif;
  text-transform: none;
}

.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 15px;
  background: rgba(15, 52, 96, 0.3);
  border-radius: 15px;
}

.emoji-option {
  font-size: 1.8rem;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border: 2px solid transparent;
}

.emoji-option:hover {
  background: rgba(0, 212, 255, 0.2);
}

.emoji-option.selected {
  background: rgba(0, 212, 255, 0.3);
  border-color: #00d4ff;
  transform: scale(1.1);
}

.btn-primary {
  padding: 20px 40px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border: none;
  border-radius: 15px;
  color: #0a0a1a;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

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

.btn-secondary {
  padding: 18px 35px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: transparent;
  border: 2px solid #0f3460;
  border-radius: 15px;
  color: #a0a0c0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: #00d4ff;
  color: #00d4ff;
}

.error-text {
  color: #ff6b6b;
  text-align: center;
  font-weight: 600;
  min-height: 24px;
}

/* Waiting Screen */
.player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px;
  background: rgba(15, 52, 96, 0.4);
  border-radius: 20px;
  margin-bottom: 40px;
}

.big-emoji {
  font-size: 5rem;
}

.player-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #00d4ff;
}

.waiting-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.waiting-animation {
  display: flex;
  gap: 12px;
}

.dot {
  width: 16px;
  height: 16px;
  background: #00d4ff;
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

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

.waiting-text {
  font-size: 1.3rem;
  color: #a0a0c0;
  text-align: center;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 25px;
  background: rgba(15, 52, 96, 0.4);
  border-radius: 20px;
}

.score-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #a0a0c0;
}

.score-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #ffd93d;
  text-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

/* Question Screen */
#questionScreen {
  padding: 15px;
  gap: 15px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.question-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#questionNumber {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #00d4ff;
}

.category-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a0a0c0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.timer-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#6bcb77 0deg, #6bcb77 360deg, transparent 360deg);
  transition: background 0.1s linear;
}

.timer-bar::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: #0a0a1a;
  border-radius: 50%;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #6bcb77;
  z-index: 1;
}

.timer-text.warning {
  color: #ffd93d;
}

.timer-text.danger {
  color: #ff6b6b;
  animation: shake 0.5s infinite;
}

@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  25% { transform: translate(-50%, -50%) rotate(-5deg); }
  75% { transform: translate(-50%, -50%) rotate(5deg); }
}

.question-text-container {
  padding: 20px;
  background: rgba(15, 52, 96, 0.4);
  border-radius: 15px;
}

#questionText {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.answers-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: transparent;
  border: 3px solid;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 70px;
}

.answer-btn:active {
  transform: scale(0.98);
}

.answer-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.answer-btn.selected {
  transform: scale(1.02);
}

.answer-btn.correct {
  background: rgba(107, 203, 119, 0.3) !important;
  border-color: #6bcb77 !important;
}

.answer-btn.wrong {
  background: rgba(255, 107, 107, 0.3) !important;
  border-color: #ff6b6b !important;
}

.answer-btn[data-index="0"] {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.answer-btn[data-index="0"] .answer-letter {
  background: #ff6b6b;
}

.answer-btn[data-index="1"] {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.1);
}

.answer-btn[data-index="1"] .answer-letter {
  background: #00d4ff;
}

.answer-btn[data-index="2"] {
  border-color: #ffd93d;
  background: rgba(255, 217, 61, 0.1);
}

.answer-btn[data-index="2"] .answer-letter {
  background: #ffd93d;
}

.answer-btn[data-index="3"] {
  border-color: #6bcb77;
  background: rgba(107, 203, 119, 0.1);
}

.answer-btn[data-index="3"] .answer-letter {
  background: #6bcb77;
}

.answer-letter {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0a0a1a;
  border-radius: 12px;
  flex-shrink: 0;
}

.answer-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
  text-align: left;
  line-height: 1.3;
}

/* Result Screen */
#resultScreen {
  align-items: center;
  justify-content: center;
  gap: 25px;
  text-align: center;
}

.result-icon {
  font-size: 6rem;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

#resultText {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
}

#resultText.correct {
  color: #6bcb77;
  text-shadow: 0 0 30px rgba(107, 203, 119, 0.5);
}

#resultText.wrong {
  color: #ff6b6b;
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

#resultText.timeout {
  color: #ffd93d;
  text-shadow: 0 0 30px rgba(255, 217, 61, 0.5);
}

.result-answer {
  font-size: 1.2rem;
  color: #a0a0c0;
  max-width: 300px;
}

.points-earned {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 20px 40px;
  background: rgba(107, 203, 119, 0.2);
  border-radius: 15px;
  border: 2px solid #6bcb77;
}

.points-earned.zero {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
}

.points-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a0a0c0;
}

.points-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #6bcb77;
}

.points-earned.zero .points-value {
  color: #ff6b6b;
}

/* Game Over Screen */
#gameOverScreen {
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.game-over-header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: #ffd93d;
  text-shadow: 0 0 30px rgba(255, 217, 61, 0.5);
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(255, 217, 61, 0.5); }
  to { text-shadow: 0 0 40px rgba(255, 217, 61, 0.8); }
}

.final-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px;
  background: rgba(15, 52, 96, 0.4);
  border-radius: 25px;
  border: 2px solid #ffd93d40;
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.rank-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: #00d4ff;
  margin-top: 10px;
}

/* Lifelines */
.lifelines-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  padding: 15px 0;
}

.lifelines-container.hidden {
  display: none;
}

.lifeline-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 15px 25px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.3) 100%);
  border: 2px solid #a855f7;
  border-radius: 15px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 110px;
}

.lifeline-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(139, 92, 246, 0.5) 100%);
}

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

.lifeline-btn.used {
  opacity: 0.3;
  pointer-events: none;
  border-style: dashed;
}

.lifeline-btn.active {
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  color: #0a0a1a;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
}

.lifeline-btn.active .lifeline-label {
  color: #0a0a1a;
}

.lifeline-icon {
  font-size: 1.8rem;
}

.lifeline-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a855f7;
}

.lifeline-btn.active .lifeline-label {
  color: #0a0a1a;
}

/* Answer button when eliminated by 50/50 */
.answer-btn.eliminated {
  opacity: 0.2;
  pointer-events: none;
  transform: scale(0.95);
}

/* 2x indicator on question screen */
.double-points-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 8px 15px;
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  animation: pulse2x 1s infinite;
  z-index: 100;
}

@keyframes pulse2x {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(168, 85, 247, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(168, 85, 247, 0.8); }
}

/* Responsive adjustments */
@media (max-height: 700px) {
  .logo h1 {
    font-size: 2rem;
  }
  
  .monster-emoji {
    font-size: 3rem;
  }
  
  .big-emoji {
    font-size: 4rem;
  }
  
  .answer-btn {
    min-height: 60px;
    padding: 15px;
  }
  
  .emoji-picker {
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px;
  }
  
  .emoji-option {
    font-size: 1.5rem;
    padding: 6px;
  }
}

