/* ═══════════════════════════════════════════════════════════════
   MODO BATALHA – Multiplayer Quiz PSP
   ═══════════════════════════════════════════════════════════════ */

/* ── Base ── */
.batalha-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  min-height: 80vh;
}
.batalha-phase { animation: fadeIn .4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 15px rgba(255,215,0,.3); }
  50%      { box-shadow: 0 0 30px rgba(255,215,0,.6); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(.95); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0) rotate(-15deg); }
  60%  { transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes scoreFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.3); }
}
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* ── Inputs ── */
.batalha-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.3);
  color: #e2e8f0;
  font-size: .95rem;
  font-weight: 500;
  transition: border-color .2s, box-shadow .2s;
}
.batalha-input:focus {
  outline: none;
  border-color: var(--accent, #FFD700);
  box-shadow: 0 0 0 3px rgba(255,215,0,.15);
}
.batalha-input::placeholder { color: #64748b; }
.batalha-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-bottom: 6px;
}
.batalha-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.3);
  color: #e2e8f0;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.batalha-select:focus {
  outline: none;
  border-color: var(--accent, #FFD700);
}

/* ── Buttons ── */
.batalha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
}
.batalha-btn:active { transform: scale(.97); }

.batalha-btn-primary {
  background: linear-gradient(135deg, var(--accent, #FFD700), #FFA000);
  color: #000;
  box-shadow: 0 4px 20px rgba(255,215,0,.3);
}
.batalha-btn-primary:hover {
  box-shadow: 0 6px 30px rgba(255,215,0,.5);
  transform: translateY(-1px);
}

.batalha-btn-secondary {
  background: linear-gradient(135deg, #00509E, #0077CC);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,80,158,.3);
}
.batalha-btn-secondary:hover {
  box-shadow: 0 6px 30px rgba(0,80,158,.5);
  transform: translateY(-1px);
}

.batalha-btn-ready {
  background: linear-gradient(135deg, #198754, #28a745);
  color: #fff;
  box-shadow: 0 4px 20px rgba(40,167,69,.3);
  max-width: 300px;
  margin: 0 auto;
}
.batalha-btn-ready:hover {
  box-shadow: 0 6px 30px rgba(40,167,69,.5);
}
.batalha-btn-ready.is-ready {
  background: rgba(40,167,69,.2);
  color: #4ade80;
  border: 2px solid #28a745;
  cursor: default;
}

.batalha-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 2px solid rgba(255,255,255,.1);
}
.batalha-btn-ghost:hover {
  border-color: rgba(255,255,255,.3);
  color: #e2e8f0;
}

/* ═══════════════════════════════════════
   LOBBY
═══════════════════════════════════════ */
.lobby-container {
  max-width: 720px;
  margin: 0 auto;
}
.lobby-hero {
  text-align: center;
  padding: 40px 20px 30px;
}
.lobby-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent, #FFD700), #FFA000);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #000;
  margin: 0 auto 16px;
  animation: glow 2s ease-in-out infinite;
}
.lobby-hero h1 {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--accent, #FFD700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.lobby-subtitle {
  color: #94a3b8;
  font-size: .95rem;
}

.lobby-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.lobby-card {
  background: var(--bg-card, #0d1f38);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.06);
  text-align: center;
  transition: border-color .2s;
}
.lobby-card:hover {
  border-color: rgba(255,255,255,.15);
}
.lobby-card-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  margin: 0 auto 14px;
}
.lobby-card h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.lobby-card p {
  font-size: .85rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

/* Matchmaking card */
.lobby-card-matchmaking {
  max-width: 720px;
  margin: 0 auto 20px;
  border: 2px solid rgba(198,40,40,.3);
  background: linear-gradient(160deg, var(--bg-card, #0d1f38), rgba(198,40,40,.05));
}
.batalha-btn-matchmaking {
  background: linear-gradient(135deg, #c62828, #e53935);
  color: #fff;
  box-shadow: 0 4px 20px rgba(198,40,40,.3);
}
.batalha-btn-matchmaking:hover {
  box-shadow: 0 6px 30px rgba(198,40,40,.5);
  transform: translateY(-1px);
}
.matchmaking-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: .88rem;
  font-weight: 600;
  color: #94a3b8;
}
.matchmaking-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: #e53935;
  border-radius: 50%;
  animation: matchSpin 1s linear infinite;
}
@keyframes matchSpin {
  to { transform: rotate(360deg); }
}
.matchmaking-cancel {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: #94a3b8;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.matchmaking-cancel:hover {
  border-color: rgba(239,68,68,.4);
  color: #ef4444;
}

.lobby-info {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.info-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  font-size: .82rem;
  font-weight: 600;
  color: #94a3b8;
}
.info-item i { color: var(--accent, #FFD700); }

/* ═══════════════════════════════════════
   WAITING ROOM
═══════════════════════════════════════ */
.waiting-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.waiting-header {
  margin-bottom: 14px;
}
.waiting-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.room-code-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card, #0d1f38);
  border-radius: 12px;
  padding: 10px 22px;
  border: 2px solid rgba(255,215,0,.3);
  position: relative;
}
.room-code-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #94a3b8;
  font-weight: 700;
}
.room-code-value {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: .25em;
  color: var(--accent, #FFD700);
  font-family: monospace;
}
/* Share button */
.batalha-btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 12px;
  background: rgba(0,80,158,.25);
  border: 1px solid rgba(0,80,158,.4);
  color: #6ab4ff;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.batalha-btn-share:hover {
  background: rgba(0,80,158,.4);
  color: #fff;
}
.batalha-btn-share.copied {
  background: rgba(40,167,69,.2);
  border-color: rgba(40,167,69,.4);
  color: #4ade80;
}
.share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-hint {
  font-size: .78rem;
  color: #64748b;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.player-slot {
  background: var(--bg-card, #0d1f38);
  border-radius: 12px;
  padding: 10px 8px;
  border: 2px solid rgba(255,255,255,.06);
  text-align: center;
  animation: slideUp .4s ease;
  position: relative;
}
.player-slot.is-ready {
  border-color: rgba(40,167,69,.5);
}
.player-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: #fff;
  margin: 0 auto 4px;
  transition: transform .3s;
}
.player-slot.is-ready .player-avatar {
  transform: scale(1.05);
}
.player-name {
  font-size: .78rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-ready-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  display: inline-block;
}
.player-ready-badge.ready {
  background: rgba(40,167,69,.2);
  color: #4ade80;
}
.player-ready-badge.waiting {
  background: rgba(255,255,255,.06);
  color: #94a3b8;
}
.player-leader-badge {
  display: inline-flex;
  align-items: center;
  font-size: .55rem;
  font-weight: 800;
  color: #FFD700;
  background: rgba(255,215,0,.12);
  border: 1px solid rgba(255,215,0,.3);
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
  margin-bottom: 3px;
}
.player-leader-badge i { font-size: .5rem; margin-right: 2px; }
.player-slot-empty {
  background: rgba(255,255,255,.02);
  border: 2px dashed rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #475569;
  min-height: 60px;
}
.player-slot-empty i { font-size: 1.1rem; margin-bottom: 2px; }
.player-slot-empty small { font-size: .7rem; }

.waiting-hint {
  font-size: .82rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════
   ROULETTE
═══════════════════════════════════════ */
.roulette-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 20px;
}
.round-indicator {
  margin-bottom: 16px;
}
.round-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(0,80,158,.3);
  color: #6ab4ff;
  font-size: .82rem;
  font-weight: 700;
}
.roulette-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 24px;
  animation: pulse 1s ease-in-out infinite;
}
.roulette-wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 28px;
}
.roulette-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 2.2rem;
  color: var(--accent, #FFD700);
  filter: drop-shadow(0 3px 8px rgba(255,215,0,.6));
  animation: pointerBounce 1s ease-in-out infinite;
}
@keyframes pointerBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(4px); }
}
.roulette-wheel-wrap.spinning .roulette-pointer {
  animation: none;
}
.roulette-wheel {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 5px solid rgba(255,255,255,.12);
  box-shadow:
    0 0 0 3px rgba(255,215,0,.2),
    0 0 60px rgba(0,0,0,.5),
    0 0 30px rgba(0,80,158,.2),
    inset 0 0 40px rgba(0,0,0,.4);
  transition: transform 7s cubic-bezier(.12,.68,.06,.98);
}
.roulette-wheel-wrap.spinning .roulette-wheel {
  box-shadow:
    0 0 0 3px rgba(255,215,0,.4),
    0 0 80px rgba(255,215,0,.15),
    0 0 40px rgba(0,80,158,.3),
    inset 0 0 40px rgba(0,0,0,.4);
}
/* Outer siren glow ring while spinning */
.roulette-wheel-wrap.spinning::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(255,23,68,.4) 0deg,
    transparent 60deg,
    rgba(41,121,255,.4) 180deg,
    transparent 240deg,
    rgba(255,23,68,.4) 360deg
  );
  animation: sirenOrbit 1.2s linear infinite;
  z-index: -1;
  filter: blur(8px);
}
.roulette-wheel-wrap.spinning::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255,23,68,.5);
  border-bottom-color: rgba(41,121,255,.5);
  animation: sirenOrbit .8s linear infinite;
  z-index: -1;
}
@keyframes sirenOrbit {
  to { transform: rotate(360deg); }
}
/* Segment separator lines via SVG overlay */
.roulette-lines {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
}
.roulette-segment-label {
  position: absolute;
  font-size: .5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 6px rgba(0,0,0,.7);
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  letter-spacing: .03em;
  text-transform: uppercase;
}
/* Legend below roulette */
.roulette-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}
.roulette-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  font-weight: 600;
  color: #94a3b8;
}
.roulette-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.roulette-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1a2e 0%, #0a0a1a 100%);
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.15),
    0 0 20px rgba(0,0,0,.5);
}
/* Police siren lights */
.siren-light {
  position: absolute;
  width: 50%; height: 100%;
  top: 0;
  border-radius: 0;
  filter: blur(3px);
}
.siren-red {
  left: 0;
  background: radial-gradient(circle at 40% 50%, #ff1744, transparent 70%);
  animation: sirenRedPulse .6s ease-in-out infinite alternate;
}
.siren-blue {
  right: 0;
  background: radial-gradient(circle at 60% 50%, #2979ff, transparent 70%);
  animation: sirenBluePulse .6s ease-in-out infinite alternate-reverse;
}
@keyframes sirenRedPulse {
  0%   { opacity: 1; filter: blur(2px) brightness(1.5); }
  100% { opacity: .15; filter: blur(4px) brightness(.5); }
}
@keyframes sirenBluePulse {
  0%   { opacity: 1; filter: blur(2px) brightness(1.5); }
  100% { opacity: .15; filter: blur(4px) brightness(.5); }
}
/* Siren glow on the wheel border while spinning */
.roulette-wheel-wrap.spinning .roulette-center {
  box-shadow:
    0 0 0 3px rgba(255,255,255,.2),
    0 0 30px rgba(255,23,68,.4),
    0 0 30px rgba(41,121,255,.4);
}
/* Outer ring ticks */
.roulette-ticks {
  position: absolute;
  top: -3px; left: -3px;
  width: calc(100% + 6px); height: calc(100% + 6px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.roulette-result {
  margin-top: 20px;
  animation: bounceIn .6s ease;
}
.roulette-result-label {
  font-size: .85rem;
  color: #94a3b8;
}
.roulette-result-theme {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent, #FFD700);
  display: block;
  margin-top: 6px;
  text-shadow: 0 0 20px rgba(255,215,0,.3);
}

/* ═══════════════════════════════════════
   QUESTION
═══════════════════════════════════════ */
.question-container {
  max-width: 650px;
  margin: 0 auto;
}
.question-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.question-round-badge {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0,80,158,.3);
  color: #6ab4ff;
  font-size: .78rem;
  font-weight: 700;
}
.question-theme-chip {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
}
.question-timer-wrap {
  margin-left: auto;
  position: relative;
  width: 48px; height: 48px;
}
.timer-svg {
  width: 48px; height: 48px;
  transform: rotate(-90deg);
}
.timer-bg {
  fill: none;
  stroke: rgba(255,255,255,.08);
  stroke-width: 3;
}
.timer-fg {
  fill: none;
  stroke: var(--accent, #FFD700);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .3s linear, stroke .3s;
}
.timer-fg.urgent { stroke: #ef4444; }
.timer-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent, #FFD700);
}
.timer-text.urgent { color: #ef4444; animation: timerPulse .5s infinite; }

.question-card {
  background: var(--bg-card, #0d1f38);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.06);
  animation: slideUp .3s ease;
}
.question-image-wrap { text-align: center; margin-bottom: 12px; }
.question-image { max-height: 200px; border-radius: 12px; object-fit: contain; }
.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
}

.options-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.battle-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  animation-fill-mode: both;
  opacity: 0;
}
/* Perguntados-style: alternate slide from left/right */
.battle-option:nth-child(1) { animation: optionFromLeft .45s cubic-bezier(.34,1.56,.64,1) .1s both; }
.battle-option:nth-child(2) { animation: optionFromRight .45s cubic-bezier(.34,1.56,.64,1) .2s both; }
.battle-option:nth-child(3) { animation: optionFromLeft .45s cubic-bezier(.34,1.56,.64,1) .3s both; }
.battle-option:nth-child(4) { animation: optionFromRight .45s cubic-bezier(.34,1.56,.64,1) .4s both; }

@keyframes optionFromLeft {
  0%   { opacity: 0; transform: translateX(-100%) scale(.85) rotate(-2deg); }
  70%  { transform: translateX(6%) scale(1.02) rotate(.5deg); }
  100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
}
@keyframes optionFromRight {
  0%   { opacity: 0; transform: translateX(100%) scale(.85) rotate(2deg); }
  70%  { transform: translateX(-6%) scale(1.02) rotate(-.5deg); }
  100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
}

.battle-option:hover:not(.disabled) {
  border-color: var(--primary, #00509E);
  background: rgba(0,80,158,.15);
  transform: translateX(4px);
}
.battle-option.selected {
  border-color: var(--accent, #FFD700);
  background: rgba(255,215,0,.1);
}
.battle-option.correct {
  border-color: #28a745 !important;
  background: rgba(40,167,69,.2) !important;
}
.battle-option.incorrect {
  border-color: #ef4444 !important;
  background: rgba(239,68,68,.15) !important;
  animation: shake .4s ease;
}
.battle-option.disabled { cursor: default; pointer-events: none; opacity: .85; }

.option-letter {
  width: 36px; height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  background: rgba(0,80,158,.3);
  color: #6ab4ff;
  transition: all .2s;
}
.battle-option.selected .option-letter {
  background: var(--accent, #FFD700); color: #000;
}
.battle-option.correct .option-letter {
  background: #28a745; color: #fff;
}
.battle-option.incorrect .option-letter {
  background: #ef4444; color: #fff;
}
.option-text {
  flex: 1;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.5;
  color: #e2e8f0;
}

.answers-counter {
  text-align: center;
  font-size: .82rem;
  color: #64748b;
  font-weight: 600;
}

/* ═══════════════════════════════════════
   REVEAL
═══════════════════════════════════════ */
.reveal-container {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
}
.reveal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.reveal-correct {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(40,167,69,.15);
  border: 1px solid rgba(40,167,69,.3);
  color: #4ade80;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.reveal-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.reveal-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-card, #0d1f38);
  border: 1px solid rgba(255,255,255,.06);
  animation: slideUp .3s ease;
  animation-fill-mode: both;
}
.reveal-player-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: .85rem;
  flex-shrink: 0;
}
.reveal-player-name {
  flex: 1;
  font-weight: 600;
  font-size: .9rem;
  text-align: left;
}
.reveal-player-result {
  display: flex; align-items: center; gap: 8px;
}
.reveal-player-icon { font-size: 1rem; }
.reveal-player-points {
  font-weight: 800;
  font-size: .9rem;
  color: var(--accent, #FFD700);
}
.reveal-player-time {
  font-size: .72rem;
  color: #64748b;
}
.score-popup {
  animation: scoreFloat 1s ease forwards;
  position: absolute;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--accent, #FFD700);
}

.reveal-standings {
  background: var(--bg-card, #0d1f38);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
}
.reveal-standings h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #94a3b8;
}
.standing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.standing-row:last-child { border-bottom: none; }
.standing-pos {
  width: 28px;
  font-weight: 900;
  font-size: .9rem;
  text-align: center;
}
.standing-pos.gold   { color: #FFD700; }
.standing-pos.silver { color: #C0C0C0; }
.standing-pos.bronze { color: #CD7F32; }
.standing-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: .75rem;
}
.standing-name {
  flex: 1;
  font-weight: 600;
  font-size: .85rem;
}
.standing-score {
  font-weight: 800;
  font-size: .9rem;
  color: var(--accent, #FFD700);
}
.standing-bar-wrap {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.standing-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent, #FFD700), #FFA000);
  transition: width .8s ease;
}

/* ═══════════════════════════════════════
   GAME OVER
═══════════════════════════════════════ */
.gameover-container {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
  padding: 30px 20px;
  position: relative;
  overflow: hidden;
}
.gameover-trophy {
  font-size: 4rem;
  animation: bounceIn .8s ease;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 20px rgba(255,215,0,.5));
  color: #FFD700;
}
.gameover-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--accent, #FFD700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  animation: popIn .6s ease .3s both;
}
.gameover-subtitle {
  color: #94a3b8;
  font-size: .95rem;
  margin-bottom: 28px;
  animation: fadeIn .5s ease .5s both;
}

/* Podium */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 24px;
  min-height: 200px;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp .5s ease;
  animation-fill-mode: both;
}
.podium-place:nth-child(1) { animation-delay: .4s; }
.podium-place:nth-child(2) { animation-delay: .2s; }
.podium-place:nth-child(3) { animation-delay: .6s; }

.podium-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.2rem; color: #fff;
  margin-bottom: 6px;
  position: relative;
}
.podium-crown {
  position: absolute;
  top: -18px;
  font-size: 1.2rem;
}
.podium-name {
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 4px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-score {
  font-size: .75rem;
  font-weight: 800;
  color: var(--accent, #FFD700);
  margin-bottom: 6px;
}
.podium-bar {
  width: 80px;
  border-radius: 8px 8px 0 0;
  transition: height .8s ease;
}
.podium-bar-1 {
  background: linear-gradient(180deg, #FFD700, #FFA000);
  height: 120px;
}
.podium-bar-2 {
  background: linear-gradient(180deg, #C0C0C0, #8C8C8C);
  height: 85px;
}
.podium-bar-3 {
  background: linear-gradient(180deg, #CD7F32, #8B4513);
  height: 60px;
}

.final-standings {
  margin-bottom: 24px;
}
.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Confetti ── */
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
  z-index: 999;
  pointer-events: none;
}

/* ── Toasts ── */
.batalha-toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batalha-toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bg-card, #0d1f38);
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  font-size: .85rem;
  font-weight: 600;
  animation: slideUp .3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

/* ── Screen effects ── */
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-6px) rotate(-.5deg); }
  30% { transform: translateX(5px) rotate(.5deg); }
  50% { transform: translateX(-4px); }
  70% { transform: translateX(3px); }
  90% { transform: translateX(-2px); }
}
@keyframes correctFlash {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  50% { box-shadow: 0 0 40px 10px rgba(74,222,128,.3); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@keyframes wrongFlash {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  50% { box-shadow: 0 0 40px 10px rgba(239,68,68,.3); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
@keyframes countdownPop {
  0% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-50%) scale(1.4); }
  100% { transform: translate(-50%,-50%) scale(1); }
}
.screen-shake { animation: screenShake .5s ease; }
.battle-option.correct { animation: correctFlash .6s ease, slideUp .3s ease; }
.battle-option.incorrect { animation: wrongFlash .5s ease, shake .4s ease; }

/* Timer urgent glow */
.question-timer-wrap.urgent {
  animation: timerPulse .5s infinite;
}
.question-timer-wrap.urgent::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239,68,68,.2) 0%, transparent 70%);
  animation: pulse .8s ease-in-out infinite;
}

/* Theme splash overlay */
.theme-splash-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  animation: themeSplashIn .5s ease;
}
.theme-splash-overlay.theme-splash-exit {
  animation: themeSplashOut .4s ease forwards;
}
.theme-splash-content {
  text-align: center;
  animation: themeSplashPop .6s cubic-bezier(.175,.885,.32,1.275);
}
.theme-splash-icon {
  font-size: 4rem;
  color: rgba(255,255,255,.3);
  display: block;
  margin-bottom: 16px;
}
.theme-splash-name {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  text-shadow: 0 0 60px currentColor, 0 0 120px rgba(255,255,255,.1);
  letter-spacing: .02em;
  line-height: 1.2;
}
@keyframes themeSplashIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes themeSplashOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.1); }
}
@keyframes themeSplashPop {
  0%   { opacity: 0; transform: scale(.5) translateY(20px); }
  60%  { transform: scale(1.05) translateY(-5px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Countdown overlay */
.countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0,6,18,.85);
  backdrop-filter: blur(12px);
  animation: countdownOverlayIn .3s ease;
}
.countdown-overlay.countdown-exit {
  animation: countdownOverlayOut .3s ease forwards;
}
@keyframes countdownOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes countdownOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
/* Expanding ring behind number */
.countdown-ring {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 3px solid rgba(255,215,0,.15);
  pointer-events: none;
}
.countdown-ring-2 {
  width: 260px; height: 260px;
  border-color: rgba(255,215,0,.06);
}
.countdown-ring-pulse {
  animation: countdownRingExpand .8s ease forwards;
}
@keyframes countdownRingExpand {
  0%   { transform: scale(.6); opacity: .8; border-color: rgba(255,215,0,.4); }
  100% { transform: scale(1.5); opacity: 0; border-color: rgba(255,215,0,0); }
}
.countdown-number {
  font-size: clamp(6rem, 20vw, 10rem);
  font-weight: 900;
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 40px rgba(255,215,0,.6),
    0 0 80px rgba(255,215,0,.3),
    0 4px 0 rgba(0,0,0,.3);
  animation: countdownNumIn .7s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes countdownNumIn {
  0%   { opacity: 0; transform: scale(2.5) rotate(-8deg); filter: blur(8px); }
  50%  { opacity: 1; transform: scale(.9) rotate(2deg); filter: blur(0); }
  70%  { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.countdown-go {
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 40px rgba(74,222,128,.6));
  animation: countdownGoIn .5s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes countdownGoIn {
  0%   { opacity: 0; transform: scale(0) rotate(-20deg); }
  60%  { transform: scale(1.2) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Reveal answer animation */
.reveal-correct-answer {
  animation: bounceIn .6s ease, glow 1.5s ease-in-out infinite;
}

/* Reveal auto-advance countdown */
.reveal-auto-advance {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 4px;
  animation: fadeIn .4s ease;
}
.reveal-timer-label {
  font-size: .85rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.reveal-timer-circle {
  position: relative;
  width: 64px;
  height: 64px;
}
.reveal-timer-circle svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}
.reveal-timer-bg {
  fill: none;
  stroke: rgba(255,255,255,.08);
  stroke-width: 4;
}
.reveal-timer-fg {
  fill: none;
  stroke: var(--accent, #FFD700);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.reveal-timer-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent, #FFD700);
}

/* Answer feedback full-screen overlay */
.answer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: answerOverlayIn .4s ease;
}
.answer-overlay-correct {
  background: radial-gradient(circle, rgba(34,197,94,.3) 0%, rgba(0,0,0,.7) 70%);
}
.answer-overlay-wrong {
  background: radial-gradient(circle, rgba(239,68,68,.3) 0%, rgba(0,0,0,.7) 70%);
}
.answer-overlay-exit {
  animation: answerOverlayOut .4s ease forwards;
}
.answer-overlay-content {
  text-align: center;
  animation: answerContentPop .5s cubic-bezier(.175,.885,.32,1.275);
}
.answer-overlay-icon {
  font-size: clamp(5rem, 18vw, 8rem);
  display: block;
  margin-bottom: 12px;
}
.answer-overlay-correct .answer-overlay-icon {
  color: #4ade80;
  filter: drop-shadow(0 0 40px rgba(74,222,128,.6));
}
.answer-overlay-wrong .answer-overlay-icon {
  color: #ef4444;
  filter: drop-shadow(0 0 40px rgba(239,68,68,.6));
  animation: answerWrongShake .5s ease .2s;
}
.answer-overlay-text {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  letter-spacing: .02em;
}
.answer-overlay-correct .answer-overlay-text {
  color: #4ade80;
  text-shadow: 0 0 40px rgba(74,222,128,.5);
}
.answer-overlay-wrong .answer-overlay-text {
  color: #ef4444;
  text-shadow: 0 0 40px rgba(239,68,68,.5);
}
@keyframes answerOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes answerOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes answerContentPop {
  0%   { opacity: 0; transform: scale(.3); }
  60%  { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes answerWrongShake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-12px) rotate(-2deg); }
  40%  { transform: translateX(10px) rotate(2deg); }
  60%  { transform: translateX(-6px) rotate(-1deg); }
  80%  { transform: translateX(4px); }
}

/* Mini confetti burst on answer */
.mini-confetti {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  animation: miniConfettiBurst ease-out forwards;
}
@keyframes miniConfettiBurst {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(360deg); opacity: 0; }
}

/* ── Mobile optimizations ── */
.batalha-page { padding: 10px; }
.lobby-hero { padding: 28px 12px 20px; }
.lobby-hero h1 { font-size: 1.7rem; }
.lobby-card { padding: 18px; }
.lobby-card h2 { font-size: 1.05rem; }
.lobby-card p { font-size: .82rem; margin-bottom: 12px; }
.lobby-card-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.3rem; }
.batalha-input { padding: 11px 14px; font-size: .9rem; }
.batalha-btn { padding: 12px 22px; font-size: .9rem; }
.question-card { padding: 18px; }
.question-text { font-size: .95rem; }
.battle-option { padding: 14px 14px; border-radius: 12px; }
.option-letter { width: 32px; height: 32px; min-width: 32px; border-radius: 8px; font-size: .82rem; }
.option-text { font-size: .88rem; }
.waiting-container { padding: 0 8px; }
.reveal-container { padding: 0 8px; }
.gameover-container { padding: 20px 12px; }
.gameover-trophy { font-size: 3rem; }
.gameover-title { font-size: 1.6rem; }

/* ── Responsive ── */
@media (min-width: 600px) {
  .batalha-page { padding: 24px; }
  .lobby-cards { grid-template-columns: 1fr 1fr; }
  .lobby-hero h1 { font-size: 2.5rem; }
  .lobby-hero { padding: 40px 20px 30px; }
  .lobby-card { padding: 24px; }
  .podium-bar { width: 100px; }
  .roulette-wheel-wrap { width: 340px; height: 340px; }
  .roulette-wheel { width: 340px; height: 340px; }
  .batalha-btn { padding: 14px 28px; font-size: .95rem; }
  .question-card { padding: 24px; }
  .question-text { font-size: 1.05rem; }
  .battle-option { padding: 16px 18px; }
  .option-letter { width: 36px; height: 36px; min-width: 36px; }
  .option-text { font-size: .95rem; }
  .room-code-value { font-size: 2rem; }
  .player-slot { padding: 14px 10px; border-radius: 14px; }
  .player-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
  .player-name { font-size: .85rem; }
  .player-ready-badge { font-size: .7rem; }
  .players-grid { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .gameover-trophy { font-size: 4rem; }
  .gameover-title { font-size: 2rem; }
}
