/* ═══════════════════════════════════════════════════════════════
   DXED Virtual — the world is the interface.
   Compact HUD, breathing room, no dashboard energy.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0d14;
  --panel: rgba(16, 19, 30, 0.92);
  --panel-solid: #12151f;
  --line: rgba(140, 160, 210, 0.14);
  --line-strong: rgba(140, 160, 210, 0.28);
  --text: #e8ecf6;
  --dim: #93a0bd;
  --faint: #5d6a88;
  --cyan: #39d0ff;
  --pink: #e14eca;
  --gold: #e8b64c;
  --violet: #7c5cff;
  --green: #12b28a;
  --red: #ff5a6a;
  --r: 10px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ── speech bubbles ── */
#bubbles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute; transform: translate(-50%, -100%);
  max-width: 230px; padding: 6px 11px;
  background: rgba(240, 244, 255, 0.94); color: #14182a;
  border-radius: 13px; border-bottom-left-radius: 4px;
  font-size: 13px; line-height: 1.35; word-wrap: break-word;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
  animation: bubbleIn 0.18s ease-out;
  transition: opacity 0.5s;
}
.bubble.fading { opacity: 0; }
.bubble .bname { display: block; font-size: 10px; font-weight: 700; color: #7c5cff; margin-bottom: 1px; }
@keyframes bubbleIn { from { transform: translate(-50%, -92%); opacity: 0; } }

/* ── HUD ── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: none; }
#hud button, #hud input, #chatBox { pointer-events: auto; }

.hud-top {
  position: absolute; top: calc(10px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar));
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.hud-loc {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px;
  font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
}
.loc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.loc-pop { color: var(--dim); font-weight: 500; font-size: 12px; }
.hud-right { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px;
  font-weight: 650; font-size: 13px;
  backdrop-filter: blur(10px);
  transition: border-color 0.15s;
}
.chip:hover { border-color: var(--line-strong); }
#chipSparks .ic { color: var(--gold); }
#chipSparks.flash { animation: sparkFlash 0.6s; }
@keyframes sparkFlash { 30% { border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 182, 76, 0.4); } }
.lv { font-size: 12px; color: var(--cyan); font-weight: 700; }
.xpbar { width: 46px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.xpbar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 2px; transition: width 0.5s; }

.iconbtn {
  position: relative;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dim); backdrop-filter: blur(10px);
  transition: color 0.15s, border-color 0.15s, transform 0.1s;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-strong); }
.iconbtn:active { transform: scale(0.93); }
.iconbtn.small { width: 30px; height: 30px; }
.iconbtn .dot {
  position: absolute; top: 2px; right: 2px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink);
  display: none;
}
.iconbtn .dot.on { display: block; }
.ic { width: 18px; height: 18px; }

.hud-bottom {
  position: absolute; bottom: calc(12px + var(--sab)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
}

/* chat */
#chatBox { width: min(330px, 62vw); }
#chatLog {
  max-height: 148px; overflow-y: auto; margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 3px;
  mask-image: linear-gradient(to bottom, transparent, black 18%);
  scrollbar-width: thin;
}
.chat-line { font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: rgba(10, 13, 22, 0.72); width: fit-content; max-width: 100%; word-wrap: break-word; backdrop-filter: blur(6px); }
.chat-line .cname { font-weight: 700; margin-right: 5px; }
.chat-line.sys { color: var(--dim); font-style: italic; }
.chat-line.party .cname { color: var(--violet); }
#chatRow { display: flex; gap: 6px; align-items: center; }
#chatInput {
  flex: 1; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--text);
  outline: none; backdrop-filter: blur(10px); min-width: 0;
}
#chatInput:focus { border-color: var(--line-strong); }
#chatInput::placeholder { color: var(--faint); }

.hud-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.fab {
  width: 50px; height: 50px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(57, 208, 255, 0.16), rgba(225, 78, 202, 0.16)), var(--panel);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s;
}
.fab:active { transform: scale(0.92); }
.fab .ic { width: 23px; height: 23px; }

/* connection pill + coach mark */
#connPill {
  position: absolute; top: calc(56px + var(--sat)); left: 50%; transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  padding: 6px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--gold); box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
