/* Layout concept: a full-bleed 3D map of the real taman; game HUD floats over it.
   Left = layer dock (six community systems), right = live feed for the active layer,
   bottom = activity ticker + Post. On phones the feed becomes a bottom sheet. */
:root {
  --ink: #12302a;            /* deep padi green: text + strong UI */
  --ink-soft: #4a615a;
  --paper: #eef3ee;          /* page ground behind map */
  --panel: rgba(250, 252, 249, .9);
  --panel-solid: #fafcf9;
  --line: rgba(18, 48, 42, .13);
  --gold: #d9971c;           /* Kelisa Emas gold (golden arowana) - brand accent */
  --gold-ink: #7a4f00;
  --gold-soft: #fbefd2;
  --shadow: 0 10px 30px -12px rgba(18, 48, 42, .35), 0 2px 6px rgba(18, 48, 42, .08);

  /* the six systems */
  --c-market: #e2702b;
  --c-meet: #2f78d6;
  --c-event: #3b8c2e;
  --c-task: #7b55e0;
  --c-care: #db3f76;
  --c-safe: #0f9a8f;
  --c-solar: #e7a90b;
  --ok: #2c9a52;
  --warn: #d98a07;
  --bad: #d23b3b;

  --f-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --t-xs: .72rem; --t-sm: .82rem; --t-md: .92rem; --t-lg: 1.12rem; --t-xl: 1.45rem; --t-2xl: 2rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6f0ea; --ink-soft: #9db3aa; --paper: #0b1714;
    --panel: rgba(16, 30, 27, .88); --panel-solid: #12221e; --line: rgba(220, 240, 230, .12);
    --gold: #f0b43a; --gold-ink: #ffd47a; --gold-soft: rgba(240, 180, 58, .16);
    --shadow: 0 12px 34px -10px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .3);
    --c-market: #ff8d4a; --c-meet: #5aa0ff; --c-event: #79d45e; --c-task: #a586ff; --c-care: #ff6b9b; --c-safe: #2fd0c1; --c-solar: #ffc63d;
    --ok: #4fd17d; --warn: #ffb547; --bad: #ff6b6b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e6f0ea; --ink-soft: #9db3aa; --paper: #0b1714;
  --panel: rgba(16, 30, 27, .88); --panel-solid: #12221e; --line: rgba(220, 240, 230, .12);
  --gold: #f0b43a; --gold-ink: #ffd47a; --gold-soft: rgba(240, 180, 58, .16);
  --shadow: 0 12px 34px -10px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .3);
  --c-market: #ff8d4a; --c-meet: #5aa0ff; --c-event: #79d45e; --c-task: #a586ff; --c-care: #ff6b9b; --c-safe: #2fd0c1; --c-solar: #ffc63d;
  --ok: #4fd17d; --warn: #ffb547; --bad: #ff6b6b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 500 14px/1.45 var(--f-body);
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--gold); outline-offset: 2px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

#app { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }

.glass {
  background: var(--panel); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* ---------------- top HUD ---------------- */
.hud-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0;
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--gold); background: var(--ink);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark.big { width: 72px; height: 72px; }
.brand-mark.big svg { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--f-display); font-size: 1.15rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.brand-text span { font-size: var(--t-xs); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vitality {
  margin-inline: auto; display: flex; gap: 6px; padding: 6px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.vit {
  display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border-radius: 999px;
  border: 0; background: transparent; font-size: var(--t-xs); font-weight: 600; color: var(--ink);
}
.vit:hover { background: var(--line); }
.vit-ring { width: 28px; height: 28px; flex: none; }
.vit-ring circle { fill: none; stroke-width: 4; }
.vit-ring .bg { stroke: var(--line); }
.vit-ring .fg { stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); transform: rotate(-90deg); transform-origin: 50% 50%; }
.vit-label { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.vit-label b { font-family: var(--f-mono); font-size: .8rem; }
.vit-label small { color: var(--ink-soft); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.vit.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.12); } }

