/* ---------- in-round interface: floating and outlined, no panels ---------- */
#hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); z-index: 2; display: grid; gap: 8px; justify-items: start; width: min(50vw - 16px, 300px); width: min(50dvw - 16px, 300px); pointer-events: none; }
#hud .row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; }
#hud .face { display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #ffffff, #bfe0ff 70%); border: 4px solid var(--tier, var(--yellow)); border-radius: 50%; box-shadow: 0 0 0 3px var(--navy), 0 4px 0 3px rgba(12, 22, 56, .45); }
#hud .face img { width: 64px; height: 64px; image-rendering: pixelated; }
#hud .meta { display: grid; gap: 3px; min-width: 0; }
#hud .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#hud-level { flex: none; font: 27px/1 var(--pixel); color: var(--tier, var(--yellow)); text-shadow: var(--ol3), 0 5px 0 var(--navy); }
#hud-name { overflow: hidden; font-weight: 900; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; text-shadow: var(--ol); padding: 2px; }
#hud .vitals { align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
#hud-hearts { display: flex; gap: 2px; flex-wrap: wrap; filter: drop-shadow(0 3px 0 rgba(12, 22, 56, .45)); }
#hud-hearts i { width: 27px; height: 24px; background: var(--heart-empty) center / 100% 100% no-repeat; image-rendering: pixelated; }
#hud-hearts i.on { background-image: var(--heart-full); }
#hud-hearts.last i.on { @media (prefers-reduced-motion: no-preference) { animation: heart-beat .6s steps(2) infinite; } }
@keyframes heart-beat { 50% { transform: scale(1.25); } }
#hud-perk { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 2px; font-size: 11px; font-weight: 900; line-height: 16px; white-space: nowrap; color: #fff; text-shadow: 0 1px 0 var(--navy), 1px 0 var(--navy), -1px 0 var(--navy), 0 -1px var(--navy); background: var(--perk); border: 2px solid var(--navy); border-radius: 999px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
#hud .gauge { display: flex; align-items: center; gap: 6px; }
#hud .food-ico { color: var(--yellow); filter: drop-shadow(2px 0 0 var(--navy)) drop-shadow(-2px 0 0 var(--navy)) drop-shadow(0 2px 0 var(--navy)) drop-shadow(0 -2px 0 var(--navy)); }
#hud-pips { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
#hud-pips i { width: 13px; height: 13px; background: rgba(20, 32, 80, .55); border: 2px solid var(--navy); border-radius: 50%; }
#hud-pips i.on { background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--yellow) 20% 60%, var(--yellow-lo)); }
#hud-pips.last i:not(.on) { @media (prefers-reduced-motion: no-preference) { animation: pip-wait .5s steps(1) infinite; } }
@keyframes pip-wait { 50% { background: rgba(255, 210, 58, .55); } }
#hud-food { flex: none; font: 18px/1 var(--pixel); color: #fff; text-shadow: var(--ol); font-variant-numeric: tabular-nums; }
#hud-count { font-size: 14px; font-weight: 900; color: var(--yellow); text-shadow: var(--ol); font-variant-numeric: tabular-nums; }
#hud-status { display: flex; flex-wrap: wrap; gap: 4px; }
#hud-status:empty { display: none; }
#hud-status span { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 5px; font-size: 11px; font-weight: 900; line-height: 18px; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-left: 6px solid var(--c); border-radius: 999px; box-shadow: 0 3px 0 rgba(12, 22, 56, .4); }
#hud-status img { width: 9px; height: 9px; image-rendering: pixelated; }
.food-bit { position: fixed; z-index: 4; width: 12px; height: 12px; background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--yellow) 20% 60%, var(--yellow-lo)); border: 2px solid var(--navy); border-radius: 50%; pointer-events: none; }

/* a big outlined word whose letters hop in one by one */
#banner { position: fixed; left: 50%; top: 28%; z-index: 4; display: flex; transform: translate(-50%, -50%); font-size: clamp(30px, 8vw, 56px); font-weight: 900; line-height: 1; white-space: pre; color: var(--tier); text-shadow: var(--ol3), 0 6px 0 var(--navy); pointer-events: none;
  @media (prefers-reduced-motion: no-preference) { animation: banner 1.7s both; } }
#banner span { display: inline-block; @media (prefers-reduced-motion: no-preference) { animation: letter .5s var(--bounce) both; animation-delay: calc(var(--k) * 45ms); } }
@keyframes banner { 0%, 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -90%); } }
@keyframes letter { 0% { opacity: 0; transform: translateY(-40px) scale(.4); } 60% { opacity: 1; transform: translateY(4px) scale(1.15, .9); } 100% { transform: none; } }