#connPill.bad { color: var(--red); }
#coach {
  position: absolute; bottom: calc(136px + var(--sab)); left: 50%; transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  padding: 9px 18px; border-radius: var(--r); font-size: 13px; text-align: center;
  max-width: 84vw; box-shadow: 0 6px 22px rgba(0,0,0,0.5);
  animation: coachIn 0.3s ease-out;
}
@keyframes coachIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── toasts ── */
#toasts {
  position: fixed; top: calc(58px + var(--sat)); right: calc(12px + var(--sar));
  display: flex; flex-direction: column; gap: 7px; z-index: 60; pointer-events: none;
  max-width: min(320px, 86vw);
}
.toast {
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  padding: 9px 14px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease-out; pointer-events: auto;
}
.toast.gold { border-left-color: var(--gold); }
.toast.pink { border-left-color: var(--pink); }
.toast.red { border-left-color: var(--red); }
.toast.green { border-left-color: var(--green); }
.toast b { font-weight: 700; }
.toast small { display: block; color: var(--dim); margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
.toast.out { opacity: 0; transition: opacity 0.4s; }

/* ── panels (side sheet desktop / bottom sheet mobile) ── */
#panel {
  position: fixed; z-index: 40;
  top: 0; right: 0; bottom: 0; width: min(400px, 100vw);
  background: var(--panel-solid); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: panelIn 0.22s ease-out;
  padding-top: var(--sat); padding-bottom: var(--sab);
}
@keyframes panelIn { from { transform: translateX(40px); opacity: 0; } }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; flex: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 16px; scrollbar-width: thin; }
.panel-tabs { display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ptab {
  padding: 7px 13px; border-radius: 8px 8px 0 0; font-size: 13px; font-weight: 600;
  color: var(--dim); border-bottom: 2px solid transparent;
}
.ptab.on { color: var(--text); border-bottom-color: var(--cyan); }

@media (max-width: 700px) {
  #panel {
    top: auto; left: 0; right: 0; width: 100%; height: min(78vh, 620px);
    border-left: 0; border-top: 1px solid var(--line-strong);
    border-radius: 16px 16px 0 0;
    animation: sheetIn 0.25s ease-out;
  }
  @keyframes sheetIn { from { transform: translateY(60px); opacity: 0; } }
}

/* ── modal (creator, game, dialogue, cards) ── */
#modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 7, 12, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, var(--sat)) 16px max(16px, var(--sab));
  animation: fadeIn 0.18s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  width: min(560px, 100%); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: cardIn 0.22s ease-out;
}
@keyframes cardIn { from { transform: translateY(14px) scale(0.985); opacity: 0; } }
.modal-card.wide { width: min(760px, 100%); }
.modal-card.slim { width: min(400px, 100%); }

/* ── shared bits ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px; font-weight: 650; font-size: 13.5px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, #2596c2, #7c3cb0); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.gold { background: linear-gradient(135deg, #a8823a, #7a5c22); border-color: transparent; color: #fff; }
.btn.danger { background: rgba(255, 90, 106, 0.14); border-color: rgba(255, 90, 106, 0.4); color: var(--red); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.btn.tiny { padding: 5px 11px; font-size: 12px; border-radius: 7px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; outline: none; font-size: 13.5px;
}
.field input:focus, .field select:focus { border-color: var(--line-strong); }

.seg { display: inline-flex; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 13px; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.seg button.on { background: rgba(57, 208, 255, 0.14); color: var(--text); }

.empty-state { text-align: center; color: var(--dim); padding: 36px 20px; font-size: 13.5px; }
.empty-state .big { font-size: 30px; margin-bottom: 10px; opacity: 0.6; }
.error-state { text-align: center; padding: 32px 20px; color: var(--dim); }
.error-state .btn { margin-top: 12px; }

.spin {
  width: 26px; height: 26px; margin: 30px auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* rarity accents */
