/* ═══ PLAYER CONTAINER ═══ */
.player-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

/* ═══ HEADER ═══ */
.player-header {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  gap: 6px;
  z-index: 60;
}
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.header-logo {
  text-decoration: none;
  font-size: 1.1em;
  line-height: 1;
}
.room-code-badge {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--neon-blue);
  cursor: pointer;
  white-space: nowrap;
}
.score-pill {
  background: rgba(255,190,11,0.15);
  color: var(--neon-yellow);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
}
.avatar-pill {
  font-size: 1.3em;
  line-height: 1;
}
.timer-display {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--neon-blue);
  font-weight: bold;
  animation: glow-pulse 1.5s infinite;
}
.settings-toggle {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.settings-toggle:hover { opacity: 1; }

/* ═══ SETTINGS DRAWER ═══ */
.settings-drawer {
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  z-index: 55;
  flex-shrink: 0;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8em;
  color: var(--text-secondary);
}
.settings-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-secondary);
  padding: 2px 10px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
}
.settings-btn.active {
  background: rgba(0,245,255,0.15);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}
.settings-slider {
  width: 80px;
  accent-color: var(--neon-blue);
}

/* ═══ TIMER BAR ═══ */
.timer-bar {
  height: 3px;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
  overflow: hidden;
}

/* ═══ GAME AREA ═══ */
.player-game-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: 70px;
  -webkit-overflow-scrolling: touch;
}

/* ═══ BOTTOM NAV ═══ */
.player-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  z-index: 100;
}
.nav-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: bold;
  font-size: 0.85rem;
  position: relative;
  transition: color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.nav-tab.active {
  color: var(--neon-blue);
  text-shadow: 0 0 5px rgba(0,245,255,0.5);
}
.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--neon-blue);
  box-shadow: 0 -2px 10px var(--neon-blue);
  border-radius: 3px 3px 0 0;
}

/* ═══ OVERLAY PANELS (Chat, Scores) ═══ */
.overlay-panel {
  position: absolute;
  top: 50px;
  bottom: 56px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

/* ═══ TEAM SELECT ═══ */
.team-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.team-select-grid button {
  height: 70px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.team-select-grid button .player-count {
  font-size: 0.75rem;
  font-weight: normal;
  opacity: 0.8;
}

/* ═══ CHAT ═══ */
.chat-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.chat-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  cursor: pointer;
  transition: color 0.2s;
}
.chat-tab.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--neon-pink);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-input-row {
  display: flex;
  padding: 10px;
  gap: 6px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-input-row input { flex: 1; }

/* ═══ SCORES / PODIUM ═══ */
.podium-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0 10px;
}
.podium-place {
  flex: 1;
  max-width: 110px;
  text-align: center;
  border-radius: 10px 10px 0 0;
  padding: 10px 6px 8px;
  position: relative;
}
.podium-place .podium-rank {
  font-size: 1.3em;
  font-weight: bold;
  line-height: 1;
}
.podium-place .podium-name {
  font-size: 0.75em;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-place .podium-avatar {
  font-size: 1.8em;
  display: block;
  margin-bottom: 4px;
}
.podium-place .podium-score {
  font-size: 0.7em;
  opacity: 0.8;
  margin-top: 2px;
}
.podium-1 { background: rgba(255,215,0,0.2); border: 1px solid rgba(255,215,0,0.3); min-height: 130px; }
.podium-2 { background: rgba(192,192,192,0.15); border: 1px solid rgba(192,192,192,0.25); min-height: 100px; }
.podium-3 { background: rgba(205,127,50,0.15); border: 1px solid rgba(205,127,50,0.25); min-height: 80px; }

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
.ranking-item.is-me {
  background: rgba(0,245,255,0.08);
  border: 1px solid rgba(0,245,255,0.2);
}
.ranking-pos {
  font-weight: bold;
  font-size: 0.85em;
  color: var(--text-secondary);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.ranking-avatar { font-size: 1.2em; flex-shrink: 0; }
.ranking-name { flex: 1; font-size: 0.9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-score {
  font-weight: bold;
  color: var(--neon-yellow);
  font-size: 0.9em;
  flex-shrink: 0;
}

/* ═══ ANSWER CARDS ═══ */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.answer-card {
  min-height: 70px;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.answer-card.selected {
  border-color: var(--neon-blue);
  background: rgba(0,245,255,0.1);
  box-shadow: var(--border-glow);
  transform: scale(0.98);
}
.answer-card.correct {
  border-color: var(--neon-green);
  background: rgba(0,255,135,0.2);
  box-shadow: 0 0 15px var(--neon-green);
}
.answer-card.wrong {
  border-color: var(--neon-red);
  background: rgba(255,51,51,0.2);
  box-shadow: 0 0 15px var(--neon-red);
  animation: shake 0.4s ease-in-out;
}

/* ═══ MISC ═══ */
.reaction-zone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  color: white;
  transition: background-color 0.1s;
}
.slider-container { margin: 30px 0; }
.estimation-value {
  font-family: var(--font-display);
  font-size: 3.5rem;
  text-align: center;
  color: var(--neon-yellow);
  text-shadow: 0 0 20px rgba(255,190,11,0.5);
  margin-bottom: 16px;
}
.waiting-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  text-align: center;
  color: var(--text-secondary);
}
.waiting-indicator .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 15px var(--neon-blue);
  animation: glow-pulse 1.5s infinite;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 380px) {
  .player-header { padding: 0 6px; gap: 4px; }
  .room-code-badge { font-size: 0.85rem; letter-spacing: 1px; }
  .score-pill { padding: 2px 6px; font-size: 0.75rem; }
  .nav-tab { font-size: 0.75rem; }
  .team-select-grid { gap: 8px; }
  .team-select-grid button { height: 60px; font-size: 0.9rem; }
}
