/* ============================================================
   BrasiliaLivre — interface (tema muda com o lado escolhido)
   ============================================================ */
@font-face { font-family: 'Teko'; src: url('/assets/fonts/teko.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  /* Tema base: urbano / preto — neutro antes de escolher o lado */
  --bg: #161618;
  --bg2: #09090b;
  --panel: rgba(24, 24, 28, 0.94);
  --panel-2: rgba(34, 34, 40, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.07);
  --primary: #f4f4f5;
  --primary-ink: #09090b;
  --accent: #71717a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --danger: #f87171;
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body[data-side="verde"] {
  --line: rgba(234, 179, 8, 0.14);
  --primary: #facc15;
  --primary-ink: #0c0a09;
  --accent: #a3a3a3;
}
body[data-side="vermelho"] {
  --bg: #2a1013;
  --bg2: #1a090b;
  --panel: rgba(38, 14, 17, 0.94);
  --panel-2: rgba(56, 20, 24, 0.92);
  --line: rgba(227, 38, 47, 0.28);
  --primary: #e3262f;
  --primary-ink: #ffffff;
  --accent: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg2); color: var(--text); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: 11px; font-family: var(--font); text-align: center; }

#game {
  position: fixed; inset: 0; width: 100vw; height: 100vh; display: block;
  touch-action: none; outline: none; background: var(--bg2);
}

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); line-height: .8; user-select: none; }
.logo b { font-size: 30px; letter-spacing: 1px; color: var(--text); }
.logo em { font-style: normal; font-size: 30px; color: var(--primary); letter-spacing: 1px; }
.logo-bars { display: inline-flex; gap: 3px; transform: skewX(-14deg); }
.logo-bars i { width: 6px; height: 26px; background: var(--primary); border-radius: 2px; }
.logo-bars i:last-child { background: var(--accent); }
.logo.big b, .logo.big em { font-size: 54px; }
.logo.big .logo-bars i { width: 10px; height: 46px; }

.logo-img { display: block; height: 34px; width: auto; max-width: 100%; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.logo-img.big { height: auto; width: min(560px, 86vw); margin: 0 auto; }
.topbar .logo-img { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 38px; z-index: 1; }

/* ---------- telas ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 28px; z-index: 20; background: radial-gradient(120% 90% at 30% 20%, rgba(0,0,0,.15), rgba(0,0,0,.62)); }
#boot {
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 70% at 50% 15%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 95%, rgba(99, 102, 241, 0.08), transparent 50%),
    linear-gradient(180deg, #121214 0%, #09090b 100%);
  opacity: 1;
  transition: opacity .35s ease;
}
#boot.boot-out { opacity: 0; pointer-events: none; }
.boot-card {
  position: relative;
  text-align: center;
  width: min(480px, 90vw);
  padding: 36px 28px 28px;
  border-radius: 28px;
  background: linear-gradient(165deg, rgba(39, 39, 42, 0.72) 0%, rgba(9, 9, 11, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 28px 64px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.boot-kicker {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
}
.boot-card .logo-img.big { width: min(340px, 72vw); height: auto; margin: 0 auto; }
.boot-progress { margin: 28px auto 0; width: min(280px, 100%); }
.boot-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #52525b, var(--primary));
  transition: width .35s cubic-bezier(.22, 1, .36, 1);
}
#bootText {
  margin: 14px 0 0;
  color: color-mix(in srgb, var(--muted) 90%, #fff);
  font-size: 13px;
  min-height: 1.2em;
}
.boot-credit { margin: 22px 0 0; font-size: 11px; color: var(--muted); opacity: 0.7; }
.boot-credit b { color: color-mix(in srgb, var(--primary) 75%, #fff); font-weight: 700; }

.login-foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-online {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45);
  animation: onlinePulse 1.6s ease-out infinite;
}
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.login-sides {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.login-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.login-side b { color: var(--text); font-variant-numeric: tabular-nums; }
.login-side i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.login-side.verde i {
  background: linear-gradient(135deg, #169b45 45%, #f7d417 45%);
}
.login-side.vermelho i { background: #e3262f; }
.login-credit { margin: 0; font-size: 11px; color: var(--muted); opacity: 0.85; }
.login-credit b { color: color-mix(in srgb, var(--primary) 75%, #fff); font-weight: 700; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.45); backdrop-filter: blur(10px); }
.headline { font-family: var(--display); font-weight: 800; font-size: 42px; line-height: 1.05; margin: 10px 0 14px; letter-spacing: -0.03em; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 2.5px; color: var(--primary); font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.fine { color: var(--muted); font-size: 11px; opacity: .8; margin: 10px 0 0; }
.center { text-align: center; }
.err { color: var(--danger); min-height: 18px; font-size: 13px; margin: 4px 0; }

/* ---------- login moderno ---------- */
#login.screen {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(63, 63, 70, 0.35), transparent 50%),
    linear-gradient(180deg, rgba(9, 9, 11, 0.55), rgba(9, 9, 11, 0.92));
}
.login-card {
  position: relative;
  width: min(420px, 94vw);
  padding: 28px 28px 22px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(39, 39, 42, 0.88) 0%, rgba(9, 9, 11, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  animation: loginIn .55s cubic-bezier(.22, 1, .36, 1) both;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}
.login-brand { margin: 0 0 4px; }
.login-card .logo-img {
  height: auto;
  width: min(100%, 280px);
  margin: 0 auto 10px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
}
.login-kicker {
  margin: 0 0 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
}
.login-card .headline {
  text-align: center;
  font-size: clamp(34px, 8vw, 44px);
  margin: 0 0 10px;
  letter-spacing: 0.4px;
}
.login-lead {
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 20px;
  color: color-mix(in srgb, var(--muted) 92%, #fff);
}
.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: color-mix(in srgb, var(--muted) 85%, #fff);
  margin: 12px 0 0;
  text-transform: uppercase;
}
.login-card input,
#nick,
.sheet input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.login-card input::placeholder { color: rgba(182, 185, 168, 0.45); }
.login-card input:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.07); }
.login-card input:focus,
#nick:focus,
.sheet input:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, transparent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.login-card .only-criar { display: none; }
.login-card.criar .only-criar { display: block; }
.login-card .err { margin: 10px 0 2px; text-align: center; }

