:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #17212a;
  color: #f7f2e9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #243947, #132027 70%);
}

.app-shell { width: min(100%, 620px); padding: 20px; }

.game-card {
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid #496576;
  border-radius: 18px;
  background: #1d2b35;
  box-shadow: 0 20px 50px #08111688;
}

.title-row, .game-info, .save-controls, .needs-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title-row { margin-bottom: 16px; }
.eyebrow { margin: 0 0 4px; color: #a8d4d8; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.save-status { color: #b8e3b4; font-size: 0.85rem; white-space: nowrap; }

.needs-hud {
  min-height: 32px;
  margin-bottom: 10px;
  padding: 5px 8px;
  border: 2px solid #789aa6;
  border-radius: 4px;
  background: #223a45;
  color: #dbe9e7;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.hud-label { color: #a8d4d8; font-weight: 800; }
.heart-row { display: inline-flex; gap: 4px; margin-right: auto; }
.heart { width: 18px; height: 18px; display: inline-block; background-image: url("./assets/ui/FreshandModern.png"); background-repeat: no-repeat; background-position: -505px -8px; image-rendering: pixelated; }
.sushi-readout { white-space: nowrap; letter-spacing: 0; }

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  image-rendering: pixelated;
  border: 4px solid #0d151a;
  border-radius: 10px;
  background: #8eb5bf;
}

.game-info { margin-top: 12px; color: #d8e5e3; font-size: 0.86rem; flex-wrap: wrap; }
.ai-panel { margin-top: 12px; padding: 10px; border: 1px solid #496576; border-radius: 10px; background: #172a34; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-heading h2 { margin: 0; color: #e7efeb; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.panel-heading span { color: #8fb9bd; font-size: 0.7rem; }
.ai-intro-status { margin: 5px 0 0; color: #d9c894; font-size: 0.7rem; }
.ai-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.ai-status li { display: grid; gap: 2px; padding: 7px; border: 1px solid #385563; border-radius: 7px; background: #203b47; font-size: 0.72rem; }
.ai-status strong { color: #f5e6be; }
.ai-status span { color: #b9e0dc; line-height: 1.2; }
.ai-status small { color: #9eb5b9; font-size: 0.64rem; }
.hint { margin: 12px 0 16px; color: #a9bcc1; font-size: 0.85rem; line-height: 1.4; }

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.secondary-button {
  min-height: 48px;
  border: 1px solid #678a96;
  border-radius: 10px;
  background: #31505c;
  transition: transform 80ms ease, background 80ms ease;
}
.secondary-button:active { transform: translateY(2px); background: #456d79; }
.sushi-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 30px;
  margin-top: 10px;
  border: 0;
  border-radius: 6px;
  background-color: #789cab;
  color: #f7f2e9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px #476a78;
}
.sushi-button::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 2px;
  left: 50%;
  width: 90px;
  height: 26px;
  transform: translateX(-50%);
  background-image: url("./assets/ui/FreshandModern.png");
  background-repeat: no-repeat;
  background-position: -70px -34px;
}
.sushi-button span { position: relative; z-index: 1; }
.sushi-button:active { transform: translateY(2px); filter: brightness(1.12); }
.encourage-panel { margin-top: 12px; padding: 10px; border: 1px solid #496576; border-radius: 10px; background: #172a34; }
.encourage-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.encourage-button { min-height: 42px; padding: 8px; font-size: 0.72rem; }
.save-controls { justify-content: flex-start; margin-top: 14px; flex-wrap: wrap; }
.secondary-button { min-height: 38px; padding: 8px 12px; font-size: 0.8rem; background: #263e48; }
.map-button { width: 100%; margin-bottom: 2px; }
.danger-button { border-color: #93666a; }

@media (max-width: 480px) {
  .app-shell { padding: 10px; }
  .game-card { padding: 14px; }
  .game-info { font-size: 0.78rem; }
  .needs-hud { font-size: 0.66rem; }
  .ai-status { grid-template-columns: 1fr; }
  .encourage-controls { grid-template-columns: 1fr; }
  .save-controls { display: grid; grid-template-columns: 1fr; }
}
