:root { --ink: #3b2a25; --panel: rgba(255, 250, 240, 0.94); --line: #e3cfb5; --accent: #e8805f;
  font-family: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "Noto Sans JP", system-ui, sans-serif; color: var(--ink); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2f5f33; touch-action: none; -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; image-rendering: pixelated; }
[hidden] { display: none !important; }
button { font: inherit; color: var(--ink); cursor: pointer; }

.hud { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.pill { margin: 0; background: var(--panel); border: 3px solid #8a6a4a; border-radius: 10px; padding: 5px 12px; font-size: 0.9rem; font-weight: 700;
  box-shadow: 0 3px 0 #6b4f36; }
.round { width: 42px; height: 42px; border-radius: 10px; border: 3px solid #8a6a4a; background: var(--panel); box-shadow: 0 3px 0 #6b4f36; font-weight: 700; }
.round.small { font-size: 0.75rem; }

.prompt { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); margin: 0; background: var(--panel); border: 3px solid #8a6a4a;
  border-radius: 10px; padding: 4px 12px; font-size: 0.9rem; font-weight: 700; box-shadow: 0 3px 0 #6b4f36; z-index: 5; white-space: nowrap; }
.prompt kbd { display: inline-block; background: #fff; border: 2px solid #8a6a4a; border-radius: 6px; padding: 0 6px; margin-right: 6px; font: inherit; }
.say { position: fixed; left: 50%; bottom: 4%; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); background: var(--panel);
  border: 3px solid #8a6a4a; border-radius: 14px; padding: 10px 16px 12px; box-shadow: 0 4px 0 #6b4f36; z-index: 6; animation: pop 0.18s ease-out; }
.say p { margin: 0; line-height: 1.7; }
#say-name { font-size: 0.8rem; font-weight: 800; color: #9a5a3a; }
#say-name:empty { display: none; }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.joystick { position: fixed; left: 26px; bottom: 26px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 250, 240, 0.35);
  border: 3px solid rgba(138, 106, 74, 0.7); z-index: 5; touch-action: none; }
.joystick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(255, 244, 222, 0.95); border: 3px solid #8a6a4a; }
.act { position: fixed; right: 30px; bottom: 44px; width: 72px; height: 72px; border-radius: 50%; border: 3px solid #8a6a4a; background: #fff4de;
  box-shadow: 0 4px 0 #6b4f36; font-size: 1.4rem; font-weight: 800; z-index: 5; touch-action: none; }
.act.ready { background: #ffd98a; }
.pause { position: fixed; inset: 0; background: rgba(40, 30, 25, 0.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.pause > div { background: var(--panel); border: 3px solid #8a6a4a; border-radius: 14px; padding: 18px 26px; text-align: center; }
.pause h2 { margin: 0 0 12px; }
.pause button { border: 3px solid #8a6a4a; border-radius: 10px; background: #fff4de; padding: 6px 18px; font-weight: 700; }

/* Episode 1 (KSK-136): goal hint, parent switch, letting time pass, action menu, night, memories */
.hint { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); max-width: min(560px, calc(100% - 260px)); font-weight: 600; text-align: center; }
button.pill.small { cursor: pointer; font: inherit; font-size: 0.8rem; color: inherit; }
.menu { position: fixed; left: 50%; bottom: 27%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; min-width: 220px;
  background: var(--panel); border: 3px solid #8a6a4a; border-radius: 12px; padding: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); z-index: 20; }
.menu button { display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-weight: 700; color: inherit; background: transparent;
  border: 2px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.menu button.on, .menu button:hover { background: #ffe9b8; border-color: #e0b878; }
.menu kbd { display: inline-block; min-width: 1.2em; text-align: center; background: #fff; border: 2px solid #8a6a4a; border-radius: 6px; font: inherit; font-size: 0.75rem; }
.night { position: fixed; inset: 0; background: rgba(24, 32, 78, 0.38); pointer-events: none; z-index: 1; }
.toast { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); margin: 0; background: #fff8e6; border: 3px solid #d9a85a; border-radius: 10px;
  padding: 6px 14px; font-weight: 700; z-index: 30; animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; top: 40px; } 12% { opacity: 1; top: 56px; } 85% { opacity: 1; } 100% { opacity: 0; } }