.login-card .tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.login-card .tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.login-card .tab:hover { color: var(--text); }
.login-card .tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 2px;
  color: rgba(182, 185, 168, 0.55);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.login-card .btn.wide { margin-top: 14px; }
.login-card .btn.primary.wide {
  padding: 15px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 28%, transparent);
}
.login-card .btn.ghost.wide {
  margin-top: 8px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.12);
}
.login-card .btn.ghost.wide:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  filter: none;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
}

.tabs { display: flex; gap: 6px; margin: 18px 0 6px; }
.tab { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.tab.active { background: var(--panel-2); color: var(--text); border-color: var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 14px; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border: 0; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.wide { width: 100%; justify-content: space-between; margin-top: 12px; padding: 16px 18px; }
.btn.ghost.wide { justify-content: center; }
.btn.small { padding: 8px 12px; font-size: 13px; }

/* ---------- montar personagem (centralizado na tela) ---------- */
#creator.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2.5vw, 32px);
  overflow: auto;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    radial-gradient(ellipse 90% 60% at 80% 100%, rgba(0, 0, 0, 0.35), transparent 50%);
}
.creator-shell {
  display: grid;
  grid-template-columns: minmax(340px, 1.25fr) min(440px, 42vw);
  align-items: stretch;
  gap: clamp(16px, 2vw, 28px);
  width: min(1280px, 97vw);
  max-height: min(94vh, 820px);
  margin: 0 auto;
  animation: creatorIn .55s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes creatorIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.avatar-stage {
  position: relative;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: min(94vh, 820px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(ellipse at 50% 62%, rgba(48, 48, 52, 0.98), rgba(9, 9, 11, 0.99) 74%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 80px color-mix(in srgb, var(--accent) 8%, transparent);
}
.stage-heading {
  position: absolute;
  top: clamp(20px, 2.5vw, 32px);
  left: clamp(22px, 3vw, 36px);
  z-index: 1;
  pointer-events: none;
  max-width: min(560px, 92%);
}
.stage-heading .eyebrow { font-size: 11px; letter-spacing: 2.8px; opacity: 0.92; }
.stage-heading .headline {
  font-size: clamp(28px, 3.2vw, 44px);
  margin: 10px 0 8px;
  letter-spacing: -0.6px;
  text-transform: none;
  line-height: 1.04;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.stage-heading > p:last-child {
  margin: 0;
  color: #d4e0cb;
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.5;
  max-width: 28em;
}
#character-preview {
  display: block;
  width: 100%;
  min-height: 320px;
  margin-top: clamp(88px, 12vh, 120px);
  height: calc(100% - clamp(150px, 18vh, 180px));
  touch-action: none;
  cursor: grab;
  outline: none;
}
#character-preview:active { cursor: grabbing; }
.preview-tools {
  position: absolute;
  bottom: clamp(36px, 4vh, 48px);
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(8, 18, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.preview-tools button {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: background .15s, transform .08s, border-color .15s;
}
.preview-tools button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.preview-tools button:active { transform: scale(0.97); }
.preview-poses { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.preview-poses [aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--primary) 35%, transparent);
}
.preview-hint {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #c8d4bf;
  margin: 0;
  pointer-events: none;
  opacity: 0.85;
}
.preview-hint span { padding: 0 5px; }
.pill { padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.28); font-weight: 600; font-size: 14px; }
.pill.active { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.form-panel, .glass-panel {
  width: 100%;
  max-height: min(94vh, 820px);
  padding: clamp(18px, 2vw, 26px) clamp(18px, 2.2vw, 28px) clamp(16px, 1.8vw, 22px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(168deg, rgba(39, 39, 42, 0.94), rgba(9, 9, 11, 0.97));
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow: 0 24px 56px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.08) inset;
  overflow: hidden;
}
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.12); color: var(--muted); background: rgba(255,255,255,.06); white-space: nowrap; font-weight: 600; }
.form-panel h2 { font-size: clamp(24px, 2.4vw, 30px); margin: 10px 0 4px; line-height: 1.12; letter-spacing: -0.3px; }
.form-panel > .muted { font-size: clamp(13px, 1.1vw, 15px); margin: 0 0 10px; line-height: 1.45; color: color-mix(in srgb, var(--muted) 70%, #fff); }
.form-panel h3 { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin: 14px 0 8px; font-weight: 800; }
.form-panel .btn.wide { margin-top: 12px; padding: clamp(14px, 1.5vw, 18px) clamp(16px, 2vw, 22px); font-size: clamp(15px, 1.2vw, 17px); border-radius: 14px; font-weight: 800; }
.form-panel .btn.primary.wide { box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 32%, transparent); }
.form-panel .fine.center { margin-top: 10px; font-size: 11px; }
.scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; max-height: min(48vh, 380px); padding-right: 8px; margin-right: -8px; }
#creator #nick { padding: 16px 18px; font-size: 15px; border-radius: 14px; margin-top: 8px; }
.scroll::-webkit-scrollbar { width: 6px; } .scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-card { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); text-align: left; transition: border-color .15s, background .15s, transform .08s; }
.side-card:hover { background: rgba(255,255,255,.09); transform: translateY(-1px); }
.side-card.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); box-shadow: 0 4px 24px color-mix(in srgb, var(--primary) 15%, transparent); }
.side-card b { display: block; font-size: 17px; font-weight: 800; } .side-card small { color: var(--muted); font-size: 13px; margin-top: 2px; display: block; }
.side-flag { width: 46px; height: 30px; border-radius: 6px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.side-flag.verde { background: linear-gradient(135deg, #169b45 0 30%, #f7d417 30% 70%, #169b45 70%); }
.side-flag.vermelho { background: #d3141c; position: relative; }
.side-flag.vermelho::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 16px; }
.bodies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.body-card { padding: 10px 8px 10px; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); font-size: 12px; font-weight: 700; transition: border-color .15s, background .15s, transform .08s; }
.body-card:hover { background: rgba(255,255,255,.08); }
.body-card .face { display: block; height: 72px; margin-bottom: 6px; border-radius: 12px; background-color: #2b3a31; background-size: 300% auto; background-position: 50% 4%; background-repeat: no-repeat; }
.body-card.active { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: 0 4px 20px color-mix(in srgb, var(--primary) 12%, transparent); }

/* editor de visual com abas */
.look-host { margin-top: 4px; }
.look-tabs {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 12px;
  border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08);
  overflow-x: auto; scrollbar-width: none;
}
.look-tabs::-webkit-scrollbar { display: none; }
.look-tab {
  touch-action: manipulation;
  flex: 1 0 auto; min-width: 64px; padding: 8px 8px 7px; border: 0; border-radius: 11px;
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background .15s, color .15s;
}
.look-tab-emoji { font-size: 16px; line-height: 1; }
.look-tab:hover { color: var(--text); }
.look-tab.active {
  background: rgba(255,255,255,.12); color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset;
}
.look-panel {
  min-height: 88px; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.look-hint { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.opt-group h4 { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches.big { gap: 10px; }
.swatch { touch-action: manipulation; width: 54px; text-align: center; font-size: 10px; color: var(--muted); background: none; border: 0; padding: 0; }
.swatches.big .swatch { width: 64px; }
.swatch i { display: block; width: 46px; height: 46px; margin: 0 auto 4px; border-radius: 12px; border: 2px solid rgba(255,255,255,.12); background-size: cover; background-position: center; transition: border-color .15s, transform .12s; }
.swatches.big .swatch i { width: 56px; height: 56px; }
.swatch.round i { border-radius: 50%; width: 38px; height: 38px; }
.swatches.big .swatch.round i { width: 44px; height: 44px; }
.swatch:hover i { transform: scale(1.06); }
.swatch.active i { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent); }
.swatch.active { color: var(--text); }
.swatch span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.big { gap: 8px; }
.chips button { touch-action: manipulation; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); font-size: 13px; font-weight: 600; }
.chips.big button { padding: 10px 16px; font-size: 14px; }
.chips button.active { background: var(--primary); color: var(--primary-ink); border-color: transparent; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#hud .hint, #hud .hud-info, #hud .toast, #hud .telao-hint { pointer-events: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: flex-end; padding: 12px 18px; pointer-events: none; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.topbar > * { pointer-events: auto; }
.top-right { display: flex; gap: 8px; align-items: center; }
.icon { min-width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); font-size: 16px; padding: 0 10px; }
.icon.small { min-width: 28px; height: 28px; font-size: 13px; border-radius: 8px; padding: 0 6px; }
.icon.wide { font-size: 13px; font-weight: 600; }
.count { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); font-weight: 700; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.verde { background: linear-gradient(135deg, #169b45 50%, #f7d417 50%); }
.dot.vermelho { background: #e3262f; margin-left: 6px; }

.hud-info {
  position: absolute;
  top: calc(104px + env(safe-area-inset-top, 0px));
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  z-index: 5;
  max-width: min(340px, 88vw);
  pointer-events: none;
}
.hud-info > * { pointer-events: auto; }
.hud-info .where,
.hud-info .points-pill,
.hud-info .nowplaying {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  max-width: 100%;
}

.where { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.where b { font-size: 12px; letter-spacing: 2px; color: var(--primary); }
.where span { font-size: 12px; color: var(--muted); }
.nowplaying { padding: 10px 14px; font-size: 13px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowplaying b { color: var(--primary); }
.minimap { position: absolute; left: 16px; bottom: calc(16px + var(--safe-b)); padding: 10px; width: 200px; }
.mm-head, .mm-foot { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.mm-head b { color: var(--text); }
#minimap { display: block; width: 180px; height: 180px; margin: 6px 0; border-radius: 8px; background: #1f3a26; }
.chat { position: absolute; right: 16px; bottom: calc(16px + var(--safe-b)); width: 330px; display: flex; flex-direction: column; max-height: 46vh; }
.chat.min .chat-tabs, .chat.min .chat-log, .chat.min .chat-input { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 13px; }
.chat-tabs { display: flex; gap: 6px; align-items: center; padding: 0 12px 6px; border-bottom: 1px solid var(--line-2); }
.chat-tabs .tab { flex: none; padding: 5px 10px; font-size: 12px; }
.live { margin-left: auto; font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 12px; font-size: 13px; line-height: 1.35; min-height: 120px; }
.chat-log p { margin: 0 0 6px; word-wrap: break-word; }
.chat-log b { margin-right: 6px; }
.chat-log b.verde { color: #facc15; } .chat-log b.vermelho { color: #ff6b70; }
.chat-log .near { font-size: 9px; padding: 1px 4px; border-radius: 4px; background: rgba(255,255,255,.12); margin-right: 4px; vertical-align: middle; }
.chat-log .sys { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line-2); }
.chat-input input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); outline: none; min-width: 0; }
.chat-input button { width: 40px; border-radius: 10px; border: 0; background: var(--primary); color: var(--primary-ink); }
.look-lock-badge {
  position: absolute; left: 50%; top: 70px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.22); color: #fff;
  text-shadow: 0 1px 2px #000; z-index: 12; pointer-events: none; white-space: nowrap;
}
body.look-locked #game { cursor: none; }

/* ---------- dock macOS: escondido, sobe no hover ---------- */
.dock-zone {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: calc(44px + var(--safe-b));
  z-index: 12;
  pointer-events: auto;
  transition: height .25s ease;
}
.dock-zone.open,
.dock-zone:hover,
.dock-zone:focus-within {
  /* cobre o painel aberto pra não sumir ao mover o mouse nos botões */
  height: min(210px, 42vh);
}
.dock-panel {
  position: absolute;
  left: 50%;
  bottom: calc(10px + var(--safe-b));
  transform: translate(-50%, calc(100% + 24px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition:
    transform .4s cubic-bezier(.22, 1, .36, 1),
    opacity .28s ease;
  will-change: transform, opacity;
}
.dock-zone.open .dock-panel,
.dock-zone:hover .dock-panel,
.dock-zone:focus-within .dock-panel {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.dock-peek {
  position: absolute;
  left: 50%;
  bottom: calc(8px + var(--safe-b));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: min(280px, 88vw);
  padding: 7px 16px 8px;
  border-radius: 999px;
  background: rgba(8, 14, 12, 0.82);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.2) inset;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  white-space: nowrap;
}
.dock-peek::before {
  content: '↑';
  font-size: 12px;
  opacity: 0.9;
}
.dock-zone.open .dock-peek,
.dock-zone:hover .dock-peek,
.dock-zone:focus-within .dock-peek {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.hint {
  position: relative; left: auto; bottom: auto; transform: none;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap;
  background: rgba(8, 14, 12, 0.88);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
}
.hint kbd {
  min-width: 18px; padding: 2px 6px; margin: 0 1px;
  border-radius: 6px; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}
.hint-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,.35); flex: none;
}

.actionbar.dock {
  --dock-s: 1;
  position: relative; left: auto; bottom: auto; transform: none;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 2px; padding: 10px 14px 12px;
  max-width: calc(100vw - 36px);
  overflow: visible;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 40%, rgba(0,0,0,0.22) 100%),
    rgba(8, 14, 12, 0.88);
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.25) inset,
    0 18px 50px rgba(0,0,0,0.45),
    0 2px 0 rgba(255,255,255,0.08) inset;
  backdrop-filter: blur(28px) saturate(1.55);
  -webkit-backdrop-filter: blur(28px) saturate(1.55);
}
.actionbar.dock::before {
  content: '';
  position: absolute; left: 12%; right: 12%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  pointer-events: none;
}
.actionbar::-webkit-scrollbar { display: none; }
.act {
  --dock-s: 1;
  --dock-y: 0px;
  position: relative;
  flex: none;
  width: 58px;
  height: 62px;
  padding: 0 2px 2px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(245, 245, 240, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transform: translate3d(0, var(--dock-y), 0) scale(var(--dock-s));
  transform-origin: 50% 100%;
  transition: transform .08s ease-out, color .15s, filter .15s;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.act .dock-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 22px;
  line-height: 1;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.22), rgba(255,255,255,0.05) 45%, rgba(0,0,0,0.18)),
    rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.28),
    0 1px 0 rgba(255,255,255,0.18) inset;
}
.act .dock-label {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.62);
  font-size: 9px;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.act small {
  position: absolute; top: 0; right: 2px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 8px; font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 2;
}
.act .dock-lock {
  display: none;
  position: absolute; top: 16px; right: 2px;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
  z-index: 2;
}
.act:hover .dock-label,
.act.active .dock-label { color: #fff; }
.act.active .dock-ico {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 92%, #fff), color-mix(in srgb, var(--primary) 70%, #000));
  border-color: color-mix(in srgb, var(--primary) 70%, #fff);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent),
    0 8px 18px color-mix(in srgb, var(--primary) 35%, transparent),
    0 1px 0 rgba(255,255,255,0.35) inset;
}
.act.locked { opacity: 0.78; }
.act.locked .dock-lock { display: block; }
.act.locked .dock-ico { filter: saturate(0.75) brightness(0.95); }
.act:disabled { opacity: 0.4; cursor: default; }
.act:disabled .dock-ico { filter: grayscale(0.5); }
.act-sep {
  width: 1px; align-self: stretch;
  margin: 10px 6px 18px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.28), transparent);
  flex: none;
}
@media (pointer: coarse) {
  .act { width: 54px; height: 60px; }
  .act .dock-ico { width: 40px; height: 40px; border-radius: 13px; font-size: 20px; }
  .act .dock-label { font-size: 8px; }
  .dock-zone { height: calc(40px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  .act { transition: none; }
  .dock-panel { transition: none; }
}
.voice-pill { position: absolute; right: 16px; top: 70px; padding: 8px; display: flex; gap: 6px; }
.voice-pill .on { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
#globalSheets { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
#globalSheets .sheet { pointer-events: auto; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50; }
.sheet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 94vw); max-height: 80vh; display: flex; flex-direction: column; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.5); z-index: 30; }
.sheet.glass-sheet {
  background: linear-gradient(165deg, rgba(39, 39, 42, 0.92), rgba(9, 9, 11, 0.96));
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 22px;
  width: min(520px, 94vw);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.row { display: flex; gap: 8px; } .row input { margin: 0; }
.music-quick {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px;
}
.mq {
  padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07); font-size: 13px; font-weight: 700; color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
}
.mq:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.mq:active { transform: scale(0.97); }
.music-search {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.music-search input {
  flex: 1; min-width: 0; margin: 0; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); outline: none;
}
.music-search input:focus {
  border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.music-search .btn { border-radius: 14px; padding: 0 18px; }
.music-foot { margin-top: 10px; }
.yt-results { overflow-y: auto; max-height: 42vh; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.yt-item {
  display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); text-align: left;
  transition: background .15s, border-color .15s;
}
.yt-item:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.yt-item img { width: 88px; height: 50px; object-fit: cover; border-radius: 8px; flex: none; background: #000; }
.yt-item b { display: block; font-size: 13px; font-weight: 600; } .yt-item small { color: var(--muted); font-size: 11px; }
.nowplaying { cursor: pointer; pointer-events: auto !important; }
.nowplaying:hover { filter: brightness(1.08); }
.help { margin: 0; padding-left: 18px; line-height: 1.9; font-size: 14px; }
.toast { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; opacity: 0; transition: opacity .25s; z-index: 40; }
.toast.show { opacity: 1; }

/* ---------- carrinho / pontos / PIX ---------- */
.points-pill {
  padding: 8px 12px; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.points-pill b { font-size: 16px; }
.interact-hint {
  position: absolute; left: 50%; bottom: calc(56px + var(--safe-b)); transform: translateX(-50%);
  padding: 10px 16px; border-radius: 14px;
  background: rgba(16, 22, 20, 0.5); border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-size: 14px; z-index: 8; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  color: inherit; font: inherit; cursor: pointer;
}
.interact-hint kbd { margin-right: 6px; }
.cart-stats { display: flex; gap: 16px; margin: 8px 0 14px; font-size: 13px; color: var(--muted); }
.cart-stats b { color: var(--primary); }
.cart-actions { display: flex; flex-direction: column; gap: 8px; }
.cart-actions .btn { justify-content: space-between; }
.cart-redeem { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.cart-redeem h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.cart-redeem-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cart-redeem-btns .btn { flex: 1 1 40%; min-width: 120px; }


/* Modal PIX à direita na montagem do personagem (não cobre o boneco 3D) */
body:has(#creator:not(.hidden)) #globalSheets .shop-sheet,
body:has(#creator:not(.hidden)) #globalSheets #cartSheet {
  left: auto;
  right: clamp(14px, 2.5vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  max-height: min(90vh, 780px);
  overflow-y: auto;
}
@media (max-width: 1100px) {
  body:has(#creator:not(.hidden)) #globalSheets .shop-sheet,
  body:has(#creator:not(.hidden)) #globalSheets #cartSheet {
    right: 10px;
    width: min(380px, calc(100vw - 20px));
  }
}
@media (max-width: 900px), (pointer: coarse) {
  body:has(#creator:not(.hidden)) #globalSheets .shop-sheet {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(10px + var(--safe-b, 0px));
    transform: none;
    width: auto;
    max-height: min(58vh, 520px);
  }
}

/* ---------- loja PIX (modal) ---------- */
.shop-sheet {
  width: min(440px, 94vw);
  padding: 22px 22px 20px;
  border-radius: 24px;
}
.shop-sheet-head { align-items: flex-start; margin-bottom: 4px; }
.shop-sheet-titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shop-sheet-head b { font-size: 18px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.shop-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.shop-close { flex: none; margin-top: 2px; }
.shop-price-wrap {
  margin: 16px 0 10px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.shop-price-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.shop-sheet .shop-price {
  font-family: var(--display);
  font-size: clamp(40px, 10vw, 52px);
  font-weight: 800;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}
body[data-side="vermelho"] .shop-sheet .shop-price { color: #fca5a5; }
.shop-hint { font-size: 13px; line-height: 1.45; margin: 0 0 16px; }
.shop-form { display: flex; flex-direction: column; gap: 10px; }
.shop-pay-cta {
  margin-top: 4px;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--primary) 28%, transparent);
}
.shop-auto-note { margin: 4px 0 0; opacity: 0.65; font-size: 10px; }
.shop-pix .pix-box { margin-top: 4px; }
.shop-pix .pix-lead { margin: 0 0 10px; font-size: 13px; }
.shop-pix textarea,
#shopQr,
#adPixCode {
  display: block; width: 100%; margin: 0 0 10px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(0, 0, 0, 0.55);
  color: #ffffff; -webkit-text-fill-color: #ffffff; caret-color: #ffffff;
  font-size: 11px; line-height: 1.45; font-family: ui-monospace, monospace;
  resize: none; outline: none;
}
.shop-pix textarea::selection,
#shopQr::selection,
#adPixCode::selection { background: rgba(255, 255, 255, 0.28); color: #fff; }
.shop-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.pix-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #22d3ee;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5);
  animation: onlinePulse 1.6s ease-out infinite;
}

.shop-price { font-family: var(--display); font-size: 42px; margin: 4px 0 8px; color: var(--primary); line-height: 1; }
.pix-box { text-align: center; }
#shopQrImg, #adQrImg { width: 220px; height: 220px; margin: 8px auto; border-radius: 12px; background: #fff; padding: 8px; display: block; }

.telao-hint {
  position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  padding: 10px 16px; border-radius: 14px;
  background: rgba(16, 22, 20, 0.5); border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-size: 14px; z-index: 8; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.telao-hint kbd { margin: 0 4px; }

#adSheet label { display: block; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; font-weight: 700; }
#adSheet input, #adSheet textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.06); outline: none; resize: none;
}
#adSheet input[type="file"] { padding: 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
#adSheet input:focus, #adSheet textarea:focus { border-color: var(--primary); }
.ad-preview { margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.ad-preview img { display: block; width: 100%; max-height: 160px; object-fit: contain; }
.ad-scope {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(0,0,0,.2);
}
.ad-scope legend { padding: 0 6px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ad-scope .radio {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 0;
  font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); cursor: pointer;
}
.ad-scope .radio input { width: auto; margin: 0; }
.ad-scope .radio b { margin-left: auto; color: var(--primary); }

#ytHost { position: fixed; left: -400px; top: 0; width: 200px; height: 112px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ---------- celular ---------- */
.joystick { position: absolute; left: 24px; bottom: calc(150px + var(--safe-b)); width: 130px; height: 130px; border-radius: 50%; background: rgba(0,0,0,.28); border: 2px solid rgba(255,255,255,.18); touch-action: none; }
.stick { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--primary); opacity: .85; }
.look-pad {
  position: absolute; right: 24px; bottom: calc(270px + var(--safe-b)); width: 110px; height: 110px;
  border-radius: 50%; background: rgba(0,0,0,.32); border: 2px solid rgba(255,255,255,.22);
  touch-action: none; z-index: 9; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8); font-size: 11px; font-weight: 800; letter-spacing: 1px; user-select: none;
}
.look-pad span { pointer-events: none; }
.run-btn { position: absolute; right: 24px; bottom: calc(170px + var(--safe-b)); width: 78px; height: 78px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.run-btn.on { background: var(--primary); color: var(--primary-ink); }

@media (max-width: 1100px) {
  .actionbar.dock { max-width: calc(100vw - 20px); padding: 8px 10px 10px; border-radius: 24px; }
  .chat { width: 290px; bottom: calc(52px + var(--safe-b)); max-height: 34vh; }
  .minimap { display: none; }
  .dock-zone .hint { display: none; }
}
@media (max-width: 900px), (pointer: coarse) {
  .screen { padding: 12px; gap: 12px; }
  #creator.screen {
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
  }
  .creator-shell {
    display: flex;
    flex-direction: column;
    width: min(560px, 96vw);
    max-height: none;
    gap: 14px;
  }
  .avatar-stage { width: 100%; min-height: 46vh; max-height: 52vh; height: auto; }
  .form-panel { max-height: none; }
  .form-panel .scroll { max-height: min(46vh, 360px); }
  .stage-heading .headline { font-size: clamp(26px, 7vw, 34px); }
  .stage-heading > p:last-child { font-size: 12px; }
  #character-preview { margin-top: 88px; min-height: 280px; height: calc(100% - 160px); }
  .body-card .face { height: 64px; }
  .preview-tools button { min-height: 44px; font-size: 12px; padding: 8px 12px; }
  .form-panel { width: 100%; }
  .form-panel .scroll { overflow: visible; }
  .headline { font-size: 34px; }
  .logo b, .logo em { font-size: 24px; }
  .topbar .logo-img { height: 26px; top: 8px; }
  .logo-bars i { height: 20px; width: 5px; }
  .topbar { padding: 8px 10px; }
  .top-right .icon:not(.wide) { display: none; }
  .top-right #btnSound { display: inline-block; }
  .hud-info { top: calc(92px + env(safe-area-inset-top, 0px)); left: 10px; gap: 8px; max-width: min(300px, 90vw); }
  .hud-info .where { padding: 8px 12px; }
  .voice-pill { top: calc(92px + env(safe-area-inset-top, 0px)); right: 10px; }
  .voice-pill .btn { padding: 7px 9px; font-size: 12px; }
  .chat { right: 10px; left: auto; width: min(300px, 60vw); max-height: 30vh; bottom: calc(48px + var(--safe-b)); }
  .chat.min { width: auto; }
  .act { width: 52px; height: 58px; }
  .act .dock-ico { width: 38px; height: 38px; }
  .act .dock-label { max-width: 52px; font-size: 8px; }
  .hud-info .nowplaying { max-width: 60vw; }
}


/* ---------- hint + dock loja ---------- */
.hint-pretty {
  flex-wrap: wrap; justify-content: center; max-width: min(920px, 96vw);
  gap: 8px 12px; padding: 10px 16px;
  background: linear-gradient(135deg, rgba(18, 22, 28, 0.92), rgba(8, 12, 16, 0.88));
  border: 1px solid rgba(242, 209, 107, 0.22);
  box-shadow: 0 10px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.hint-chip { display: inline-flex; align-items: center; gap: 4px; }
.hint-gold { color: var(--primary); font-weight: 700; }
.hint-gold kbd { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--primary); }

.act[data-act="shop"] .dock-ico {
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 55%, #fff), color-mix(in srgb, var(--primary) 25%, #1a1a12));
  border-color: color-mix(in srgb, var(--primary) 50%, #fff);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* ---------- loja completa (moderna) ---------- */
.store-sheet {
  width: min(480px, 96vw);
  max-height: 88vh;
  padding: 0;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, rgba(255,255,255,0.12));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 32px 80px rgba(0,0,0,0.55),
    0 0 48px color-mix(in srgb, var(--primary) 12%, transparent);
  background: linear-gradient(168deg, rgba(32, 32, 38, 0.97) 0%, rgba(8, 8, 12, 0.98) 55%);
}
.store-hero {
  position: relative;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent 55%);
}
.store-hero-shine {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% -20%, color-mix(in srgb, var(--primary) 35%, transparent), transparent 55%);
  opacity: 0.85;
}
.store-head { position: relative; z-index: 1; margin-bottom: 14px; }
.store-title {
  font-family: var(--display);
  font-size: clamp(22px, 5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff 0%, color-mix(in srgb, var(--primary) 85%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.store-close {
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}
.store-wallet {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.store-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.store-stat-credit {
  border-color: color-mix(in srgb, var(--primary) 28%, rgba(255,255,255,0.1));
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 10%, rgba(0,0,0,0.35)), rgba(0,0,0,0.28));
}
.store-stat-ico {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, rgba(255,255,255,0.06));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.store-stat-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.store-stat-val {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.store-scroll {
  overflow-y: auto;
  max-height: calc(88vh - 168px);
  padding: 18px 20px 22px;
  scrollbar-gutter: stable;
}
.store-scroll::-webkit-scrollbar { width: 6px; }
.store-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 99px;
}
.store-section { margin-bottom: 26px; }
.store-section:last-child { margin-bottom: 0; }
.store-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.store-section-badge {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary-ink);
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #000));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}
.store-section-badge-blue {
  color: #dbeafe;
  background: linear-gradient(145deg, #2563eb, #1e3a8a);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.store-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.store-section-lead {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.store-grid { display: flex; flex-direction: column; gap: 8px; }
.store-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 12px 12px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  transition: transform 0.18s ease, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.store-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}
.store-card.owned {
  border-color: color-mix(in srgb, var(--primary) 42%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 8%, rgba(255,255,255,0.04)), rgba(255,255,255,0.03));
}
.store-card-ico-wrap {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
}
.store-card-ico { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); }
.store-card-main { min-width: 0; }
.store-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.store-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.store-card-sub {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.store-price-tag {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, rgba(0,0,0,0.35));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.store-chip {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
}
.store-card-act { flex: none; }
.store-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 14px;
  border: none;
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
.store-btn span { font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.store-btn em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.92;
}
.store-btn-buy {
  color: var(--primary-ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 95%, #fff), color-mix(in srgb, var(--primary) 70%, #000));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 38%, transparent), 0 1px 0 rgba(255,255,255,0.35) inset;
}
.store-btn-buy:hover { filter: brightness(1.06); transform: scale(1.02); }
.store-btn-buy:active { transform: scale(0.98); }
.store-btn-equip {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.store-btn-equip:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  border-color: color-mix(in srgb, var(--primary) 45%, rgba(255,255,255,0.2));
}
.store-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.store-police .police-perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(30, 64, 120, 0.45), rgba(10, 14, 24, 0.65));
  border: 1px solid rgba(96, 165, 250, 0.28);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.police-perk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.35;
}
.police-perk > span { font-size: 18px; line-height: 1; flex: none; }
.police-perk strong { display: block; font-size: 12px; margin-bottom: 2px; }
.police-perk small { display: block; font-size: 10px; color: var(--muted); line-height: 1.35; }
.police-perk kbd { margin: 0 2px; font-size: 10px; }
.store-footnote {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 420px) {
  .store-wallet { grid-template-columns: 1fr; }
  .store-card {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
  }
  .store-card-act {
    grid-column: 1 / -1;
  }
  .store-btn { width: 100%; flex-direction: row; justify-content: space-between; min-width: 0; }
  .store-police .police-perks { grid-template-columns: 1fr; }
}

/* Tinta spray (grátis) */
.spray-crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.spray-crosshair::before,
.spray-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.85);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.spray-crosshair::before { width: 2px; height: 10px; }
.spray-crosshair::after { width: 10px; height: 2px; }
body.spray-mode .spray-crosshair { opacity: 0.85; }

.spray-sheet .spray-free {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a12;
  background: linear-gradient(135deg, #7dffb2, #f7d417);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.spray-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}
.spray-swatch {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 3px solid rgba(255,255,255,0.15);
  background: var(--sw, #ccc);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 0.15s, border-color 0.15s;
}
.spray-swatch:hover { transform: scale(1.08); }
.spray-swatch.active {
  border-color: #fff;
  transform: scale(1.12);
  outline: 2px solid rgba(255,255,255,0.35);
}
.spray-current {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.spray-current-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.25);
}
