:root {
  --bg: #07050c;
  --gold: #e0c060;
  --btn: rgba(255, 255, 255, 0.12);
  --btn-on: rgba(224, 192, 96, 0.55);
  --line: rgba(255, 255, 255, 0.35);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: #fff;
  font-family: "Press Start 2P", ui-monospace, monospace;
  touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* iPhone/Safari: com user-select:none no body os campos de texto não aceitam digitação */
button, a { touch-action: manipulation; }
input, textarea, select { font-size: max(16px, 1em); -webkit-user-select: text; user-select: text; touch-action: manipulation; -webkit-touch-callout: default; }
#screen { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

#topbar { display: none; position: fixed; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); gap: 6px; z-index: 5; }
#topbar button {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(rgba(255, 255, 255, 0.14), rgba(10, 8, 20, 0.6)); color: #fff; font-size: 18px; cursor: pointer; opacity: 0.6;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.45);
}
#topbar button:hover { opacity: 1; }

/* ------------------------------------------------ controles de toque */
#touch { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 4; }
body.touch #touch { display: block; }
body.touch #topbar { display: flex; top: calc(60% + 8px); bottom: auto; right: auto; left: max(14px, env(safe-area-inset-left)); }

#stick-zone {
  position: absolute; left: 0; bottom: 0; width: 50%; height: 55%;
  pointer-events: auto; touch-action: none;
}
body.portrait #stick-zone { height: 40%; }
#stick {
  position: absolute; left: 104px; top: calc(100% - 128px);
  width: 144px; height: 144px; margin: -72px 0 0 -72px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 144 144'><g fill='none' stroke='%23ffe9a8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='.7'><path d='M64 20l8-8 8 8'/><path d='M64 124l8 8 8-8'/><path d='M20 64l-8 8 8 8'/><path d='M124 64l8 8-8 8'/></g><circle cx='72' cy='72' r='50' fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='2' stroke-dasharray='3 7'/></svg>") center / 100% 100% no-repeat,
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.13), rgba(10, 8, 24, 0.5) 72%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.18), 0 4px 14px rgba(0, 0, 0, 0.45);
  opacity: 0.6; transition: opacity 0.15s, box-shadow 0.15s;
}
#stick.on { opacity: 1; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), 0 0 18px rgba(224, 192, 96, 0.45), 0 4px 14px rgba(0, 0, 0, 0.45); }
#knob {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85), rgba(200, 210, 235, 0.45) 30%, rgba(70, 70, 110, 0.65) 75%);
  box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.5);
}
#stick.on #knob { border-color: #ffe9a8; box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.3), 0 0 14px rgba(255, 233, 168, 0.6), 0 3px 8px rgba(0, 0, 0, 0.5); }

