:root {
  --ink: #f8fff4;
  --muted: #b7ceb6;
  --deep: #10251a;
  --card: rgba(13, 39, 26, .9);
  --lime: #c9ff72;
  --gold: #ffd76d;
  --purple: #caa8ff;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at 15% 0%, #285d3a 0, transparent 34rem), linear-gradient(155deg, #10251a, #07150d 70%);
}

button { font: inherit; }
.game-shell { width: min(1120px, 94vw); margin: 0 auto; padding: 24px 0 38px; }
.hud { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 8px 0 18px; }
.eyebrow, .quest-label { margin: 0 0 5px; color: var(--lime); font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; color: #fff8d1; font-size: clamp(1.55rem, 4vw, 3rem); line-height: 1; text-shadow: 0 3px 0 #533e20; }
.hud-stats { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.hud-stats span { padding: 9px 12px; border: 1px solid rgba(201,255,114,.28); border-radius: 999px; color: var(--muted); background: rgba(3, 18, 10, .45); }
.hud-stats strong { color: #fff; }
.game-card { position: relative; overflow: hidden; border: 3px solid #7f542b; border-radius: 24px 8px 24px 8px; background: #6abf55; box-shadow: 0 22px 45px rgba(0,0,0,.3); }
#scene { display: block; width: 100%; height: min(64vw, 640px); min-height: 390px; touch-action: none; }
.quest-card { position: absolute; top: 16px; left: 16px; display: grid; gap: 3px; max-width: min(360px, calc(100% - 32px)); padding: 12px 15px; border: 1px solid rgba(255,255,255,.32); border-radius: 14px 4px 14px 4px; background: rgba(7, 28, 16, .78); backdrop-filter: blur(8px); }
.quest-card strong { color: #fff2a1; }
.quest-card span:last-child { color: var(--muted); font-size: .9rem; }
.toast { position: absolute; left: 50%; bottom: 22px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 999px; color: #1b260b; font-weight: 900; text-align: center; background: var(--lime); box-shadow: 0 8px 20px rgba(0,0,0,.22); opacity: 0; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.controls-panel { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-top: 15px; padding: 15px 18px; border: 1px solid rgba(201,255,114,.22); border-radius: 16px; background: var(--card); }
.control-copy p { margin: 3px 0; color: var(--muted); font-size: .9rem; }.control-copy strong { color: #fff; }.small-note { color: var(--purple) !important; }
.button-row { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }.action-button { border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 10px 12px; color: #fff; font-weight: 900; cursor: pointer; background: #315c39; transition: transform .15s, filter .15s; }.action-button:hover, .action-button:focus-visible { filter: brightness(1.2); outline: 2px solid var(--lime); outline-offset: 2px; }.action-button:active { transform: scale(.95); }.chest-button { background: #8a5a2d; }.attack-button { background: #794052; }.gait-button { background: #38518a; }.interact-button { background: #6a4d8e; }.restart-button { background: #3d5e41; }
.joystick { position: relative; width: 78px; height: 78px; flex: 0 0 78px; border: 2px solid rgba(201,255,114,.5); border-radius: 50%; background: radial-gradient(circle, rgba(201,255,114,.2), rgba(16,37,26,.85)); touch-action: none; }.joystick::after { content: 'RUCH'; position: absolute; left: 0; right: 0; bottom: -16px; color: #91b095; font-size: .55rem; font-weight: 900; letter-spacing: .1em; text-align: center; }.joystick-knob { position: absolute; top: 50%; left: 50%; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: #396f43; transform: translate(-50%, -50%); user-select: none; }
.pad-note { grid-column: 1 / -1; margin: 0; color: #8eaa92; font-size: .76rem; text-align: right; }
.prototype-note { margin: 13px 0 0; color: #91b095; font-size: .82rem; text-align: center; }
@media (max-width: 780px) { .hud, .controls-panel { align-items: stretch; flex-direction: column; }.hud { display: flex; }.hud-stats { justify-content: start; }.controls-panel { grid-template-columns: 1fr; }.button-row { justify-content: start; }.pad-note { text-align: center; } }
@media (max-width: 500px) { .game-shell { width: 96vw; padding-top: 12px; } #scene { height: 106vw; min-height: 350px; }.hud-stats span { font-size: .82rem; }.action-button { flex: 1 1 42%; font-size: .78rem; }.joystick { margin: 4px auto 13px; } }