.rar-common { color: #aeb6c8; } .rar-uncommon { color: #6fd39a; }
.rar-rare { color: #56b5f2; } .rar-epic { color: #ad7bff; }
.rar-legendary { color: #ffc554; } .rar-limited { color: #ff7ac2; }
.rline-common { border-color: rgba(174,182,200,.35) !important; }
.rline-uncommon { border-color: rgba(111,211,154,.45) !important; }
.rline-rare { border-color: rgba(86,181,242,.5) !important; }
.rline-epic { border-color: rgba(173,123,255,.55) !important; }
.rline-legendary { border-color: rgba(255,197,84,.6) !important; }
.rline-limited { border-color: rgba(255,122,194,.6) !important; }

/* item grid */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.item-card {
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, transform 0.12s; position: relative;
}
.item-card:hover { transform: translateY(-2px); }
.item-card.equipped { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.item-card canvas { width: 100%; aspect-ratio: 1; display: block; }
.item-card .iname { font-size: 11px; font-weight: 600; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .imeta { font-size: 10px; }
.item-card .fav { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--gold); opacity: 0; }
.item-card .fav.on, .item-card:hover .fav { opacity: 1; }
.item-card .price { font-size: 11px; color: var(--gold); font-weight: 700; }
.item-card .owned-tag { font-size: 10px; color: var(--green); font-weight: 700; }

.filter-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 11px; }
.fchip { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--dim); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.fchip.on { color: var(--text); border-color: var(--cyan); background: rgba(57, 208, 255, 0.1); }

/* quests */
.quest-card { background: rgba(255,255,255,0.035); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 9px; }
.quest-card h4 { font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quest-card .qdesc { font-size: 12px; color: var(--dim); margin: 3px 0 7px; }
.qobj { font-size: 12px; margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.qbar { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.qbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width 0.4s; }
.qobj .qn { color: var(--dim); font-size: 11px; min-width: 34px; text-align: right; }
.qreward { font-size: 11.5px; color: var(--gold); }
.qtag { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 4px; background: rgba(124, 92, 255, 0.18); color: var(--violet); }
.qcheck { color: var(--green); font-weight: 800; }

/* character creator + entry */
.screen {
  position: fixed; inset: 0; z-index: 45; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;
}
.entry-wrap { text-align: center; max-width: 480px; padding: 40px 24px; }
.entry-logo { font-size: 13px; font-weight: 800; letter-spacing: 0.42em; color: var(--dim); }
.entry-title {
  font-size: clamp(38px, 8vw, 58px); font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--cyan), var(--violet), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 4px 0 8px;
}
.entry-sub { color: var(--dim); font-size: 14.5px; margin-bottom: 26px; }
.entry-stats { display: flex; justify-content: center; gap: 22px; margin: 18px 0 26px; font-size: 12.5px; color: var(--dim); }
.entry-stats b { display: block; font-size: 19px; color: var(--text); }

.creator { display: flex; gap: 0; width: min(860px, 100vw); height: min(640px, 100dvh); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.creator-preview { flex: 1; min-width: 0; position: relative; background: radial-gradient(ellipse at 50% 30%, #1d2438, #0d1019); display: flex; align-items: center; justify-content: center; }
.creator-preview canvas { width: 100%; height: 100%; }
.creator-side { width: min(340px, 46vw); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.creator-side .panel-body { padding: 12px 14px; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.1s; }
.sw:hover { transform: scale(1.12); }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
.opt-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.opt { padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.opt.on { border-color: var(--cyan); background: rgba(57, 208, 255, 0.1); }
.creator-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
@media (max-width: 700px) {
  .creator { flex-direction: column; height: 100dvh; border-radius: 0; }
  .creator-preview { min-height: 34dvh; }
  .creator-side { width: 100%; flex: 1; border-left: 0; border-top: 1px solid var(--line); }
}

/* emote wheel */
#emoteWheel {
  position: fixed; z-index: 42; inset: 0;
  background: rgba(5, 7, 12, 0.45);
}
.wheel {
  position: absolute; bottom: calc(76px + var(--sab)); right: calc(14px + var(--sar));
  width: min(320px, calc(100vw - 28px));
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 14px;
  padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  animation: cardIn 0.18s ease-out;
}
.wheel h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 6px 2px 6px; }
.wheel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.emote-b {
  padding: 9px 4px; border-radius: 9px; background: rgba(255,255,255,0.045);
  border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; text-align: center;
}
.emote-b:hover { border-color: var(--cyan); }
.emote-b .ee { display: block; font-size: 17px; margin-bottom: 2px; }
.emote-b.locked { opacity: 0.38; }

/* player card */
.pcard-head { display: flex; gap: 13px; padding: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.pcard-ava { width: 74px; height: 92px; background: radial-gradient(ellipse at 50% 30%, #202844, #10141f); border-radius: 10px; border: 1px solid var(--line); }
.pcard-info h3 { font-size: 17px; }
.pcard-info .ptitles { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.pcard-info .pbio { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.pcard-actions { display: flex; gap: 7px; padding: 12px 16px; flex-wrap: wrap; }
.pcard-outfit { padding: 4px 16px 14px; }
.pcard-outfit h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); margin-bottom: 7px; }
.outfit-row { display: flex; gap: 6px; flex-wrap: wrap; }
.outfit-pill { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }

/* NPC dialogue */
.npc-dialog {
  position: fixed; z-index: 44; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + var(--sab));
  width: min(560px, calc(100vw - 24px));
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 14px;
  padding: 15px 18px; box-shadow: 0 14px 44px rgba(0,0,0,0.6);
  animation: cardIn 0.2s ease-out;
}
.npc-dialog .nname { font-weight: 800; font-size: 13px; }
.npc-dialog .nrole { font-size: 10.5px; color: var(--dim); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-left: 7px; }
.npc-dialog .ntext { margin: 8px 0 12px; font-size: 14px; line-height: 1.5; }
.npc-opts { display: flex; flex-direction: column; gap: 6px; }
.npc-opt {
  text-align: left; padding: 8px 13px; border-radius: 9px;
  background: rgba(255,255,255,0.045); border: 1px solid var(--line); font-size: 13px;
}
.npc-opt:hover { border-color: var(--cyan); }

/* pulse grid game */
.pg-wrap { padding: 18px; text-align: center; }
.pg-status { font-size: 13px; color: var(--dim); min-height: 20px; margin-bottom: 12px; }
.pg-grid { display: grid; grid-template-columns: repeat(3, 84px); gap: 9px; justify-content: center; margin: 0 auto 14px; }
.pg-cell {
  width: 84px; height: 84px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  transition: background 0.08s, box-shadow 0.08s;
}
.pg-cell.live { background: var(--green); box-shadow: 0 0 24px rgba(18, 178, 138, 0.6); border-color: transparent; }
.pg-cell.hit { background: var(--cyan); }
.pg-cell.wrong { background: var(--red); }
.pg-score { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.pg-round { font-size: 12px; color: var(--dim); }

/* contextual interaction prompt */
#prompt {
  position: fixed; z-index: 24; left: 50%; transform: translateX(-50%);
  bottom: calc(78px + var(--sab));
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 15, 22, 0.92); border: 1px solid var(--line-strong);
  padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  animation: coachIn 0.16s ease-out;
  cursor: pointer;
}
#prompt .pk {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px;
  background: rgba(255, 255, 255, 0.10); border: 1px solid var(--line-strong);
  border-radius: 5px; font-size: 11px; font-weight: 700;
}
#prompt .pl { color: var(--dim); font-weight: 500; }

/* photo mode bar */
#photoBar {
  position: fixed; z-index: 46; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + var(--sab));
  display: flex; gap: 8px; align-items: center;
  background: rgba(13, 15, 22, 0.9); border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 9px 13px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}

/* home edit bar */
#editBar {
  position: fixed; z-index: 38; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + var(--sab));
  display: flex; gap: 7px; align-items: center;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 8px 10px; box-shadow: 0 10px 34px rgba(0,0,0,0.55);
  flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px);
}
#editBar .btn { padding: 7px 12px; font-size: 12.5px; }

/* map */
.map-wrap { position: relative; padding: 8px 0; }
.map-node {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 11px; margin-bottom: 8px;
  background: rgba(255,255,255,0.035); border: 1px solid var(--line);
  text-align: left; transition: border-color 0.15s;
}
.map-node:hover { border-color: var(--cyan); }
.map-node.here { border-color: var(--cyan); background: rgba(57, 208, 255, 0.07); }
.map-glyph { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.map-node h4 { font-size: 14px; }
.map-node p { font-size: 12px; color: var(--dim); }
.map-node .mpop { margin-left: auto; font-size: 12px; color: var(--dim); white-space: nowrap; }
.map-node .mpop b { color: var(--green); }

/* settings sliders */
.vol-row { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; font-size: 13px; }
.vol-row label { width: 62px; color: var(--dim); font-weight: 600; font-size: 12px; }
.vol-row input[type=range] { flex: 1; accent-color: var(--cyan); }

/* leaderboard rows */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.lb-row:nth-child(odd) { background: rgba(255,255,255,0.028); }
.lb-row .rank { width: 26px; font-weight: 800; color: var(--dim); }
.lb-row .rank.top { color: var(--gold); }
.lb-row .score { margin-left: auto; font-weight: 700; color: var(--cyan); }

/* admin */
.adm-stat { display: inline-block; background: rgba(255,255,255,0.035); border: 1px solid var(--line); border-radius: 10px; padding: 10px 15px; margin: 0 8px 8px 0; }
.adm-stat b { display: block; font-size: 19px; }
.adm-stat span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th { text-align: left; color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.adm-table td { padding: 7px 8px; border-bottom: 1px solid rgba(140,160,210,0.07); }
.adm-row-btns { display: flex; gap: 5px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* small screens: tighter HUD */
@media (max-width: 520px) {
  .hud-loc { font-size: 12px; padding: 6px 11px; }
  .loc-pop { display: none; }
  #chipLevel .xpbar { display: none; }
  .iconbtn { width: 34px; height: 34px; }
  #chatLog { max-height: 108px; }
}
