* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050608;
  font-family: 'Rajdhani', sans-serif;
  color: #fff;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

/* Video Player Duplo em Tela Cheia */
#video-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

.game-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.game-video.active {
  opacity: 1;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  pointer-events: none;
  background: transparent;
}

/* Widescreen Cinematic Letterboxing */
.letterbox {
  position: absolute;
  left: 0;
  width: 100%;
  height: 7vh;
  background: #000;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 25px rgba(0,0,0,0.8);
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.letterbox.top { top: 0; }
.letterbox.bottom { bottom: 0; }

.cinematic-deep .letterbox {
  height: 12vh;
}

/* Vignette & Overlays */
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 5;
}

#flash-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  z-index: 25;
  transition: opacity 0.05s ease-out;
}

#death-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(160, 0, 0, 0.4) 0%, rgba(50, 0, 0, 0.95) 100%);
  opacity: 0;
  z-index: 20;
  transition: opacity 0.3s ease;
}

/* QTE HUD Interface - Posicionado no TOPO para NUNCA cobrir a luta */
#qte-hud {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#qte-hud.hidden {
  opacity: 0;
  transform: translate(-50%, -20px) scale(0.92);
  pointer-events: none;
}

.qte-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  background: rgba(10, 14, 24, 0.85);
  padding: 3px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.qte-alert {
  font-family: 'Teko', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.25em;
  color: #ff3344;
  text-shadow: 0 0 10px rgba(255, 51, 68, 0.9);
}

.qte-counter {
  display: flex;
  gap: 8px;
}

.qte-counter .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: all 0.25s ease;
}

.qte-counter .dot.active {
  background: #ffcc00;
  border-color: #ffe680;
  box-shadow: 0 0 10px #ffcc00;
  transform: scale(1.2);
}

.qte-counter .dot.completed {
  background: #00ffaa;
  border-color: #80ffd4;
  box-shadow: 0 0 8px #00ffaa;
}

.qte-counter .dot.failed {
  background: #ff2233;
  border-color: #ff7788;
  box-shadow: 0 0 10px #ff2233;
}

.qte-action-label {
  font-family: 'Teko', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: #cbd5e1;
  text-transform: uppercase;
}

/* Empilhamento das faixas de timing (1 faixa = golpe simples, 2 = tecla dupla) */
.qte-lanes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

/* Linha horizontal compacta */
.qte-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qte-row.hidden {
  display: none;
}

/* Tecla já resolvida dentro de um golpe de tecla dupla */
.qte-key-box.done {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.7);
  opacity: 0.55;
}

.qte-row.done .timing-meter-container {
  opacity: 0.5;
}

.qte-key-box {
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, #1b2030, #0d101a);
  border: 2px solid #ffcc00;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 204, 0, 0.3);
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.qte-key-box.pressing {
  transform: scale(0.92);
  border-color: #00e5ff;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
}

.qte-key-box.in-sweet-zone {
  border-color: #00ff88;
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.9);
  animation: key-throb 0.2s infinite alternate;
}

.qte-key-box.overheated {
  border-color: #ff1a1a;
  box-shadow: 0 0 25px rgba(255, 26, 26, 0.9);
}

.qte-key-label {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Única Barra de Timing Rítmico - Ultra Compacta e Minimalista */
.timing-meter-container {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 14, 24, 0.92);
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

.meter-track {
  position: relative;
  width: 100%;
  height: 12px;
  background: #111520;
  border-radius: 4px;
  border: 1px solid #2d3748;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Sweet Spot Target Zone */
.sweet-zone {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(16, 185, 129, 0.4);
  border-left: 2px solid #10b981;
  border-right: 2px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: none;
}

.sweet-indicator {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a7f3d0;
  text-shadow: 0 0 6px #10b981;
  pointer-events: none;
}

/* Fill bar that expands as the user holds the key */
.meter-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
  z-index: 1;
  transition: width 0.02s linear;
}

.meter-fill.overheat {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.9);
}

