/* ============================================================
   GAME SHELLS — Estilos compartilhados para todos os jogos
   ============================================================ */

/* ── Layout base do jogo ── */
.game-shell {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--z-game);
}

/* ── HUD (Heads-Up Display) ── */
.game-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(5, 8, 20, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.hud-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.hud-center {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ── HUD Stats ── */
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}

.hud-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hud-stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue-electric);
  line-height: 1;
}

/* ── Botão voltar ao menu ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: none;
  transition: all var(--transition-base);
  backdrop-filter: blur(var(--glass-blur));
}

.btn-back:hover {
  color: var(--blue-electric);
  border-color: var(--blue-electric);
  box-shadow: var(--shadow-glow-sm);
}

/* ── Tela inicial do jogo ── */
.game-start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(5, 8, 20, 0.92);
  backdrop-filter: blur(16px);
  z-index: 40;
  padding: var(--space-xl) var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.game-start-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 540px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  margin: auto;
  flex-shrink: 0;
}

.game-start-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: var(--radius-lg);
  font-size: 2.5rem;
  color: var(--blue-electric);
  margin: 0 auto var(--space-xl);
}

.game-start-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
}

.game-start-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

/* Tutorial dropdown (details/summary) */
.tutorial-details {
  margin-bottom: var(--space-xl);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: background 0.3s;
}
.tutorial-details:hover {
  background: rgba(255, 255, 255, 0.05);
}
.tutorial-details summary {
  padding: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  list-style: none; /* Esconde seta padrão no Firefox */
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tutorial-details summary::-webkit-details-marker {
  display: none; /* Esconde seta no Chrome/Safari */
}
.tutorial-details summary::after {
  content: "▼";
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}
.tutorial-details[open] summary::after {
  transform: rotate(180deg);
}
.tutorial-content {
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
  animation: fadeInDown 0.3s ease-out;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tutorial steps */
.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(79,143,255,0.06);
  border: 1px solid rgba(79,143,255,0.12);
  border-radius: var(--radius-md);
}

.tutorial-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-primary);
  color: var(--bg-void);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
}

.tutorial-step-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game-start-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ── Game Over Screen ── */
.game-over-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(5, 8, 20, 0.92);
  backdrop-filter: blur(16px);
  z-index: 40;
  padding: var(--space-xl) var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.game-over-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin: auto;
  flex-shrink: 0;
}

.game-over-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue-electric);
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 40px rgba(0,212,255,0.5);
}

.game-over-score-big {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  margin: var(--space-lg) 0;
}

.game-over-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.game-over-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
}

.game-over-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.game-over-stat-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.game-over-stat-lbl {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.game-over-new-record {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: var(--space-lg);
  animation: recordGlow 2s ease-in-out infinite;
}

@keyframes recordGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
  50%       { box-shadow: 0 0 25px rgba(255,215,0,0.5); }
}

.game-over-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ── Timer bar ── */
.timer-bar-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(255,255,255,0.05);
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-electric), var(--blue-primary));
  transition: width 0.5s linear;
  box-shadow: 0 0 8px var(--blue-electric);
}

.timer-bar.danger {
  background: linear-gradient(90deg, var(--accent-orange), #ff0055);
  box-shadow: 0 0 8px var(--accent-orange);
}

/* ── Mobile HUD ── */
@media (max-width: 600px) {
  .game-hud {
    padding: var(--space-sm) var(--space-md);
  }
  .hud-stat-value {
    font-size: 1rem;
  }
  .hud-title {
    display: none;
  }
  .btn-back {
    cursor: auto;
    padding: 10px 14px;
    min-height: 44px;
  }
  .btn-play,
  .btn-primary {
    cursor: auto;
    min-height: 48px;
  }
  .game-start-screen,
  .game-over-screen {
    padding: var(--space-md) var(--space-sm);
  }
  .game-start-panel,
  .game-over-panel {
    padding: var(--space-lg) var(--space-md);
    width: 100%;
    max-width: 100%;
  }
  .game-start-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
  }
  .game-start-title {
    font-size: 1.35rem;
  }
  .game-start-desc {
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
  }
  .tutorial-details {
    margin-bottom: var(--space-lg);
  }
  .game-over-score-big {
    font-size: 3rem;
  }
  /* Ações empilhadas no mobile */
  .game-start-actions,
  .game-over-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .game-start-actions .btn-primary,
  .game-over-actions .btn-primary,
  .game-over-actions .btn-back {
    width: 100%;
    justify-content: center;
  }
  /* Stats compactos */
  .game-over-stats {
    gap: var(--space-lg);
    padding: var(--space-md);
  }
  .game-over-stat-val {
    font-size: 1.1rem;
  }
  /* HUD center com menos gap */
  .hud-center {
    gap: var(--space-md);
  }
  .hud-stat {
    min-width: 50px;
  }
}