.hud-actions { display: flex; align-items: center; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 700; font-size: var(--t-sm);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.chip-btn svg { width: 18px; height: 18px; }
.chip-btn:hover { border-color: var(--gold); }
.player {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; height: 44px; border-radius: 999px;
  background: var(--ink); color: var(--panel-solid); border: 0; box-shadow: var(--shadow);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--gold), #f6d27a); color: #3b2600; font-family: var(--f-display); font-weight: 800;
}
.player-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.player-name { font-weight: 700; font-size: var(--t-sm); line-height: 1; }
.player-name em { font-style: normal; font-family: var(--f-mono); color: var(--gold); margin-left: 4px; font-size: .74rem; }
.xpbar { width: 84px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 3px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------------- layer dock ---------------- */
.dock {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 15;
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 22px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  max-height: calc(100% - 180px); overflow-y: auto; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock-btn {
  --c: var(--ink);
  position: relative; width: 64px; padding: 8px 4px 6px; border-radius: 14px; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .64rem; font-weight: 700;
  letter-spacing: .02em; color: var(--ink-soft); transition: background .2s, color .2s, transform .15s;
}
.dock-btn:hover { background: var(--line); color: var(--ink); }
.dock-btn:active { transform: scale(.95); }
.dock-btn .ico {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); transition: background .2s, color .2s, box-shadow .2s;
}
.dock-btn .ico svg { width: 21px; height: 21px; }
.dock-btn.active { color: var(--ink); }
.dock-btn.active .ico { background: var(--c); color: #fff; box-shadow: 0 6px 16px -6px var(--c); }
.dock-btn .count {
  position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--c); color: #fff; font: 600 .64rem/18px var(--f-mono); text-align: center;
  border: 2px solid var(--panel-solid);
}
.dock-sep { height: 1px; background: var(--line); margin: 0 6px; }

/* ---------------- right panel ---------------- */
.panel {
  position: absolute; right: 16px; top: 76px; bottom: 16px; width: 372px; z-index: 14;
  display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.panel-grip { display: none; }
.panel-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 12px 12px 90px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }

.eyebrow { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--c, var(--ink-soft)); }
.panel-title { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.panel-title h2 { font-size: var(--t-xl); font-weight: 800; }
.panel-sub { color: var(--ink-soft); font-size: var(--t-sm); margin-top: 4px; max-width: 46ch; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { padding: 8px 10px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c, var(--ink)) 9%, transparent); min-width: 0; }
.stat b { display: block; font-family: var(--f-mono); font-size: 1.02rem; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.stat span { font-size: .68rem; color: var(--ink-soft); font-weight: 600; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft);
}
.filter.on { background: var(--ink); color: var(--panel-solid); border-color: var(--ink); }

/* feed cards */
.card {
  --c: var(--ink);
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: start; text-align: left;
  padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel-solid);
  transition: transform .15s, border-color .15s, box-shadow .15s; width: 100%;
}
.card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-1px); box-shadow: 0 6px 18px -10px var(--c); }
.card.sel { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.card-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem;
  background: color-mix(in srgb, var(--c) 13%, transparent);
}
.card-main { min-width: 0; }
.card-main h3 { font-size: .98rem; font-weight: 700; line-height: 1.2; }
.card-main p { font-size: var(--t-sm); color: var(--ink-soft); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  background: var(--line); color: var(--ink-soft); white-space: nowrap;
}
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.pill.c { background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.price { font-family: var(--f-mono); font-weight: 600; font-size: .9rem; color: var(--ink); white-space: nowrap; }
.reward {
  font-family: var(--f-mono); font-weight: 600; font-size: .86rem; color: #fff; background: var(--c); padding: 3px 9px; border-radius: 8px; white-space: nowrap;
}
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--c); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.section-label { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft); padding: 6px 4px 0; }

/* overview (All) */
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ov {
  --c: var(--ink);
  text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel-solid);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.ov:hover { border-color: var(--c); }
