/* Layout: full-screen 3D canvas, thin HUD bar on top, objective chip + bag gauge at bottom. Single dark-ice look by choice. */
:root {
  --ice: #9fd6ff;
  --night: #13253d;
  --glass: rgba(19, 37, 61, .62);
  --ember: #ff9a3c;
  --blood: #e5484d;
  --snow: #f6fbff;
  --display: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; }
[hidden] { display: none !important; }
body { background: var(--night); color: var(--snow); font-family: var(--display); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }

#hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0; display: grid; gap: 8px; pointer-events: none; }
.row { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.pill { background: var(--glass); border-radius: 999px; padding: 6px 12px; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); }
#coins { transition: transform .08s; transform-origin: left center; color: #ffd36b; font-weight: 700; }
#storm.warn { background: rgba(160, 90, 20, .8); }
#storm.on { background: rgba(70, 110, 160, .85); color: #fff; }
#hp { color: var(--blood); letter-spacing: 1px; }
.warm { display: flex; align-items: center; gap: 8px; background: var(--glass); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.warm .bar { flex: 1; height: 10px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.warm i { display: block; height: 100%; width: 60%; background: linear-gradient(90deg, var(--ice), var(--ember)); transition: width .2s; }
.warm.cold i { background: var(--ice); }
.goal { font-size: 14px; white-space: normal; flex: 1; min-width: 0; }
.btns { display: flex; gap: 6px; pointer-events: auto; }
.btns button { font-size: 17px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--glass); color: var(--snow); cursor: pointer; }
.btns button.off { opacity: .35; }
.card button.ghost { background: transparent; color: var(--ice); box-shadow: none; font-size: 16px; padding: 6px; }

#bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 14px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
#obj { background: rgba(255,255,255,.92); color: var(--night); border-radius: 14px; padding: 8px 14px; font-size: 16px; max-width: 92%; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
#obj:empty { display: none; }
#bag { font-size: 15px; }

#toast { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); background: rgba(19,37,61,.85); padding: 10px 18px; border-radius: 14px; font-size: 19px; text-align: center; max-width: 86vw; pointer-events: none; opacity: 0; transition: opacity .25s; }
#toast.show { opacity: 1; }
#alert { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 118px); transform: translate(-50%, 20px); background: #fff4e0; color: #4a2a10; border: 3px solid #ff8a3a; border-radius: 16px; padding: 8px 16px 9px; width: min(360px, 90vw); text-align: center; font: inherit; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: pointer; animation: alertPulse 1.2s ease-in-out infinite; }
#alert.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#alert b { display: block; font-size: 16px; line-height: 1.3; }
#alert span { display: block; font-size: 13px; color: #c0561a; margin-top: 2px; }
@keyframes alertPulse { 50% { border-color: #ffc83d; } }
#spot { position: fixed; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(.85); background: linear-gradient(160deg, #fff8e6, #ffe2a8); color: #3a2410; border: 3px solid #ffb347; padding: 14px 22px 16px; border-radius: 20px; text-align: center; width: min(340px, 86vw); pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#spot.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#spot .ic { font-size: 46px; line-height: 1.1; }
#spot b { display: block; font-size: 24px; margin: 4px 0; }
#spot span { display: block; font-size: 15px; line-height: 1.45; }
#spot span i { display: block; font-style: normal; font-size: 13px; color: #a0581a; letter-spacing: .5px; margin-bottom: 2px; }
#frost { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(225,240,255,.85) 100%); }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(229,72,77,.6) 100%); transition: opacity .3s; }

#joy { position: fixed; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); pointer-events: none; display: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,.85); }

#update { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(19,37,61,.82); }
#update[hidden] { display: none; }
#update h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--snow); }
#start { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(180deg, rgba(19,37,61,.55), rgba(19,37,61,.9)); }
.card { max-width: 360px; width: 100%; text-align: center; display: grid; gap: 14px; }
.card h1 { margin: 0; font-size: 46px; font-weight: 400; letter-spacing: 2px; color: var(--snow); text-shadow: 0 3px 0 #2f6ea5; }
.card .sub { color: var(--ice); font-size: 17px; margin-top: -8px; }
.card ul { list-style: none; margin: 0; padding: 14px 16px; text-align: left; display: grid; gap: 8px; background: var(--glass); border-radius: 16px; font-size: 15px; line-height: 1.4; }
.card button { font-family: var(--display); font-size: 22px; border: 0; border-radius: 16px; padding: 14px; background: var(--ember); color: #3a1c00; cursor: pointer; box-shadow: 0 5px 0 #b8611a; }
.card button:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; }
.card .keys { font-size: 13px; color: rgba(246,251,255,.6); }
@media (prefers-reduced-motion: reduce) { #toast, #spot, #alert, .warm i, #hurt { transition: none; animation: none; } }
