:root {
  --teal: #2c6e6a;
  --teal-dark: #1e504d;
  --teal-soft: #e0eeec;
  --coral: #e07050;
  --coral-dark: #c45a3c;
  --cream: #f5f0e8;
  --cream-card: #fffcf8;
  --dark: #1a1a1a;
  --muted: #6b6560;
  --border: #e4ddd3;
  --shadow: 0 18px 60px rgba(26, 26, 26, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(224, 112, 80, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(44, 110, 106, 0.18), transparent 28rem),
    var(--cream);
  color: var(--dark);
  font-family: 'Inter', sans-serif;
  margin: 0;
  min-height: 100vh;
}

button {
  font: inherit;
}

.game-page {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 40px) 16px 40px;
}

.back-link {
  align-self: flex-start;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 auto;
  max-width: 920px;
  text-decoration: none;
  width: 100%;
}

.back-link:hover {
  color: var(--coral-dark);
}

.game-hero {
  max-width: 760px;
  text-align: center;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: 'Hammersmith One', sans-serif;
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
}

h1 {
  color: var(--dark);
  font-size: clamp(2.35rem, 7vw, 4.35rem);
}

.intro {
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  line-height: 1.65;
  margin: 12px auto 0;
  max-width: 620px;
}

.game-shell {
  background: rgba(255, 252, 248, 0.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  max-width: 860px;
  padding: clamp(14px, 3vw, 24px);
  width: 100%;
}

.hud {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.hud > div {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.hud-label {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hud strong {
  color: var(--teal-dark);
  display: block;
  font-family: 'Hammersmith One', sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 400;
  margin-top: 3px;
}

.canvas-wrap {
  aspect-ratio: 2 / 3;
  background: #f8dba3;
  border: 5px solid var(--dark);
  border-radius: 24px;
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.38),
    0 14px 34px rgba(26, 26, 26, 0.16);
  margin: 0 auto;
  max-height: min(68vh, 720px);
  max-width: 480px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  width: min(100%, 480px);
}

canvas {
  display: block;
  height: 100%;
  image-rendering: pixelated;
  width: 100%;
}

.overlay {
  align-items: center;
  background: rgba(26, 26, 26, 0.68);
  color: #fff8ef;
  display: none;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: absolute;
  text-align: center;
}

.overlay.visible {
  display: flex;
}

.overlay h2 {
  font-size: clamp(1.65rem, 6vw, 3rem);
  max-width: 380px;
}

.overlay p {
  line-height: 1.55;
  max-width: 370px;
}

.dinner-summary {
  background: rgba(255, 252, 248, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  font-weight: 700;
  padding: 12px 14px;
}

.game-button,
.controls button {
  background: var(--coral);
  border: 0;
  border-radius: 999px;
  color: #fff8ef;
  cursor: pointer;
  font-family: 'Hammersmith One', sans-serif;
  font-size: 1rem;
  min-height: 44px;
  padding: 12px 22px;
  transition: background 0.2s, transform 0.15s;
}

.game-button:hover,
.controls button:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
}

.controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin: 16px auto 0;
  max-width: 480px;
}

.controls-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 14px auto 0;
  max-width: 560px;
  text-align: center;
}

@media (max-width: 680px) {
  .hud {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .game-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .game-shell {
    border-radius: 20px;
    padding: 10px;
  }

  .canvas-wrap {
    border-width: 4px;
    border-radius: 18px;
    max-height: 64vh;
  }

  .controls {
    gap: 8px;
  }

  .controls button {
    font-size: 0.9rem;
    padding: 10px 8px;
  }
}
