:root {
  --ink: #1a120c;
  --panel: #3a2416;
  --panel-edge: #6b4226;
  --amber: #f0a040;
  --cream: #f6e6c8;
  --blood: #c43c28;
  --good: #6fbf4a;
  --sky: #6ea8c9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0a08;
  color: var(--cream);
  font-family: "Press Start 2P", monospace;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hidden {
  display: none !important;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(240, 160, 64, 0.18), transparent 50%),
    linear-gradient(180deg, #2a1810 0%, #0d0a08 70%);
  z-index: 20;
}

.panel {
  text-align: center;
  max-width: 720px;
  padding: 2rem 1.5rem;
}

.title-panel h1 {
  font-size: clamp(1.6rem, 5vw, 3rem);
  line-height: 1.25;
  color: var(--amber);
  text-shadow: 4px 4px 0 #000, 0 0 24px rgba(240, 160, 64, 0.35);
  margin: 0.8rem 0 1.2rem;
  letter-spacing: 0.04em;
}

.eyebrow {
  color: var(--good);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}

h2 {
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  color: var(--amber);
  margin: 0.8rem 0 1rem;
  text-shadow: 3px 3px 0 #000;
}

.tagline {
  font-size: 0.6rem;
  line-height: 1.8;
  color: #d8c3a0;
  margin-bottom: 1.5rem;
}

.score-line {
  font-size: 0.75rem;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.btn {
  appearance: none;
  border: 3px solid #000;
  background: var(--amber);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.btn.secondary {
  display: block;
  margin: 0.8rem auto 0;
  background: #c8b08a;
}

.controls-help {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.controls-help span {
  font-size: 0.45rem;
  color: #a89070;
  border: 1px solid #5a4030;
  padding: 0.4rem 0.5rem;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#crosshair {
  position: absolute;
  top: calc(50% - 48px);
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.4rem;
  text-shadow: 0 0 2px #000;
}

#toast {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--cream);
  text-shadow: 2px 2px 0 #000;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
}

#status-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  display: grid;
  grid-template-columns: 1fr 1.2fr auto 1fr 1fr 1.8fr;
  gap: 4px;
  padding: 6px;
  background:
    linear-gradient(180deg, #5a3824 0%, #3a2416 40%, #2a1810 100%);
  border-top: 4px solid #000;
  box-shadow: inset 0 2px 0 rgba(255, 200, 120, 0.15);
  image-rendering: pixelated;
}

.stat-block,
.face-block {
  background: #1a1008;
  border: 3px solid #000;
  box-shadow: inset 0 0 0 2px var(--panel-edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.stat-block.wide {
  align-items: flex-start;
  padding: 0.4rem 0.55rem;
}

.stat-label {
  font-size: 0.42rem;
  color: #a07040;
  margin-bottom: 0.35rem;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: clamp(0.7rem, 2vw, 1.1rem);
  color: var(--amber);
}

.stat-objective {
  font-size: 0.42rem;
  line-height: 1.5;
  color: var(--cream);
  text-align: left;
}

.face-block {
  width: 104px;
  padding: 4px;
}

#face-canvas {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  background: #2a1a10;
}

.face-caption {
  font-size: 0.4rem;
  color: #c09050;
  margin-top: 2px;
}

@media (max-width: 800px) {
  #status-bar {
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    height: 110px;
  }

  .stat-block.wide {
    display: none;
  }

  .controls-help span {
    font-size: 0.4rem;
  }
}