#btns {
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom));
  width: 240px; height: 220px; pointer-events: none;
}
.btn {
  position: absolute; pointer-events: auto; touch-action: none;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4);
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.06) 42%, rgba(12, 10, 28, 0.62) 100%);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.28), 0 3px 10px rgba(0, 0, 0, 0.5);
  color: #fff; font-family: inherit; font-size: 20px; line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.06s, box-shadow 0.1s;
}
.btn .ic { width: 58%; height: 58%; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55)); }
.btn.on { transform: scale(0.93); background: radial-gradient(circle at 50% 40%, rgba(255, 233, 168, 0.55), rgba(224, 192, 96, 0.25) 60%, rgba(12, 10, 28, 0.6) 100%); border-color: var(--gold); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(224, 192, 96, 0.55); }
.btn.a { width: 98px; height: 98px; right: 0; bottom: 42px; font-size: 28px; color: #ffeab0; border-color: rgba(224, 192, 96, 0.9); background: radial-gradient(circle at 32% 26%, rgba(255, 233, 168, 0.4), rgba(224, 192, 96, 0.1) 45%, rgba(40, 28, 10, 0.62) 100%); box-shadow: inset 0 -7px 12px rgba(80, 50, 0, 0.45), inset 0 2px 3px rgba(255, 240, 200, 0.4), 0 0 14px rgba(224, 192, 96, 0.3), 0 3px 10px rgba(0, 0, 0, 0.5); }
.btn.b { width: 78px; height: 78px; right: 112px; bottom: 4px; color: #e8f0ff; border-color: rgba(190, 205, 235, 0.75); }
.btn.roll { width: 64px; height: 64px; right: 118px; bottom: 110px; border-color: rgba(120, 210, 255, 0.7); box-shadow: inset 0 -6px 10px rgba(0, 30, 60, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.28), 0 0 12px rgba(100, 200, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.5); }
.btn.m1, .btn.m2 { display: none; width: 58px; height: 58px; font-size: 14px; border-color: rgba(168, 150, 255, 0.8); color: #e0d8ff; background: radial-gradient(circle at 32% 26%, rgba(190, 170, 255, 0.4), rgba(120, 100, 220, 0.1) 45%, rgba(20, 12, 50, 0.62) 100%); box-shadow: inset 0 -6px 10px rgba(30, 10, 80, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.3), 0 0 12px rgba(150, 120, 255, 0.35), 0 3px 10px rgba(0, 0, 0, 0.5); }
body.magic .btn.m1, body.magic .btn.m2 { display: flex; }
.btn.m1 { right: 10px; bottom: 152px; }
.btn.m2 { right: 74px; bottom: 182px; }
.btn.menu {
  width: 58px; height: 44px; border-radius: 14px; font-size: 20px; border-color: rgba(255, 255, 255, 0.5);
  right: max(14px, env(safe-area-inset-right)); bottom: auto; top: calc(60% + 8px);
}
/* em pé: M1 e M2 numa coluna à esquerda do roll (longe do botão de pausa, em qualquer altura de tela) */
body.portrait .btn.m1 { width: 54px; height: 54px; right: 186px; bottom: 90px; }
body.portrait .btn.m2 { width: 54px; height: 54px; right: 186px; bottom: 150px; }
body:not(.portrait) .btn.menu { top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: auto; }

noscript { position: fixed; inset: 0; display: grid; place-items: center; font-size: 12px; }
body.touch:not(.portrait) #topbar {
  flex-direction: column; bottom: auto; transform: none; right: auto;
  top: calc(max(10px, env(safe-area-inset-top)) + 56px); left: max(10px, env(safe-area-inset-left));
}

/* ------------------------------------------------ formulário de login por e-mail */
#auth {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10;
  width: min(92vw, 380px); padding: 20px 18px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(16, 12, 30, 0.97); border: 2px solid var(--gold); border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.5); font-size: 10px; line-height: 1.6;
}
#auth[hidden] { display: none; }
#auth h2 { margin: 0 0 6px; font-size: 12px; color: #ffe08a; text-align: center; font-weight: normal; }
#auth label { color: #c8c0d8; }
#auth input {
  font: 16px/1.4 system-ui, sans-serif; -webkit-appearance: none; appearance: none; padding: 10px; border-radius: 4px;
  border: 1px solid var(--line); background: #0b0820; color: #fff;
}
#auth input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
#auth .row { display: flex; gap: 8px; }
#auth button {
  flex: 1; font-family: inherit; font-size: 10px; padding: 10px 6px; cursor: pointer;
  background: #e0c060; color: #1a1030; border: 0; border-radius: 4px;
}
#auth button.link { background: transparent; color: #c8c0d8; border: 1px solid var(--line); }
#auth button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#auth-msg { min-height: 1.6em; margin: 2px 0; color: #ff9aa8; }

/* ------------------------------------------------ instalar o app */
#btn-install {
  position: fixed; z-index: 6; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  font-family: inherit; font-size: 10px; padding: 10px 14px; cursor: pointer;
  background: #e0c060; color: #1a1030; border: 0; border-radius: 6px; box-shadow: 0 2px 0 #7a5a1a;
}
#btn-install[hidden] { display: none; }
#btn-install:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.touch.portrait #btn-install { bottom: auto; top: max(10px, env(safe-area-inset-top)); }
#install-help { position: fixed; inset: 0; z-index: 11; display: grid; place-items: center; background: rgba(5, 3, 12, 0.7); padding: 16px; }
#install-help[hidden] { display: none; }
#install-help .box {
  width: min(92vw, 380px); padding: 18px; background: rgba(16, 12, 30, 0.98); border: 2px solid var(--gold); border-radius: 6px;
  font-size: 10px; line-height: 1.8; color: #e8e2f4;
}
#install-help h2 { margin: 0 0 8px; font-size: 12px; color: #ffe08a; font-weight: normal; text-align: center; }
#install-help ol { margin: 0 0 8px; padding-left: 20px; }
#install-help ol[hidden] { display: none; }
#install-help b { color: #ffe08a; font-weight: normal; }
#install-help button { width: 100%; font-family: inherit; font-size: 10px; padding: 10px; background: #e0c060; color: #1a1030; border: 0; border-radius: 4px; cursor: pointer; }