.ov:last-child:nth-child(odd), .type-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ov-top { display: flex; align-items: center; justify-content: space-between; }
.ov-top .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.ov-top .ico svg { width: 18px; height: 18px; }
.ov b { font-family: var(--f-mono); font-size: 1.15rem; }
.ov h3 { font-size: .9rem; }
.ov p { font-size: .72rem; color: var(--ink-soft); }
.quest {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: var(--r-md);
  background: var(--panel-solid); border: 1px solid var(--line);
}
.quest .qi { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; }
.quest.done .qi { background: var(--ok); border-color: var(--ok); color: #fff; }
.quest.done h4 { text-decoration: line-through; color: var(--ink-soft); }
.quest h4 { font-family: var(--f-body); font-size: .85rem; font-weight: 700; }
.quest small { color: var(--ink-soft); font-size: .72rem; }
.quest .xp { font-family: var(--f-mono); font-size: .75rem; color: var(--gold-ink); background: var(--gold-soft); padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.board { display: flex; flex-direction: column; gap: 4px; }
.board-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: .82rem; }
.board-row.me { background: var(--gold-soft); }
.board-row .rk { font-family: var(--f-mono); color: var(--ink-soft); font-size: .76rem; }
.board-row .bar { height: 6px; border-radius: 3px; background: var(--gold); margin-top: 3px; }
.board-row b { font-family: var(--f-mono); font-size: .8rem; }

/* ---------------- detail card ---------------- */
.detail {
  --c: var(--ink);
  position: absolute; z-index: 18; right: 404px; top: 76px; width: 360px; max-height: calc(100% - 92px); overflow-y: auto;
  border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: pop .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.detail-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center;
}
.icon-btn svg { width: 16px; height: 16px; }
.d-hero {
  padding: 18px 18px 14px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
}
.d-emoji { font-size: 2.1rem; line-height: 1; }
.d-hero h2 { font-size: 1.4rem; font-weight: 800; margin-top: 8px; padding-right: 30px; }
.d-hero .who { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--t-sm); color: var(--ink-soft); }
.mini-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; background: var(--c); flex: none; }
.d-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.d-body > p { color: var(--ink-soft); font-size: var(--t-md); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--t-sm); }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.menu-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; font-size: var(--t-sm); }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; line-height: 1; }
.qty span { font-family: var(--f-mono); min-width: 14px; text-align: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 120px; height: 44px; border-radius: 12px; border: 0; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--c); color: #fff; box-shadow: 0 8px 18px -10px var(--c); transition: transform .12s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.done { background: var(--ok); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.avatars { display: flex; }
.avatars span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel-solid); margin-left: -8px; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; }
.avatars span:first-child { margin-left: 0; }
.route-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 10%, transparent); font-size: var(--t-sm); }
.route-info b { font-family: var(--f-mono); }
.note { font-size: .75rem; color: var(--ink-soft); padding: 8px 10px; border-radius: 10px; background: var(--line); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.amounts button { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel); font-family: var(--f-mono); font-weight: 600; }
.amounts button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.pool-vis { position: relative; height: 150px; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--c) 7%, var(--panel-solid)); border: 1px solid var(--line); }
.pool-vis svg { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: wave 6s linear infinite; }
@keyframes wave { to { transform: translateX(-50%); } }
.pool-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; z-index: 1; }
.pool-text b { font-family: var(--f-mono); font-size: 1.7rem; color: var(--ink); }
.pool-text span { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.ledger { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; }
.ledger div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ledger span:last-child { font-family: var(--f-mono); }
.sparkbars { display: flex; align-items: flex-end; gap: 4px; height: 70px; padding-top: 6px; }
.sparkbars i { flex: 1; background: var(--c); border-radius: 3px 3px 0 0; opacity: .85; min-height: 2px; }
.sparkbars i:last-child { opacity: 1; }
.spark-axis { display: flex; justify-content: space-between; font-size: .64rem; color: var(--ink-soft); font-family: var(--f-mono); }

/* events */
.roles { display: flex; flex-direction: column; gap: 6px; }
.role {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--panel); text-align: left; font-size: var(--t-sm);
}
.role.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.role .rd { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.role.on .rd { border: 5px solid var(--c); }
.role small { font-family: var(--f-mono); color: var(--ink-soft); }
.role[disabled] { opacity: .5; cursor: default; }
.agenda { display: flex; flex-direction: column; border-left: 2px solid var(--c); margin-left: 4px; }
.agenda div { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 4px 0 4px 12px; font-size: var(--t-sm); }
.agenda b { font-family: var(--f-mono); font-weight: 600; font-size: .78rem; color: var(--c); }
.tips { margin: 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 9%, transparent); font-size: .8rem; display: flex; flex-direction: column; gap: 4px; }
.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.entry {
  display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line);
  background: var(--panel); text-align: left; font-size: .7rem; min-width: 0;
}
.entry .ph { aspect-ratio: 4 / 3; max-width: 100%; display: grid; place-items: center; font-size: 1.9rem; background: color-mix(in srgb, var(--c) 14%, var(--panel-solid)); }
.entry b { padding: 0 8px; font-size: .74rem; line-height: 1.2; }
.entry span { padding: 0 8px; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 4px; }
.entry.voted { border-color: var(--c); }
.entry.voted .ph { background: color-mix(in srgb, var(--c) 30%, var(--panel-solid)); }
.standings { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.standings div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 8px 12px; font-size: var(--t-sm); }
.standings div + div { border-top: 1px solid var(--line); }
.standings small { color: var(--ink-soft); }

