:root {
  font-family: system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;
  color: #2a2328;
  color-scheme: light;
  background: #fff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  height: 100svh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
.game-nav-header { flex-shrink: 0; }
button {
  font: inherit;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: inherit;
  background: #f3f4f6;
  touch-action: manipulation;
}
button:disabled { opacity: .5; }
[hidden] { display: none !important; }
.shell {
  width: 100%;
  max-width: 450px;
  flex: 1;
  min-height: 0;
  margin: auto;
  padding: 4px 8px max(8px,env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field {
  flex: 1;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f7ef;
}
#scene { display: block; width: 100%; height: 100%; touch-action: none; }
.hud {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 12px;
  right: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#stats { grid-column: 2; grid-row: 1; }
#progress { grid-column: 1 / 3; grid-row: 2; color: #6e626a; }
#pause { grid-column: 3; grid-row: 1 / 3; font-size: 12px; }
.panel {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  background: #fff;
  text-align: center;
  overflow: auto;
  padding: 16px;
}
.panel > div {
  margin: auto;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.panel img,.companion img { object-fit: contain; }
.cast-name { font-size: 12px; color: #6e626a; margin-top: -6px; }
.panel h2 { font-size: 18px; margin: 2px 0; }
.panel p { font-size: 13px; line-height: 1.65; margin: 0; }
#copy { white-space: pre-line; }
#record { color: #6e626a; font-size: 12px; }
.panel button { width: 100%; min-height: 48px; font-weight: 700; margin-top: 4px; }
#grow {
  min-height: 56px;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-size: 14px;
  font-weight: 700;
}
#grow[aria-pressed=true] { background: #e1eddf; }
.companion { display: flex; gap: 8px; align-items: center; min-height: 48px; }
.companion img { flex-shrink: 0; }
.companion b { font-size: 11px; color: #6e626a; font-weight: 500; }
.companion p { font-size: 13px; line-height: 1.5; margin: 2px 0 0; }
#save-note { font-size: 11px; color: #6e626a; margin: 0; }
.is-panel > #grow,.is-panel > .companion { display: none; }
@media (max-height: 650px) {
  .field { min-height: 220px; }
  .panel img { width: 64px; height: 64px; }
  .panel > div { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
