:root { background: #110d0a; }

.minigame-page {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: #110d0a;
  color: #f7eedf;
}

.game-shell,
.game-card {
  position: relative;
  width: 100vw;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.game-back,
.game-intro,
.game-note { display: none; }

.game-card {
  height: 100svh;
  background: #17110d;
  box-shadow: none;
}

.game-hud {
  position: absolute;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(94vw, 1240px);
  transform: translateX(-50%);
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  padding: 10px 16px;
  border: 1px solid rgba(248, 225, 159, .48);
  border-radius: 5px;
  background: rgba(23, 16, 12, .76);
  color: #f7eedf;
  font: 700 clamp(.52rem, 1vw, .78rem) monospace;
  letter-spacing: .06em;
  pointer-events: none;
  text-shadow: 0 2px 0 #130e0a;
  backdrop-filter: blur(3px);
}

.game-hud span:nth-child(3),
.game-hud span:nth-child(4),
.game-hud span:last-child { color: #f0bc3a; }

.game-card canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #2d211a;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.game-card::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(0,0,0,.16), transparent 12%, transparent 88%, rgba(0,0,0,.16));
}

.game-controls {
  position: absolute;
  z-index: 7;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.game-controls button,
.game-button {
  border: 2px solid #eadb9d;
  border-radius: 7px;
  min-width: 58px;
  min-height: 44px;
  background: #777954;
  color: #fff8e9;
  box-shadow: 0 4px #383522;
  font: 700 1rem monospace;
  cursor: pointer;
}

.game-controls button:active,
.game-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px #383522;
}

.game-overlay {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 25px;
  background: rgba(16, 12, 9, .72);
  text-align: center;
  backdrop-filter: blur(3px);
}

.game-overlay[hidden] { display: none; }

.game-overlay h2 {
  max-width: 900px;
  margin: .35rem 0 1rem;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: .86;
  letter-spacing: -.06em;
}

.game-overlay p:not(.meta-label) {
  max-width: 620px;
  margin: 0 auto 26px;
  color: #ece1cf;
  font: clamp(.8rem, 1.5vw, 1.05rem)/1.55 monospace;
}

.game-button {
  min-width: min(80vw, 540px);
  padding: 14px 30px;
  border: 0;
  background: #e8ae2b;
  color: #25180c;
  font-size: clamp(.85rem, 1.3vw, 1rem);
}

@media (max-width: 760px) {
  .game-hud {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100vw - 16px);
    gap: 6px;
    padding: 8px 7px;
    font-size: .45rem;
    letter-spacing: .02em;
  }

  .game-hud span:nth-child(2),
  .game-hud span:nth-child(4) { display: none; }

  .game-controls { gap: 10px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .game-controls button { min-width: 55px; min-height: 42px; }
  .game-overlay { padding: 20px; }
  .game-overlay h2 { font-size: clamp(2.5rem, 12vw, 4rem); }
}