/* ---------------- markers ---------------- */
.mk {
  --c: var(--ink);
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; will-change: transform;
  display: flex; flex-direction: column; align-items: center; border: 0; padding: 0; background: none;
  transition: opacity .25s;
}
.mk-bubble {
  display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 999px;
  background: var(--panel-solid); border: 2px solid var(--c); box-shadow: 0 6px 14px -6px rgba(0,0,0,.45);
  font-size: .74rem; font-weight: 700; white-space: nowrap; color: var(--ink); transition: transform .15s;
}
.mk-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c); font-size: .85rem; }
.mk-tail { width: 2px; height: 14px; background: var(--c); }
.mk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.mk:hover .mk-bubble, .mk.sel .mk-bubble { transform: scale(1.1); }
.mk.sel .mk-bubble { background: var(--c); color: #fff; }
.mk.sel .mk-ico { background: #fff; }
.mk.compact .mk-label, .mk.compact .mk-tag { display: none; }
.mk.compact .mk-bubble { padding: 3px; }
.mk.compact .mk-ico { width: 22px; height: 22px; font-size: .78rem; }
.mk.dim { opacity: 0; pointer-events: none; }
.mk.task .mk-ico { border-radius: 6px; transform: rotate(45deg); }
.mk.task .mk-ico > span { transform: rotate(-45deg); }
.mk-tag { font-family: var(--f-mono); font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: var(--c); color: #fff; }
.mk.home .mk-bubble { border-color: var(--gold); }
.mk.home .mk-ico { background: var(--gold); color: #3b2600; font-family: var(--f-display); font-weight: 800; }
.mk.pulse .mk-ico { animation: mkpulse 1.6s ease-out infinite; }
@keyframes mkpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.mk.alert .mk-bubble { background: var(--bad); color: #fff; border-color: var(--bad); animation: shake 2.4s ease-in-out infinite; }
@keyframes shake { 0%, 90%, 100% { transform: none; } 93% { transform: translateX(-3px); } 96% { transform: translateX(3px); } }
.mk-place { font-size: .7rem; font-weight: 700; color: var(--ink); background: var(--panel); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); white-space: nowrap; pointer-events: none; }
.float-xp {
  position: absolute; pointer-events: none; font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.25); animation: floatup 1.4s ease-out forwards; z-index: 40;
}
@keyframes floatup { from { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -12px) scale(1.15); } to { opacity: 0; transform: translate(-50%, -70px) scale(1); } }

/* ---------------- bottom ---------------- */
.ticker {
  position: absolute; left: 50%; transform: translateX(calc(-50% - 186px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 12;
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 520px)); padding: 9px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: var(--t-sm); font-weight: 600;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#tickerText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; transition: opacity .3s; }
.ticker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.fab {
  position: absolute; z-index: 16; right: 404px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  height: 52px; padding: 0 22px 0 16px; border-radius: 999px; border: 0; display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #2e1d00; font-family: var(--f-display); font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 12px 26px -10px var(--gold), 0 2px 0 rgba(0,0,0,.15) inset;
}
.fab svg { width: 22px; height: 22px; }
.fab:hover { filter: brightness(1.05); transform: translateY(-1px); }
.sos {
  position: absolute; z-index: 16; left: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: 64px; height: 52px; border-radius: 16px; border: 0; background: var(--bad); color: #fff; font-family: var(--f-display); font-weight: 800; letter-spacing: .06em;
  box-shadow: 0 10px 22px -10px var(--bad);
}
.attribution {
  position: absolute; left: 92px; bottom: calc(env(safe-area-inset-bottom, 0px) + 2px); z-index: 11; font-size: .62rem; color: var(--ink-soft); margin: 0;
  pointer-events: auto; padding: 0 4px;
}
.attribution a { color: inherit; }
.placing {
  position: absolute; z-index: 30; left: 50%; top: 80px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--ink); color: var(--panel-solid); font-weight: 700; box-shadow: var(--shadow);
}
.text-btn { border: 0; background: rgba(255,255,255,.14); color: inherit; padding: 6px 12px; border-radius: 999px; font-weight: 700; }

/* ---------------- toasts ---------------- */
.toasts { position: absolute; z-index: 50; left: 50%; top: 76px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast {
  --c: var(--ink);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; width: 100%;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: var(--t-sm); font-weight: 600;
  animation: toastin .35s cubic-bezier(.2,.9,.3,1.2);
}
.toast .t-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); font-size: 1rem; flex: none; }
.toast .t-xp { margin-left: auto; font-family: var(--f-mono); color: var(--gold-ink); background: var(--gold-soft); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.toast.out { animation: toastout .3s forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- modal ---------------- */
.modal-scrim { position: absolute; inset: 0; z-index: 60; background: rgba(8, 20, 17, .45); display: grid; place-items: center; padding: 16px; }
.modal {
  position: relative; width: min(520px, 100%); max-height: calc(100% - 32px); overflow-y: auto; border-radius: 22px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; animation: pop .3s cubic-bezier(.2,.9,.3,1.2);
}
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal h2 { font-size: var(--t-xl); font-weight: 800; padding-right: 40px; }
.modal .sub { color: var(--ink-soft); font-size: var(--t-sm); margin-top: 4px; }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.type-btn {
  --c: var(--ink);
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; text-align: left; padding: 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: transparent;
}
.type-btn.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); }
.type-btn .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.type-btn .ico svg { width: 22px; height: 22px; }
.type-btn b { font-size: .9rem; display: block; }
.type-btn small { font-size: .72rem; color: var(--ink-soft); }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 500 .92rem var(--f-body);
}
.field textarea { height: 70px; padding: 10px 12px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-top { display: flex; gap: 14px; align-items: center; }
.profile-top .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--line); text-align: center; font-size: .66rem; font-weight: 700; }
.badge .b-ico { font-size: 1.4rem; }
.badge.locked { opacity: .4; filter: grayscale(1); }