/* ------------------------------------------------ Jerry do carregamento: acompanha a barra e continua pulando mesmo com o jogo travado (CSS) */
#load-wrap { display: none; position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; width: calc(24px * var(--js, 2)); height: calc(24px * var(--js, 2)); transform: translate(var(--jx, 0px), var(--jy, 0px)); transition: transform 0.5s ease-out; will-change: transform; }
body.loading #load-wrap { display: block; }
#load-jerry { width: 100%; height: 100%; image-rendering: pixelated; will-change: transform; transform-origin: 50% 88%; animation: jerry-hop 0.5s cubic-bezier(.3,.7,.4,1) infinite; }
@keyframes jerry-hop { 0%, 100% { transform: translateY(0) scale(1.06, 0.88); } 45% { transform: translateY(calc(var(--js, 2) * -5px)) scale(0.94, 1.1); } }
@media (prefers-reduced-motion: reduce) { #load-jerry { animation: none; } }

/* ------------------------------------------------ dica de girar o celular */
#rotate-hint {
  display: none; position: fixed; left: 0; right: 0; top: calc(60% - 22px); z-index: 3;
  text-align: center; font-size: 9px; color: #c8c0d8; opacity: 0.75; pointer-events: none;
  animation: hint-pulse 2.4s ease-in-out infinite;
}
body.touch.portrait #rotate-hint { display: block; }
@keyframes hint-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { #rotate-hint { animation: none; } }

/* celular deitado: controles compactos nas colunas laterais */
body.touch:not(.portrait) #stick { left: min(92px, 11vw); }
body.touch:not(.portrait) #stick-zone { width: 34%; height: 70%; }
body.touch:not(.portrait) #btns { width: 196px; right: max(10px, env(safe-area-inset-right)); }
body.touch:not(.portrait) .btn.a { width: 88px; height: 88px; bottom: 56px; }
body.touch:not(.portrait) .btn.b { width: 70px; height: 70px; right: 96px; bottom: 4px; }
body.touch:not(.portrait) .btn.roll { width: 56px; height: 56px; right: 104px; bottom: 98px; }
body.touch:not(.portrait) .btn.m1 { width: 50px; height: 50px; right: 4px; bottom: 154px; }
body.touch:not(.portrait) .btn.m2 { width: 50px; height: 50px; right: 60px; bottom: 166px; }

/* jogo girado pelo sensor (rotação automática do celular desligada) */
body.rot { position: fixed; top: 0; left: 0; transform-origin: top left; height: auto; }
body.rot #screen { width: 100%; height: 100%; }
#btn-rot { display: none; }
body.touch #btn-rot { display: block; }

/* controle físico conectado: esconde os botões de toque (voltam ao tocar na tela) */
body.pad #touch, body.pad #rotate-hint { display: none !important; }

/* ------------------------------------------------ jogo em grupo */
.gbox {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 12;
  width: min(92vw, 400px); max-height: 94dvh; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(16, 12, 30, 0.98); border: 2px solid var(--gold); border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.5); font-size: 10px; line-height: 1.7; color: #e8e2f4;
  -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
.gbox[hidden] { display: none; }
.gbox h2 { margin: 0 0 4px; font-size: 12px; color: #ffe08a; text-align: center; font-weight: normal; }
.gbox label { color: #c8c0d8; }
.gbox p { margin: 0; }
.gbox input {
  font: 16px/1.4 system-ui, sans-serif; -webkit-appearance: none; appearance: none; padding: 10px; border-radius: 4px; width: 100%;
  border: 1px solid var(--line); background: #0b0820; color: #fff;
}
#join-code { font: 22px/1.3 "Press Start 2P", monospace; letter-spacing: 0.25em; text-align: center; text-transform: uppercase; }
.gbox input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.gbox .row { display: flex; gap: 8px; }
.gbox button {
  flex: 1; font-family: inherit; font-size: 10px; padding: 11px 6px; cursor: pointer;
  background: #e0c060; color: #1a1030; border: 0; border-radius: 4px;
}
.gbox button.link { background: transparent; color: #c8c0d8; border: 1px solid var(--line); }
.gbox button:disabled { opacity: 0.5; cursor: default; }
.gbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#join-msg, #group-msg { min-height: 1.7em; color: #ff9aa8; }
#group-msg.ok { color: #9ae8a8; }
#group-code { font-size: 26px; letter-spacing: 0.3em; text-align: center; color: #ffe08a; padding: 6px 0; }
#group-state { text-align: center; color: #c8c0d8; }
#group-hint { color: #b8b0d0; font-size: 9px; }
#group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#group-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
#group-list li i { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* ------------------------------------------------ chat do grupo */
#chat-btn {
  position: fixed; left: max(6px, env(safe-area-inset-left)); top: 42%; z-index: 6;
  width: 40px; height: 40px; font-size: 18px; border-radius: 10px; cursor: pointer;
  background: rgba(10, 8, 20, 0.6); border: 1px solid var(--line); color: #fff; opacity: 0.8;
}
#chat-btn[hidden] { display: none; }
#chat-btn.new { border-color: var(--gold); opacity: 1; }
#chat-log {
  position: fixed; left: max(8px, env(safe-area-inset-left)); bottom: max(100px, 22vh); z-index: 5; pointer-events: none;
  max-width: min(60vw, 420px); display: flex; flex-direction: column; gap: 3px;
  font: 12px/1.35 system-ui, sans-serif; text-shadow: 0 1px 2px #000;
}
#chat-log div { background: rgba(10, 8, 20, 0.6); padding: 3px 7px; border-radius: 4px; transition: opacity 0.6s; overflow-wrap: anywhere; }
#chat-log b { font-weight: 700; margin-right: 4px; }
#chat-box { top: auto; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 13; width: min(94vw, 460px); }
#chat-quick { display: flex; flex-wrap: wrap; gap: 6px; }
#chat-quick button { flex: 0 0 auto; padding: 8px 9px; font-size: 9px; background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid var(--line); }

#group-modes { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
#group-modes[hidden] { display: none; }
.gbox label.chk { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.gbox label.chk input { width: 20px; height: 20px; flex: none; accent-color: #e0c060; padding: 0; }
.gbox select { flex: 1; font: 16px system-ui, sans-serif; padding: 10px; border-radius: 4px; border: 1px solid var(--line); background: #0b0820; color: #fff; }
#br-hint { color: #b8b0d0; font-size: 9px; }
#br-end { background: #e8344a !important; color: #fff !important; }

#friends-box { z-index: 14; }
#invite-box { z-index: 15; }
#fr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 32vh; overflow: auto; }
#fr-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
#fr-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#fr-list li i { width: 9px; height: 9px; border-radius: 50%; background: #5a5470; flex: none; }
#fr-list li i.on { background: #4cd04a; }
#fr-list li button { flex: 0 0 auto; padding: 7px 8px; font-size: 8px; }
#fr-msg { min-height: 1.5em; color: #9ae8a8; }
#fr-msg.err { color: #ff9aa8; }
#fr-hint { color: #b8b0d0; font-size: 9px; }

#br-msg { min-height: 1.5em; color: #ff9aa8; }

/* ------------------------------------------------ botões da tela inicial (um bloco só, no meio de cima) */
#hub { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(var(--vw, 100vw) - 16px); }
#hub button {
  font-family: inherit; font-size: 8px; padding: 9px 11px; cursor: pointer; white-space: nowrap;
  background: rgba(42, 30, 68, 0.92); color: #ffe08a; border: 2px solid var(--gold); border-radius: 6px;
}
#hub button#btn-br { background: rgba(120, 24, 40, 0.92); }
#hub button[hidden] { display: none; }
/* aviso de amigo online (canto de baixo, à direita) */
#fr-alert {
  position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 16;
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; max-width: min(88vw, 340px);
  background: rgba(16, 12, 30, 0.96); border: 2px solid #4cd04a; border-radius: 8px; font: 12px/1.3 system-ui, sans-serif; color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
#fr-alert[hidden] { display: none; }
#fr-alert span { flex: 1; }
#fr-alert button { flex: 0 0 auto; padding: 8px 10px; border-radius: 6px; border: 0; font: 11px system-ui, sans-serif; background: #e0c060; color: #1a1030; cursor: pointer; }
#fr-alert button[data-do=close] { background: transparent; color: #c8c0d8; border: 1px solid var(--line); padding: 6px 8px; }
#fr-alert button[hidden] { display: none; }
body.touch #fr-alert { bottom: max(190px, 26vh); }
/* telas pequenas / giradas: caixas cabem inteiras e rolam se precisar */
.gbox { max-height: calc(var(--vh, 100dvh) - 16px); width: min(calc(var(--vw, 100vw) - 24px), 400px); }
body.short .gbox { padding: 10px; gap: 5px; font-size: 8px; line-height: 1.45; }
body.short .gbox h2 { font-size: 10px; margin: 0; }
body.short .gbox button { padding: 8px 5px; font-size: 8px; }
body.short #group-code { font-size: 18px; padding: 2px 0; }
body.short #group-hint, body.short #fr-hint, body.short #br-hint { display: none; }
body.short #fr-list { max-height: 22vh; }
body.short #group-list { grid-template-columns: 1fr 1fr; }
body.short .gbox input, body.short .gbox select { padding: 7px; }

/* chat escrito no canto esquerdo: no computador o campo fica fixo; no celular abre pelo botão */
#chat-log { left: max(8px, env(safe-area-inset-left)); bottom: max(100px, 22vh); }
body:not(.touch) #chat-log { bottom: 56px; }
#chat-box.dock { top: auto; left: max(8px, env(safe-area-inset-left)); bottom: 8px; transform: none; width: min(300px, 46vw); padding: 6px; border-width: 1px; background: rgba(10, 8, 20, 0.6); box-shadow: none; z-index: 5; }
#chat-box.dock #chat-quick { display: none; }
#chat-box.dock input { padding: 6px 8px; font-size: 14px; }
#chat-box.dock button[type=submit] { padding: 6px 8px; }

#fr-status { font-size: 9px; }
/* caixa de seleção animada (interruptor) */
.gbox label.chk input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 46px; height: 26px; flex: none; padding: 0; position: relative; cursor: pointer;
  border-radius: 13px; border: 2px solid var(--line); background: #1a1530; transition: background 0.22s ease, border-color 0.22s ease;
}
.gbox label.chk input[type=checkbox]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #c8c0d8;
  transition: transform 0.22s cubic-bezier(.3, 1.4, .5, 1), background 0.22s ease;
}
.gbox label.chk input[type=checkbox]:checked { background: #3a8a3a; border-color: #7ae07a; }
.gbox label.chk input[type=checkbox]:checked::before { transform: translateX(20px); background: #ffffff; }
.gbox label.chk input[type=checkbox]:disabled { opacity: 0.55; cursor: default; }
.gbox label.chk input[type=checkbox]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* botão do chat: embaixo no meio (único lugar livre: longe do menu, topbar, joystick e botões de ação) */
#chat-btn, body.touch #chat-btn, body.touch:not(.portrait) #chat-btn, body.touch.portrait #chat-btn {
  left: 50%; right: auto; top: auto; transform: translateX(-50%);
  bottom: max(10px, env(safe-area-inset-bottom)); width: 44px; height: 44px; z-index: 6;
}

/* ------------------------------------------------ erro ao abrir o jogo (sem internet / servidor) */
#load-error { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); width: min(86vw, 360px); z-index: 20; text-align: center; padding: 14px; background: rgba(60, 10, 16, 0.95); border: 1px solid #e8344a; border-radius: 8px; color: #ffd0d8; font-size: 11px; line-height: 1.5; }
#load-error[hidden] { display: none; }
#load-error button { margin-top: 8px; font-family: inherit; font-size: 11px; padding: 8px 14px; background: #e0c060; color: #1a1030; border: 0; border-radius: 4px; cursor: pointer; }
