:root {
  color-scheme: light;
  --ink: #1c1512;
  --brick: #c84d3a;
  --gold: #f3c16c;
  --mint: #6fbfa7;
  --fog: #f8f0e6;
  --shadow: rgba(28, 21, 18, 0.18);
}

@font-face {
  font-family: "Aerosoldier";
  src: url("aerosoldier/Aerosoldier_PERSONAL_USE_ONLY.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Gill Sans", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #f6dbc1 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, #f8f0e6 0%, transparent 45%),
    linear-gradient(160deg, #f0c49a 0%, #f7eadb 45%, #f4d1ae 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

.page {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
}

.hero-title {
  display: block;
  font-family: "Aerosoldier", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0;
  margin-top: 6px;
  margin-bottom: 5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 450px) {
  .hero-title {
    font-size: clamp(1.5rem, 2vw, 2rem);
  }
}

.hero-subtitle {
  display: block;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  margin: 0;
  margin-top: -5px;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  font-style: italic;
}

.subhead {
  margin: 0;
  max-width: 420px;
  color: #3a2b25;
}

.info-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(28, 21, 18, 0.3);
  background: #f8f0e6;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 12px var(--shadow);
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

@media (max-width: 550px) {
  .info-btn {
    width: 20px;
    height: 20px;
    top: 5px;
    right: 5px;
  }
}

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

.info-btn.floating {
  position: absolute;
  top: 16px;
  right: 16px;
}

.round-badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: "Aerosoldier", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}


.hud-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background: rgba(248, 240, 230, 0.85);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 12px 30px var(--shadow);
  position: relative;
  width: 100%;
  container-type: inline-size;
  container-name: hud-panel;
  touch-action: manipulation;
}


.hud {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  margin: 18px 22px;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}

.meter {
  background: #efe3d6;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(28, 21, 18, 0.2);
  width: 160px;
  margin-left: 0;
  position: relative;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  transition: width 0.2s ease;
}

.meter-text {
  position: absolute;
  inset: 0;
  padding-left: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
}

.hud-stats {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.front-meter {
  display: flex;
  gap: 1px;
}

.front-icon {
  width: 26px;
  height: 26px;
  opacity: 0.2;
  image-rendering: pixelated;
}

.front-icon.exposed {
  opacity: 1;
}

.heat-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.heat-icon {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.round-and-expose {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}


@container hud-panel (max-width: 400px) {
  .hud {
    margin: 15px 10px;
  }

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

  .hud-label {
    font-size: 0.6rem;
  }

  .heat-meter {
    font-size: 0.75rem;
  }

  .hud-panel {
    padding: 15px 10px;
  }
}

.game-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.canvas-shell {
  position: relative;
  padding: 0;
  width: 100%;
  height: 100%;
  margin: 0 auto;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  border-radius: 0;
  background: #efe3d6;
  border: 2px solid rgba(28, 21, 18, 0.15);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 21, 18, 0.4);
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.accuse-float {
  border: none;
  padding: 8px 14px;
  border-radius: 3px;
  background: rgba(250, 77, 58, 0.8);
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 1rem;
  font-family: "Aerosoldier", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(28, 21, 18, 0.25);
  display: none;
  touch-action: manipulation;
}

.accuse-float.hud-accuse {
  align-self: center;
}

.accuse-float[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  background: #f8f0e6;
  padding: 18px 24px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 12px 30px var(--shadow);
}

.start-btn {
  margin-top: 14px;
  border: none;
  background: linear-gradient(135deg, #1c1512, #3a2b25);
  color: #f8f0e6;
  padding: 10px 18px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  cursor: pointer;
}

.overlay-title {
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: "Aerosoldier", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.overlay-body {
  margin-top: 8px;
  font-size: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 21, 18, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 18px;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #f8f0e6;
  border-radius: 16px;
  padding: 20px 22px;
  max-width: 560px;
  max-height: min(80vh, 720px);
  overflow-y: auto;
  box-shadow: 0 18px 40px var(--shadow);
  position: relative;
}


.sprite-title {
  margin-top: 16px;
  margin-bottom: 16px;
}

.sprite-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 12px;
  margin: 8px 0 16px;
}

.sprite-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(28, 21, 18, 0.12);
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  line-height: 1.2;
}

.sprite-item img {
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
}

.clue-dot {
  width: 8px;
  height: 8px;
  margin: 15px;
  border-radius: 50%;
  background: #f3c16c;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}
