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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  color: #f4f6ff;
  user-select: none;
}

/* Área do jogo: 960x640 fixos, escalados por JS para caber na janela */
#jogo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 960px;
  height: 640px;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

#tela, #hud {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 960px;
  height: 640px;
  touch-action: none;
}

/* ---------- Telas sobrepostas ---------- */
.tela {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(8, 12, 28, 0.62);
  backdrop-filter: blur(2px);
}

.oculto { display: none; }

.titulo {
  font-size: 64px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 4px 0 #c0392b, 0 8px 20px rgba(0, 0, 0, 0.6);
}
.titulo span { color: #ffd23f; }

h2 {
  font-size: 34px;
  font-style: italic;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}

.subtitulo { font-size: 18px; opacity: 0.85; margin-top: -8px; }
.dica { font-size: 13px; opacity: 0.7; }

/* ---------- Cartões (carros e fases) ---------- */
.cartoes {
  display: flex;
  gap: 18px;
  justify-content: center;
}

.cartao {
  width: 280px;
  padding: 12px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(20, 28, 56, 0.92);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cartao:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.4); }
.cartao.selecionado {
  border-color: #ffd23f;
  box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.25), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.cartao canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}
.cartao h3 { font-size: 22px; font-style: italic; }
.cartao .sub { font-size: 13px; color: #ffd23f; margin-bottom: 4px; }
.cartao .desc { font-size: 13px; opacity: 0.8; min-height: 34px; margin: 4px 0 8px; line-height: 1.3; }

.atributo {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  font-size: 12px;
  margin: 3px 0;
}
.barra {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.barra i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffd23f, #ff7b39);
}

.fase-info { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.dificuldade { color: #ff9f43; }
.melhor { opacity: 0.85; }

/* ---------- Botões ---------- */
.botao {
  min-width: 200px;
  padding: 10px 26px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.botao:hover { background: rgba(255, 255, 255, 0.26); transform: scale(1.04); }
.botao.principal {
  background: linear-gradient(180deg, #ffd23f, #ff9f1c);
  color: #2b1600;
  font-size: 22px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 #b86b00;
}
.botao.principal:hover { background: linear-gradient(180deg, #ffe066, #ffb13b); }

/* ---------- Caixas (pausa / resultado) ---------- */
.caixa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 40px;
  border-radius: 18px;
  background: rgba(20, 28, 56, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.15);
  min-width: 360px;
}
.estrelas { font-size: 46px; color: #ffd23f; letter-spacing: 6px; }
.tempo { font-size: 24px; font-family: Consolas, monospace; }
.recorde { font-size: 15px; color: #7bed9f; min-height: 18px; }
#res-motivo { opacity: 0.85; }
