* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fc7ea; color: #fffefa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; margin: 0 2px; border-radius: 6px; background: #fffefa; color: #292a23;
  font: 700 13px system-ui, sans-serif; text-align: center; box-shadow: 0 2px 0 #b9b6a8; }
#fade { position: fixed; inset: 0; background: #0d2a36; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 30; }
#fade.on { opacity: 1; }

/* start.ng profile card */
.startng-card { position: fixed; top: 16px; left: 16px; display: flex; align-items: center; gap: 12px; z-index: 5;
  padding: 8px 16px 8px 8px; border-radius: 999px; background: #292a23e6; color: #fffefa; max-width: calc(100vw - 32px); }
.startng-card img { width: 48px; height: 48px; border-radius: 50%; background: #d8fd71; }
.startng-card b { display: block; font-size: 16px; white-space: nowrap; }
.startng-card span { font-size: 12px; opacity: .7; }
.startng-card button { margin-left: 8px; border: 0; border-radius: 999px; padding: 6px 12px; background: #d8fd71; color: #292a23; font-weight: 700; }

.objective { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: min(520px, calc(100vw - 460px));
  background: #292a23e6; border-left: 4px solid #d8fd71; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1.35; }

.hud { position: fixed; top: 16px; right: 16px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.stats { display: flex; gap: 6px; }
.stats > div { display: flex; align-items: center; gap: 6px; background: #292a23e6; border-radius: 12px; padding: 7px 11px; font-size: 16px; }
.stats i { width: 14px; height: 14px; display: inline-block; }
.stats .gem { background: #ffcc33; transform: rotate(45deg); border-radius: 2px; }
.stats .coin { background: #ffcc33; border-radius: 50%; box-shadow: inset 0 0 0 3px #e0a800; }
.stats .clock { border: 2px solid #fffefa; border-radius: 50%; }
#minimap { width: 150px; height: 150px; border-radius: 50%; border: 3px solid #292a23; background: #1f8fc4; cursor: pointer; box-shadow: 0 6px 20px #0004; }

.prompt { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 6; background: #292a23ee; padding: 10px 16px;
  border-radius: 999px; font-weight: 600; white-space: nowrap; }
.toast { position: fixed; top: 84px; left: 50%; transform: translate(-50%, -10px); opacity: 0; z-index: 7; background: #d8fd71; color: #292a23;
  font-weight: 700; padding: 10px 18px; border-radius: 999px; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Touch controls */
#joy { position: fixed; left: 24px; bottom: 28px; width: 130px; height: 130px; border-radius: 50%; background: #ffffff26; border: 2px solid #ffffff55; z-index: 6; touch-action: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: #fffefacc; }
.tbtn { position: fixed; z-index: 6; border: 0; border-radius: 50%; background: #292a23cc; color: #fffefa; font-size: 26px; touch-action: none; }
.tbtn.jump { right: 24px; bottom: 34px; width: 78px; height: 78px; }
.tbtn.use { right: 112px; bottom: 54px; width: 64px; height: 64px; }
.tbtn.use.ready { background: #d8fd71; color: #292a23; }
.tbtn.map { right: 24px; bottom: 124px; width: 52px; height: 52px; font-size: 22px; }

/* Panels */
.panel-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: #0d2a3699; z-index: 20; padding: 16px; }
.panel { background: #292a23; border-radius: 24px; padding: 28px; width: min(440px, 100%); text-align: center; box-shadow: 0 20px 60px #0008;
  max-height: calc(100vh - 32px); overflow: auto; }
.panel.wide { width: min(700px, 100%); }
.panel h1 { margin: 0 0 10px; font-size: 44px; letter-spacing: -.02em; line-height: 1; }
.panel h1 span, .eyebrow { color: #d8fd71; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.panel h2 { margin: 0 0 10px; }
.panel p { opacity: .88; line-height: 1.45; }
.controls { display: grid; gap: 8px; margin: 16px 0; font-size: 14px; opacity: .9; }
.touch-only { display: none; }
body.touch .touch-only { display: grid; }
body.touch .desktop-only { display: none; }
body.touch .prompt kbd { display: none; }
.primary { display: block; width: 100%; margin-top: 14px; border: 0; border-radius: 999px; padding: 14px; background: #d8fd71; color: #292a23; font-size: 18px; font-weight: 800; }
.link { margin-top: 12px; border: 0; background: none; color: #d8fd71; text-decoration: underline; }
#bigmap { width: 100%; max-width: 520px; aspect-ratio: 1; border-radius: 16px; background: #1f8fc4; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; font-size: 13px; margin-top: 10px; opacity: .9; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend i.flag { background: var(--accent, #d8fd71); border-radius: 2px; }
.order { list-style: none; padding: 0; display: flex; justify-content: center; gap: 16px; margin: 16px 0; }
.order li { display: grid; place-items: center; gap: 6px; font-weight: 800; }
.order i { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fffefa66; }
.results { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.results div { background: #ffffff10; border-radius: 14px; padding: 10px 14px; min-width: 90px; }
.results small { display: block; font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: .06em; }
.results b { font-size: 22px; }
.save { font-weight: 600; }
.board { text-align: left; padding: 0; margin: 12px 0 0; list-style: none; }
.board li { padding: 8px 12px; border-radius: 10px; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.board li:nth-child(odd) { background: #ffffff0a; }
.board li.me { outline: 2px solid #d8fd71; }
.board li.muted { opacity: .6; }
.board i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

@media (max-width: 760px) {
  .startng-card { top: 10px; left: 10px; padding: 5px 12px 5px 5px; gap: 8px; }
  .startng-card img { width: 34px; height: 34px; }
  .startng-card b { font-size: 14px; }
  .objective { top: auto; bottom: 182px; max-width: calc(100vw - 32px); font-size: 13px; padding: 8px 12px; text-align: center; width: max-content; }
  .hud { top: 10px; right: 10px; }
  .stats > div { padding: 5px 8px; font-size: 13px; }
  #minimap { width: 96px; height: 96px; }
  .prompt { bottom: 236px; }
  .toast { top: 64px; }
  .panel h1 { font-size: 36px; }
}
