@font-face {
  font-family: "Burger";
  src: url("burger_dog_assets/WashYourHand.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --cream: #fff5df;
  --orange: #f6aa36;
  --orange-hot: #ff7f32;
  --line: rgba(255, 238, 211, 0.15);
}

* { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 170, 54, .16), transparent 35%),
    radial-gradient(circle at 88% 88%, rgba(151, 63, 20, .2), transparent 38%),
    #0c0805;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

button { font: inherit; }

.game-shell {
  width: min(900px, calc(100% - 30px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
}

.game-header {
  display: flex;
  padding: 6px 2px 16px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow {
  color: #ad927d;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  color: var(--orange);
  font-family: Burger, Impact, sans-serif;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  font-weight: 400;
  line-height: .86;
}

.sound-button,
.help-button,
.controls button,
#startButton {
  min-height: 48px;
  border: 1px solid var(--line);
  color: var(--cream);
  background: rgba(255, 245, 223, .07);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

.sound-button,
.help-button { padding: 0 18px; white-space: nowrap; }

.help-button {
  border-color: var(--orange);
  color: var(--orange);
}

.stage-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  border-radius: 22px;
  box-shadow: 0 25px 75px rgba(0,0,0,.43);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  touch-action: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  padding: 20px;
  place-items: center;
  background: rgba(7, 4, 2, .58);
  backdrop-filter: blur(7px);
}

.game-overlay.is-visible { display: grid; }

.overlay-panel {
  width: min(470px, 100%);
  max-height: calc(100% - 8px);
  overflow-y: auto;
  padding: clamp(24px, 6vw, 48px);
  border: 1px solid rgba(255, 238, 211, .17);
  background: rgba(18, 10, 5, .92);
  border-radius: 22px;
  text-align: center;
}

.overlay-kicker {
  color: var(--orange);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.overlay-panel h2 {
  margin: 11px 0 0;
  font-size: clamp(1.55rem, 5vw, 2.65rem);
  line-height: 1;
}

.overlay-panel p {
  margin: 14px auto 22px;
  color: #c1aa98;
  font-size: .9rem;
  line-height: 1.5;
}

.overlay-text {
  margin: 14px auto 22px;
  color: #c1aa98;
  font-size: .9rem;
  line-height: 1.5;
  text-align: left;
}

.overlay-text p { margin: 0 0 12px; }
.overlay-text ul { margin: 0; padding-left: 20px; }
.overlay-text li + li { margin-top: 7px; }

#startButton {
  width: 100%;
  border-color: var(--orange);
  color: #2c1605;
  background: var(--orange);
  font-weight: 850;
}

.controls {
  display: none;
  margin-top: 14px;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.dpad {
  display: grid;
  width: 168px;
  grid-template: repeat(2, 52px) / repeat(3, 52px);
  gap: 4px;
}

.dpad button { width: 52px; min-height: 52px; border-radius: 15px; font-size: 1.3rem; font-weight: 850; }
.dpad .up { grid-column: 2; }
.dpad .left { grid-row: 2; grid-column: 1; }
.dpad .down { grid-row: 2; grid-column: 2; }
.dpad .right { grid-row: 2; grid-column: 3; }

.controls button.is-active {
  color: #2c1605;
  background: var(--orange);
  transform: translateY(2px);
}

.action-button {
  display: flex;
  width: min(230px, 43vw);
  min-height: 74px !important;
  padding: 10px 20px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
}

.action-button strong { font-size: .94rem; }
.action-button span { color: #b5a394; font-size: .68rem; }
.action-button.is-active span { color: #593112; }

.game-footer {
  display: flex;
  padding: 14px 3px 0;
  justify-content: space-between;
  gap: 20px;
  color: #9f8875;
  font-size: .72rem;
}

.game-footer p { margin: 0; }
.game-footer strong { color: #e4cfbc; }

@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .controls { display: flex; }
  .game-footer { display: none; }
}

@media (max-width: 560px) {
  .game-shell { width: calc(100% - 18px); }
  .game-header { padding-bottom: 11px; align-items: center; }
  .sound-button,
  .help-button { min-height: 42px; padding: 0 13px; font-size: .76rem; }
  .stage-card { border-radius: 16px; }
  canvas { min-height: min(56svh, 520px); aspect-ratio: auto; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .game-shell { width: min(100% - 18px, 900px); padding: 8px 0; }
  .game-header {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 18px;
    display: flex;
    padding: 0;
  }
  .game-header > div:first-child,
  .sound-button { display: none; }
  canvas { height: calc(100svh - 18px); aspect-ratio: auto; }
  .controls {
    position: absolute;
    z-index: 4;
    right: 18px;
    bottom: 15px;
    left: 18px;
    margin: 0;
    pointer-events: none;
  }
  .controls button { pointer-events: auto; background: rgba(20, 11, 5, .72); }
}