/* Needle / Position cursor */
.meter-needle {
  position: absolute;
  top: -2px;
  left: 0%;
  width: 3px;
  height: 24px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff, 0 0 16px #38bdf8;
  z-index: 3;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Feedback text */
.feedback-text {
  margin-top: 6px;
  font-family: 'Teko', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  min-height: 30px;
  text-align: center;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.feedback-text.perfect {
  color: #10b981;
  text-shadow: 0 0 25px rgba(16, 185, 129, 0.9);
  animation: feedback-pop 0.3s ease;
}

.feedback-text.early {
  color: #f59e0b;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.9);
  animation: feedback-pop 0.3s ease;
}

.feedback-text.late {
  color: #ef4444;
  text-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
  animation: feedback-pop 0.3s ease;
}

.feedback-text.wrong {
  color: #dc2626;
  text-shadow: 0 0 25px rgba(220, 38, 38, 0.9);
  animation: feedback-pop 0.3s ease;
}

/* Screen Overlays (Start, Game Over, Victory) */
.screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(6, 9, 15, 0.88);
  backdrop-filter: blur(10px);
  z-index: 50;
  transition: opacity 0.4s ease;
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.screen-content {
  max-width: 620px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.game-title {
  font-family: 'Cinzel', serif;
  font-size: 3.2rem;
  letter-spacing: 0.15em;
  color: #f8fafc;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  margin-bottom: 5px;
}

.subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 25px;
  letter-spacing: 0.05em;
}

.instructions-panel {
  text-align: left;
  background: rgba(2, 6, 23, 0.6);
  padding: 20px 25px;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  margin-bottom: 30px;
  width: 100%;
}

.instructions-panel h3 {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: #60a5fa;
  margin-bottom: 10px;
}

.instructions-panel p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.instructions-panel ul {
  padding-left: 20px;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
}

.instructions-panel strong {
  color: #e2e8f0;
}

.instructions-panel em {
  color: #f87171;
  font-style: normal;
  font-weight: bold;
}

.btn-action {
  font-family: 'Teko', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  padding: 10px 45px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 2px solid #60a5fa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.6);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-action:active {
  transform: translateY(1px);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border-color: #f87171;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 25px rgba(220, 38, 38, 0.6);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: #34d399;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 12px 25px rgba(5, 150, 105, 0.6);
}

/* Death Screen Specifics */
.death-title {
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  letter-spacing: 0.2em;
  color: #ef4444;
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
  margin-bottom: 10px;
}

.death-reason {
  font-size: 1.3rem;
  color: #fca5a5;
  margin-bottom: 20px;
  font-weight: 600;
}

.death-details {
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  font-size: 1rem;
  color: #cbd5e1;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Victory Screen Specifics */
.victory-title {
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  letter-spacing: 0.15em;
  color: #10b981;
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
  margin-bottom: 5px;
}

.victory-subtitle {
  font-size: 1.2rem;
  color: #6ee7b7;
  margin-bottom: 25px;
}

.stats-panel {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.4);
  padding: 15px 10px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-key {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: #34d399;
}

.stat-timing {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-top: 5px;
}

.stat-badge {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

#audio-hint {
  position: absolute;
  bottom: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
  z-index: 40;
  pointer-events: none;
}

/* Animations */
@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.05); opacity: 1; }
}

@keyframes key-throb {
  0% { transform: scale(0.92); }
  100% { transform: scale(0.96); }
}

@keyframes feedback-pop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Screen shake classes */
.shake-light {
  animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

.shake-heavy {
  animation: shake-heavy 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 1px, 0); }
  20%, 80% { transform: translate3d(3px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 3px, 0); }
  40%, 60% { transform: translate3d(4px, -3px, 0); }
}

@keyframes shake-heavy {
  10%, 90% { transform: translate3d(-6px, 4px, 0) rotate(-0.5deg); }
  20%, 80% { transform: translate3d(8px, -6px, 0) rotate(0.8deg); }
  30%, 50%, 70% { transform: translate3d(-10px, 8px, 0) rotate(-1deg); }
  40%, 60% { transform: translate3d(10px, -7px, 0) rotate(1deg); }
}

/* ==========================================================================
   TELA INICIAL — Terminal de combate Cyberdyne
   Aço escuro, vermelho de HUD do T-800 e cartaz de cinema. Tudo escopado em
   #start-screen para não afetar as telas de morte e vitória.
   ========================================================================== */

#start-screen {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 18, 12, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(90, 14, 10, 0.3), transparent 55%),
    linear-gradient(180deg, #08090c 0%, #0d0f14 45%, #05060a 100%);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

/* Textura de CRT por cima de tudo */
.crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.35) 3px,
      rgba(0, 0, 0, 0.35) 4px
    );
  animation: crt-flicker 4.5s steps(60) infinite;
}

