* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fc9ff;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

button { font: inherit; cursor: pointer; }
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  font: bold 0.8em/1.5 system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

/* ---------------- lobby ---------------- */
#lobby {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 16px max(16px, 5vw);
  background: linear-gradient(90deg, rgba(10, 20, 40, 0.78) 0%, rgba(10, 20, 40, 0.35) 55%, rgba(10, 20, 40, 0) 100%);
  overflow-y: auto;
}
.panel {
  width: min(440px, 100%);
  background: rgba(20, 24, 33, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}
h1 {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  font-weight: 900;
  background: linear-gradient(90deg, #f7d117, #1fae4b 45%, #e0262d 55%, #ff5a5f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 4px 0 18px; opacity: 0.8; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; margin-bottom: 6px; }
.field em { font-style: normal; opacity: 0.6; font-weight: 400; font-size: 0.85em; }
.field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 2px solid #3a4152;
  background: #10131a;
  color: #fff;
  font-size: 1rem;
  outline: none;
}
.field input:focus { border-color: #6b8cff; }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.side {
  background: #1b202b;
  border: 3px solid #2d3443;
  border-radius: 14px;
  color: #fff;
  padding: 14px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s, border-color 0.12s;
}
.side:hover { transform: translateY(-2px); }
.side small { opacity: 0.65; }
.side[data-side='direita'].sel { border-color: #1fae4b; background: #1a2a20; }
.side[data-side='esquerda'].sel { border-color: #e0262d; background: #2c1a1c; }
.shirt {
  width: 64px;
  height: 56px;
  clip-path: polygon(22% 0, 38% 0, 50% 14%, 62% 0, 78% 0, 100% 22%, 88% 40%, 80% 34%, 80% 100%, 20% 100%, 20% 34%, 12% 40%, 0 22%);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.1rem;
}
.shirt-d { background: #f7d117; color: #009b3a; box-shadow: inset 0 -6px 0 #009b3a; }
.shirt-e { background: #d81f26; color: #fff; font-size: 1.6rem; }

.custom { display: grid; gap: 8px; margin-bottom: 16px; }
.custom .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.custom .row > span { width: 110px; font-size: 0.9rem; opacity: 0.8; }
.swatches, .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  padding: 0;
}
.swatch.sel { border-color: #fff; }
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid #3a4152;
  background: #1b202b;
  color: #fff;
  font-size: 0.82rem;
}
.chip.sel { border-color: #6b8cff; background: #26304a; }

#play {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #2b7bff, #6b5cff);
  box-shadow: 0 6px 0 #1a3f99;
  transition: transform 0.1s;
}
#play:active { transform: translateY(3px); box-shadow: 0 3px 0 #1a3f99; }
#play:disabled { background: #3a4152; box-shadow: 0 6px 0 #252a35; cursor: default; opacity: 0.8; }
#play.d { background: linear-gradient(90deg, #1fae4b, #c9b100); box-shadow: 0 6px 0 #116b2d; }
#play.e { background: linear-gradient(90deg, #e0262d, #a3141a); box-shadow: 0 6px 0 #6b0d11; }
#lobby-status { min-height: 1.2em; margin: 10px 0 0; color: #ffb3b3; }
.online { margin: 4px 0 0; opacity: 0.7; font-size: 0.9rem; }
.channel-row { display: flex; align-items: center; gap: 8px; opacity: 0.85; }
#channel { padding: 4px 8px; border-radius: 8px; border: 1px solid #3a4152; background: #1b202b; color: #fff; font: inherit; }
.pill.ch { border-left: 6px solid #6b8cff; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#counts {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  display: flex;
  gap: 8px;
  pointer-events: none !important;
}
.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px #000;
}
.pill { white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
.pill b { font-variant-numeric: tabular-nums; }
.pill.d { border-left: 6px solid #1fae4b; }
.pill.e { border-left: 6px solid #e0262d; }

#minimap {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 180px;
  height: 180px;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none !important;
}

#chat {
  position: absolute;
  left: 12px;
  bottom: 70px;
  width: min(380px, calc(100vw - 24px));
}
#chat-log {
  max-height: 190px;
  overflow-y: auto;
  padding: 6px 8px;
  font-size: 0.92rem;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  scrollbar-width: thin;
  mask-image: linear-gradient(to bottom, transparent 0, #000 30px);
}
.chat-line { margin: 2px 0; word-wrap: break-word; }
.chat-line.system { opacity: 0.75; font-style: italic; }
#chat-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}
#chat-input:focus { border-color: #fff; background: rgba(0, 0, 0, 0.7); }

#prompt {
  position: absolute;
  left: 50%;
  bottom: 34%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  font-weight: 700;
  pointer-events: none !important;
  white-space: nowrap;
}

#emotes {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#emotes button {
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
#emotes button:hover { background: rgba(0, 0, 0, 0.7); }
#emotes button.on { background: rgba(31, 120, 255, 0.75); }

#help-toggle {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
}
#sound-btn {
  position: absolute;
  right: 58px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  font-size: 1.05rem;
}
body.touch #sound-btn { right: calc(8px + env(safe-area-inset-right)); bottom: auto; top: calc(128px + env(safe-area-inset-top)); }

#help {
  position: absolute;
  right: 12px;
  bottom: 60px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.88rem;
  line-height: 1.9;
  max-width: calc(100vw - 24px);
}
.hidden-panel { display: none; }

#shop-menu {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
}
.menu-box {
  width: min(360px, calc(100vw - 32px));
  background: #fffaf0;
  color: #222;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.menu-box h2 { margin: 0 0 12px; }
#shop-items { display: grid; gap: 8px; margin-bottom: 12px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #eadfc8;
  background: #fff;
  text-align: left;
}
.shop-item:hover { border-color: #d68a3c; background: #fff4e0; }
.shop-item .icon { font-size: 1.5rem; }
.shop-item .name { flex: 1; font-weight: 600; }
.shop-item .price { color: #1e8449; font-weight: 700; }
#shop-close {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: #ddd;
  font-weight: 600;
}

#toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  font-weight: 600;
  pointer-events: none !important;
}

