* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #1f241d;
  color: #fff8dc;
  font-family: Verdana, Geneva, sans-serif;
}

.inicio {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #31452b, #151914 70%);
}

.pantalla-inicio {
  width: min(920px, 92vw);
  text-align: center;
}

.tarjeta-inicio {
  padding: 44px 34px;
  border: 4px solid #8b6a3e;
  border-radius: 18px;
  background: rgba(44, 35, 26, 0.92);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.sello {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d8c18a;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 7vw, 72px);
}

.boton-principal,
button {
  border: 0;
  border-radius: 12px;
  background: #d6b36b;
  color: #2b2116;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.boton-principal {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 24px;
  text-decoration: none;
}

#contenedor-juego {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

#barra-superior {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #2c231a;
  border-bottom: 3px solid #7a5a34;
}

#nombre-escena {
  font-weight: 700;
}

#btn-reiniciar {
  padding: 8px 12px;
  font-size: 13px;
}

#marco-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #10140f;
}

canvas {
  width: min(100vw, calc((100vh - 48px) * 16 / 9));
  height: min(calc(100vh - 48px), calc(100vw * 9 / 16));
  image-rendering: pixelated;
  background: #000;
  border: 4px solid #5b4428;
}

#tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 7px 10px;
  border: 2px solid #6b4d2b;
  border-radius: 10px;
  background: rgba(255, 244, 202, 0.96);
  color: #2a2118;
  font-size: 13px;
  font-weight: 700;
  transform: translate(14px, 14px);
}

.dialogo {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  width: min(920px, 90vw);
  min-height: 146px;
  padding: 18px 22px 18px;
  transform: translateX(-50%);
  border: 4px solid #7a5a34;
  border-radius: 18px;
  background: rgba(255, 246, 217, 0.96);
  color: #2d2115;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.dialogo.oculto {
  display: none;
}

.dialogo-nombre {
  margin-bottom: 8px;
  color: #7b2e1f;
  font-weight: 800;
}

.dialogo-texto {
  margin: 0 0 14px;
  line-height: 1.45;
  font-size: clamp(16px, 2.1vw, 21px);
}

.dialogo-avanzar {
  float: right;
  padding: 8px 14px;
}

.minijuego-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
}

.minijuego-panel {
  width: min(760px, 92vw);
  padding: 26px;
  border: 4px solid #7a5a34;
  border-radius: 20px;
  background: #fff2c7;
  color: #2a2118;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.minijuego-panel h2 {
  margin: 0 0 12px;
  color: #7b2e1f;
}

.minijuego-panel p {
  line-height: 1.45;
}

.opciones-minijuego {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.opciones-minijuego button {
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #ead19b;
}

.resultado-minijuego {
  min-height: 24px;
  margin-top: 14px;
  font-weight: 700;
}