/* Brilho vermelho difuso, como a visão do endoesqueleto */
.crt-scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 40, 24, 0.07), transparent 65%);
}

@keyframes crt-flicker {
  0%, 96%, 100% { opacity: 0.55; }
  97% { opacity: 0.38; }
  98% { opacity: 0.62; }
}

/* Painel principal: chapa de aço com cantos chanfrados, sem nada arredondado */
#start-screen .screen-content {
  position: relative;
  z-index: 3;
  max-width: 660px;
  padding: 0 0 34px;
  background: linear-gradient(175deg, rgba(20, 22, 27, 0.97), rgba(9, 10, 13, 0.97));
  border: 1px solid rgba(255, 60, 40, 0.28);
  border-radius: 0;
  clip-path: polygon(
    26px 0, 100% 0, 100% calc(100% - 26px),
    calc(100% - 26px) 100%, 0 100%, 0 26px
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 30px 80px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Barra de status do sistema */
.term-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8b9099;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.term-id {
  color: #c9ced6;
}

.term-sep {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(to right, rgba(255, 255, 255, 0.2) 0 4px, transparent 4px 8px);
}

.term-threat b {
  color: #ff3a24;
  animation: threat-blink 1.4s steps(2) infinite;
}

@keyframes threat-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Faixa de risco industrial */
.hazard-strip {
  width: 100%;
  height: 9px;
  background: repeating-linear-gradient(
    -45deg,
    #f0b418 0 11px,
    #0a0a0c 11px 22px
  );
  opacity: 0.85;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ---- Cartaz do confronto ---- */
.title-block {
  width: 100%;
  padding: 30px 30px 24px;
  text-align: center;
}

.title-kicker {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  color: #6f757e;
  margin-bottom: 14px;
}

#start-screen .game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: 'Anton', 'Teko', sans-serif;
  font-size: clamp(2.5rem, 7.5vw, 4.4rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  text-shadow: none;
}

/* Letras de aço escovado com sombra dura — cartaz de cinema */
.title-line {
  position: relative;
  background: linear-gradient(
    180deg,
    #ffffff 0%, #d5dae1 26%, #767d88 50%,
    #454b55 54%, #aeb5bf 72%, #f2f5f8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.85)) drop-shadow(0 0 22px rgba(255, 255, 255, 0.12));
}

/* O nome da IA queima em vermelho */
.title-line-red {
  background: linear-gradient(
    180deg,
    #ffd9d2 0%, #ff6a4d 30%, #e01508 55%,
    #8e0a03 70%, #ff5334 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.9)) drop-shadow(0 0 26px rgba(255, 45, 25, 0.55));
}

/* Falha de sinal ocasional na cópia sobreposta */
.title-line::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: none;
  -webkit-text-fill-color: #ff2a18;
  color: #ff2a18;
  opacity: 0;
  mix-blend-mode: screen;
  animation: title-glitch 7s infinite;
  pointer-events: none;
}

.title-line-red::after {
  -webkit-text-fill-color: #35d9ff;
  color: #35d9ff;
  animation-delay: 0.35s;
}

@keyframes title-glitch {
  0%, 92%, 100% { opacity: 0; transform: translate(0, 0); }
  93% { opacity: 0.85; transform: translate(-3px, 1px); }
  94% { opacity: 0; transform: translate(0, 0); }
  96% { opacity: 0.7; transform: translate(2px, -1px); }
  97% { opacity: 0; transform: translate(0, 0); }
}

/* "VS" cravado entre os dois nomes */
.title-vs {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  color: #0b0c0f;
  background: #ff3a24;
  padding: 3px 16px 2px 20px;
  margin: 7px 0;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 0 22px rgba(255, 58, 36, 0.55);
}

#start-screen .subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #7d838c;
  margin-bottom: 0;
}

/* ---- Briefing em terminal ---- */
#start-screen .instructions-panel {
  width: calc(100% - 60px);
  margin: 0 30px 28px;
  padding: 18px 22px 20px;
  background:
    linear-gradient(180deg, rgba(255, 45, 25, 0.05), rgba(0, 0, 0, 0)),
    rgba(4, 5, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid #ff3a24;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

#start-screen .instructions-panel h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  color: #ff5a41;
  margin-bottom: 12px;
}

/* Cursor piscando no fim do cabeçalho */
.term-caret {
  display: inline-block;
  width: 8px;
  height: 13px;
  margin-left: 7px;
  background: #ff5a41;
  vertical-align: -2px;
  animation: caret-blink 1s steps(2) infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

#start-screen .instructions-panel p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #aeb4bd;
  letter-spacing: 0.03em;
}

#start-screen .instructions-panel ul {
  list-style: none;
  padding-left: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #939aa3;
}

#start-screen .instructions-panel li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 7px;
}