#disconnected {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 16px;
}
#disconnected button {
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  background: #2b7bff;
  color: #fff;
  font-weight: 700;
}


/* ---------------- sobrevivência ---------------- */
#status {
  position: absolute;
  top: 52px;
  left: 12px;
  width: 190px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
  pointer-events: none !important;
  text-shadow: 0 1px 2px #000;
}
#status .money { font-size: 1rem; margin-bottom: 4px; }
#status .money b { color: #7dff9a; }
#status .money small { opacity: 0.7; font-size: 0.72rem; }
.bar { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.bar i { font-style: normal; width: 1.2em; text-align: center; }
.bar span { width: 2.2em; text-align: right; font-weight: 700; }
.bar .track { flex: 1; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.bar .fill { height: 100%; width: 100%; border-radius: 5px; transition: width 0.3s; }
.bar.energy .fill { background: linear-gradient(90deg, #f7d117, #ffe86b); }
.bar.hunger .fill { background: linear-gradient(90deg, #e67e22, #f5b041); }
.bar.thirst .fill { background: linear-gradient(90deg, #2e86de, #6cc4ff); }
.bar.burn .fill { background: linear-gradient(90deg, #ff9a3c, #ff3b1f); }
.bar.crit { animation: blink 0.8s infinite; }
.bar.crit span { color: #ff6b6b; }
@keyframes blink { 50% { opacity: 0.45; } }
#sun-state { margin-top: 3px; font-size: 0.75rem; opacity: 0.9; }

.shop-item:disabled { opacity: 0.5; cursor: default; }
.shop-item:disabled:hover { border-color: #eadfc8; background: #fff; }
.shop-item .info { flex: 1; display: flex; flex-direction: column; }
.shop-item .info small { color: #777; font-size: 0.75rem; }
.shop-money { margin: -6px 0 10px; color: #1e8449; font-weight: 700; }

#btn-eat { right: 30px; bottom: 192px; }
body.touch #status { top: calc(40px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); width: 160px; padding: 5px 8px; font-size: 0.72rem; }
body.touch #status .money { font-size: 0.85rem; }
body.touch .bar .track { height: 7px; }

/* ---------------- toque (celular / tablet) ---------------- */
html, body { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#lobby { min-height: 100dvh; }
#stick, #touch-buttons { display: none; }

body.touch #stick {
  display: block;
  position: absolute;
  left: calc(28px + env(safe-area-inset-left));
  bottom: calc(40px + env(safe-area-inset-bottom));
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  pointer-events: none !important;
  opacity: 0.45;
}
body.touch #stick.on { opacity: 1; }
#stick-knob {
  position: absolute;
  left: 40px;
  top: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

body.touch #touch-buttons {
  display: block;
  position: absolute;
  right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom);
  width: 210px;
  height: 230px;
  pointer-events: none !important;
}
#touch-buttons button {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  pointer-events: auto;
  touch-action: none;
}
#touch-buttons button:active, #touch-buttons button.pressed { background: rgba(255, 255, 255, 0.35); }
#btn-jump { right: 22px; bottom: 26px; width: 82px !important; height: 82px !important; font-size: 1.8rem !important; }
#btn-use { right: 118px; bottom: 20px; }
#btn-use.ready { background: rgba(31, 120, 255, 0.85) !important; border-color: #fff !important; animation: pulse 1s infinite; }
#btn-flag { right: 30px; bottom: 124px; }
#btn-flag.on { background: rgba(31, 120, 255, 0.75); }
#btn-emote { right: 102px; bottom: 96px; }
#btn-chat { right: 140px; bottom: 166px; width: 50px !important; height: 50px !important; font-size: 1.1rem !important; }
@keyframes pulse { 50% { transform: scale(1.1); } }

/* emotes viram um painel que abre no 😀 */
body.touch #emotes {
  display: none;
  top: auto;
  left: auto;
  right: calc(214px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: none;
  flex-direction: column;
  align-items: stretch;
}
body.touch #emotes.open { display: flex; }
body.touch #emotes button { padding: 10px 14px; font-size: 0.95rem; text-align: left; }
body.touch #emotes kbd, body.touch #flag-btn, body.touch #help-toggle, body.touch #help { display: none; }

/* chat no topo, fora da área do joystick */
body.touch #chat {
  top: calc(52px + env(safe-area-inset-top));
  bottom: auto;
  left: calc(10px + env(safe-area-inset-left));
  width: min(320px, 56vw);
}
body.touch #chat-log { max-height: 84px; font-size: 0.8rem; pointer-events: none; }
body.touch #chat-input { display: none; }
body.touch.chat-open #chat-input { display: block; font-size: 16px; } /* 16px evita zoom no iOS */
body.touch #counts { left: calc(10px + env(safe-area-inset-left)); top: calc(8px + env(safe-area-inset-top)); }
body.touch .pill { padding: 4px 10px; font-size: 0.8rem; }
body.touch #minimap {
  width: 112px;
  height: 112px;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(8px + env(safe-area-inset-right));
  border-width: 2px;
}
body.touch #prompt { bottom: calc(18px + env(safe-area-inset-bottom)); pointer-events: auto !important; font-size: 1.05rem; padding: 10px 18px; }
@media (orientation: portrait) {
  body.touch #prompt { bottom: auto; top: 24%; }
  body.touch #emotes { right: calc(16px + env(safe-area-inset-right)); bottom: calc(240px + env(safe-area-inset-bottom)); }
}
body.touch #prompt kbd { background: #1f78ff; color: #fff; }
body.touch #toast { top: auto; bottom: calc(240px + env(safe-area-inset-bottom)); }

@media (max-width: 720px), (max-height: 500px) {
  #lobby { background: rgba(10, 20, 40, 0.55); justify-content: center; align-items: flex-start; }
  .panel { padding: 18px; }
  h1 { font-size: 1.7rem; }
  .sub { margin-bottom: 12px; }
  .side { padding: 10px 6px 8px; }
  .custom .row > span { width: 100%; }
  #emotes button { padding: 6px 8px; font-size: 0.75rem; }
  #emotes kbd { display: none; }
  #minimap { width: 120px; height: 120px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  /* celular deitado: painel em duas colunas */
  .panel { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .panel > h1, .panel > .sub { grid-column: 1 / -1; }
  .panel > :not(.custom):not(h1):not(.sub) { grid-column: 1; }
  .custom { grid-column: 2; grid-row: 3 / span 4; align-content: start; }
}

/* chat abaixo/ao lado do painel de status no celular */
@media (orientation: landscape) {
  body.touch #chat { top: calc(44px + env(safe-area-inset-top)); left: calc(184px + env(safe-area-inset-left)); width: min(300px, 36vw); }
}
@media (orientation: portrait) {
  /* logo abaixo do painel de status (a altura real vem do JS em --status-bottom) */
  body.touch #chat { top: calc(var(--status-bottom, 190px) + 6px); }
}

#reconnecting {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.75);
  font-weight: 700;
  animation: blink 1.2s infinite;
  pointer-events: none !important;
}

/* ---------------- conta (login Google) ---------------- */
#account { margin-bottom: 14px; padding: 12px; border-radius: 12px; background: #151a24; border: 1px solid #2d3443; }
#account small { display: block; margin-top: 6px; opacity: 0.65; font-size: 0.78rem; line-height: 1.35; }
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #222;
  font-weight: 700;
  font-size: 1rem;
}
.google-btn .g {
  font: 900 1.15rem Arial, sans-serif;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #4285f4 0 50%, #34a853 0 75%, #fbbc05 0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.link-btn { background: none; border: 0; color: #8fb3ff; text-decoration: underline; padding: 0; }

/* ---------------- mochila (inventário em grade, estilo RPG) ---------------- */
#bag { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); padding: 12px; }
.inv-box {
  width: min(400px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #3b2a1d, #2a1d14);
  border: 3px solid #8a6a43;
  box-shadow: 0 0 0 2px #1a110b, 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f3e6cf;
}
.inv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.inv-head h2 { margin: 0; font-size: 1.25rem; text-shadow: 0 2px 0 #000; }
.inv-head small { font-size: 0.85rem; color: #d4b98c; font-weight: 600; }
.inv-x { width: 32px; height: 32px; border-radius: 8px; border: 2px solid #8a6a43; background: #4a3424; color: #f3e6cf; font-weight: 900; }
.inv-body { display: flex; gap: 12px; align-items: flex-start; }
.inv-equip { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.72rem; color: #d4b98c; font-weight: 700; }
.inv-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot {
  aspect-ratio: 1;
  min-width: 52px;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 35%, #4e3a2a, #2b1e14);
  border: 2px solid #5c4430;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.08s, border-color 0.08s;
}
.slot.hand { width: 64px; border-color: #c9a227; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.55), 0 0 10px rgba(201, 162, 39, 0.35); }
.slot.filled { cursor: pointer; }
.slot.filled:hover { border-color: #c9a227; transform: translateY(-1px); }
.slot.sel { border-color: #ffd54a !important; box-shadow: 0 0 0 2px #ffd54a, 0 0 14px rgba(255, 213, 74, 0.6); }
.slot-icon { font-size: 1.8rem; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.inv-detail {
  margin-top: 12px;
  padding: 10px;
  min-height: 74px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #5c4430;
}
.inv-detail.empty { display: grid; place-items: center; color: #b09a78; font-size: 0.85rem; }
.det-head { display: flex; gap: 10px; align-items: center; }
.det-head div { display: flex; flex-direction: column; }
.det-head small { color: #d4b98c; font-size: 0.78rem; }
.det-icon { font-size: 2.2rem; }
.det-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.det-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid #8a6a43;
  background: #4a3424;
  color: #f3e6cf;
  font-weight: 800;
  font-size: 0.85rem;
}
.det-actions button.use { background: #2e7d32; border-color: #66bb6a; }
.det-actions button.drop { background: #5d1f1a; border-color: #c0392b; }
.inv-tip { display: block; margin-top: 8px; text-align: center; color: #b09a78; font-size: 0.72rem; }
body.touch .inv-tip { display: none; }

/* ---------------- barra vazia: aviso fixo ---------------- */
#need {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 420px);
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(192, 57, 43, 0.88);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none !important;
  animation: blink 1.4s infinite;
}
body.touch #need { top: auto; bottom: calc(240px + env(safe-area-inset-bottom)); max-width: 70vw; font-size: 0.8rem; }
#btn-bag { right: 168px; bottom: 104px; width: 50px !important; height: 50px !important; font-size: 1.1rem !important; }

/* ---------------- barrinha de opções (danças / bandeira) ---------------- */
#subbar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 24px);
}
#subbar-title { font-size: 0.75rem; font-weight: 700; opacity: 0.85; text-shadow: 0 1px 2px #000; }
#subbar-items { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#subbar-items button {
  padding: 8px 11px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 24, 33, 0.82);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
#subbar-items button:hover { background: rgba(40, 48, 66, 0.9); }
#subbar-items button.on { border-color: #6b8cff; background: rgba(43, 123, 255, 0.55); }
#subbar-items button.locked { opacity: 0.6; border-style: dashed; }
body.touch #subbar { bottom: auto; top: calc(44px + env(safe-area-inset-top)); }
body.touch #subbar kbd { display: none; }
body.touch #subbar-items button { padding: 10px 12px; font-size: 0.9rem; }

/* ---------------- loja de diamantes ---------------- */
.gem-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
  padding: 3px 4px 3px 8px;
  border-radius: 999px;
  border: 2px solid #4fc3f7;
  background: linear-gradient(90deg, #0d3b66, #155e9a);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}
.gem-btn .plus {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2ecc71;
  font-weight: 900;
}
.gem-btn .plus::after { content: '+'; }
.gem-btn.locked .plus { background: #6b7a8c; font-size: 0.7rem; }
.gem-btn.locked .plus::after { content: '🔒'; }
.gem-btn:hover { filter: brightness(1.15); }

#gem-store { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(0, 0, 0, 0.45); pointer-events: auto; }
.gem-box {
  width: min(460px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #102a43, #0b1d30);
  border: 3px solid #4fc3f7;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(79, 195, 247, 0.25);
  color: #eaf6ff;
}
/* ---------------- denúncia ---------------- */
#report { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(0, 0, 0, 0.45); pointer-events: auto; }
.report-label { display: block; margin: 10px 0 5px; font-weight: 700; font-size: 0.85rem; }
#report-player, #report-note {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #2a6f97;
  background: #0b1d30;
  color: #fff;
  font: inherit;
  font-size: 16px; /* evita zoom no iOS */
}
#report-note { resize: none; }
#report-send { margin-top: 12px; }
.chat-name { cursor: pointer; }
.chat-name:hover { text-decoration: underline; }

.gem-head { display: flex; justify-content: space-between; align-items: center; }
.gem-head h2 { margin: 0; font-size: 1.4rem; }
.gem-x { width: 34px; height: 34px; border-radius: 10px; border: 2px solid #4fc3f7; background: #133b5c; color: #fff; font-weight: 900; }
.gem-sub { margin: 6px 0 10px; opacity: 0.85; font-size: 0.88rem; }
.gem-reason { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 193, 7, 0.15); border: 1px solid #ffc107; font-weight: 700; font-size: 0.88rem; }
.gem-test { margin: 0 0 10px; font-size: 0.8rem; color: #ffd166; }
.gem-packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gem-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px 12px;
  border-radius: 14px;
  border: 2px solid #2a6f97;
  background: radial-gradient(circle at 50% 20%, #1b4f7a, #0f2c47);
  color: #fff;
  transition: transform 0.1s, border-color 0.1s;
}
.gem-pack:hover { transform: translateY(-2px); border-color: #4fc3f7; }
.gem-pack em {
  position: absolute;
  top: -9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ff6b35;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.gem-ico { font-size: 2.2rem; filter: drop-shadow(0 0 8px rgba(79, 195, 247, 0.7)); }
.gem-pack b { font-size: 1.3rem; }
.gem-price { margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: #2ecc71; font-weight: 800; font-size: 0.9rem; }
.gem-chosen { text-align: center; font-size: 1.1rem; font-weight: 800; margin: 4px 0 12px; }
.gem-pay {
  width: 100%;
  margin-bottom: 8px;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gem-pay small { font-weight: 600; opacity: 0.85; font-size: 0.75rem; }
.gem-pay.pix { background: linear-gradient(90deg, #00b894, #00a37a); }
.gem-pay.card { background: linear-gradient(90deg, #009ee3, #0077c8); }
.gem-pay:disabled { opacity: 0.6; }
.gem-link { display: block; margin: 4px auto 0; background: none; border: 0; color: #8fd3ff; text-decoration: underline; font-size: 0.85rem; text-align: center; }
.gem-center { text-align: center; }
.gem-qr { width: min(220px, 60vw); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; }
.gem-code { width: 100%; margin: 8px 0; padding: 8px; border-radius: 8px; border: 1px solid #2a6f97; background: #0b1d30; color: #cfe8ff; font: 0.72rem monospace; resize: none; }
.gem-waiting { font-size: 0.85rem; opacity: 0.9; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #4fc3f7; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.gem-big { font-size: 4rem; filter: drop-shadow(0 0 16px rgba(79, 195, 247, 0.9)); animation: pulse 1s infinite; }
.gem-center h3 { margin: 4px 0; font-size: 2rem; color: #7fe0ff; }
.gem-foot { display: block; margin-top: 12px; text-align: center; opacity: 0.6; font-size: 0.72rem; line-height: 1.4; }
.shop-money .buy-gems { margin-left: 6px; padding: 3px 10px; border-radius: 999px; border: 0; background: #155e9a; color: #fff; font-weight: 800; font-size: 0.8rem; }
.price.short { color: #c0392b !important; }