/* ---------------- CCTV ---------------- */
.cctv {
  position: absolute; z-index: 19; left: 100px; bottom: 80px; width: 340px; border-radius: 14px; overflow: hidden;
  background: #050807; color: #d7f5e8; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.12); font-family: var(--f-mono);
}
.cctv-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; font-size: .74rem; }
.cctv-head .icon-btn { margin-left: auto; width: 28px; height: 28px; background: transparent; border-color: rgba(255,255,255,.2); color: #fff; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; animation: blink 1s infinite; }
#cctvCanvas { display: block; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; }
.cctv-foot { padding: 6px 12px 8px; font-size: .68rem; color: #9fc7b6; }

/* ---------------- loading ---------------- */
.loading { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--paper); transition: opacity .6s; }
.loading.gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; font-family: var(--f-display); font-weight: 700; color: var(--ink-soft); }
.loading .brand-mark { animation: swim 1.4s ease-in-out infinite; }
@keyframes swim { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .vit-label small { display: none; }
  .vit { padding-right: 8px; }
}
@media (max-width: 1020px) {
  .vit-label { display: none; }
  .vit { padding: 2px; }
  .ticker { display: none; }
}
@media (max-width: 760px) {
  .hud-top { flex-wrap: wrap; padding-inline: 12px; gap: 8px; }
  .brand { flex: 1; }
  .brand-text span { max-width: 44vw; }
  .vitality { order: 3; margin: 0; width: 100%; justify-content: space-between; }
  .chip-btn span { display: none; }
  .chip-btn { width: 40px; padding: 0; justify-content: center; }
  .player-info { display: none; }
  .player { padding: 4px; }
  .dock {
    top: auto; bottom: auto; left: 12px; right: 12px; transform: none; top: 112px; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 18px;
    scrollbar-width: none;
  }
  .dock::-webkit-scrollbar { display: none; }
  .dock-btn { width: 58px; flex: none; }
  .dock-sep { width: 1px; height: auto; margin: 6px 0; }
  .panel {
    left: 0; right: 0; width: auto; top: auto; bottom: 0; height: 42%; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); transition: height .35s cubic-bezier(.2,.8,.2,1);
  }
  .panel.min { height: 120px; }
  .panel.max { height: 78%; }
  .panel-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; cursor: grab; }
  .panel-head { padding: 8px 16px 10px; }
  .panel-body { padding-bottom: 24px; }
  .detail { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 60%; z-index: 25; }
  .fab { right: 14px; bottom: calc(42% + 12px); height: 48px; transition: bottom .35s; }
  .panel.min ~ .fab { bottom: 132px; }
  .sos { left: 12px; bottom: calc(42% + 12px); width: 56px; height: 48px; }
  .panel.min ~ .sos { bottom: 132px; }
  .attribution { display: none; }
  .cctv { left: 8px; right: 8px; width: auto; bottom: auto; top: 180px; }
  .toasts { top: 176px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