/* Marcador de linha de terminal */
#start-screen .instructions-panel li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: #ff3a24;
}

#start-screen .instructions-panel strong {
  color: #edf0f3;
  font-weight: 400;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

#start-screen .instructions-panel em {
  color: #ff3a24;
  font-style: normal;
  letter-spacing: 0.1em;
}

/* Sequência de teclas do combate */
.key-sequence {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 14px 0 16px;
}

.kbd {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  font-family: 'Anton', sans-serif;
  font-size: 0.95rem;
  color: #f4f6f8;
  background: linear-gradient(160deg, #262a31, #101217);
  border: 1px solid rgba(255, 90, 65, 0.5);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px rgba(255, 58, 36, 0.2);
}

.kbd-plus,
.key-arrow {
  font-family: 'Share Tech Mono', monospace;
  color: #ff5a41;
  font-size: 0.9rem;
}

.key-arrow {
  opacity: 0.6;
  margin: 0 3px;
}

/* ---- Botão de início ---- */
#start-screen .btn-action {
  position: relative;
  overflow: hidden;
  font-family: 'Anton', 'Teko', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  padding: 14px 58px;
  background: linear-gradient(160deg, #ff4a2e, #b3160a 55%, #7d0d05);
  border: 1px solid #ff8368;
  border-radius: 0;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  box-shadow: 0 0 26px rgba(255, 58, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-label {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* Varredura de scanner atravessando o botão */
#start-screen .btn-action::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: btn-scan 3.2s ease-in-out infinite;
}

@keyframes btn-scan {
  0%, 62%, 100% { left: -60%; }
  86% { left: 125%; }
}

#start-screen .btn-action:hover {
  transform: translateY(-2px);
  background: linear-gradient(160deg, #ff6144, #d01a0c 55%, #941006);
  box-shadow: 0 0 38px rgba(255, 58, 36, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#start-screen .btn-action:active {
  transform: translateY(1px);
}

/* Respeita quem prefere menos movimento na tela */
@media (prefers-reduced-motion: reduce) {
  .crt-scanlines,
  .term-threat b,
  .term-caret,
  .title-line::after,
  #start-screen .btn-action::after {
    animation: none;
  }
}

/* Telas estreitas */
@media (max-width: 560px) {
  #start-screen .instructions-panel {
    width: calc(100% - 32px);
    margin: 0 16px 22px;
  }

  .title-block {
    padding: 22px 16px 18px;
  }

  .key-sequence {
    flex-wrap: wrap;
  }
}

/* O cartão é alto: garante rolagem em vez de corte quando a tela é baixa */
#start-screen {
  align-items: flex-start;
  overflow-y: auto;
  padding: 28px 0;
}

#start-screen .screen-content {
  margin: auto;
}

/* "VS" com mais presença de cartaz */
.title-vs {
  font-size: 1.05rem;
  padding: 4px 20px 3px 24px;
}

/* Modo compacto: notebooks de 768px e janelas baixas */
@media (max-height: 850px) {
  #start-screen {
    padding: 16px 0;
  }

  .term-bar {
    padding: 8px 20px;
  }

  .title-block {
    padding: 20px 26px 16px;
  }

  #start-screen .game-title {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    margin-bottom: 10px;
  }

  .title-kicker {
    margin-bottom: 10px;
  }

  #start-screen .instructions-panel {
    margin-bottom: 20px;
    padding: 14px 18px 16px;
  }

  #start-screen .instructions-panel li {
    margin-bottom: 5px;
  }

  .key-sequence {
    margin: 11px 0 12px;
  }

  #start-screen .screen-content {
    padding-bottom: 26px;
  }

  #start-screen .btn-action {
    font-size: 1.3rem;
    padding: 11px 46px;
  }
}

