/*
 * FiGGYZ Verse art-direction demos: shared HUD + brand tokens.
 * Tokens come from figgyz.com themes/development/assets/styles-static.css
 * (mirrored in figgyz_mobile_app/docs/design/mobile-proposals/brand.css).
 * Each demo page overrides the --hud-* tokens to restyle the HUD for its look.
 */
:root {
  --primary-color: #E14826;
  --primary-yellow: #FCAA1A;
  --primary-dark: #CC3530;
  --secondary-color: #585C3F;
  --background-color: #FFF8F4;
  --soft-peach: #FFF1EB;
  --soft-cream: #FEF8E7;
  --dark-navy: #263445;
  --badge-color: #5A6676;
  --verse-purple: #4B2A63;

  --title-font: 'Cherry Bomb One', 'Bubblegum Sans', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --heading-font: 'Bubblegum Sans', 'Cherry Bomb One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body-font: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* HUD theme (overridden per look) */
  --hud-bg: rgba(255, 248, 244, 0.94);
  --hud-fg: #263445;
  --hud-muted: #5A6676;
  --hud-accent: #E14826;
  --hud-accent-2: #FCAA1A;
  --hud-border: 2px solid rgba(38, 52, 69, 0.12);
  --hud-radius: 14px;
  --hud-shadow: 0 8px 22px rgba(38, 52, 69, 0.18);
  --hud-font: var(--body-font);
  --hud-title-font: var(--title-font);
  --hud-btn-bg: linear-gradient(90deg, #FCAA1A 0%, #E14826 50%, #CC3530 100%);
  --hud-btn-fg: #fff;
  --hud-btn-radius: 999px;
  --tag-bg: rgba(38, 52, 69, 0.78);
  --tag-fg: #fff;
  --tag-you-bg: #E14826;
  --tag-pet-bg: rgba(252, 170, 26, 0.92);
  --tag-pet-fg: #263445;
  --tag-font: var(--body-font);
  --tag-radius: 999px;
  --bubble-bg: #fff;
  --bubble-fg: #263445;
  --bubble-border: 2px solid #263445;
  --bubble-radius: 12px;
  --sign-bg: #263445;
  --sign-fg: #FFF8F4;
  --sign-font: var(--heading-font);
}

html, body { height: 100%; margin: 0; overflow: hidden; }
[hidden] { display: none !important; }
body { background: #263445; color: var(--hud-fg); font-family: var(--hud-font); -webkit-font-smoothing: antialiased; }
canvas.fz-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

.fz-overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fz-overlay * { box-sizing: border-box; }
.fz-world-ui { position: absolute; inset: 0; }

/* ---------- Name tags, bubbles, signs (positioned in JS) ---------- */
.fz-tag, .fz-bubble, .fz-sign {
  position: absolute; left: 0; top: 0; will-change: transform; white-space: nowrap;
}
.fz-tag {
  font: 600 11px/1 var(--tag-font); color: var(--tag-fg); background: var(--tag-bg);
  padding: 4px 8px; border-radius: var(--tag-radius); letter-spacing: 0.2px;
}
.fz-tag--you { background: var(--tag-you-bg); }
.fz-tag--pet { background: var(--tag-pet-bg); color: var(--tag-pet-fg); font-size: 10px; padding: 3px 7px; }
.fz-tag--away { opacity: 0.55; }
.fz-bubble {
  font: 500 12px/1.3 var(--hud-font); color: var(--bubble-fg); background: var(--bubble-bg);
  border: var(--bubble-border); border-radius: var(--bubble-radius); padding: 6px 10px; max-width: 220px;
  white-space: normal; width: max-content; box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  animation: fz-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fz-sign {
  font: 400 15px/1 var(--sign-font); color: var(--sign-fg); background: var(--sign-bg);
  padding: 6px 12px; border-radius: 10px; letter-spacing: 0.5px; text-transform: uppercase;
}
@keyframes fz-pop { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
/* Town Works labels over yard props */
.fz-worktag {
  position: absolute; left: 0; top: 0; will-change: transform; white-space: nowrap;
  font: 700 10px/1 var(--hud-font); color: #fff; background: rgba(27, 34, 51, 0.82); padding: 4px 7px; border-radius: 999px;
}
.fz-worktag.is-ready { background: #2E9E6A; }
.fz-worktag.is-thirsty { background: #2F7FC0; }

/* ---------- HUD panels ---------- */
.fz-card {
  background: var(--hud-bg); color: var(--hud-fg); border: var(--hud-border);
  border-radius: var(--hud-radius); box-shadow: var(--hud-shadow); pointer-events: auto;
}
.fz-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
}
.fz-brand { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; }
.fz-brand img { height: 42px; width: auto; display: block; }
.fz-brand__where { display: flex; flex-direction: column; gap: 3px; }
.fz-brand__place { font: 400 17px/1 var(--hud-title-font); letter-spacing: 0.3px; }
.fz-brand__online { font: 500 11px/1 var(--hud-font); color: var(--hud-muted); display: flex; align-items: center; gap: 6px; }
.fz-brand__online::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34C46A; box-shadow: 0 0 0 3px rgba(52,196,106,0.2); }

.fz-wallet { display: flex; gap: 8px; align-items: center; padding: 6px; }
.fz-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  font: 700 14px/1 var(--hud-font); font-variant-numeric: tabular-nums;
}
.fz-pill--points { background: var(--hud-accent); color: #fff; }
.fz-pill--points i { width: 16px; height: 16px; border-radius: 50%; background: var(--hud-accent-2); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); display: inline-block; }
.fz-pill--bag { background: transparent; color: var(--hud-fg); }
/* Gems: the Verse-only currency from Town Works (cyan diamond, never the points coin). */
.fz-pill--gems { background: #E3F6FB; color: #0E5A6E; }
.fz-pill--gems i { width: 12px; height: 12px; background: #2BB5D6; transform: rotate(45deg); border-radius: 2px; box-shadow: inset -2px -2px 0 rgba(0,0,0,0.18); display: inline-block; }
.fz-pill--carry { background: rgba(38,52,69,0.07); color: var(--hud-fg); gap: 8px; }
.fz-pill--carry small { font-size: 11px; color: var(--hud-muted); }
.fz-pill--carry[hidden] { display: none; }
.fz-res { display: inline-flex; align-items: center; gap: 4px; }
.fz-res::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--res, #999); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); }
.fz-res--wood { --res: #A86B3C; }
.fz-res--stone { --res: #8E95A3; }
.fz-res--stone::before { border-radius: 50%; }
.fz-res--crops { --res: #F2C14E; }
.fz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fz-pill--sound { border: 0; cursor: pointer; padding: 6px; background: transparent; color: var(--hud-fg); min-width: 32px; min-height: 32px; justify-content: center; }
.fz-pill--sound svg { width: 20px; height: 20px; }
.fz-pill--sound.is-off { color: var(--hud-muted); }
.fz-pill--sound:hover { background: rgba(0,0,0,0.06); }
.fz-pill--sound:focus-visible { outline: 3px solid var(--hud-accent); outline-offset: 2px; }
.fz-pill.is-bump { animation: fz-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes fz-bump { 40% { transform: scale(1.18); } }

.fz-about { position: absolute; right: 16px; top: calc(72px + env(safe-area-inset-top, 0px)); width: min(320px, calc(100vw - 32px)); padding: 14px 16px; }
.fz-about__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fz-about__num { font: 700 11px/1 var(--hud-font); letter-spacing: 1.2px; text-transform: uppercase; color: var(--hud-accent); }
.fz-about__title { font: 400 22px/1.05 var(--hud-title-font); margin: 6px 0 6px; text-wrap: balance; }
.fz-about__tag { font: 400 13px/1.45 var(--hud-font); color: var(--hud-muted); margin: 0 0 10px; }
.fz-about dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; font: 400 12px/1.4 var(--hud-font); }
.fz-about dt { font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; font-size: 10px; color: var(--hud-muted); padding-top: 2px; }
.fz-about dd { margin: 0; }
.fz-about.is-collapsed .fz-about__body { display: none; }
.fz-about__toggle { all: unset; cursor: pointer; font: 600 11px/1 var(--hud-font); color: var(--hud-muted); padding: 4px 6px; border-radius: 6px; }
.fz-about__toggle:focus-visible { outline: 2px solid var(--hud-accent); }

.fz-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.fz-missions { padding: 12px 14px; width: min(290px, 46vw); }
.fz-missions__title { font: 700 10px/1 var(--hud-font); letter-spacing: 1.2px; text-transform: uppercase; color: var(--hud-muted); margin-bottom: 8px; }
.fz-mission { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font: 500 12px/1.2 var(--hud-font); margin-top: 8px; }
.fz-mission:first-of-type { margin-top: 0; }
.fz-mission b { font-weight: 700; }
.fz-mission span { font-variant-numeric: tabular-nums; color: var(--hud-muted); }
.fz-mission__bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: rgba(38,52,69,0.12); overflow: hidden; }
.fz-mission__bar > i { display: block; height: 100%; background: var(--hud-btn-bg); border-radius: inherit; }
.fz-mission--idle { color: var(--hud-muted); }

.fz-prompt {
  position: absolute; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; cursor: pointer;
  font: 600 14px/1 var(--hud-font); white-space: nowrap; animation: fz-pop 0.25s ease;
}
.fz-key {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px;
  background: var(--hud-fg); color: var(--hud-bg); font: 700 12px/1 var(--hud-font); box-shadow: 0 2px 0 rgba(0,0,0,0.35);
}

.fz-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fz-nav__looks { display: flex; gap: 4px; padding: 5px; }
.fz-nav__looks a {
  font: 700 12px/1 var(--hud-font); color: var(--hud-fg); text-decoration: none; padding: 7px 9px; border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.fz-nav__looks a:hover, .fz-nav__looks a:focus-visible { background: rgba(38,52,69,0.08); outline: none; }
.fz-nav__looks a[aria-current='page'] { background: var(--hud-accent); color: #fff; }
.fz-nav__all { font: 700 10px/1 var(--hud-font) !important; letter-spacing: 1px; text-transform: uppercase; }
.fz-help { font: 500 11px/1.4 var(--hud-font); color: var(--hud-fg); padding: 8px 12px; text-align: right; }
.fz-help .fz-key { min-width: 20px; height: 20px; font-size: 10px; border-radius: 5px; }

/* ---------- Modal panel ---------- */
.fz-modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(20, 26, 36, 0.35); pointer-events: auto; animation: fz-fade 0.2s ease; }
@keyframes fz-fade { from { opacity: 0; } }
.fz-panel { width: min(560px, 100%); max-height: min(80vh, 680px); overflow: auto; padding: 20px 22px 22px; animation: fz-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.fz-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fz-panel__title { font: 400 28px/1 var(--hud-title-font); margin: 0; text-wrap: balance; }
.fz-panel__sub { font: 400 13px/1.4 var(--hud-font); color: var(--hud-muted); margin: 6px 0 0; }
.fz-close { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font: 700 18px/1 var(--hud-font); background: rgba(38,52,69,0.08); flex: none; }
.fz-close:focus-visible { outline: 2px solid var(--hud-accent); }
.fz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fz-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: calc(var(--hud-radius) - 4px); background: rgba(38,52,69,0.05); min-width: 0; }
.fz-item canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.fz-item__name { font: 700 13px/1.2 var(--hud-font); }
.fz-item__meta { font: 400 11px/1.35 var(--hud-font); color: var(--hud-muted); flex: 1; }
.fz-item__row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fz-price { font: 700 13px/1 var(--hud-font); color: var(--hud-accent); font-variant-numeric: tabular-nums; }
.fz-btn {
  all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 8px 14px; border-radius: var(--hud-btn-radius);
  background: var(--hud-btn-bg); background-size: 200% 100%; color: var(--hud-btn-fg); font: 700 12px/1 var(--hud-font);
  letter-spacing: 0.5px; text-transform: uppercase; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
}
.fz-btn:hover { transform: translateY(-2px) scale(1.04); }
.fz-btn:focus-visible { outline: 3px solid var(--hud-accent-2); outline-offset: 2px; }
.fz-btn[disabled] { filter: grayscale(1) opacity(0.45); cursor: not-allowed; transform: none; }
.fz-btn--ghost { background: transparent; color: var(--hud-fg); box-shadow: inset 0 0 0 2px currentColor; }
.fz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fz-chip { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(38,52,69,0.06); font: 600 12px/1 var(--hud-font); }
.fz-chip canvas { width: 26px; height: 32px; image-rendering: pixelated; }
.fz-chip .fz-photo { margin: -2px 0; }
.fz-chip[aria-pressed='true'] { background: var(--hud-accent); color: #fff; }
.fz-chip[disabled] { opacity: 0.45; cursor: not-allowed; }
.fz-chip:focus-visible { outline: 2px solid var(--hud-accent); }
.fz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.fz-stat { padding: 10px; border-radius: 10px; background: rgba(38,52,69,0.05); }
.fz-stat b { display: block; font: 700 20px/1 var(--hud-font); font-variant-numeric: tabular-nums; }
.fz-stat span { font: 500 10px/1.2 var(--hud-font); color: var(--hud-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.fz-news { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fz-news li { padding: 12px 14px; border-radius: 10px; background: rgba(38,52,69,0.05); font: 400 13px/1.45 var(--hud-font); }
.fz-news b { display: block; font: 700 13px/1.3 var(--hud-font); margin-bottom: 2px; }
.fz-h { font: 700 10px/1 var(--hud-font); letter-spacing: 1.2px; text-transform: uppercase; color: var(--hud-muted); margin: 16px 0 8px; }

/* ---------- Toasts ---------- */
.fz-toasts { position: absolute; left: 50%; top: calc(76px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.fz-toast { padding: 10px 16px; font: 600 13px/1.3 var(--hud-font); animation: fz-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); max-width: min(420px, calc(100vw - 32px)); text-align: center; }
.fz-toast b { color: var(--hud-accent); }

/* ---------- Chat + touch controls ---------- */
.fz-chat { position: absolute; left: 50%; bottom: calc(160px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); padding: 6px; display: flex; gap: 6px; }
.fz-chat input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 14px/1 var(--hud-font); color: var(--hud-fg); padding: 8px 10px; outline: none; }
.fz-joy { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.5); }
.fz-joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,0.8); }

/* ---------- Town-centre live stream ---------- */
.fz-screen-layer { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.fz-screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #0B0F16; overflow: hidden; visibility: hidden; }
.fz-screen iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
/* The player needs one click inside it before Chrome lets it play sound. */
.fz-screen.is-tap, .fz-screen.is-tap iframe { pointer-events: auto; cursor: pointer; }
.fz-screen__tap {
  display: none; position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--hud-accent); color: #fff;
  font: 700 22px/1 var(--hud-font); white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.fz-screen.is-tap .fz-screen__tap { display: block; animation: fz-tap-pulse 1.6s ease-in-out infinite; }
@keyframes fz-tap-pulse { 50% { transform: translateX(-50%) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .fz-screen.is-tap .fz-screen__tap { animation: none; } }
.fz-streamctl__hint { font: 700 11px/1.2 var(--hud-font); color: var(--hud-accent); }
.fz-streamctl__hint[hidden] { display: none; }
.fz-screen__card { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; color: #FFF8F4; font: 400 44px/1 var(--title-font); text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(225, 72, 38, 0.55), transparent 60%), linear-gradient(135deg, #263445, #4B2A63); }
.fz-screen__card span:last-child { font: 500 20px/1.2 var(--body-font); opacity: 0.85; }
.fz-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: #E14826; color: #fff; font: 700 18px/1 var(--body-font); letter-spacing: 2px; }
.fz-live::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: fz-blink 1.2s steps(2) infinite; }
.fz-live--corner { position: absolute; left: 14px; top: 14px; }
.fz-streamctl { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.fz-streamctl__label { font: 700 11px/1 var(--hud-font); letter-spacing: 1px; text-transform: uppercase; color: var(--hud-accent); }
.fz-streamctl__clock { min-width: 7.5ch; text-align: center; font: 600 13px/1 var(--hud-font); font-variant-numeric: tabular-nums; }
.fz-streamctl .fz-btn { padding: 6px 10px; font-size: 12px; }
@keyframes fz-blink { 50% { opacity: 0.2; } }
.fz-panel--wide { width: min(960px, 100%); }
.fz-video { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: calc(var(--hud-radius) - 4px); overflow: hidden; background: #0B0F16; }
.fz-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fz-video--card { display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: #FFF8F4; background: linear-gradient(135deg, #263445, #4B2A63); }
.fz-video--card p { margin: 0; max-width: 42ch; font: 400 14px/1.5 var(--hud-font); }
.fz-panel a:not(.fz-btn) { color: var(--hud-accent); }

/* ---------- House portal, house editor, avatar editor ---------- */
.fz-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.fz-links .fz-link { margin-top: 0; }
.fz-portal { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.fz-portal__card { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: calc(var(--hud-radius) - 4px); background: rgba(38,52,69,0.05); margin: 0; }
.fz-portal__card .fz-h { margin: 0; }
.fz-portal__big { font: 400 22px/1.1 var(--hud-title-font); }
.fz-code { display: flex; gap: 8px; align-items: center; }
.fz-code code { font: 700 18px/1 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: 2px; padding: 8px 10px; border-radius: 8px; background: var(--hud-bg); border: 2px dashed var(--hud-accent); }
.fz-code input { flex: 1; min-width: 0; font: 700 16px/1 ui-monospace, Menlo, monospace; letter-spacing: 2px; text-transform: uppercase; padding: 9px 10px; border-radius: 8px; border: 2px solid rgba(38,52,69,0.2); background: var(--hud-bg); color: var(--hud-fg); }
.fz-code input:focus { outline: 2px solid var(--hud-accent); }
.fz-portal__err { margin: 0; color: #CC3530; font: 600 12px/1.4 var(--hud-font); }

.fz-editor {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(900px, calc(100vw - 32px)); padding: 12px 14px; display: grid; gap: 8px; z-index: 3;
}
.fz-editor__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fz-editor__head > b { font: 400 20px/1 var(--hud-title-font); }
.fz-editor__head > span { font: 600 12px/1 var(--hud-font); color: var(--hud-muted); }
.fz-editor__head .fz-btn { margin-left: auto; }
.fz-editor__tabs { display: flex; gap: 4px; }
.fz-editor__tabs button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 8px; font: 600 12px/1 var(--hud-font); }
.fz-editor__tabs .fz-key { min-width: 18px; height: 18px; font-size: 10px; }
.fz-editor__tabs button[aria-selected='true'] { background: var(--hud-accent); color: #fff; }
.fz-editor__tabs button:focus-visible { outline: 2px solid var(--hud-accent); }
.fz-editor__hint { font: 500 12px/1.4 var(--hud-font); color: var(--hud-muted); }
.fz-editor__hint .fz-key { min-width: 20px; height: 20px; font-size: 10px; }
.fz-editor__row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.fz-edit-item { all: unset; box-sizing: border-box; cursor: pointer; flex: none; display: grid; gap: 3px; min-width: 120px; padding: 9px 11px; border-radius: 10px; background: rgba(38,52,69,0.06); font: 500 11px/1.25 var(--hud-font); color: var(--hud-muted); }
.fz-edit-item b { font: 700 12px/1.2 var(--hud-font); color: var(--hud-fg); }
.fz-edit-item--owned { box-shadow: inset 0 0 0 2px var(--hud-accent-2); }
.fz-edit-item[aria-pressed='true'], .fz-edit-item.is-current { box-shadow: inset 0 0 0 2px var(--hud-accent); }
.fz-edit-item[disabled] { opacity: 0.45; cursor: not-allowed; }
.fz-edit-item:focus-visible { outline: 2px solid var(--hud-accent); }
.fz-swatch { display: block; width: 100%; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.12); }
.fz-cursor { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fz-cursor polygon { fill: rgba(252, 170, 26, 0.18); stroke: #FCAA1A; stroke-width: 3; stroke-dasharray: 8 5; }
.fz-cursor[data-state='ok'] polygon { fill: rgba(52, 196, 106, 0.25); stroke: #34C46A; }
.fz-cursor[data-state='bad'] polygon { fill: rgba(204, 53, 48, 0.25); stroke: #CC3530; }
.fz-cursor text { font: 700 13px var(--body-font); fill: #fff; paint-order: stroke; stroke: rgba(20, 26, 36, 0.85); stroke-width: 4px; text-anchor: middle; }

.fz-avatar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; }
.fz-avatar__preview { display: grid; gap: 10px; justify-items: center; padding: 14px; border-radius: 12px; background: var(--dialog-pic-bg, rgba(225, 72, 38, 0.1)); align-content: start; }
.fz-avatar__big { width: 132px; height: 168px; image-rendering: pixelated; }
.fz-avatar__views { display: flex; gap: 4px; }
.fz-avatar__views canvas { width: 33px; height: 42px; image-rendering: pixelated; }
.fz-avatar__opts { display: grid; gap: 8px; align-content: start; }
.fz-avatar__row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; }
.fz-avatar__row > span { font: 700 10px/1.2 var(--hud-font); letter-spacing: 0.8px; text-transform: uppercase; color: var(--hud-muted); }
.fz-avatar__row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.fz-avatar__row .fz-chip { padding: 6px 10px; }
.fz-sw { all: unset; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.fz-sw[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--hud-bg), 0 0 0 4px var(--hud-accent); }
.fz-sw:focus-visible { outline: 2px solid var(--hud-accent); outline-offset: 3px; }
.fz-avatar__actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 720px) { .fz-avatar { grid-template-columns: 1fr; } .fz-avatar__row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Rooms, conversations, collection ---------- */
.fz-fade { position: absolute; inset: 0; background: var(--fade-bg, #141A24); opacity: 0; pointer-events: none; transition: opacity 0.24s ease; }
.fz-fade.is-on { opacity: 1; pointer-events: auto; }
.fz-tag--staff { background: var(--hud-accent); }
.fz-tag small { display: block; font-size: 9px; font-weight: 500; opacity: 0.85; margin-top: 2px; text-align: center; }
.fz-mission__team { grid-column: 1 / -1; font-size: 11px; color: var(--hud-muted); }
.fz-link { all: unset; cursor: pointer; display: block; margin-top: 10px; font: 700 11px/1 var(--hud-font); letter-spacing: 0.6px; text-transform: uppercase; color: var(--hud-accent); }
.fz-link:focus-visible { outline: 2px solid var(--hud-accent); outline-offset: 3px; }

.fz-dialog {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px)); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 16px 18px;
  animation: fz-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 3;
}
.fz-dialog__pic { width: 76px; height: 92px; border-radius: calc(var(--hud-radius) - 4px); background: var(--dialog-pic-bg, rgba(225, 72, 38, 0.12)); display: grid; place-items: end center; overflow: hidden; }
.fz-dialog__pic canvas { width: 66px; height: 84px; image-rendering: pixelated; }
.fz-dialog__name { font: 400 20px/1 var(--hud-title-font); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fz-dialog__name span { font: 600 11px/1 var(--hud-font); letter-spacing: 0.8px; text-transform: uppercase; color: var(--hud-accent); }
.fz-dialog__text { margin: 8px 0 0; font: 400 15px/1.5 var(--hud-font); min-height: 3em; }
.fz-dialog__choices { display: grid; gap: 6px; margin-top: 12px; }
.fz-dialog__choice { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font: 500 14px/1.2 var(--hud-font); }
.fz-dialog__choice .fz-key { min-width: 22px; height: 22px; font-size: 11px; }
.fz-dialog__choice:hover, .fz-dialog__choice.is-sel { background: rgba(225, 72, 38, 0.12); }
.fz-dialog__choice:focus-visible { outline: 2px solid var(--hud-accent); }

.fz-rarity { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 2px 6px; border-radius: 99px; background: var(--rc); color: #fff; font: 700 9px/1.2 var(--hud-font); letter-spacing: 0.5px; text-transform: uppercase; }
.fz-grid--figs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.fz-fig canvas { width: 44px; height: 56px; }
/* FiGGYZ in HUD panels are their real product photo (figure on card), never redrawn. */
.fz-photo { display: block; object-fit: contain; flex: none; filter: drop-shadow(0 2px 3px rgba(27, 34, 51, 0.25)); }
.fz-fig__status { font: 600 11px/1.2 var(--hud-font); color: #2E9E6A; }
.fz-fig__status.is-away { color: var(--hud-accent); }
.fz-grid--missions { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.fz-mcard { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: calc(var(--hud-radius) - 4px); background: rgba(38,52,69,0.05); box-shadow: inset 0 0 0 2px transparent; }
.fz-mcard canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.fz-mcard[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--hud-accent); background: rgba(225, 72, 38, 0.08); }
.fz-mcard:focus-visible { outline: 2px solid var(--hud-accent); }
.fz-odds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: center; padding: 12px; border-radius: 10px; background: rgba(38,52,69,0.05); margin-top: 4px; }
.fz-odds b { display: block; font: 700 20px/1 var(--hud-font); font-variant-numeric: tabular-nums; }
.fz-odds span { font: 500 10px/1.25 var(--hud-font); color: var(--hud-muted); text-transform: uppercase; letter-spacing: 0.5px; }

@media (max-width: 720px) {
  .fz-odds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fz-odds .fz-btn { grid-column: 1 / -1; }
  .fz-dialog__pic { width: 56px; height: 70px; }
  .fz-dialog__pic canvas { width: 48px; height: 62px; }
  .fz-brand img { height: 32px; }
  .fz-brand__place { font-size: 14px; }
  .fz-about { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .fz-help { display: none; }
  .fz-missions { width: min(240px, 56vw); padding: 10px 12px; }
  .fz-nav__looks a { padding: 7px 6px; }
  .fz-prompt { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .fz-bubble, .fz-prompt, .fz-panel, .fz-toast, .fz-modal { animation: none; }
}

/* house editor: expand tab (a floor plan with a push button on each side) */
.fz-cursor polygon.fz-cursor__grow { fill: rgba(91, 209, 232, 0.22); stroke: #5BD1E8; stroke-dasharray: 8 6; }
.fz-grow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) minmax(0, 1fr); grid-template-areas: '. back .' 'left plan right' '. front .'; gap: 8px; align-items: center; justify-items: center; }
.fz-grow__btn--back { grid-area: back; } .fz-grow__btn--front { grid-area: front; }
.fz-grow__btn--left { grid-area: left; justify-self: end; } .fz-grow__btn--right { grid-area: right; justify-self: start; }
.fz-grow__btn[disabled] { opacity: 0.45; cursor: default; }
.fz-grow__plan { grid-area: plan; position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 34 / 22; border-radius: 8px; background: rgba(38,52,69,0.06); box-shadow: inset 0 0 0 2px rgba(38,52,69,0.12); }
.fz-grow__plan i { position: absolute; border-radius: 4px; background: #E9C58F; box-shadow: inset 0 0 0 3px var(--hud-accent); }
.fz-grow__plan span { position: relative; font: 700 13px/1 var(--hud-font); color: var(--hud-fg); }

/* character view */
.fz-char__tabs { margin-bottom: 12px; }
.fz-char__pet { width: 144px; height: 128px; }
.fz-char__name { font: 400 20px/1 var(--hud-title-font); }
.fz-char__species { display: flex; flex-wrap: wrap; gap: 6px; }
.fz-char__sp { min-width: 0; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.fz-char__sp canvas { grid-row: span 2; width: 36px; height: 32px; image-rendering: pixelated; }
.fz-char__sp[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--hud-accent); background: rgba(225, 72, 38, 0.08); }
.fz-char__cost { margin-right: auto; font: 600 12px/1.2 var(--hud-font); color: var(--hud-muted); }
.fz-input { width: min(100%, 240px); font: 600 15px/1 var(--hud-font); padding: 9px 10px; border-radius: 8px; border: 2px solid rgba(38,52,69,0.2); background: var(--hud-bg); color: var(--hud-fg); }
.fz-input:focus { outline: 2px solid var(--hud-accent); }
.fz-avatar__row > label { font: 700 10px/1.2 var(--hud-font); letter-spacing: 0.5px; text-transform: uppercase; color: var(--hud-muted); }

/* house editor: on-screen actions (touch and mouse) */
.fz-editor__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fz-editor__acts .fz-btn { padding: 8px 12px; }

/* ---------- Phones and small screens: keep the world visible ----------
 * The HUD shrinks to a top strip (logo + points) and a bottom strip (missions
 * summary + links, look switcher). Keyboard help and the design notes card are
 * hidden; panels and the house editor become sheets from the bottom. */
@media (max-width: 720px), (max-height: 520px) {
  .fz-top { padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 0; gap: 6px; }
  .fz-brand { padding: 5px 10px 5px 6px; gap: 8px; }
  .fz-brand img { height: 28px; }
  .fz-brand__place { font-size: 13px; }
  .fz-brand__online { font-size: 10px; }
  .fz-wallet { padding: 4px; gap: 4px; }
  .fz-pill { padding: 6px 9px; font-size: 12px; }
  .fz-about, .fz-help { display: none; }
  .fz-bottom { padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; align-items: flex-end; }
  .fz-missions { width: auto; max-width: 58vw; padding: 8px 10px; }
  .fz-missions__title { margin-bottom: 4px; }
  .fz-mission { font-size: 11px; }
  .fz-mission ~ .fz-mission { display: none; } /* one running mission is enough on a phone */
  .fz-links { gap: 4px 10px; }
  .fz-nav { gap: 6px; }
  .fz-nav__looks { padding: 3px; gap: 2px; }
  .fz-nav__looks a { padding: 6px 7px; font-size: 11px; }
  .fz-streamctl { padding: 5px 6px; gap: 5px; }
  .fz-streamctl__label { display: none; }
  .fz-streamctl .fz-key { display: none; }
  .fz-prompt { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
  .fz-toasts { top: calc(56px + env(safe-area-inset-top, 0px)); }
  .fz-chat { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .fz-modal { place-items: end center; padding: 0; }
  .fz-panel { width: 100%; max-height: 86vh; max-height: 86dvh; border-radius: var(--hud-radius) var(--hud-radius) 0 0; padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .fz-panel__title { font-size: 22px; }
  .fz-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .fz-avatar { grid-template-columns: 1fr; }
  .fz-avatar__row { grid-template-columns: 1fr; gap: 4px; }
  .fz-portal { grid-template-columns: 1fr; }
  .fz-editor { left: 0; right: 0; bottom: 0; transform: none; width: auto; max-height: 46vh; max-height: 46dvh; overflow: auto; border-radius: var(--hud-radius) var(--hud-radius) 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .fz-editor__hint { display: none; }
  .fz-grow { grid-template-columns: 1fr 1fr; grid-template-areas: 'back back' 'plan plan' 'left right' 'front front'; }
  .fz-grow__btn--left, .fz-grow__btn--right { justify-self: stretch; }
}
/* touch screens: no keyboard, so hide key hints everywhere they'd mislead */
@media (pointer: coarse) {
  .fz-help, .fz-editor__hint, .fz-prompt .fz-key, .fz-editor__tabs .fz-key { display: none; }
}
.fz-editor__holding { align-self: center; font: 600 12px/1 var(--hud-font); margin-right: 4px; }

/* ---------- Town Works panel ---------- */
.fz-works { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fz-works__card { background: rgba(38,52,69,0.05); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fz-works__card--wide { grid-column: 1 / -1; }
.fz-works__card h3 { margin: 0; font: 700 15px/1.2 var(--hud-font); }
.fz-works__card p { margin: 0; font: 500 13px/1.4 var(--hud-font); }
.fz-works__need { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; font: 600 12px/1 var(--hud-font); }
.fz-works__bar { height: 8px; border-radius: 4px; background: rgba(38,52,69,0.12); overflow: hidden; }
.fz-works__bar i { display: block; height: 100%; background: #2E9E6A; border-radius: 4px; }
.fz-works__rates { color: var(--hud-muted); font-size: 12px !important; }
.fz-works__built { display: inline-block; padding: 4px 10px; margin: 0 4px 4px 0; border-radius: 999px; background: #2E9E6A; color: #fff; font: 700 12px/1 var(--hud-font); }
.fz-works .fz-btn { align-self: flex-start; }
@media (max-width: 720px) { .fz-works { grid-template-columns: 1fr; } }

/* ---------- Push-to-talk ---------- */
.fz-voice { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; max-width: min(360px, 92vw); }
.fz-ptt {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 10px;
  border: 0; border-radius: 999px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  font: 700 13px/1 var(--hud-font); background: var(--hud-fg); color: #fff;
}
.fz-ptt svg { width: 20px; height: 20px; flex: none; }
.fz-ptt:focus-visible { outline: 3px solid var(--hud-accent); outline-offset: 2px; }
.fz-ptt.is-talking { background: var(--hud-accent); box-shadow: 0 0 0 4px rgba(225, 72, 38, 0.25); }
.fz-ptt.is-off { background: transparent; color: var(--hud-muted); box-shadow: inset 0 0 0 2px currentColor; }
.fz-voice__meter { width: 6px; height: 28px; border-radius: 3px; background: rgba(0,0,0,0.1); position: relative; overflow: hidden; flex: none; }
.fz-voice__meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #34C46A; transition: height 60ms linear; }
.fz-voice__who { display: flex; flex-wrap: wrap; gap: 4px 8px; font: 600 11px/1.2 var(--hud-font); color: var(--hud-muted); min-width: 0; }
.fz-voice__who span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fz-voice__who span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,0.2); }
.fz-voice__who span.is-talking { color: var(--hud-fg); }
.fz-voice__who span.is-talking::before { background: #34C46A; box-shadow: 0 0 0 3px rgba(52,196,106,0.3); }
.fz-tag.is-talking { box-shadow: 0 0 0 3px #34C46A; }
@media (max-width: 720px), (max-height: 520px) {
  .fz-voice { padding: 4px; gap: 6px; }
  .fz-ptt { min-height: 48px; min-width: 48px; padding: 0 12px; }
  .fz-voice__who { display: none; }
}
@media (pointer: coarse) { .fz-ptt .fz-key { display: none; } }
/* narrow phones: the bag count lives in the collection panel; keep the wallet to one row */
@media (max-width: 420px) { .fz-pill--bag { display: none; } .fz-pill--carry small { display: none; } }