/* At most half the screen wide, so it never reaches the status card on the left. */
#side { position: fixed; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); z-index: 3; display: grid; gap: 8px; justify-items: end; width: min(50vw - 16px, 280px); width: min(50dvw - 16px, 280px); pointer-events: none; }
#side .top { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
#map-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 14px; text-align: right; text-shadow: var(--ol); }
#map-name .ico { color: var(--yellow); filter: drop-shadow(2px 0 0 var(--navy)) drop-shadow(-2px 0 0 var(--navy)) drop-shadow(0 2px 0 var(--navy)) drop-shadow(0 -2px 0 var(--navy)); }
#map-name .ico svg { width: 14px; height: 14px; }
#map-name:empty { display: none; }
#pause { pointer-events: auto; }
#toasts { display: grid; gap: 8px; justify-items: end; width: 100%; }
.toast { position: relative; max-width: 100%; padding: 8px 14px 9px 18px; font-weight: 800; font-size: 13px; line-height: 1.4; color: var(--card-text); background: #fff; border: 3px solid var(--navy); border-radius: 14px; box-shadow: inset 6px 0 0 var(--accent, var(--blue)), 0 4px 0 rgba(12, 22, 56, .45); overflow-wrap: break-word;
  @media (prefers-reduced-motion: no-preference) { animation: toast-in .35s var(--bounce) both; } }
.toast.grow, .toast.golden { --accent: var(--yellow); }
.toast.hurt { --accent: var(--red); }
.toast.quick { padding: 4px 12px 5px; font-weight: 800; font-size: 12px; color: #fff; background: rgba(20, 32, 80, .78); border-width: 2px; box-shadow: none; }
.toast.out { opacity: 0; transition: opacity .2s;
  @media (prefers-reduced-motion: no-preference) { transform: translateX(14px) scale(.9); transition: opacity .2s, transform .2s; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.7); } to { opacity: 1; transform: none; } }

#skill { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 3; display: grid; justify-items: center; gap: 4px; min-height: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; --cool: 0; }
#skill:hover, #skill:active { background: none; box-shadow: none; transform: none; }
#skill::before { display: none; }
#skill .ring { position: relative; display: grid; place-items: center; width: 80px; height: 80px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #eaf3ff, #9fbfef); border: 4px solid var(--navy); border-radius: 50%; box-shadow: inset 0 -6px 0 rgba(20, 32, 80, .25), inset 0 4px 0 rgba(255, 255, 255, .6), 0 5px 0 var(--navy); transition: transform .1s; }
#skill .icon { position: relative; z-index: 1; width: 36px; height: 36px; image-rendering: pixelated; }
#skill .cool { position: absolute; inset: 0; background: conic-gradient(rgba(20, 32, 80, .55) calc(var(--cool) * 360deg), transparent 0); }
#skill.ready .ring { background: radial-gradient(circle at 50% 30%, var(--yellow-hi), var(--yellow) 60%, var(--yellow-lo)); }
#skill.ready .ring { @media (prefers-reduced-motion: no-preference) { animation: ready 1.6s ease-in-out infinite; } }
@keyframes ready { 50% { box-shadow: inset 0 -6px 0 rgba(20, 32, 80, .25), inset 0 4px 0 rgba(255, 255, 255, .6), 0 5px 0 var(--navy), 0 0 0 8px rgba(255, 210, 58, .35); } }
#skill:active .ring { transform: translateY(3px) scale(.96); }
#skill kbd { position: absolute; top: -6px; left: -10px; z-index: 2; padding: 1px 6px; font: 900 10px/1.4 ui-monospace, Consolas, monospace; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 6px; }
@media (pointer: coarse) { #skill kbd { display: none; } }

@media (max-width: 520px) {
  #hud .row { gap: 7px; }
  #hud .face { width: 46px; height: 46px; border-width: 3px; }
  #hud .face img { width: 48px; height: 48px; }
  #hud-level { font-size: 18px; text-shadow: var(--ol), 0 3px 0 var(--navy); }
  #hud-name { font-size: 11px; }
  #hud-hearts i { width: 18px; height: 16px; }
  #hud-perk { display: none; }
  #hud-pips i { width: 10px; height: 10px; }
  #hud-food { font-size: 9px; }
  #map-name { font-size: 12px; }
  #skill .ring { width: 66px; height: 66px; }
  #skill .icon { width: 27px; height: 27px; }
  .toast { font-size: 12px; }
}
#stick-base, #stick-knob { position: fixed; left: 0; top: 0; border-radius: 50%; pointer-events: none; z-index: 2; }
#stick-base { width: 68px; height: 68px; background: rgba(255, 255, 255, .18); border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(20, 32, 80, .55); }
#stick-knob { width: 30px; height: 30px; background: radial-gradient(circle at 40% 35%, #fff, #cfe0ff); border: 3px solid var(--navy); }