/* Telas bem baixas: enxuga o cartaz para o briefing continuar visível */
@media (max-height: 620px) {
  .title-kicker,
  #start-screen .subtitle {
    display: none;
  }

  #start-screen .game-title {
    font-size: clamp(1.9rem, 5vw, 2.7rem);
  }

  .title-block {
    padding: 14px 22px 10px;
  }

  #start-screen .instructions-panel p,
  #start-screen .instructions-panel ul {
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   HUD DO QTE — mesma linguagem da tela inicial
   Chapa de aço chanfrada, vermelho de HUD e tipografia de terminal.
   A zona de acerto continua VERDE: é leitura crítica durante a luta.
   ========================================================================== */

#qte-hud {
  padding: 0 0 6px;
  background: linear-gradient(175deg, rgba(20, 22, 27, 0.95), rgba(8, 9, 12, 0.95));
  border: 1px solid rgba(255, 60, 40, 0.3);
  clip-path: polygon(
    14px 0, 100% 0, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 0 100%, 0 14px
  );
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 14px 40px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

/* Faixa de risco no topo, igual à da tela inicial */
#qte-hud::before {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(-45deg, #f0b418 0 8px, #0a0a0c 8px 16px);
  opacity: 0.8;
}

/* ---- Cabeçalho de sistema ---- */
#qte-hud .qte-header {
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.35));
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  backdrop-filter: none;
}

/* Etiqueta vermelha cravada, como o "VS" do cartaz */
#qte-hud .qte-alert {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: #0b0c0f;
  background: #ff3a24;
  padding: 2px 10px 1px 14px;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  text-shadow: none;
  box-shadow: 0 0 16px rgba(255, 58, 36, 0.5);
}

/* Contador de golpes: traços angulares no lugar das bolinhas */
#qte-hud .qte-counter {
  gap: 5px;
}

#qte-hud .qte-counter .dot {
  width: 14px;
  height: 5px;
  border-radius: 0;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
  transform: skewX(-20deg);
}

#qte-hud .qte-counter .dot.active {
  background: #ff3a24;
  box-shadow: 0 0 12px rgba(255, 58, 36, 0.9);
  transform: skewX(-20deg) scaleY(1.35);
}

#qte-hud .qte-counter .dot.completed {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  transform: skewX(-20deg);
}

#qte-hud .qte-counter .dot.failed {
  background: #7d0d05;
  box-shadow: 0 0 10px rgba(255, 58, 36, 0.6);
  transform: skewX(-20deg);
}

#qte-hud .qte-action-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #9aa1aa;
}

/* ---- Faixas de tecla ---- */
.qte-lanes {
  padding: 0 12px;
}

/* Keycap idêntico ao da tela inicial */
#qte-hud .qte-key-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(160deg, #262a31, #101217);
  border: 1px solid rgba(255, 90, 65, 0.55);
  border-radius: 0;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px rgba(255, 58, 36, 0.22);
}

#qte-hud .qte-key-label {
  font-family: 'Anton', sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Segurando: a tecla esquenta */
#qte-hud .qte-key-box.pressing {
  transform: scale(0.94);
  border-color: #ff5a41;
  background: linear-gradient(160deg, #3a1a14, #14090a);
  box-shadow: 0 0 22px rgba(255, 58, 36, 0.75), inset 0 0 12px rgba(255, 58, 36, 0.35);
}

/* Dentro da janela de acerto */
#qte-hud .qte-key-box.in-sweet-zone {
  border-color: #10b981;
  background: linear-gradient(160deg, #0d2a22, #06110e);
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.85), inset 0 0 12px rgba(16, 185, 129, 0.3);
}

/* Estourou o tempo */
#qte-hud .qte-key-box.overheated {
  border-color: #ff2a18;
  background: linear-gradient(160deg, #4a0f08, #1a0503);
  box-shadow: 0 0 28px rgba(255, 42, 24, 0.95);
}

/* Tecla já resolvida no golpe duplo */
#qte-hud .qte-key-box.done {
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
  opacity: 0.5;
}

/* ---- Medidor ---- */
#qte-hud .timing-meter-container {
  padding: 4px 5px;
  background: rgba(4, 5, 8, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid rgba(255, 58, 36, 0.7);
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), inset 0 0 10px rgba(0, 0, 0, 0.7);
  backdrop-filter: none;
}

