* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #23180f; }
#c { display: block; width: 100vw; height: 100vh; touch-action: none; }
#hud { position: fixed; inset: 0; pointer-events: none; font-family: system-ui, sans-serif; color: #fff3dc; }
#hud .hidden { display: none !important; }
#bar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: auto; }
.chip { background: rgba(35,24,15,.72); border: 1px solid rgba(255,226,138,.35); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chip b { color: #ffe28a; }
#btn-shop { pointer-events: auto; background: #e0b25a; color: #23180f; border: 0; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
#hint { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); background: rgba(35,24,15,.75); border-radius: 8px; padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.panel { pointer-events: auto; }
#overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(20,12,6,.62); text-align: center; padding: 20px; }
#overlay h1 { font-size: clamp(34px, 8vw, 64px); color: #ffe28a; letter-spacing: 2px; }
#overlay p { max-width: 520px; line-height: 1.55; opacity: .9; }
#overlay button, #shop button { background: #e0b25a; color: #23180f; border: 0; border-radius: 10px; padding: 10px 22px; font-size: 16px; font-weight: 700; cursor: pointer; }
#overlay button:hover, #shop button:hover { background: #ffd98a; }
#shop { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(430px, 92vw); max-height: 82vh; overflow: auto; background: rgba(35,24,15,.93); border: 1px solid rgba(255,226,138,.4); border-radius: 14px; padding: 18px; }
#shop h2 { color: #ffe28a; margin-bottom: 10px; font-size: 20px; }
#shop .row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,243,220,.12); font-size: 14px; }
#shop .row span:first-child { flex: 1; }
#shop .prc { color: #ffe28a; }
#shop .row button { padding: 6px 12px; font-size: 13px; }
#shop .tip { font-size: 12px; opacity: .75; margin: 10px 0; line-height: 1.5; }
#shop > button { margin-top: 8px; }
#touch-controls { display: none; }
#touch-controls.on { display: block; }
#joy-base { position: fixed; left: 26px; bottom: 26px; width: 92px; height: 92px; border-radius: 50%; background: rgba(255,243,220,.15); border: 2px solid rgba(255,243,220,.4); pointer-events: none; display: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; margin: -24px 0 0 -24px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,226,138,.8); }
#btn-action { position: fixed; right: 26px; bottom: 30px; width: 84px; height: 84px; border-radius: 50%; background: rgba(224,178,90,.92); color: #23180f; font-weight: 800; font-size: 17px; border: 2px solid rgba(255,243,220,.6); pointer-events: auto; }
#btn-run { position: fixed; right: 122px; bottom: 44px; width: 60px; height: 60px; border-radius: 50%; background: rgba(35,24,15,.65); color: #fff3dc; font-weight: 700; font-size: 13px; border: 2px solid rgba(255,243,220,.4); pointer-events: auto; }
#btn-run.active { background: #e0b25a; color: #23180f; }
@media (max-width: 600px) { #hint { font-size: 12px; bottom: 128px; } .chip { font-size: 11px; } }
