/* Tela de criação de personagem: painel sólido à esquerda, o boneco aparece à direita */
#creator { position: fixed; inset: 0; z-index: 42; display: flex; align-items: stretch; pointer-events: none;
  background: linear-gradient(90deg, rgba(9, 11, 15, .6), rgba(9, 11, 15, 0) 44%); animation: fade .25s; }
#creator.hidden { display: none; }
.cr-panel { pointer-events: auto; width: min(420px, 92vw); display: flex; flex-direction: column; background: var(--ink-1); border-right: 1px solid var(--line); box-shadow: 12px 0 40px rgba(0, 0, 0, .35); overflow: hidden; }
.cr-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.cr-head small { font: 700 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.cr-head h2 { margin: 6px 0 0; font: 700 28px/1.05 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.cr-scroll { flex: 1; overflow-y: auto; padding: 4px 22px 14px; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.cr-scroll section { padding: 14px 0; border-top: 1px solid var(--line); }
.cr-scroll section:first-child { border-top: 0; }
.cr-scroll h3 { margin: 0 0 10px; font: 700 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.cr-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cr-chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer;
  font: 600 14px/1 var(--font); transition: background var(--t), color var(--t), border-color var(--t); }
.cr-chip:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.cr-chip.on { background: #fff; border-color: #fff; color: var(--ink-0); }
.cr-sw { width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer; background: var(--sw); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); transition: transform var(--t); }
.cr-sw:hover { transform: translateY(-1px); }
.cr-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--ink-1), 0 0 0 3px #fff; }
.cr-tabs { display: flex; gap: 0; margin-bottom: 10px; padding: 3px; border-radius: var(--r-sm); background: var(--ink-0); border: 1px solid var(--line); }
.cr-tab { flex: 1; min-height: 34px; border: 0; border-radius: 3px; background: transparent; color: var(--text-2); cursor: pointer; font: 600 14px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.cr-tab.on { color: #fff; }
.cr-tab.on.t-esquerda { background: var(--lula); }
.cr-tab.on.t-direita { background: var(--flavio); }
.cr-tab.on.t-neutra { background: var(--ink-3); }
.cr-shirts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cr-shirt { padding: 6px 6px 8px; border-radius: var(--r-sm); background: var(--ink-2); border: 1px solid transparent; color: var(--text-2); cursor: pointer; text-align: left; transition: border-color var(--t), background var(--t), color var(--t); }
.cr-shirt:hover { border-color: var(--line-2); color: var(--text); }
.cr-shirt.on { border-color: #fff; color: var(--text); background: var(--ink-3); }
.cr-shirt img { width: 100%; aspect-ratio: 1; display: block; border-radius: 3px; }
.cr-shirt span { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; }
/* visuais de políticos: cartão com retrato do boneco 3D, nome e traços */
.cr-pols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cr-pol { position: relative; padding: 5px 5px 7px; border-radius: var(--r-sm); background: var(--ink-2); border: 1px solid transparent; color: var(--text-2); cursor: pointer; text-align: left; transition: border-color var(--t), background var(--t); }
.cr-pol:hover { border-color: var(--line-2); color: var(--text); }
.cr-pol.on { border-color: #fff; background: var(--ink-3); color: var(--text); }
.cr-pol img, .cr-pol i { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; object-fit: cover; }
.cr-pol i { background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.cr-pol.l0 img, .cr-pol.l0 i { box-shadow: inset 0 -3px 0 var(--lula); }
.cr-pol.l1 img, .cr-pol.l1 i { box-shadow: inset 0 -3px 0 var(--flavio); }
.cr-pol b { display: block; margin-top: 6px; font: 700 14px/1.1 var(--display); letter-spacing: .02em; color: var(--text); }
.cr-pol small { display: -webkit-box; margin-top: 3px; font-size: 11px; line-height: 1.25; color: var(--text-3); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.cr-hint { position: absolute; bottom: 22px; left: calc(50% + 210px); transform: translateX(-50%); padding: 8px 14px; border-radius: var(--r-sm); background: rgba(9, 11, 15, .82); border: 1px solid var(--line);
  font: 600 14px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
@media (max-width: 760px) { .cr-hint { display: none; } #creator { background: none; } }
.cr-wrap .cr-chip { padding: 0 10px; font-size: 13px; }
.cr-sub { margin: 4px 0 8px; font: 600 12px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.cr-more .cr-chip { min-height: 32px; font-size: 13px; }

/* ---------- chat da partida ----------
   Legível sobre a praia clara e de noite: texto grande, cada linha com fundo escuro translúcido e sombra no texto,
   nome em negrito na cor do lado (um pouco mais claro: contraste AA). Fechado: só as 6 últimas, que ficam ~12 s
   e somem devagar. Aberto: histórico mais alto num painel suave. Embaixo à esquerda, em cima da voz e do minimapa. */
#chat { position: fixed; left: calc(var(--hu, 12px) * .9); bottom: calc(var(--hu, 12px) * 18.9 + 44px); width: min(460px, 36vw); z-index: 25; pointer-events: none;
  font-size: clamp(15px, calc(var(--hu, 12px) * 1.25), 18px); }
#chat.hidden { display: none; }
#chat:not(.open) { z-index: 17; } /* fechado: por baixo do HUD (placar Tab, cartas e tela de queda ficam por cima das mensagens) */
.ch-log { display: flex; flex-direction: column; gap: 3px; scrollbar-width: none; }
#chat:not(.open) .ch-row:not(:nth-last-child(-n+6)) { display: none; }
.ch-row { display: block; align-self: flex-start; max-width: 100%; padding: 3px 10px 4px; border-radius: 4px; background: rgba(10, 12, 16, .72); color: #fff; font-weight: 500; line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9); animation: fade .2s; transition: opacity 1.4s ease; word-break: break-word; }
.ch-row.old { opacity: 0; }
.ch-row b { font-weight: 800; margin-left: 2px; filter: brightness(1.18); } /* cor do lado (chat.js), clareada para ler no fundo escuro */
.ch-badge { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: 3px; }
.ch-row svg[viewBox="0 0 28 20"] { width: 1.35em; height: .95em; vertical-align: -.12em; border-radius: 2px; }
.ch-tag { color: #f5c542; font: 700 .8em/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.ch-bot { font: 700 .66em/1.4 var(--display); letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; padding: 0 4px; border-radius: 2px; background: rgba(255,255,255,.14); vertical-align: .1em; }
.ch-sys { color: #d5dae2; }
/* aberto: histórico mais alto num painel suave (as linhas perdem o fundo próprio); as mais novas ficam embaixo, junto
   do campo, e as mais antigas que não cabem somem por cima (sem rolagem: abria mostrando as antigas) */
#chat.open .ch-log { max-height: min(40vh, 340px); overflow: hidden; justify-content: flex-end; padding: 6px 4px; border-radius: 6px; background: rgba(10, 12, 16, .62);
  mask-image: linear-gradient(to bottom, transparent, #000 12%); }
#chat.open .ch-row:not(:nth-last-child(-n+16)) { display: none; }
#chat.open .ch-row { background: transparent; padding: 2px 8px; }
#chat.open .ch-row.old { opacity: 1; }
.ch-form { pointer-events: auto; display: flex; gap: 6px; margin-top: 6px; }
.ch-form.hidden { display: none; }
.ch-form input { flex: 1; min-width: 0; font: inherit; font-weight: 500; color: #fff; padding: 9px 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.28); background: rgba(12, 14, 19, .94); outline: none; }
.ch-form input:focus { border-color: #fff; }
.ch-scope { font: 700 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; padding: 0 12px; border-radius: 4px; border: 0; cursor: pointer; background: var(--ink-3); color: #fff; }
.ch-scope.team { background: var(--mine); color: #fff; }
.ch-scope.near { background: #4cb8ff; color: #0b0d11; }
.ch-tag.near { color: #5ec8ff; }
.ch-tip { margin-top: 5px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.72); text-shadow: 0 1px 2px rgba(0,0,0,.9); }
#chat.open .ch-tip { display: none; }

/* aviso dos carros de som / painel do carro (fica ABAIXO do HUD: as cartas de nível sempre aparecem por cima) */
#car-hint { position: fixed; left: 50%; bottom: 168px; transform: translateX(-50%) translateY(8px); z-index: 19; padding: 8px 16px; border-radius: 14px; font-weight: 800; font-size: 14px;
  background: rgba(8, 14, 26, .78); border: 1px solid rgba(255, 209, 102, .35); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; text-align: center; }
#car-hint.show { opacity: 1; transform: translateX(-50%); }
#car-hint.car { bottom: 104px; padding: 7px 14px; }
#car-hint b { color: #ffd166; padding: 0 3px; }
#car-hint .ch-now { display: flex; align-items: center; justify-content: center; gap: 10px; }
#car-hint .ch-song { color: #ffd166; font-weight: 900; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#car-hint .ch-yt { color: #ff5a5a; font-weight: 900; }
#car-hint .ch-vol { display: inline-flex; gap: 2px; }
#car-hint .ch-vol i { width: 4px; height: 11px; border-radius: 2px; background: rgba(255,255,255,.18); }
#car-hint .ch-vol i.on { background: #4fd17d; }
#car-hint .ch-keys { margin-top: 4px; font-size: 12px; font-weight: 700; opacity: .8; animation: fade .3s; }

/* dirigindo: some com o que não serve dentro do carro */
body.driving #abilities, body.driving #stamina, body.driving #crosshair, body.driving #buffs, body.driving .ch-tip { display: none !important; }
body.driving #upgrades { bottom: 12.5em; }

/* voz por proximidade */
#voice { position: fixed; left: 16px; top: 108px; z-index: 21; display: flex; flex-direction: column; gap: 4px; pointer-events: none; font-size: 12px; font-weight: 800; }
#voice .vc-mic { display: flex; align-items: center; gap: 6px; }
#voice .vc-mic span { padding: 3px 9px; border-radius: 999px; background: rgba(8,14,26,.7); border: 1px solid rgba(255,255,255,.14); }
#voice .vc-mic small { opacity: .6; font-weight: 700; }
#voice .vc-on { color: #4fd17d; }
#voice .vc-on.talk { box-shadow: 0 0 0 2px #4fd17d; }
#voice .vc-off { color: rgba(255,255,255,.7); }
#voice .vc-err { color: #ff8a8a; max-width: 260px; }
#voice .vc-talk { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: rgba(79,209,125,.2); border: 1px solid rgba(79,209,125,.5); animation: fade .15s; }
body:not(.in-match) #voice { display: none; }

/* YouTube do paredão: só um aviso pequeno; o player fica invisível (botão "vídeo" mostra) */
#yt-box { position: fixed; right: 16px; top: 72px; z-index: 21; display: flex; align-items: center; gap: 6px; }
#yt-box.hidden { display: none; }
#yt-box .yt-label { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; background: rgba(8,14,26,.78); border: 1px solid rgba(255,90,90,.45); color: #ffd6d6; }
#yt-box .yt-show { pointer-events: auto; font: inherit; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 999px; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
#yt-box .yt-frame { position: fixed; right: 16px; top: 104px; width: 356px; height: 200px; opacity: 0; pointer-events: none; border-radius: 12px; overflow: hidden; }
#yt-box.video .yt-frame { opacity: 1; }
/* janela "Tocar no paredão" */
#yt-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4, 8, 16, .55); backdrop-filter: blur(4px); animation: fade .15s; }
#yt-modal.hidden { display: none; }
.ytm-card { position: relative; width: min(480px, calc(100vw - 32px)); padding: 22px 22px 16px; border-radius: 20px; color: #fff;
  background: linear-gradient(180deg, rgba(24, 32, 48, .97), rgba(12, 18, 30, .97)); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,0,51,.08); animation: ytm-in .22s cubic-bezier(.2,1.2,.4,1); }
@keyframes ytm-in { from { transform: translateY(10px) scale(.97); opacity: 0; } }
.ytm-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; font-size: 14px; color: #fff; background: rgba(255,255,255,.08); }
.ytm-x:hover { background: rgba(255,255,255,.18); }
.ytm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding-right: 30px; }
.ytm-logo svg { width: 46px; height: 33px; display: block; filter: drop-shadow(0 4px 12px rgba(255,0,51,.35)); }
.ytm-head h3 { margin: 0; font-family: var(--display, inherit); font-weight: 400; font-size: 24px; letter-spacing: .01em; }
.ytm-head p { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.65); line-height: 1.35; }
.ytm-field { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1.5px solid rgba(255,255,255,.14); transition: border-color .15s, box-shadow .15s; }
.ytm-field:focus-within { border-color: #ff3355; box-shadow: 0 0 0 4px rgba(255,51,85,.15); }
.ytm-field i { display: grid; color: rgba(255,255,255,.5); }
.ytm-field i svg { width: 18px; height: 18px; }
.ytm-field input { flex: 1; min-width: 0; font: inherit; font-size: 14px; font-weight: 700; color: #fff; padding: 10px 0; border: 0; background: transparent; outline: none; }
.ytm-field input::placeholder { color: rgba(255,255,255,.35); }
.ytm-paste { font: inherit; font-size: 12px; font-weight: 900; padding: 8px 12px; border-radius: 10px; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.12); }
.ytm-paste:hover { background: rgba(255,255,255,.2); }
.ytm-msg { min-height: 18px; margin: 6px 2px 2px; font-size: 12px; font-weight: 700; color: #ff9aa8; }
.ytm-msg.warn { color: #ffd166; }
.ytm-preview { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); animation: fade .2s; }
.ytm-preview.hidden { display: none; }
.ytm-preview img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; background: #000; flex: none; }
.ytm-preview div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ytm-preview b { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytm-preview small { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.55); }
.ytm-ok { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #2fbf71; font-size: 13px; font-weight: 900; }
.ytm-recent { margin: 8px 0 4px; }
.ytm-recent.hidden { display: none; }
.ytm-recent > small { display: block; margin: 0 2px 6px; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.ytm-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ytm-chips button { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); cursor: pointer; text-align: left; color: #fff; font: inherit; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.04); }
.ytm-chips button:hover { background: rgba(255,255,255,.1); }
.ytm-chips img { width: 48px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.ytm-chips span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytm-actions { display: flex; gap: 8px; margin-top: 12px; }
.ytm-actions button { font: inherit; font-size: 14px; font-weight: 900; padding: 12px 16px; border-radius: 12px; border: 0; cursor: pointer; }
.ytm-stop { color: #fff; background: rgba(255,255,255,.1); }
.ytm-stop:hover { background: rgba(255,255,255,.18); }
.ytm-stop.hidden { display: none; }
.ytm-play { flex: 1; color: #fff; background: linear-gradient(180deg, #ff2a4d, #e0002a); box-shadow: 0 6px 18px rgba(255,0,51,.35); }
.ytm-play:hover:not(:disabled) { filter: brightness(1.08); }
.ytm-play:disabled { opacity: .35; cursor: default; box-shadow: none; }
.ytm-keys { margin-top: 10px; text-align: center; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.4); }
.ytm-keys kbd { font: inherit; font-weight: 900; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
@media (max-width: 520px) { .ytm-chips { grid-template-columns: 1fr; } }

.ytm-x svg { width: 14px; height: 14px; margin: auto; }
.ytm-ok svg { width: 14px; height: 14px; }
.ytm-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ytm-play i { display: grid; width: 16px; height: 16px; }
.ytm-play i svg { width: 100%; height: 100%; }

/* ---------- celular deitado: criador compacto (mesmas regras que estavam em touch.css) e alvos de toque maiores ---------- */
@media (max-height: 540px) {
  .cr-panel { width: min(380px, 52vw); }
  .cr-head { padding: 10px 16px 8px; }
  .cr-head h2 { font-size: 22px; }
  .cr-foot { padding: 10px 16px 12px; }
  .cr-scroll { padding: 2px 16px 12px; }
  .cr-scroll section { padding: 10px 0; }
  #yt-modal { align-items: start; padding-top: 8px; overflow-y: auto; }
}
body.touch .cr-panel { padding-left: env(safe-area-inset-left, 0px); }
body.touch .cr-chip { min-height: 42px; padding: 0 14px; }
body.touch .cr-tab { min-height: 42px; }
body.touch .cr-sw { width: 38px; height: 38px; }
body.touch .cr-row { gap: 8px; }
body.touch .cr-hint { left: calc(50% + min(190px, 26vw)); bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