#qte-hud .meter-track {
  height: 13px;
  background: #07080b;
  border: 1px solid #23262d;
  border-radius: 0;
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.95);
}

/* Carga da tecla: medidor de calor, âmbar virando vermelho */
#qte-hud .meter-fill {
  background: linear-gradient(90deg, #7d3a06, #f0b418 55%, #ff6a2c);
  box-shadow: 0 0 14px rgba(240, 180, 24, 0.55);
}

#qte-hud .meter-fill.overheat {
  background: linear-gradient(90deg, #b3160a, #ff2a18);
  box-shadow: 0 0 22px rgba(255, 42, 24, 0.95);
}

/* A janela de acerto segue verde, com moldura angular */
#qte-hud .sweet-zone {
  background: rgba(16, 185, 129, 0.28);
  border-left: 2px solid #10b981;
  border-right: 2px solid #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55), inset 0 0 8px rgba(16, 185, 129, 0.25);
}

/* Agulha de varredura */
#qte-hud .meter-needle {
  width: 2px;
  height: 21px;
  top: -4px;
  background: #ffffff;
  border-radius: 0;
  box-shadow: 0 0 8px #ffffff, 0 0 18px rgba(255, 58, 36, 0.9);
}

/* ---- Veredicto ---- */
#qte-hud .feedback-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  min-height: 22px;
  margin-top: 4px;
}

/* Impacto de acerto: tremida curta da cena, no lugar do aviso escrito.
   Deslocamentos pequenos e assimétricos — leem como pancada, não como glitch. */
#game-container.hit-shake {
  animation: hit-shake 0.2s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* O leve scale evita que o deslocamento revele as bordas pretas da viewport */
@keyframes hit-shake {
  0%   { transform: scale(1) translate(0, 0) rotate(0deg); }
  15%  { transform: scale(1.018) translate(-5px, 2px) rotate(-0.35deg); }
  32%  { transform: scale(1.018) translate(4px, -3px) rotate(0.3deg); }
  50%  { transform: scale(1.014) translate(-3px, -1px) rotate(-0.2deg); }
  68%  { transform: scale(1.01) translate(2px, 2px) rotate(0.12deg); }
  85%  { transform: scale(1.004) translate(-1px, 0) rotate(0deg); }
  100% { transform: scale(1) translate(0, 0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  #game-container.hit-shake {
    animation: none;
  }
}

/* ==========================================================================
   GOLPE DE SEQUÊNCIA (4º) — fileira de teclas, sem barras
   Mesma linguagem do resto: keycaps chanfrados, aço e vermelho de HUD.
   ========================================================================== */

.qte-sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 12px 4px;
}

.qte-sequence.hidden {
  display: none;
}

.seq-key {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 30px;
  font-family: 'Anton', sans-serif;
  font-size: 0.95rem;
  color: #6b7079;
  background: linear-gradient(160deg, #1a1d23, #0c0e12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: color 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
}

/* A próxima tecla a ser apertada */
.seq-key.next {
  color: #fff;
  background: linear-gradient(160deg, #3a1a14, #14090a);
  border-color: #ff5a41;
  box-shadow: 0 0 18px rgba(255, 58, 36, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-2px) scale(1.08);
  animation: seq-next-throb 0.55s ease-in-out infinite alternate;
}

@keyframes seq-next-throb {
  from { box-shadow: 0 0 14px rgba(255, 58, 36, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
  to   { box-shadow: 0 0 26px rgba(255, 58, 36, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
}

/* Teclas já acertadas */
.seq-key.done {
  color: #0b0c0f;
  background: linear-gradient(160deg, #10b981, #067a56);
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
  transform: none;
  animation: none;
}

/* Relógio da sequência: número, não barra */
.seq-timer {
  margin-left: 10px;
  min-width: 46px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #f0b418;
  text-align: right;
  text-shadow: 0 0 10px rgba(240, 180, 24, 0.5);
}

.seq-timer.urgent {
  color: #ff3a24;
  text-shadow: 0 0 14px rgba(255, 58, 36, 0.9);
  animation: seq-timer-blink 0.4s steps(2) infinite;
}

@keyframes seq-timer-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Marca do golpe final na tela inicial */
.kbd-final {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-color: rgba(240, 180, 24, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px rgba(240, 180, 24, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .seq-key.next,
  .seq-timer.urgent {
    animation: none;
  }
}
