/* ===== VARS + RESET ===== */
:root {
  color-scheme: only light;

  /* =========================
     🎯 PALETA PRINCIPAL
     ========================= */
  --color-bg:      #7eb3dc;
  --color-primary: #12b8f4;
  --color-danger:  #e35a4a;
  --color-warning: #ffcc33;
  --color-accent:  #f4a62a;

  --color-text-dark:  #06263a;
  --color-text-light: #ffffff;

  /* =========================
     🌫 SUPERFÍCIES (CYAN/BLUE)
     ========================= */
  --warm-0: #e9fbff;
  --warm-1: #c9f5ff;
  --warm-2: #9fe7fb;
  --warm-3: #68d4f6;
  --warm-4: #33bde8;
  --warm-5: #1399c8;

  /* =========================
     🌑 ESCALA ESCURA (TEAL)
     ========================= */
  --dark-0: #0d6c93;
  --dark-1: #08587a;
  --dark-2: #064764;
  --dark-3: #03354b;
  --dark-4: #022638;

  /* =========================
     ❄ ICE (CYAN PRINCIPAL)
     ========================= */
  --ice-0: #e9fbff;
  --ice-1: #bdf3ff;
  --ice-2: #73ddf8;
  --ice-3: #12b8f4;
  --ice-4: #0a92ca;
  --ice-5: #066f9d;

  /* =========================
     🌌 DEEP (PROFUNDIDADE)
     ========================= */
  --deep-0: #08587a;
  --deep-1: #064764;
  --deep-2: #03354b;
  --deep-3: #022638;
  --deep-4: #011926;

  /* =========================
     🎨 ACCENTS (CONTROLADOS)
     ========================= */
  --gem-yellow:     #ffcc33;
  --gem-yellow-dim: #c89b22;

  --coral:          #f4a62a;
  --coral-dim:      #c27a10;

  --mint:           #5affb2;
  --mint-dim:       #18b978;

  --violet:         #7d8cff;
  --violet-dim:     #5463d8;

  /* =========================
     📝 TEXTO
     ========================= */
  --text:       #06263a;
  --text-muted: #4f7f96;

  /* =========================
     📦 BASE
     ========================= */
  --bg:      #7eb3dc;
  --bg2:     #a9d1eb;
  --bg3:     #d2ecf7;
  --border:  rgba(18, 184, 244, 0.45);

  /* =========================
     📐 RADIUS / FONT
     ========================= */
  --radius-s:    10px;
  --radius-m:    14px;
  --radius-l:    20px;
  --radius-pill: 999px;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* Padding horizontal de página — sincronizado com .app-header */
  --pad-h:  max(12px, env(safe-area-inset-left,  0px));
  --pad-hr: max(12px, env(safe-area-inset-right, 0px));

  /* =========================
     🔁 LEGACY COMPAT
     ========================= */
  --accent:   var(--color-primary);
  --accent2:  var(--color-accent);
  --gold:     var(--gem-yellow);
  --green:    var(--mint);
  --red:      var(--color-danger);
  --text2:    var(--text-muted);

  --radius:    var(--radius-m);
  --radius-sm: var(--radius-s);

  /* =========================
     🧩 CARD / MODAL
     ========================= */
  --card-bg:           #04384c;
  --card-border:       #1dd2ff;
  --card-shadow:       #021d2b;

  --card-header-start: #3fd6ff;
  --card-header-end:   #0697cf;
  --card-header-text:  #ffffff;

  --coral-dark:        #9e5600;
  --coral-light:       #ffc266;

  /* =========================
     📊 CARGA DE SERVIDOR
     ========================= */
  --load-low:          #47d97c;
  --load-low-shadow:   #1e8f4a;
  --load-low-border:   #49b86d;

  --load-med:          #ffcc33;
  --load-med-shadow:   #a87d00;
  --load-med-border:   #c9a21a;

  --load-high:         #f4a62a;
  --load-high-shadow:  #8a5200;
  --load-high-border:  #c27a10;

  --load-full:         #e35a4a;
  --load-full-shadow:  #7a1f16;
  --load-full-border:  #b63a2c;

  --load-off:          #728392;
  --load-off-shadow:   #45515c;

  --load-maint:        #7d8cff;
  --load-maint-shadow: #434fb0;

  --load-locked-border: rgba(125, 140, 255, 0.6);

  /* =========================
     ⌨ INPUTS
     ========================= */
  --input-bg:          #04384c;
  --input-bg-focus:    #064764;
  --input-border:      #0fb6ed;
  --input-text:        #e9fbff;
  --input-focus:       #ffcc33;
  --input-placeholder: rgba(210, 245, 255, 0.45);

  /* =========================
     🔘 CTA (AJUSTADO)
     ========================= */
--cta-start:       #bdf3ff;  /* topo brilho */
--cta-mid:         #24c9f7;  /* azul principal */
--cta-end:         #0779b0;  /* base escura */

--cta-shadow:      #055880;  /* sombra externa */
--cta-border:      #0a90cc;  /* borda principal */

--cta-text:        #ffffff;  /* texto branco */
--cta-text-shadow: rgba(0, 200, 255, 0.4); /* glow leve */

  /* =========================
     🔵 BOTÃO SECUNDÁRIO
     ========================= */
  --btn-sec-start:       #8cecff;
  --btn-sec-mid:         #24c9f7;
  --btn-sec-end:         #0779b0;
  --btn-sec-shadow:      #055880;
  --btn-sec-border:      #0a90cc;
  --btn-sec-text-shadow: rgba(0,40,80,0.45);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select, button, a {
  touch-action: manipulation;
}

html,
body {
  height: 100%;
  width: 100%;
  background: radial-gradient(140% 60% at 50% -10%, #f0ece7 0%, #e3ded8 35%, #d4cfc9 70%, #c5bfb9 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ===== SCROLL GLOBAL ===== */
* {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(107,94,88,0.35) transparent;
}
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(107,94,88,0.35);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(107,94,88,0.6);
}

/* ===== SPA STRUCTURE ===== */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 2;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* splash: permite que dropdowns absolutos (país) transbordem */
#screen-splash {
  overflow: visible;
}

#screen-lobby {
  overflow: hidden;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}

#screen-waiting {
  overflow: hidden;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}
#screen-waiting::before {
 
}

#screen-game {
  background: #7fbbd9;
  overflow: hidden;
}

/* screens that scroll via inner flex: panel handles its own scroll */
#screen-levels {
  overflow: hidden;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}

#screen-ranking {
  overflow: hidden;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}

#screen-account {
  overflow: hidden;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}

/* screens that scroll as a whole: prevent flex from shrinking children */
#screen-auth {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#screen-auth.active>* {
  flex-shrink: 0;
}

/* ===== BG-SCAPE ===== */
.bg-scape {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-scape .clouds {
  position: absolute;
  top: 8%;
  left: 0;
  right: 0;
  height: 40px;
  opacity: 0.5;
  background:
    radial-gradient(40px 18px at 15% 50%, #fff 0%, transparent 70%),
    radial-gradient(60px 22px at 70% 50%, #fff 0%, transparent 70%),
    radial-gradient(30px 14px at 90% 50%, #fff 0%, transparent 70%);
}

.bg-scape .scape-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

/* ===== SNOW ===== */
.snow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snow .flake {
  position: absolute;
  top: -10px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.7;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  100% {
    transform: translate3d(20px, 110dvh, 0);
    opacity: 0.2;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    transform: translate(-50%, -12px);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(99, 171, 215, 0.7);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 55px rgba(99, 171, 215, 0.9);
  }
}

/* ===== APP HEADER ===== */
.app-header {
  position: relative;
  z-index: 5;
  padding: 6px 14px 10px;
  padding-top: calc(6px + var(--safe-top));
  padding-left: var(--pad-h);
  padding-right: var(--pad-hr);
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--dark-2);
  letter-spacing: 0.3px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 10px rgba(99, 171, 215, 0.3);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, #96c9e5 0%, #63abd7 50%, #4a8ab5 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 3px 0 #356a8e,
    0 6px 12px rgba(0, 0, 0, 0.2);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-title {
  font-size: 18px;
  line-height: 1;
}

.brand-sub {
  font-size: 10px;
  color: #4a8ab5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-weight: 500;
}

.hdr-spacer {
  flex: 1;
}

.icon-btn {
  appearance: none;
  border: 0;
  padding: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 3px 0 #356a8e,
    0 5px 10px rgba(0, 0, 0, 0.2);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
  position: relative;
  flex-shrink: 0;
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 #356a8e;
}

/* ===== PLAYER CARD ===== */
.player-card {
  position: relative;
  z-index: 5;
  margin: 4px 14px 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.92), rgba(236, 232, 226, 0.92));
  border-radius: var(--radius-m);
  border: 1.5px solid rgba(99, 171, 215, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 6px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(6px);
}

.player-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.level-icon-lobby {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
  object-fit: contain;
}

.player-main {
  min-width: 0;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--dark-2);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fda64c, #e08530);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(253, 166, 76, 0.4);
}

.currency-row {
  display: flex;
  gap: 10px;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
}

.curr {
  color: var(--dark-0);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #4a8ab5;
}

.curr.gold {
  color: var(--gem-yellow);
}

.curr-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.curr.gold .curr-dot {
  background: linear-gradient(180deg, #FFE071, #C9890B);
}

.level-chip {
  text-align: center;
  min-width: 58px;
  padding: 4px 6px;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, #ede9e3, #d4cfc9);
  border: 1px solid rgba(99, 171, 215, 0.3);
}

.level-chip .lv-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: #63abd7;
}

.level-chip .lv-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--dark-2);
  line-height: 1;
}

.xp-bar {
  margin-top: 4px;
  height: 4px;
  border-radius: 2px;
  background: #d4cfc9;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

.xp-bar>span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4CE0A0, #1FA06E);
  box-shadow: 0 0 6px rgba(76, 224, 160, 0.6);
}

/* ===== CHANNEL STRIP ===== */
.channel-strip {
  position: relative;
  z-index: 5;
  margin: 0 14px 10px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.9), rgba(236, 232, 226, 0.9));
  border-radius: var(--radius-m);
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.channel-strip::-webkit-scrollbar {
  display: none;
}

.ch-label {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  color: #63abd7;
  letter-spacing: 1.5px;
  padding: 8px 8px 0 6px;
  text-transform: uppercase;
}

.ch-btn {
  flex-shrink: 0;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ede9e3, #d4cfc9);
  color: #4a8ab5;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 0 rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ch-btn.active {
  background: linear-gradient(180deg, #fccc72, #e5a830);
  color: #3d3530;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.15),
    0 0 12px rgba(252, 204, 114, 0.5);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  position: relative;
  z-index: 5;
  margin: 0 14px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-seg {
  display: inline-flex;
  gap: 5px;
  background: rgba(236, 232, 226, 0.9);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(99, 171, 215, 0.2);
}

.seg-btn {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ice-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
}

.seg-btn:hover {
  background: rgba(99, 171, 215, 0.1);
}

.seg-btn.on {
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.2);
}

.room-filter {
  display: flex;
  background: #ede9e3;
  border: 2px solid rgba(99, 171, 215, 0.4);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.room-filter-btn {
  flex: 1;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(99,171,215,0.3) !important;
  border-radius: 0 !important;
  color: rgba(74,138,181,0.7) !important;
  height: 28px;
  padding: 0 10px !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer !important;
  transition: background 80ms, color 80ms !important;
  box-shadow: none !important;
}

.room-filter-btn:last-child {
  border-right: none !important;
}

.rf-short { display: none; }
.rf-full  { display: inline; }

@media (max-width: 359px) {
  .rf-full  { display: none; }
  .rf-short { display: inline; }
}

.room-filter-btn:active {
  background: rgba(99,171,215,0.15) !important;
  transform: none !important;
}

.room-filter-btn.on {
  background: #63abd7 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.seg-btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.seg-btn .dot.green {
  background: var(--mint);
  box-shadow: 0 0 6px var(--mint);
}

.seg-btn .dot.orange {
  background: var(--gem-yellow);
  box-shadow: 0 0 6px var(--gem-yellow);
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 32px;
  background: linear-gradient(180deg, #f8f5f2, #ede9e3);
  border: 1px solid rgba(99, 171, 215, 0.3);
  border-radius: 999px;
  color: #4a8ab5;
  font-size: 12px;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.search-field input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--dark-2);
  font-family: var(--font-body);
  font-size: 12px;
  flex: 1;
  min-width: 0;
}

.search-field input::placeholder {
  color: #b5aeaa;
}

/* ===== PANEL ===== */
.panel {
  position: relative;
  z-index: 5;
  margin: 0 14px;
  flex: 1;
  background: rgba(248, 245, 242, 0.6);
  border-radius: var(--radius-m);
  border: 1px solid rgba(99, 171, 215, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(99, 171, 215, 0.08);
  border-bottom: 1px solid rgba(99, 171, 215, 0.15);
}

.panel-head .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dark-2);
}

.panel-head .count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #63abd7;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 171, 215, 0.15);
  border: 1px solid rgba(99, 171, 215, 0.3);
}

.panel-head .grow {
  flex: 1;
}

.mini-btn {
  border: 0;
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== ROOMS LIST ===== */
.rooms {
  list-style: none;
  padding: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.rooms::-webkit-scrollbar {
  width: 4px;
}

.rooms::-webkit-scrollbar-thumb {
  background: rgba(99, 171, 215, 0.3);
  border-radius: 2px;
}

/* ===== ROOM CARD ===== */
@keyframes rc-shimmer {
  0%   { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(300%) skewX(-18deg); }
}

.room-card {
    cursor: pointer;
    overflow: visible;
    transition: transform 80ms;
    position: relative;
    height: 90px;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.rc-inner {
    border: 2px solid #000000;
    border-radius: 10px;
    background: #008ce8;
    box-shadow: inset -2px -2px 2px rgb(0 0 0 / 61%), inset 3px 3px 0 rgba(180, 220, 255, 0.35);
    overflow: hidden;
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* brilho no topo */
.rc-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.room-card.disabled {
  opacity: 1;
  cursor: default;
  filter: none;
  pointer-events: none;
}

.room-card:not(.disabled):active {
  transform: translateY(4px);
}

/* mini-cano conector por card via ::after */
#screen-lobby .rooms .room-card::after {
content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 25px;
    background: repeating-linear-gradient(to right, #1661a1 0px, #2089f1 6px, #1a8fd4 12px, #2aa8e8 15px, #48a1d5 18px, #1c7cdd 24px, #0e57ad 30px, #155a9d 36px, #125995b0 42px);
    border-radius: 5px;
    box-shadow: inset -1px 3px 1px 2px rgb(255 255 255 / 21%), inset 4px -2px 2px rgb(0 0 0 / 27%) !important;
    border-top: 1px solid #00080f;
    border-bottom: 2px solid #00080f;
    z-index: 6;
    pointer-events: none;
}

/* coluna esquerda (ímpar): entra sobre o cano */
#screen-lobby .rooms .room-card:nth-child(odd)::after {
  right: -20px;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.1),
    inset 0 -2px 3px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,8,15,0.3),
    -3px 0 6px rgba(0,0,0,0.25);
}

/* coluna direita (par): entra sobre o cano */
#screen-lobby .rooms .room-card:nth-child(even)::after {
  left: -20px;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.1),
    inset 0 -2px 3px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,8,15,0.3),
    3px 0 6px rgba(0,0,0,0.25);
}

.rc-top {
  padding: 5px;
  position: relative;
  z-index: 2;
  background: transparent;
}

.rc-top-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: #0d2a52;
  border-radius: 6px;
  border: 1px solid rgba(10,31,61,0.8);
}

.rc-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ffe766;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(255,220,80,0.4);
  border-radius: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.rc-num.locked {
  color: #d4b0ff;
  border-color: rgba(180,139,255,0.4);
  background: rgba(100,60,180,0.3);
}

.rc-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 5px rgba(0,0,0,0.9);
}

.rc-count {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #ffe766;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(255,220,80,0.4);
  border-radius: 20px;
  padding: 1px 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.rc-count.full {
  color: #ff6060;
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,80,80,0.5);
}

.rc-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.12);
  position: relative;
  z-index: 2;
  flex: 1;
}

.rc-status {
  font-family: 'Lilita One', var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 0px;
  flex-shrink: 0;
}
@keyframes wait-pulse {
  0%, 100% {
    text-shadow:
      -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6),
      -1px  1px 0 rgba(0,0,0,0.6), 1px  1px 0 rgba(0,0,0,0.6),
      0 0 10px rgba(255,214,0,0.9), 0 0 22px rgba(255,214,0,0.5);
  }
  50% {
    text-shadow:
      -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6),
      -1px  1px 0 rgba(0,0,0,0.6), 1px  1px 0 rgba(0,0,0,0.6),
      0 0 3px rgba(255,214,0,0.3), 0 0 6px rgba(255,214,0,0.1);
  }
}

.rc-status.wait {
  color: #ffd600;
  background: none;
  border-color: transparent;
  box-shadow: none;
  animation: wait-pulse 1.6s ease-in-out infinite;
}
.rc-status.full {
  color: #ff8080;
  background: none;
  border-color: transparent;
  box-shadow: none;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 2px 6px rgba(255,255,255,0.25);
}
.rc-status.playing {
  color: #c0c0c0;
  background: none;
  border-color: transparent;
  box-shadow: none;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 2px 6px rgba(255,255,255,0.2);
}

.rc-map-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid rgba(62,168,216,0.5);
  border-radius: 8px;
  overflow: hidden;
  background: #0a1e38;
  min-width: 0;
}

.rc-map-wrap .rc-mode {
  width: 46px;
  flex-shrink: 0;
  border-radius: 0;
  border: none;
  border-left: 2px solid rgba(62,168,216,0.4);
  margin: 0;
  padding: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-size: 8px;
}

.rc-map {
  flex: 1;
  height: 28px;
  overflow: hidden;
  background: transparent;
  border: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  animation: rc-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.room-card.disabled .rc-map::after,
.room-card.disabled .rc-map-wrap::after,
.room-card.full .rc-map::after,
.room-card.full .rc-map-wrap::after {
  display: none;
}
.rc-map-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.75;
  pointer-events: none;
}
.rc-map-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.rc-mode {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 6px;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  /* fallback */
  color: #90d8ff;
  background: rgba(62,168,216,0.15);
  border: 2px solid rgba(62,168,216,0.4);
}

/* Badges de modo — lobby rc-mode + waiting wr-mode-btn */
.gm-normal {
  color: #fff !important;
  background: #7bc74e !important;
  border-color: #0e6634 !important;
  box-shadow: 0 2px 0 #0e6634, inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6) !important;
}
.gm-score {
  color: #fff !important;
  background: #2288cc !important;
  border-color: #125a8a !important;
  box-shadow: 0 2px 0 #125a8a, inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6) !important;
}
.gm-tag {
  color: #fff !important;
  background: #cc2222 !important;
  border-color: #8a0e0e !important;
  box-shadow: 0 2px 0 #8a0e0e, inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6) !important;
}
.gm-same {
  color: #fff !important;
  background: #a268db !important;
  border-color: #4a0e8a !important;
  box-shadow: 0 2px 0 #4a0e8a, inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6) !important;
}
.gm-boss {
  color: #fff !important;
  background: #df8021 !important;
  border-color: #8a3e00 !important;
  box-shadow: 0 2px 0 #8a3e00, inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6) !important;
}

.rc-watch-btn {
  background: rgba(255,165,0,0.15);
  border: 1px solid rgba(255,165,0,0.5);
  color: #ffa500;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.rc-watch-btn:hover { background: rgba(255,165,0,0.3); }
.rc-watch-btn:active { filter: brightness(1.2); }

/* ===== TABBAR ===== */
.tabbar {
  position: relative;
  z-index: 20;
  margin-top: 8px;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(6, 25, 43, 0.9) 0%, rgba(2, 10, 20, 1) 100%);
  border-top: 1.5px solid rgba(99, 171, 215, 0.25);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.tabbar .tab {
  border: 0;
  background: transparent;
  color: #5D88A6;
  padding: 6px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.5px;
  position: relative;
  transition: color 150ms;
}

.tabbar .tab svg {
  width: 22px;
  height: 22px;
}

.tabbar .tab.active {
  color: #FFD33D;
}

.tabbar .tab.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--gem-yellow);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--gem-yellow);
}

.tabbar .tab.danger {
  color: var(--coral);
}

.tab-primary-inner {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #FFE071 0%, #FFD33D 50%, #E5A90B 100%);
  color: #3A2800;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1.5px 0 rgba(122, 80, 0, 0.5),
    0 3px 0 #7A5A00;
  margin-top: -6px;
  margin-bottom: -2px;
}

/* Waiting bottom actions */
.waiting-actions {
  position: relative;
  z-index: 20;
  padding: 8px 14px calc(10px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.95) 0%, rgba(236, 232, 226, 1) 100%);
  border-top: 1.5px solid rgba(99, 171, 215, 0.25);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 8px;
}

/* ===== BTN-GAME (estilo Gunbound — bordas concêntricas + glow neon) ===== */

.btn-label {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fffbe0;
    text-shadow:
    -1px -1px 0 #000a1e,
     1px -1px 0 #000a1e,
    -1px  1px 0 #000a1e,
     1px  1px 0 #000a1e,
    -2px  0   0 #000a1e,
     2px  0   0 #000a1e,
     0   -2px 0 #000a1e,
     0    2px 0 #000a1e,
     0    3px 4px rgba(0,8,30,0.7);
}

/* ===== BOTÃO UNIVERSAL ===== */
.btn-game, .bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 1px solid #07427ec7;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #e9c300;
    position: relative;
    background: linear-gradient(180deg, #ccf0ff 0%, #54d3f9 30%, #ffffff7a 65%, #0080cc00 100%);
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 1px 1px 3px 0px #000;
}
.btn-game::before, .bb-btn::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 3%;
    width: 95%;
    height: 90%;
    border: 3px solid rgb(0 150 247 / 55%);
    background: radial-gradient(ellipse at 50% 20%, rgb(255 255 255 / 19%) 0%, rgb(255 255 255 / 25%) 45%, rgba(255, 255, 255, 0) 100%);
    border-radius: 12px;
    box-shadow: 0px 0px 0px 0px #000000;
    pointer-events: none;
}
.btn-game:active, .bb-btn:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}
.btn-game:disabled, .bb-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.bb-btn--full   { width: 100%; }
.bb-btn--icon   { width: 36px; height: 36px; padding: 0; flex-shrink: 0; }
.bb-btn--cancel { margin-right: auto; }

/* ===== CTA BUTTONS ===== */
.cta {
  appearance: none;
  cursor: pointer;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--cta-border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cta-text);
  text-shadow: 0 1px 0 var(--cta-text-shadow);
  background: linear-gradient(180deg,
    var(--cta-start) 0%,
    var(--cta-mid)   45%,
    var(--cta-end)   100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.75),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 5px 0 var(--cta-shadow),
    0 8px 20px rgba(0,0,0,0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 100ms, box-shadow 100ms;
}
.cta:hover:not(:disabled) {
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.85),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 6px 0 var(--cta-shadow),
    0 10px 24px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.cta:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.6),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 1px 0 var(--cta-shadow);
}

.cta.secondary {
  border-color: var(--btn-sec-border);
  background: linear-gradient(180deg,
    var(--btn-sec-start) 0%,
    var(--btn-sec-mid)   45%,
    var(--btn-sec-end)   100%);
  color: #fff;
  text-shadow: 0 1px 2px var(--btn-sec-text-shadow);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.55),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 5px 0 var(--btn-sec-shadow),
    0 8px 20px rgba(0,0,0,0.28);
}
.cta.secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.65),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 6px 0 var(--btn-sec-shadow),
    0 10px 24px rgba(0,0,0,0.3);
}

.cta.ghost {
  background: transparent;
  border: 2px solid rgba(99,171,215,0.45);
  color: var(--btn-sec-mid);
  text-shadow: none;
  box-shadow: none;
}

.cta.danger {
  border-color: var(--coral-dark);
  background: linear-gradient(180deg,
    var(--coral-light) 0%,
    var(--coral)       45%,
    var(--coral-dim)   100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(80,0,0,0.4);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.55),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 5px 0 var(--coral-dark),
    0 8px 20px rgba(0,0,0,0.28);
}

.cta.mint {
  background: linear-gradient(180deg, #7EF0B9 0%, #4CE0A0 50%, #1FA06E 100%);
  color: #04391F;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 4px 0 #0B5A3D,
    0 8px 16px rgba(0, 0, 0, 0.35);
}

.cta.small {
  padding: 8px 14px;
  font-size: 12px;
}

.cta.block {
  display: flex;
  width: 100%;
}

.cta-ready-active {
  background: linear-gradient(180deg, #fdc07a 0%, var(--color-accent) 50%, #e08530 100%) !important;
  color: #fff !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 4px 0 #b56a1a, 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

@keyframes btn-pulse {

  0%,
  100% {
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 4px 0 #0B5A3D, 0 0 0 rgba(78, 224, 160, 0);
  }

  50% {
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 4px 0 #0B5A3D, 0 0 18px rgba(78, 224, 160, 0.8);
  }
}

.btn-pulse {
  animation: btn-pulse 1s ease-in-out infinite;
}

/* ===== LEGACY BUTTONS (auth screen) ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  padding: 14px 24px;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 120ms, box-shadow 120ms;
}

.btn:active {
  transform: translateY(2px);
}

.btn-primary {
  background: linear-gradient(180deg, #fce38a 0%, #fccc72 50%, #e5a830 100%);
  color: #3d3530;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(122, 80, 0, 0.3),
    0 4px 0 #c5881a,
    0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(99, 171, 215, 0.4);
  color: #4a8ab5;
}

.btn-outline:hover {
  background: rgba(99, 171, 215, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(99, 171, 215, 0.2);
}

.btn-xl {
  font-size: 1.2rem;
  padding: 18px 32px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-display);
  align-self: flex-start;
  padding: 4px 0;
}

.btn-fire {
  background: linear-gradient(135deg, var(--ice-3), #ff8c00);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1.1rem;
  font-weight: 900;
  padding: 14px 28px;
  cursor: pointer;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 184, 217, 0.5);
}

.btn-fire:active {
  transform: scale(0.95);
}

.btn-copy {
  background: rgba(99, 171, 215, 0.1);
  border: 1px solid rgba(99, 171, 215, 0.3);
  border-radius: 8px;
  color: #63abd7;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-body);
}

/* ===== SECONDARY SCREEN HEADER ===== */
.screen-head {
  position: relative;
  z-index: 5;
  padding: 8px 14px 10px;
  padding-top: calc(8px + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #3FB0D9, #1585B2);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.3),
    0 3px 0 #06334C;
}

.screen-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  flex: 1;
}

.screen-head .sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #4a8ab5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ===== MODAL ===== */

/* ── Sistema unificado de popup ─────────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.popup-overlay.hidden { display: none; }

.popup {
  width: 100%;
  max-width: 290px;
  max-height: calc(100dvh - 32px);
  background: #0ea3d8;
  border: 3px solid #001428;
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: 0 6px 0 #00080f, 0 12px 32px rgba(0,0,0,0.4);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
}
.popup--wide { max-width: 340px; }
#bl-add-modal .popup { max-width: 400px; }

.popup-title {
  margin: 0 -16px 2px;
  padding: 14px 16px 12px;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.popup-title::before {
  content: '';
  position: absolute;
  top: 0; left: -5%; width: 110%; height: 50%;
  background: rgba(255,255,255,0.42);
  pointer-events: none;
}
.popup-title::after {
  content: '';
  position: absolute;
  top: 50%; left: -5%; width: 110%; height: 4px;
  transform: translateY(-50%);
  background: #001428;
  pointer-events: none;
}

.popup-badge {
  display: inline-block;
  position: relative;
  z-index: 1;
  background: #001428;
  border: 2px solid #000a14;
  border-radius: 8px;
  padding: 4px 14px 3px;
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: #001428;
  font-size: 13px;
  line-height: 1.6;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,20,40,0.3) transparent;
}
.popup-body::-webkit-scrollbar { width: 4px; }
.popup-body::-webkit-scrollbar-thumb { background: rgba(0,20,40,0.25); border-radius: 2px; }
.popup-body p { margin: 0; color: #001428; }

.popup-hint {
  font-size: 0.83rem;
  color: #001428;
  opacity: 0.8;
  margin: 0;
}

.popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
  background: transparent;
  padding: 0;
}
.popup-actions:empty { display: none; }

.popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #07427ec7;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ccf0ff 0%, #54d3f9 30%, #ffffff7a 65%, #0080cc 100%);
  box-shadow: 1px 1px 3px 0px #000;
  transition: transform 0.1s, filter 0.1s;
}
.popup-btn:active { transform: scale(0.96); filter: brightness(0.92); }
.popup-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.popup-btn--cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1.5px solid rgba(0,20,40,0.4);
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #001428;
  background: rgba(0,0,0,0.12);
  box-shadow: none;
  transition: transform 0.1s, filter 0.1s;
}
.popup-btn--cancel:active { transform: scale(0.96); filter: brightness(0.92); }

.pp-add-friend-btn {
  background: linear-gradient(180deg, #a8ffd8, #3fcb8a);
  border-color: #3fcb8a;
  box-shadow: 1px 1px 3px 0px #000;
}

.popup-btn--danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #7a0000c7;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffe040;
  background: linear-gradient(180deg, #ffcccc 0%, #f95454 30%, #ffffff7a 65%, #cc000000 100%);
  box-shadow: 1px 1px 3px 0px #000;
  transition: transform 0.1s, filter 0.1s;
}
.popup-btn--danger:active { transform: scale(0.96); filter: brightness(0.92); }

.popup-input {
  width: 100%;
  background: #001020;
  border: 1.5px solid #003d5c;
  border-radius: var(--radius-pill);
  color: #e9fbff;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  box-sizing: border-box;
  outline: none;
  touch-action: manipulation;
  transition: border-color 0.18s, background 0.18s;
}
.popup-input::placeholder { color: rgba(200,236,255,0.4); }
.popup-input:focus { background: #001a2e; border-color: #0ea3d8; box-shadow: none; }

.kicked-popup-icon { font-size: 36px; text-align: center; padding: 12px 0 4px; }

/* ── Legacy (lobby usa .field, .field-label, .mode-grid internamente) ─ */
.modal-backdrop,
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: grid;
  place-items: center;
  animation: fade 180ms;
  padding: 14px;
}

.modal,
.modal-panel {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 0 18px 18px;
  box-shadow: 0 6px 0 var(--card-shadow), 0 16px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: pop 200ms cubic-bezier(.22, .9, .34, 1);
}

.modal h2,
.modal-title {
  margin: 0 -18px 16px;
  padding: 14px 18px 12px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-header-text);
  font-weight: 800;
  background: linear-gradient(180deg, var(--card-header-start) 0%, var(--card-header-end) 100%);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.field,
.form-field {
  margin-bottom: 12px;
}

.field label,
.form-field label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dark-2);
  margin-bottom: 6px;
}

.text-input,
.field input,
.field select,
.form-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--input-bg) !important;
  border: 2px solid var(--input-border);
  border-radius: 10px;
  color: var(--input-text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: 0;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.text-input::placeholder,
.field input::placeholder,
.form-field input::placeholder {
  color: var(--input-placeholder);
}

.text-input:focus,
.field input:focus,
.field select:focus,
.form-field input:focus {
  border-color: var(--input-focus);
  background: var(--input-bg-focus) !important;
  box-shadow: 0 0 0 2px rgba(253,166,76,0.2);
}

.field select {
  -webkit-appearance: none;
  appearance: none;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-option,
.mode-btn {
  border: 2px solid rgba(99,171,215,0.3);
  background: linear-gradient(180deg, #ede9e3, #d4cfc9);
  color: rgba(74,138,181,0.9);
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  transition: transform 0.1s, box-shadow 0.1s;
}
.mode-option:active,
.mode-btn:active { transform: translateY(4px); box-shadow: none; }

.mode-option.on,
.mode-btn.active {
  border-color: #fccc72;
  background: linear-gradient(180deg, #fccc72, #e5a830);
  box-shadow: 0 4px 0 #c5881a;
  color: #3d3530;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.slots-row {
  display: flex;
  gap: 6px;
}

.mode-seg {
  display: flex;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 10px;
  overflow: hidden;
}
.mode-seg-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  color: rgba(200,190,180,0.5);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.12s, color 0.12s;
}
.mode-seg-btn:first-child { border-left: none; }
.mode-seg-btn.active {
  background: linear-gradient(180deg, var(--cta-start), var(--cta-end));
  color: var(--cta-text);
}

.create-pw-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  color: var(--dark-2);
  font-size: 0.875rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.create-pw-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--input-focus);
  cursor: pointer;
  flex-shrink: 0;
}

.slot-btn {
  flex: 1;
  padding: 10px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  cursor: pointer;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.88), rgba(236, 232, 226, 0.88));
  color: #4a8ab5;
}

.slot-btn.on {
  background: linear-gradient(180deg, #3FB0D9, #1585B2);
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(99, 171, 215, 0.1);
}

.switch-row .txt .t {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}

.switch-row .txt .s {
  font-size: 11px;
  color: var(--text-muted);
}

.switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d4cfc9;
  border: 1px solid rgba(99, 171, 215, 0.3);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 180ms;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #C3E9F7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: left 180ms;
}

.switch.on {
  background: linear-gradient(180deg, #4CE0A0, #1FA06E);
}

.switch.on::after {
  left: 22px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions .cta,
.modal-actions .btn {
  flex: 1;
}

.form-error {
  color: var(--coral);
  font-size: 0.9rem;
  min-height: 0;
}

.form-error:empty {
  display: none;
}

/* ===== AUTH SCREEN ===== */
.screen-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 20px;
  padding-bottom: 32px;
  gap: 16px;
  overflow-y: auto;
}

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(99, 171, 215, 0.2);
  margin-bottom: 4px;
}

.tabs .tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px;
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tabs .tab.active {
  color: var(--ice-3);
  border-bottom-color: var(--ice-3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gender-options {
  display: flex;
  gap: 12px;
}

.gender-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  border-radius: 6px;
  flex: 1;
  justify-content: center;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.gender-option:has(input:checked) {
  border-color: var(--ice-3);
  background: rgba(99, 171, 215, 0.12);
}

.gender-option input {
  display: none;
}

.screen-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}

.screen-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== LOBBY SPECIFIC ===== */
.lobby-notice {
  background: linear-gradient(135deg, #c0251a, #8c1010);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  border-radius: 12px;
  border: 2px solid #701010;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  margin: 0 14px 8px;
  position: relative;
  z-index: 5;
  box-shadow: 0 3px 0 #5a0c0c, 0 4px 12px rgba(0,0,0,0.4);
}

.empty-state {
  padding: 36px 14px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
}

.empty-state .ico {
  font-size: 38px;
  margin-bottom: 8px;
  opacity: 0.5;
}

#join-error {
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 4px 14px;
  min-height: 18px;
  position: relative;
  z-index: 5;
}

/* ===== LOBBY PLAYER CARD ===== */
.lobby-profile-row {
  display: flex;
  align-items: stretch;
  margin: 8px 14px 10px;
  flex-shrink: 0;
  background: #ede9e3;
  border: 2px solid rgba(99,171,215,0.35);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 0 #c5bfb9, 0 6px 20px rgba(0,0,0,0.1);
}

.las-avatar-wrap {
  position: relative;
  width: 110px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 55%, #356a8e 100%);
  border-right: 2px solid rgba(99,171,215,0.4);
}

.hpc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hpc-main-row {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 12px 8px;
  gap: 8px;
}

.hpc-name-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hpc-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.hpc-username {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.hpc-rank-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hpc-rank-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.hpc-rank-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hpc-rank-line .hpc-gp-line {
  margin-left: auto;
}

.hpc-level-img {
  width: 20px;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hpc-rl-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
}

.hpc-rl-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.hpc-gp-line {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #FFD33D;
}

.hpc-coins-row {
  display: flex;
  border-top: 1px solid rgba(99,171,215,0.35);
  padding: 6px 12px;
}

.hpc-coin {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.3px;
}

.hpc-coin + .hpc-coin {
  border-left: 1px solid rgba(99,171,215,0.35);
  padding-left: 12px;
}

.hpc-coin-val {
  font-weight: 700;
}

.hpc-gold { color: #FFD33D; }
.hpc-cash { color: #4CE0A0; }
.hpc-gp   { color: #FFD33D; }

.hpc-meta-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hpc-position {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #FFD33D;
  margin-left: auto;
}

.hpc-stats-row {
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 6px 0;
}

.hpc-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.hpc-stat + .hpc-stat {
  border-left: 1px solid rgba(99,171,215,0.25);
}

.hpc-stat-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

.hpc-stat-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

#lobby-avatar-preview {
  position: absolute !important;
  width: 64px;
  height: 96px;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  overflow: visible !important;
  z-index: 2;
  pointer-events: none;
}

/* ===== LOBBY SCREEN THEME ===== */
/* ===== HEADER COMPARTILHADO ===== */
.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  padding-top: calc(8px + var(--safe-top));
  padding-left: var(--pad-h);
  padding-right: var(--pad-hr);
  flex-shrink: 0;
  background: rgba(0, 10, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(42, 112, 168, 0.3);
  position: relative;
  z-index: 10;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* ── Filtros de modo no header do lobby ── */
.lobby-mode-filters {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
}
.lmf-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.1s;
  flex-shrink: 0;
  min-width: 36px;
  height: 36px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  border: 1px solid rgba(0,0,0,0.35);
}
.lmf-btn svg {
  flex-shrink: 0;
}
.lmf-btn:hover {
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.8);
}
.lmf-btn:active {
  transform: scale(0.95);
}
.lmf-btn.active {
  background: rgba(18, 140, 232, 0.85);
  color: #fff;
  border-color: rgba(100, 190, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.lmf-btn.active svg {
  filter: drop-shadow(0 0 3px rgba(180,230,255,0.6));
}


/* Botão de mute — visual base */
.audio-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  transition: background 0.15s, transform 0.12s;
  flex-shrink: 0;
}
/* Global fixo — canto inferior esquerdo, alinhado com o hamburger */
#audio-toggle {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: calc(14px + env(safe-area-inset-left));
  z-index: 9999;
}
/* Oculta o global quando a tela já tem o botão no header */
.screen--haudio.active ~ #audio-toggle { display: none; }
.audio-toggle-btn:hover  { background: rgba(0,0,0,0.55); }
.audio-toggle-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.audio-toggle-btn .audio-off { display: none; }
.audio-toggle-btn.audio-muted {
  background: rgba(20,16,12,0.55);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.38);
}
.audio-toggle-btn.audio-muted .audio-on  { display: none; }
.audio-toggle-btn.audio-muted .audio-off { display: block; }

/* Componente de logo — path definido aqui, uma única vez */
.app-logo {
  background-image: url('/assets/logo.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  display: inline-block;
}

.app-header-logo {
  height: 34px;
  width: 150px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.app-header-back {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid #07427ec7;
  background: linear-gradient(180deg, #ccf0ff 0%, #54d3f9 30%, #3ab8ee 65%, #0070bb 100%);
  box-shadow: 1px 1px 3px 0px #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.app-header-back::before {
  content: '';
  position: absolute;
  top: 5%;
  left: 3%;
  width: 95%;
  height: 90%;
  border: 3px solid rgb(0 150 247 / 55%);
  background: radial-gradient(ellipse at 50% 20%, rgb(255 255 255 / 19%) 0%, rgb(255 255 255 / 25%) 45%, rgba(255, 255, 255, 0) 100%);
  border-radius: 12px;
  pointer-events: none;
}
.app-header-back--warm {
  background: linear-gradient(180deg, #ffe566 0%, #ffc800 35%, #e6a000 100%);
  border-color: #6b4200e0;
}
.app-header-back--warm::before {
  border-color: rgba(180, 120, 0, 0.6);
}
.app-header-back--warm svg {
  stroke: #fff;
  filter:
    drop-shadow(-1px 0 0 rgba(255,200,0,0.4))
    drop-shadow( 1px 0 0 rgba(255,200,0,0.4));
}

.app-header-back:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}
.app-header-back svg {
  color: #fff;
  filter:
    drop-shadow(-1px  0   0 rgba(0,0,0,0.9))
    drop-shadow( 1px  0   0 rgba(0,0,0,0.9))
    drop-shadow( 0  -1px  0 rgba(0,0,0,0.9))
    drop-shadow( 0   1px  0 rgba(0,0,0,0.9))
    drop-shadow( 0   2px  3px rgba(0,0,0,0.7));
}

/* ===== HAMBÚRGUER ===== */
.hamburger-btn {
  justify-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  transition: all 80ms;
}
.hamburger-btn span {
  display: block;
  height: 2.5px;
  background: #fff;
  border-radius: 3px;
  transition: all 200ms;
}
.hamburger-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== MENU LATERAL ===== */
.lmenu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 250ms ease;
}
.lmenu-overlay.visible { opacity: 1; }

.lmenu-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 72%;
  max-width: 240px;
  z-index: 51;
  display: flex;
  flex-direction: column;
  background: #071e30;
  border-right: 2px solid #1a5480;
  box-shadow: 6px 0 30px rgba(0,0,0,0.6);
  transform: translateX(-105%);
  transition: transform 280ms cubic-bezier(0.34, 1.2, 0.64, 1);
}
.lmenu-panel.open { transform: translateX(0); }

.lmenu-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 10px 4px;
  margin-top: calc(10px + var(--safe-top));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(42, 112, 168, 0.4);
  background: rgba(14, 48, 80, 0.8);
  cursor: pointer;
  transition: all 80ms;
  flex-shrink: 0;
}
.lmenu-profile:active { transform: translateY(1px); }

.lmenu-profile-level {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.lmenu-profile-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.lmenu-buycash-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFD33D 0%, #E5A90B 100%);
  border: 2px solid #FFE566;
  border-bottom-color: #8a6000;
  color: #2a1800;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 3px 0 #7a5000, 0 4px 12px rgba(255,180,0,0.25);
  transition: all 80ms;
  flex-shrink: 0;
}
.lmenu-buycash-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.lmenu-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  overflow-y: auto;
}

.lmenu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 80ms, border-color 80ms;
  cursor: pointer;
}
.lmenu-item:active {
  background: rgba(42, 112, 168, 0.2);
  border-left-color: #2a70a8;
}

.lmenu-label {
  flex: 1;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: #a8d0e8;
  letter-spacing: 0.05px;
}

.lmenu-item svg {
  color: rgba(168, 208, 232, 0.25);
  flex-shrink: 0;
}

#lmenu-logout .lmenu-label {
  color: rgba(255, 160, 160, 0.8);
}
#lmenu-logout svg {
  color: rgba(255, 160, 160, 0.3);
}

/* ===== LOBBY PANEL ===== */
/* ── Lobby landscape ── */

.lobby-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  padding: 6px var(--pad-hr) 4px var(--pad-h);
  min-height: 0;
}

.lobby-left {
  width: 225px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.lobby-profile-panel {
  flex: 1;
  width: 225px;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.lobby-left-bar {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 4px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}


.lsf-btn {
  flex-direction: column !important;
  gap: 0;
  flex: 1 !important;
  width: 100% !important;
  height: auto !important;
  padding: 8px 14px !important;
  font-size: 1rem !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  color: #e9c300 !important;
}

.lsf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.lsb-card-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
}

.lsb-btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
}

.lsf-btn-group {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
}

.lsb-btn-group .app-header-back {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
}

.app-header-back--danger {
  background: linear-gradient(180deg, #ff8a6e 0%, #e03a1a 35%, #a01800 100%);
  border-color: #7a1000c7;
}
.app-header-back--danger::before {
  border-color: rgba(255, 120, 80, 0.5);
}
.app-header-back--danger svg {
  stroke: #fff;
  filter:
    drop-shadow(-1px 0 0 rgba(0,0,0,0.6))
    drop-shadow( 1px 0 0 rgba(0,0,0,0.6));
}



.lobby-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.lobby-rooms-panel {
  will-change: transform;
}

/* Profile card */
.lobby-profile-card {
  flex: 1;
  min-height: 0;
}

.lobby-profile-body {
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 0 !important;
  gap: 0;
}

.lobby-profile-body .las-avatar-wrap {
  width: 100%;
  min-height: 100px;
  flex-shrink: 0;
  border-bottom: 2px solid rgba(0,0,0,0.2);
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 55%, #356a8e 100%);
  position: relative;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.lobby-profile-body .hpc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 0;
  background-color: #033043;
}

.lobby-profile-body .hpc-name-row {
  padding: 8px 10px;
  gap: 8px;
}

.lobby-profile-body .hpc-level-img {
  width: 100%px;
}

.lobby-profile-body .hpc-stats-row {
  padding: 5px 0 6px;
  margin: 0;
}



/* Criar Sala — destaque dourado */
.lobby-btn-create {
  background: linear-gradient(180deg, #ffe566 0%, #ffc800 35%, #e6a000 100%) !important;
  color: #2a1800 !important;
  border-color: #a06800c7 !important;
  gap: 6px;
}
.lobby-btn-create::before {
  border-color: rgba(255,220,50,0.5) !important;
}

/* Botões soltos da lobby-left precisam de fundo opaco (sem card atrás) */
.lobby-left .bb-btn:not(.lobby-btn-create) {
  background: linear-gradient(180deg, #ccf0ff 0%, #54d3f9 30%, #2080bb 65%, #005fa0 100%);
}

/* Nav btns: Servidores + Shop */
.lobby-nav-btns {
  display: flex;
  gap: 6px;
}
.lobby-nav-btns .bb-btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 8px 6px;
}

.lobby-rooms-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
  position: relative;
}


.rooms-pipe {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  background: repeating-linear-gradient(to right, #1661a1 0px, #2089f1 6px, #1a8fd4 12px, #2aa8e8 15px, #1a8fd4 18px, #1c7cdd 24px, #0e57ad 30px, #155a9d 36px, #125995b0 42px);
  border: 2px solid #00080f;
  border-radius: 10px;
  box-shadow: inset -9px 6px 1px 2px rgb(0 0 0 / 23%), inset -1px 0 17px rgb(0 0 0 / 22%);
  z-index: 0;
  pointer-events: none;
}

.rooms-pipe::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(255,255,255,0.08) 30%,
    rgba(255,255,255,0.22) 45%,
    rgba(255,255,255,0.28) 50%,
    rgba(255,255,255,0.22) 55%,
    rgba(255,255,255,0.08) 70%,
    transparent 100%
  );
  pointer-events: none;
}

.rooms-pipe::after {
  content: '';
  position: absolute;
  inset: 0;
  /*
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 88px,
    rgba(0,0,0,0.35) 88px,
    rgba(0,0,0,0.35) 92px,
    rgba(255,255,255,0.08) 92px,
    rgba(255,255,255,0.08) 94px,
    transparent 94px,
    transparent 100px
  );
  */
}

#screen-lobby .rooms {
  background: transparent;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  padding: 0;
  column-gap: 46px;
  row-gap: 10px;
  overflow: visible;
}

.lobby-footer-bar {
  flex-shrink: 0;
  padding: 4px 0 0 0;
  display: flex;
  gap: 6px;
  align-items: stretch;
  justify-content: space-between;
}

.lobby-footer-bar .bb-card {
  flex: 0 0 auto;
}

.lobby-footer-bar .bb-card-body {
  padding: 6px 10px !important;
  justify-content: center;
}

.lobby-footer-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.lobby-rooms-pag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.lobby-rooms-pag-info {
  font-family: var(--font-display);
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  min-width: 28px;
  text-align: center;
}

.lobby-room-filter {
  display: flex;
  gap: 4px;
}

/* Header do lobby: 3 colunas — logo esquerda, filtros centralizados no lobby-right, buddy direita */
#screen-lobby .app-header {
  display: flex;
  align-items: center;
}
#screen-lobby .app-header-left {
  width: calc(200px + 10px + var(--pad-h) - 14px);
  flex-shrink: 0;
  gap: 8px;
}
#screen-lobby .app-header-logo {
  flex-shrink: 0;
}
.lobby-header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.lobby-header-center .lobby-mode-filters {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.15);
}
#screen-lobby .app-header-right {
  flex-shrink: 0;
  justify-content: flex-end;
}


/* ===== INTRO CANVAS ===== */
#wipe-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: #000;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

/* ===== SPLASH ===== */
#screen-splash {
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-top: max(60px, env(safe-area-inset-top));
}

.splash-top-bar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 10;
}

.splash-logo {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 0 12px;
}

@keyframes splash-logo-in {
  from { transform: scale(0.88) translateY(-20px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);     opacity: 1; }
}

.splash-logo-img {
  width: 300px;
  height: auto;
  background-position: center;
  animation:
    splash-logo-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both,
    splash-float   4s ease-in-out 0.7s infinite alternate,
    splash-glow    4s ease-in-out 0.7s infinite alternate;
}

@keyframes splash-float {
  from { transform: translateY(0px); }
  to   { transform: translateY(-8px); }
}

@keyframes splash-glow {
  from { filter: drop-shadow(0 4px 12px rgba(0, 8, 30, 0.35)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
  to   { filter: drop-shadow(0 10px 28px rgba(0, 8, 30, 0.65)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
}



.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #1a3a50;
  letter-spacing: 5px;
  text-transform: uppercase;
  opacity: 0;
  animation: splash-fade-up 0.5s ease 0.6s both;
}

.splash-auth {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  animation: splash-fade-up 0.5s ease 0.4s both;
}

@keyframes splash-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== AUTH OFFCANVAS ===== */
.auth-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  visibility: hidden;
  pointer-events: none;
}

.auth-offcanvas.open {
  visibility: visible;
  pointer-events: all;
}

.auth-offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 280ms;
}

.auth-offcanvas.open .auth-offcanvas-backdrop {
  opacity: 1;
}

.auth-offcanvas-panel {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #f8f5f2 0%, #ede9e3 100%);
  border-top: 3px solid var(--ice-3);
  border-radius: 24px 24px 0 0;
  padding: 12px 24px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15), 0 -2px 0 rgba(99,171,215,0.25);
}

.auth-offcanvas.open .auth-offcanvas-panel {
  transform: translateY(0);
}

.auth-offcanvas-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(99,171,215,0.4);
  align-self: center;
  margin-bottom: 4px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.auth-tab.active {
  background: var(--ice-4);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-input {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-s);
  color: var(--input-text);
  font-size: 1rem;
  padding: 11px 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-input::placeholder {
  color: var(--input-placeholder);
}

.auth-input:focus {
  border-color: var(--input-focus);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 2px rgba(253,166,76,0.2);
}

.auth-input option {
  background: var(--input-bg);
  color: var(--input-text);
}

.auth-gender {
  display: flex;
  gap: 10px;
}

.auth-gender-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--input-placeholder);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.auth-gender-opt:has(input:checked) {
  border-color: var(--input-focus);
  background: var(--input-bg-focus);
  color: var(--input-text);
}

.auth-gender-opt input {
  accent-color: var(--input-focus);
  width: 16px;
  height: 16px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .auth-input {
  padding-right: 44px;
}

.auth-pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--input-placeholder);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.auth-pw-toggle:hover { color: var(--input-text); }

.auth-pw-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-email-status {
  font-size: 0.75rem;
  min-height: 1em;
  transition: color 0.15s;
}

.auth-email-status.ok  { color: #4ecb71; }
.auth-email-status.err { color: #ff6b6b; }


.auth-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: #001428;
  cursor: pointer;
  user-select: none;
  opacity: 0.85;
}

.auth-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #fda64c;
  cursor: pointer;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: #001428;
  margin-top: 2px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  text-decoration: none;
  opacity: 0.75;
}

.forgot-link:hover { text-decoration: underline; opacity: 1; }

.auth-label-detecting {
  font-size: 0.65rem;
  color: var(--ice-3);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  animation: detecting-pulse 1s ease-in-out infinite alternate;
}

@keyframes detecting-pulse {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* ===== AUTH STEP FLOW ===== */
.auth-step {
    width: 100%;
    max-width: 380px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
    background: #008ce8;
    border: 2px solid #001428;
    border-radius: var(--radius-l);
    box-shadow: 0px 3px 0 #00080f, 0px 4px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: auth-step-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-step-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.auth-step-label {
  margin: 0 -16px 2px;
  padding: 14px 16px 12px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.auth-step-label::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5%;
  width: 110%;
  height: 50%;
  background:#68D8F8;
  pointer-events: none;
}

.auth-step-label::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -5%;
  width: 110%;
  height: 4px;
  transform: translateY(-50%);
  background: #001428;
  pointer-events: none;
}

.auth-step-badge {
  display: inline-block;
  position: relative;
  z-index: 1;
  background: #001428;
  border: 2px solid #000a14;
  border-radius: 8px;
  padding: 4px 14px 3px;
}

.badge-text {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #FFE040 0%, #ffffff 50%, #FFE040 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FFE040;
}

.auth-field-pill {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1.5px solid #003d5c;
  background: #001020;
}

.auth-field-label {
  background: #c8ecff;
  color: #001428;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  border-right: 1.5px solid #003d5c;
}

.auth-field-pill .auth-input {
  flex: 1;
  background: #001020;
  border: none;
  border-radius: 0;
  color: #e9fbff;
  padding: 11px 14px;
  min-width: 0;
}

.auth-field-pill .auth-input:focus {
  background: #001a2e;
  box-shadow: none;
}

.auth-field-pill .auth-input::placeholder {
  color: rgba(189,243,255,0.35);
}

.auth-field-pill .auth-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-field-pill .auth-input-wrap .auth-input {
  padding-right: 44px;
}

.auth-step > .cta,
.auth-step > .btn-game {
  align-self: flex-end;
  min-width: 130px;
  margin-top: 2px;
}

/* ===== BB-CARD — card flutuante genérico reutilizável ===== */
/*
 * Use .bb-card onde quiser o padrão de card azul do jogo.
 * .bb-card-label  → faixa de cabeçalho com gloss (igual .auth-step-label)
 * .bb-card-badge  → pílula escura com texto dourado (igual .auth-step-badge)
 * .bb-card-label pode ter justify-content: space-between para ações extras.
 */
.bb-card {
  display: flex;
  flex-direction: column;
  background: #008ce8;
  border: 2px solid #001428;
  border-radius: var(--radius-l);
  box-shadow: 0px 3px 0 #00080f, 0px 4px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: auth-step-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bb-card-label {
  margin: 0;
  padding: 14px 16px 12px;
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.bb-card-label::before {
  content: '';
  position: absolute;
  top: 0; left: -5%;
  width: 110%; height: 50%;
  background: #68D8F8;
  pointer-events: none;
}
.bb-card-label::after {
  content: '';
  position: absolute;
  top: 50%; left: -5%;
  width: 110%; height: 4px;
  transform: translateY(-50%);
  background: #001428;
  pointer-events: none;
}

.bb-card-label > .bb-btn {
  position: relative;
  z-index: 1;
}

.bb-card-badge {
  display: inline-block;
  position: relative;
  z-index: 1;
  background: #001428;
  border: 2px solid #000a14;
  border-radius: 8px;
  padding: 4px 14px 3px;
}
/* .badge-text é compartilhado — mesmo estilo dourado */

.bb-card-body {
  flex: 1;
  min-height: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
}

.bb-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 16px 14px;
}

.auth-email-chip {
  background: rgba(0, 20, 40, 0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--warm-1);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.auth-new-user-notice {
  background: rgba(0, 30, 60, 0.35);
  border: 1px solid rgba(0, 20, 40, 0.4);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #c8ecff;
  text-align: center;
  line-height: 1.55;
}

.auth-new-user-notice strong {
  display: block;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 3px;
}

.auth-back-link {
  background: none;
  border: none;
  color: #001428;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: var(--font-body);
  opacity: 0.75;
  transition: opacity 0.15s;
}

.auth-back-link:hover { opacity: 1; text-decoration: underline; }

.country-select {
  position: relative;
}

.country-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(99,171,215,0.25);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 1rem;
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  user-select: none;
}

.country-select-trigger:hover,
.country-select.open .country-select-trigger {
  border-color: var(--ice-3);
  background: rgba(99,171,215,0.08);
}

.country-select-trigger img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.country-select-placeholder { color: var(--text-muted); }

.country-select-trigger::after {
  content: '';
  margin-left: auto;
  border: 5px solid transparent;
  border-top-color: var(--text-muted);
  margin-top: 4px;
  transition: transform 0.18s;
}

.country-select.open .country-select-trigger::after {
  transform: rotate(180deg);
  margin-top: -2px;
}

.country-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #f8f5f2;
  border: 1.5px solid rgba(99,171,215,0.3);
  border-radius: var(--radius-s);
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

.country-search-wrap {
  padding: 8px;
  border-bottom: 1px solid rgba(99,171,215,0.1);
}

.country-search-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(99,171,215,0.2);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 7px 10px;
  outline: none;
}

.country-search-input:focus { border-color: var(--ice-3); }

.country-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.country-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.12s;
}

.country-list li:hover,
.country-list li.selected {
  background: rgba(99,171,215,0.12);
}

.country-list li img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ===== WAITING SCREEN ===== */
.room-header {
  position: relative;
  z-index: 5;
  margin: 0 14px 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.92), rgba(236, 232, 226, 0.92));
  border-radius: var(--radius-m);
  border: 1.5px solid rgba(99, 171, 215, 0.3);
}

.room-header h2 {
  margin: 0;
  font-family: var(--font-display);
  color: #fff;
  font-size: 18px;
}

.room-header .meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: #63abd7;
  align-items: center;
  flex-wrap: wrap;
}

.room-header .meta .chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 171, 215, 0.12);
  border: 1px solid rgba(99, 171, 215, 0.3);
  font-family: var(--font-mono);
  font-size: 10px;
}

.room-code-display {
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.92), rgba(236, 232, 226, 0.92));
  border: 1.5px solid rgba(99, 171, 215, 0.3);
  border-radius: var(--radius-m);
  margin: 0 14px 10px;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.room-code-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ice-3);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.room-code {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--gem-yellow);
  line-height: 1;
}

.slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
  z-index: 5;
  align-content: start;
}

.team-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-column-header {
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 8px;
  border-radius: 8px;
}

.team-column.a .team-column-header {
  background: var(--coral);
  color: #fff;
}

.team-column.b .team-column-header {
  background: var(--ice-3);
  color: #fff;
}

.player-slot {
  background: linear-gradient(180deg, rgba(248, 245, 242, 0.92), rgba(236, 232, 226, 0.92));
  border: 1.5px solid rgba(99, 171, 215, 0.3);
  border-radius: 14px;
  padding: 12px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.team-column.a .player-slot {
  border-color: rgba(255, 107, 91, 0.4);
}

.team-column.b .player-slot {
  border-color: rgba(99, 171, 215, 0.4);
}

.player-slot.empty {
  border-style: dashed;
  background: rgba(7, 25, 43, 0.4);
  display: grid;
  place-items: center;
  color: #5D88A6;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
}

.player-slot .ready-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
}

.ready-badge.yes {
  background: var(--mint);
  color: #04391F;
}

.ready-badge.no {
  background: #96c9e5;
  color: var(--dark-2);
}

.slot-av {
  width: 48px;
  height: 48px;
  margin: 10px auto 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 20px;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.4), 0 3px 0 rgba(0, 0, 0, 0.3);
}

.slot-nm {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

.slot-rank {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #FFD33D;
}

/* Character select */
.character-select {
  padding: 0 14px 10px;
  position: relative;
  z-index: 5;
}

.section-label,
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #63abd7;
  margin: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(99, 171, 215, 0.3), transparent);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.character-card {
  background: linear-gradient(180deg, rgba(7, 25, 43, 0.85), rgba(3, 12, 24, 0.85));
  border: 1.5px solid rgba(99, 171, 215, 0.2);
  border-radius: 12px;
  padding: 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 150ms, background 150ms;
}

.character-card.active {
  border-color: var(--gem-yellow);
  background: linear-gradient(180deg, rgba(255, 211, 61, 0.12), rgba(255, 211, 61, 0.02));
  box-shadow: 0 0 12px rgba(255, 211, 61, 0.25);
}

.char-icon {
  font-size: 1.5rem;
}

.char-name {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.char-tip {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== WAITING ROOM (redesign) ===== */

/* --- Layout principal da waiting room --- */
.wr-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 12px;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}
.wr-layout::-webkit-scrollbar { display: none; }

/* Barra de info da sala */
.wr-room-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 100%);
  border: 2px solid #356a8e;
  border-radius: 12px;
  padding: 0 10px;
  height: 50px;
  flex-shrink: 0;
  box-shadow: 0 2px 0 #356a8e, inset 0 1px 0 rgba(255,255,255,0.25);
}
.wr-room-number {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  padding: 4px 9px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
.wr-room-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: default;
}
.wr-room-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.wr-edit-btn {
  background: none;
  border: none;
  color: #63abd7;
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}
.wr-edit-btn:hover { opacity: 1; background: rgba(127,210,238,0.12); }
.wr-lock {
  color: #FFD33D;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Linha do mapa */
.wr-map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #F5B042 0%, #E08020 60%, #B85C10 100%);
  border: 2px solid #7a3a08;
  border-radius: 12px;
  padding: 8px 10px;
  flex-shrink: 0;
  box-shadow: 0 3px 0 #3a1a00, inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Area dos slots */
.wr-slots-area {
  flex: 0 0 auto;
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 100%);
  border: 2px solid #062840;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 0 #040e1a, inset 0 1px 0 rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}



/* Toolbar: mobile + ferramentas */
.wr-toolbar {
  display: flex;
  gap: 6px;
  align-items: stretch;
  height: 64px;
  flex-shrink: 0;
}
.wr-toolbar-btn {
  flex: 0 0 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  height: 100%;
  padding: 0 4px;
}

/* Footer igual ao lobby */
.wr-action-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px calc(8px + var(--safe-bottom));
  border-top: 3px solid #1a3d5c;
  background: linear-gradient(180deg, #ede9e3 0%, #d4cfc9 100%);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
}
.wr-ready-btn {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #27ae60 0%, #1a7a42 100%);
  border: 2px solid #2ecc71;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 4px 0 #063a20,
    0 6px 14px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.wr-ready-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #063a20; }
.wr-start-btn {
  position: relative;
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #FFD966 0%, #F0A020 100%);
  border: 2px solid #7a4500;
  color: #1a0a00;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 4px 0 #5a3000,
    0 6px 14px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.wr-start-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5a3000; }

/* Overrides para botões da toolbar (btn-gu conflita com height/font-size) */
.wr-toolbar .wr-toolbar-btn {
  height: 100%;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  border-radius: 10px;
  padding: 0 8px;
}
.wr-toolbar .wr-toolbar-btn:active:not(:disabled) {
  transform: translateY(3px);
}
.wr-ready-btn, .wr-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Map row: setas acompanham altura da linha */
.wr-map-row .wr-map-arrow {
  align-self: stretch;
  height: auto;
}

.wr-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  align-content: start;
  position: relative;
}

.wr-change-team-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 14px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid #ff8c42;
  background: linear-gradient(180deg, #ff6b1a 0%, #c73f00 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 4px 0 #7a2500,
    0 6px 14px rgba(0,0,0,0.4);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  animation: change-btn-glow 3.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.wr-change-team-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,160,80,0.3) 0%, transparent 70%);
  opacity: 0;
  animation: change-btn-radial 3.5s ease-in-out infinite;
}

@keyframes change-btn-radial {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

@keyframes change-btn-glow {
  0%, 100% { box-shadow: 0 3px 0 #7a2500, inset 0 1px 0 rgba(255,255,255,0.2), 0 0 6px rgba(255,107,26,0.2); }
  50%       { box-shadow: 0 3px 0 #7a2500, inset 0 1px 0 rgba(255,255,255,0.2), 0 0 16px rgba(255,107,26,0.55); }
}

.wr-change-team-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #7a2500, inset 0 1px 0 rgba(255,255,255,0.08);
  animation: none;
}

.wr-change-team-btn svg {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: transform 0.05s;
}

.wr-change-team-btn span {
  position: relative;
  z-index: 1;
}

.wr-change-team-btn.spinning svg {
  animation: change-btn-spin 0.5s ease-in-out;
}

@keyframes change-btn-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wr-change-team-btn:disabled {
  opacity: 0.35;
  cursor: default;
  animation: none;
}

.wr-change-team-btn:disabled::before {
  animation: none;
}

.wr-slot {
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #0E8FCC 0%, #0070A8 100%);
  height: 130px;
  position: relative;
  border: none;
  box-shadow:
    inset 0 3px 0 rgba(0,0,0,0.35),
    inset 0 -3px 0 rgba(255,255,255,0.12),
    inset 3px 0 0 rgba(0,0,0,0.2),
    inset -3px 0 0 rgba(255,255,255,0.06);
}

.wr-slot.team-a:not(.empty) { 
  box-shadow: inset 0 3px 0 rgba(0,0,0,0.35), inset 0 -3px 0 rgba(255,255,255,0.12), inset 3px 0 0 rgba(0,0,0,0.2), inset -3px 0 0 rgba(255,255,255,0.06); 
}
.wr-slot.team-b:not(.empty) { 
  box-shadow: inset 0 3px 0 rgba(0,0,0,0.35), inset 0 -3px 0 rgba(255,255,255,0.12), inset 3px 0 0 rgba(0,0,0,0.2), inset -3px 0 0 rgba(255,255,255,0.06); 

}

.wr-slot.empty {
  justify-content: flex-end;
  background: linear-gradient(180deg, #0E8FCC 0%, #0070A8 100%);
  box-shadow:
    inset 0 3px 0 rgba(0,0,0,0.35),
    inset 0 -3px 0 rgba(255,255,255,0.12),
    inset 3px 0 0 rgba(0,0,0,0.2),
    inset -3px 0 0 rgba(255,255,255,0.06);
}

.wr-slot.ghost {
  background: linear-gradient(180deg, #0E8FCC 0%, #0070A8 100%);
  border: none;
  box-shadow:
    inset 0 3px 0 rgba(0,0,0,0.4),
    inset 0 -2px 0 rgba(255,255,255,0.04),
    inset 3px 0 0 rgba(0,0,0,0.3),
    inset -3px 0 0 rgba(255,255,255,0.03);
  opacity: 0.45;
  pointer-events: none;
}

.wr-slot.empty::before {
  content: '+';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.12);
  z-index: 0;
  pointer-events: none;
  animation: slot-empty-pulse 2.4s ease-in-out infinite;
}

@keyframes slot-empty-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
}



.wr-slot-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 2px;
  flex-shrink: 0;
}

.wr-ping {
  font-family: var(--font-mono);
  color: #63abd7;
  font-size: 10px;
  flex-shrink: 0;
}

.wr-name {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr-host-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.wr-slot-scene {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.wr-mob-scene {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.wr-avt-scene {
  position: absolute;
  width: 80px;
  height: 110px;
  transform: translate(-50%, -50%);
  overflow: visible !important;
  z-index: 2;
  pointer-events: none;
}

.wr-slot-stripe {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 1;
  opacity: 0.85;
  border-top: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 3px 4px rgba(0,0,0,0.4);
}

.wr-slot-stripe.team-a {
  background: repeating-linear-gradient(
    -45deg,
    #4DC8F0 0px, #4DC8F0 5px,
    #0A3A7A 5px, #0A3A7A 10px
  );
}

.wr-slot-stripe.team-b {
  background: repeating-linear-gradient(
    -45deg,
    #FFD700 0px, #FFD700 5px,
    #B8860B 5px, #B8860B 10px
  );
}

.wr-slot-team-letter {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 4;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 42px;
  line-height: 1;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.wr-slot-team-letter.team-a {
  color: #4DC8F0;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
               0 0 14px rgba(77, 200, 240, 0.75);
}

.wr-slot-invite-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: rgba(127,210,238,0.55);
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 5;
}
.wr-slot.empty:hover .wr-slot-invite-hint {
  color: rgba(127,210,238,0.9);
}

/* ─── Modal de convite de amigo ─── */
.wr-invite-popup { max-width: 460px; width: 94vw; }

.wr-invite-body { padding: 16px 20px 6px; display: flex; flex-direction: column; gap: 12px; }

.wr-invite-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 80px;
}

.wr-invite-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

.wr-invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(127,210,238,0.12);
  cursor: pointer;
  transition: background 80ms;
}
.wr-invite-row:hover { background: rgba(127,210,238,0.08); }
.wr-invite-row.selected {
  background: rgba(127,210,238,0.15);
  border-color: rgba(127,210,238,0.4);
}
.wr-invite-row--other-server {
  cursor: not-allowed;
  opacity: 0.45;
}
.wr-invite-row--other-server:hover { background: none; }

.wr-invite-level {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.wr-invite-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wr-invite-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wr-invite-server {
  font-size: 10px;
  color: var(--text-muted);
}
.wr-invite-server.same { color: var(--mint); }

.wr-slot-team-letter.team-b {
  color: #FFD700;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
               0 0 14px rgba(255, 215, 0, 0.75);
}

.wr-slot-ready-icon {
  position: absolute;
  bottom: 0px;
  right: 3px;
  width: 36px;
  height: 36px;
  object-fit: contain;
  z-index: 4;
  pointer-events: none;
}

/* Footer do slot: nível + nome */
.wr-slot-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 6px;
  min-height: 24px;
  background: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.wr-slot.team-a .wr-slot-footer {
    background: #41bce6;
}

.wr-slot.team-b .wr-slot-footer {
background: #d9c91a;
}

.wr-level-img {
  width: auto;
  image-rendering: pixelated;
  flex-shrink: 0;
  background-color: #000000;
}

.wr-slot-name {
  font-size: 11px;
  font-weight: 500;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Painel de mapa ─────────────────────────────────────── */
.wr-map-thumb-wrap {
  position: relative;
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 2px 0 rgba(255,255,255,0.15);
}
.wr-map-thumb-wrap.host-clickable {
  cursor: pointer;
  transition: border-color 0.12s;
}
.wr-map-thumb-wrap.host-clickable:active { filter: brightness(1.15); }
.wr-map-thumb {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
}
.wr-map-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #FFE0A0;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 3px 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.wr-map-arrow {
  background: linear-gradient(180deg, #9aa8b0 0%, #6a7880 100%);
  border: 2px solid #3a4850;
  color: #dde8ee;
  font-size: 26px;
  width: 36px;
  height: 56px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 0 #3a4850, inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.08s, box-shadow 0.08s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.wr-map-arrow:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.wr-map-arrow:disabled { opacity: 0.3; cursor: default; }

/* Modal de seleção de mapa */
.popup--map-select { max-width: 380px; width: 90vw; }
.popup--map-select .popup-body { padding: 4px 4px 0; }
.wr-map-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.wr-map-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #3eb8d4;
  pointer-events: none;
  flex-shrink: 0;
}
.wr-map-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: rgba(4,16,32,0.95);
  border: 2px solid #3eb8d4;
  border-radius: 10px;
  color: #e8f6ff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px 9px 32px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,171,215,0.15), inset 0 2px 4px rgba(0,0,0,0.4);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wr-map-search::placeholder { color: rgba(120,180,210,0.5); font-weight: 400; }
.wr-map-search:focus {
  border-color: #7fd2ee;
  box-shadow: 0 0 0 4px rgba(99,171,215,0.3), inset 0 2px 4px rgba(0,0,0,0.4);
}
.wr-map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 55dvh;
  overflow-y: auto;
  padding: 4px 2px 8px;
}
.wr-map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 4px 5px;
  border-radius: 8px;
  border: 2px solid rgba(99,171,215,0.2);
  background: linear-gradient(180deg, rgba(20,58,92,0.95), rgba(6,30,54,0.95));
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
  transition: border-color 0.12s, background 0.12s, transform 0.08s, box-shadow 0.08s;
  user-select: none;
}
.wr-map-card:active { transform: translateY(2px); box-shadow: none; }
.wr-map-card.selected {
  border-color: #FFD33D;
  background: linear-gradient(180deg, rgba(50,40,0,0.95), rgba(25,18,0,0.95));
  box-shadow: 0 2px 0 #7a5500;
}
.wr-map-card-thumb {
  width: 100%;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
  background: #d4cfc9;
  display: block;
}
.wr-map-card-name {
  font-family: var(--font-display);
  font-size: 7.5px;
  font-weight: 700;
  color: #4a8ab5;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.wr-map-card.selected .wr-map-card-name { color: #FFE0A0; }

.wr-mode-btn {
  background: linear-gradient(180deg, #ede9e3 0%, #d4cfc9 100%);
  border: 2px solid rgba(99,171,215,0.35);
  color: #4a8ab5;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 0 #b5aeaa;
  transition: transform 0.08s, box-shadow 0.08s;
}
.wr-mode-btn.active {
  background: linear-gradient(180deg, #fccc72 0%, #e5a830 100%);
  border-color: #c5881a;
  color: #3d3530;
  box-shadow: 0 3px 0 #c5881a;
  text-shadow: none;
}
.wr-mode-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.wr-mode-btn:disabled { opacity: 0.3; cursor: default; }

/* Bottom sheet */
.wr-bottom-sheet {
  flex-shrink: 0;
  background: linear-gradient(180deg, #ede9e3 0%, #d4cfc9 100%);
  border-radius: 20px 20px 0 0;
  margin-top: -20px;
  position: relative;
  z-index: 10;
  box-shadow: 0px -2px 11px rgb(255 255 255 / 17%), 0 -2px 0 rgba(62, 184, 212, 0.3);
  padding-top: 4px;
}
.wr-bottom-sheet-handle {
  width: 40px;
  height: 5px;
  background: rgba(99,171,215,0.4);
  border-radius: 4px;
  margin: 0 auto 4px;
}

/* Seletor de mobile */
.wr-mobile-bar {
  flex-shrink: 0;
  height: 76px;
  background: transparent;
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
  display: flex;
  align-items: center;
  padding: 5px 6px;
  gap: 4px;
}
.wr-mob-scroll-btn {
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFD966 0%, #F0A020 60%, #C06010 100%);
  border: 2px solid #7a4500;
  color: #fff;
  font-size: 22px;
  width: 34px;
  height: 90%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 3px 0 #7a4500;
  transition: transform 0.08s, box-shadow 0.08s;
  line-height: 1;
}
.wr-mob-scroll-btn:active { transform: translateY(3px); box-shadow: none; }

.wr-mobile-scroll {
  flex: 1;
  display: flex;
  gap: 5px;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  padding: 0 4px;
  background: transparent;
}

.wr-mobile-scroll::-webkit-scrollbar { display: none; }

.wr-mob-btn {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border: 2px solid #0a2e4e;
  border-radius: 12px;
  background: linear-gradient(180deg, #63abd7 0%, #4a8ab5 100%);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 3px 0 #050f1e;
  transition: transform 0.08s, box-shadow 0.08s;
}
.wr-mob-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }

.wr-mob-btn.active {
  border-color: #FFD33D;
  background: linear-gradient(180deg, #63abd7 0%, #356a8e 100%);
  box-shadow: 0 3px 0 #7a5500;
}

.wr-mob-btn.random {
  width: 62px;
}

.wr-mob-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.wr-mob-sprite {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Botões de ação */
.wr-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 6px 14px calc(8px + var(--safe-bottom));
}

.wr-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.wr-header-actions .wr-btn {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-waiting .app-header-brand {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#screen-waiting .app-header-logo {
  filter: none;
}

.wr-btn {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
}

/* ── Estilo Gunbound base ── */
.btn-gu {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.35);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  transition: transform 0.08s, box-shadow 0.08s;
  position: relative;
}
/* press: desce 4px como botão físico */
.btn-gu:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: none !important;
}
.btn-gu:disabled {
  opacity: 0.38;
  cursor: default;
}

/*
  Estrutura das sombras (frente → fundo):
  1. inset topo — brilho branco (face levantada)
  2. inset fundo — sombra (face afundada)
  3. 0 0 0 3px — anel colorido (trim)
  4. 0 0 0 6px — anel escuro (bezel externo)
  5. drop shadow — elevação
*/

.btn-gu-blue {
  background: linear-gradient(180deg, #96c9e5 0%, #63abd7 35%, #4a8ab5 100%);
  border-color: #356a8e;
  color: #fff;
  box-shadow: 0 4px 0 #356a8e;
}

.btn-gu-green {
  background: linear-gradient(180deg, #4ED48C 0%, #1EA060 35%, #0B6038 100%);
  border-color: #063a20;
  box-shadow: 0 4px 0 #063a20;
}

.btn-gu-red {
  background: linear-gradient(180deg, #E85050 0%, #B82020 35%, #780808 100%);
  border-color: #500505;
  box-shadow: 0 4px 0 #500505;
}

.btn-gu-gold {
  background: linear-gradient(180deg, #FFD966 0%, #F0A020 35%, #C06010 100%);
  border-color: #7a4500;
  box-shadow: 0 4px 0 #7a4500;
}

/* ready ativo (vermelho) sobrepoe o verde */
.wr-btn-ready-active,
.wr-ready-btn.wr-btn-ready-active {
  background: linear-gradient(180deg, #E85050 0%, #B82020 35%, #780808 100%) !important;
  border-color: #500505 !important;
  box-shadow: 0 3px 0 #4a1511 !important;
}

.wr-start-btn:not(:disabled) {
  animation: start-pulse 1.2s ease-in-out infinite;
}
.wr-start-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
#btn-start-game[data-countdown]::after {
  content: attr(data-countdown);
  position: absolute;
  top: -7px;
  right: -7px;
  background: #e74c3c;
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
}
.wr-new-host-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #ede9e3, #d4cfc9);
  border: 2px solid rgba(99,171,215,0.45);
  border-radius: 14px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 900;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: banner-in 0.25s ease-out;
  pointer-events: none;
}
.wr-new-host-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: rgba(99,171,215,0.85);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.wr-new-host-player {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}
.wr-new-host-level {
  height: 22px;
  width: auto;
}
@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -55%) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes start-pulse {
  0%, 100% {
    box-shadow: 0 4px 0 #7a4500, 0 0 12px 3px rgba(255,211,61,0.4);
  }
  50% {
    box-shadow: 0 4px 0 #7a4500, 0 0 26px 10px rgba(255,211,61,0.85);
  }
}

/* ===== RANKING ===== */

/* Barra de tabs */
.rk-body {
  flex: 1;
  min-height: 0;
  padding: 8px var(--pad-h) 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rk-grid {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rk-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rk-card-body {
  overflow: hidden;
  gap: 8px;
}

.rk-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  gap: 0 !important;
  padding: 0 !important;
}

.rk-tabs {
  display: inline-flex;
  background: rgba(4, 14, 26, 0.8);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(99, 171, 215, 0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  gap: 2px;
}

.rk-tab {
  height: 36px;
  padding: 0 22px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.38);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 80ms;
  white-space: nowrap;
}

.rk-tab:active { opacity: 0.8; }

.rk-tab.on {
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  color: #fff;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.35), 0 2px 0 #0c3d54;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Busca */
.rk-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 10px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid rgba(99, 171, 215, 0.16);
  background: rgba(4, 14, 26, 0.78);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.rk-search-ico {
  color: rgba(99, 171, 215, 0.45);
  flex-shrink: 0;
}

.rk-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}

.rk-search-input::placeholder {
  color: rgba(93, 136, 166, 0.7);
  font-weight: 500;
}

.rk-search-clear {
  background: none;
  border: none;
  color: rgba(99, 171, 215, 0.5);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.rk-search-clear:hover { color: #fff; }

/* Lista scrollável — scroll agora está no .rk-inner */
.rk-list-wrap {
  display: contents;
}

#ranking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Cards de jogador */
.rk-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

.rk-row--me {
  border-color: rgba(99, 171, 215, 0.45);
  background: rgba(12, 50, 78, 0.75);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3), 0 0 14px rgba(99,171,215,0.1);
}


/* Badge de posição */
.rk-pos {
  font-family: var(--font-display);
  font-weight: 800;
  color: rgba(99, 171, 215, 0.55);
  text-align: center;
  font-size: 10px;
  line-height: 1;
  min-width: 20px;
  flex-shrink: 0;
}


/* Imagem de nível */
.rk-level-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Flag (ranking por país) */
.rk-flag {
  font-size: 18px;
  line-height: 1;
  text-align: center;
  width: 24px;
  flex-shrink: 0;
}

/* Coluna de texto */
.rk-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.rk-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}


.rk-me-tag {
  font-size: 8px;
  background: #FFD33D;
  color: #1a3d5c;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 800;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.rk-gp {
  font-family: var(--font-mono);
  font-weight: 600;
  color: rgba(255, 211, 61, 0.8);
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Paginação no header do card */
.rk-pag {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.rk-pag-btn {
  padding: 10px 12px;
  flex-shrink: 0;
}

.rk-pag-btn svg {
  color: #fff;
  filter:
    drop-shadow(-1px 0 0 rgba(0,0,0,0.8))
    drop-shadow(1px 0 0 rgba(0,0,0,0.8))
    drop-shadow(0 -1px 0 rgba(0,0,0,0.8))
    drop-shadow(0 1px 0 rgba(0,0,0,0.8));
}

.rk-pag-btn:disabled svg {
  opacity: 0.4;
}


/* Grid 3 colunas dentro do ranking de jogadores */
#ranking-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  column-gap: 8px;
  row-gap: 3px;
}

#ranking-list .rk-row:nth-child(-n+5),
#ranking-list .rk-row:nth-child(n+6):nth-child(-n+10) {
  box-shadow: 4px 0 0 rgba(99, 171, 215, 0.18), 0 1px 0 rgba(0,0,0,0.25);
}

/* Loading / vazio */
.rk-loading, .rk-empty {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  padding: 40px 20px;
  grid-column: 1 / -1;
}

.rk-empty-ico {
  font-size: 40px;
  margin-bottom: 10px;
}

/* Fim da lista */
.rk-sentinel { height: 1px; }

.rk-end {
  text-align: center;
  color: rgba(99, 171, 215, 0.25);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 16px 0 10px;
  letter-spacing: 0.5px;
}

/* ===== AVATARES ===== */
.avatar-hero {
  position: relative;
  z-index: 5;
  margin: 0 14px 10px;
  height: 160px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 80%, rgba(99, 171, 215, 0.5), transparent 60%),
    linear-gradient(180deg, #143A5C 0%, #061E36 100%);
  border: 1.5px solid rgba(99, 171, 215, 0.3);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.avatar-hero .char-big {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  font-size: 3rem;
  background: linear-gradient(180deg, #FFE071 0%, #FFD33D 50%, #C9890B 100%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.7), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 10px;
  position: relative;
  z-index: 5;
}

.stat-card {
  background: linear-gradient(180deg, rgba(15, 50, 82, 0.85), rgba(4, 24, 39, 0.85));
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.stat-card .v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}

.stat-card .l {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #63abd7;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.gear-sections {
  padding: 0 14px 10px;
  position: relative;
  z-index: 5;
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.avatar-card {
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(7, 25, 43, 0.85), rgba(3, 12, 24, 0.85));
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms;
}

.avatar-card.owned {
  border-color: rgba(76, 224, 160, 0.5);
}

.avatar-card.equipped {
  border-color: var(--gem-yellow);
  background: linear-gradient(180deg, rgba(255, 211, 61, 0.12), rgba(255, 211, 61, 0.02));
}

.avatar-img {
  font-size: 2rem;
}

.avatar-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: #fff;
}

.avatar-price {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gem-yellow);
}

.avatar-owned-badge {
  font-size: 10px;
  color: var(--mint);
  font-weight: 700;
}

.coming-soon-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 0 14px;
}

/* ===== LEVELS ===== */
.level-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  image-rendering: pixelated;
  margin-right: 4px;
  flex-shrink: 0;
}

.level-icon-lg {
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* ===== LEVELS PAGE ===== */
.lvl-body {
  flex: 1;
  min-height: 0;
  padding: 8px var(--pad-h) 16px;
  display: flex;
  flex-direction: column;
}

.lvl-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lvl-card-body {
  padding: 8px !important;
  overflow: hidden;
}

.lvl-inner {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 0 !important;
  padding: 0 !important;
}

#levels-table {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 6px 0 8px;
}

/* Row */
.lvl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin: 2px 8px;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: background 0.12s;
  position: relative;
}

.lvl-row:active {
  background: rgba(255,255,255,0.04);
}

.lvl-row--current {
  background: linear-gradient(135deg, rgba(255,211,61,0.12), rgba(229,169,11,0.04));
  border-color: rgba(255,211,61,0.5);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

.lvl-badge-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.lvl-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lvl-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.lvl-gp {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #FFD33D;
  opacity: 0.85;
}

.lvl-current-tag {
  font-size: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  background: #FFD33D;
  color: #1a3d5c;
  border-radius: 6px;
  padding: 2px 6px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* ===== MISSING / EXTRA ALIASES ===== */
.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(99, 171, 215, 0.3), rgba(7, 53, 102, 0.6));
  border: 1.5px solid rgba(99, 171, 215, 0.4);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 18px rgba(0, 0, 0, 0.4);
}

.gear-slot {
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(7, 25, 43, 0.85), rgba(3, 12, 24, 0.85));
  border: 1.5px solid rgba(99, 171, 215, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: border-color 150ms;
}

.gear-slot.equipped {
  border-color: var(--gem-yellow);
  background: linear-gradient(180deg, rgba(255, 211, 61, 0.12), rgba(255, 211, 61, 0.02));
}

.gear-slot.locked {
  opacity: 0.6;
  cursor: default;
}

.gear-slot .emoji {
  font-size: 2rem;
}

.gear-slot .tier {
  position: absolute;
  top: 5px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.gear-slot .tier.E {
  background: var(--gem-yellow);
  color: #3A2800;
}

.gear-slot .tier.N {
  background: rgba(99, 171, 215, 0.3);
  color: #63abd7;
}

.gear-slot .tier.L {
  background: rgba(93, 136, 166, 0.3);
  color: #5D88A6;
}

.gear-price {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gem-yellow);
}

.av-hero-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE071 0%, #FFD33D 50%, #C9890B 100%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.av-hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  margin-top: 8px;
}

.av-hero-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #63abd7;
  margin-top: 2px;
}

.stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #63abd7;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.pod-pos {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #63abd7;
  margin-top: 2px;
}

/* ===== SISTEMA DE AVATARES NOVO ===== */
#screen-avatars {
  overflow: hidden;
  gap: 0;
  background: url('/assets/bg-splash02.png') center center / cover no-repeat;
}

/* Coins bar */
.av-coins-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--pad-h) 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.av-coin-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}
.av-coin-chip--gold .av-coin-ico { color: #f5c842; }
.av-coin-chip--cash .av-coin-ico { color: #b48bff; }
.av-coin-label {
  font-size: 9px;
  opacity: 0.55;
  font-weight: 600;
}
.av-buy-cash-btn {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #1a1a2e;
  background: linear-gradient(180deg, #fce38a, #e5a830);
  border: 2px solid #fff3a0;
  box-shadow: 0 3px 0 #9a7800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.av-buy-cash-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9a7800;
}

/* Hero */
.av-hero {
  display: flex;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  margin: 4px 14px;
  height: 140px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 90%, rgba(79,195,232,0.4) 0%, transparent 65%),
    linear-gradient(180deg, rgba(10,40,70,0.88) 0%, rgba(4,16,30,0.95) 100%);
  border: 2px solid rgba(99,171,215,0.25);
  box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}

.av-hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.av-preview-sprite {
  position: absolute;
  bottom: 38px;
  width: 100%;
  height: 160px;
  overflow: hidden;
  image-rendering: pixelated;
}

.av-hero-ground {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(79,195,232,0.45) 0%, transparent 70%);
}

/* Main tabs: Loja / Inventário */
.av-main-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 14px 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.av-main-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid rgba(99,171,215,0.25);
  background: linear-gradient(180deg, rgba(20,58,92,0.85), rgba(6,30,54,0.85));
  box-shadow: 0 4px 0 rgba(0,0,0,0.45);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #63abd7;
  transition: transform 0.1s, box-shadow 0.1s;
}
.av-main-tab:active { transform: translateY(4px); box-shadow: none; }
.av-main-tab.on {
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  border-color: var(--ice-3);
  color: #fff;
  box-shadow: 0 4px 0 #356a8e;
}

/* Tab content */
#screen-avatars .av-tab-content {
  flex-shrink: 1;
  flex-grow: 1;
  min-height: 0;
}

/* Moedas no header */
.av-currencies {
  display: flex;
  gap: 8px;
  align-items: center;
}

.av-currency {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.av-currency.gold {
  background: rgb(23, 238, 3);
  color: #111;
  border: 1px solid rgba(255, 211, 61, 0.4);
}

.av-currency.cash {
  background: rgb(251, 255, 2);
  color: #111;
  border: 1px solid rgba(180, 139, 255, 0.4);
}

/* ── Hero: personagem centralizado no topo ── */
.av-hero {
  display: flex;
  justify-content: center;
  padding: 6px 0 0;
  flex-shrink: 0;
}

.av-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.av-hero-stage {
  position: relative;
  width: 100%;
  height: 155px;
  flex-shrink: 0;
  overflow: hidden;
}

.av-preview-sprite {
  position: absolute;
  bottom: 60px;
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.av-hero-ground {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(99, 171, 215, 0.35) 0%, transparent 70%);
}

.av-currencies {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
}

.av-hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ── Tabs principais: Loja / Inventário ── */
.av-main-tabs {
  display: flex;
  gap: 3px;
  margin: 0 14px 8px;
  background: rgba(7, 25, 43, 0.8);
  border: 1px solid rgba(99, 171, 215, 0.18);
  border-radius: 12px;
  padding: 3px;
  flex-shrink: 0;
}

.av-main-tab {
  flex: 1;
  padding: 8px 6px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #63abd7;
  background: transparent;
  transition: 150ms;
}

.av-main-tab.on {
  background: linear-gradient(180deg, rgba(99, 171, 215, 0.25), rgba(99, 171, 215, 0.08));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── Tab content panels ── */
.av-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.av-tab-content.hidden {
  display: none;
}

/* ── Inventário ── */
.av-inventory-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 16px;
  margin: 0 var(--pad-h) 10px;
  border-radius: 18px;
  border: 2px solid rgba(62, 184, 212, 0.2);
  background: linear-gradient(180deg, rgba(4, 16, 30, 0.92), rgba(2, 8, 18, 0.92));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}

.av-inv-section {
  margin-bottom: 4px;
}

.av-inv-section-title {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #63abd7;
  padding: 4px 8px;
  background: rgba(0,0,0,0.2);
}

/* ── Lista do inventário ── */
.av-inv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}
.av-inv-row:nth-child(even) { background: rgba(255,255,255,0.05); }
.av-inv-row:nth-child(odd)  { background: rgba(0,0,0,0.15); }
.av-inv-row:active          { background: rgba(255,255,255,0.1) !important; }
.av-inv-row.equipped        { background: rgba(255,211,61,0.12) !important; }
.av-inv-row.equipped .av-inv-row-name { color: #FFD33D; }

.av-inv-thumb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
}

.av-inv-row-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.av-inv-badge {
  font-size: 8px;
  font-weight: 700;
  color: #FFD33D;
  background: rgba(255,211,61,0.15);
  border: 1px solid rgba(255,211,61,0.3);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.av-inv-equipped-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gem-yellow);
  z-index: 10;
}

/* Tabs de tipo */
.av-type-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 10px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}
.av-type-tabs::-webkit-scrollbar { display: none; }

.av-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20,58,92,0.85), rgba(6,30,54,0.85));
  border: 2px solid rgba(99,171,215,0.25);
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  color: #63abd7;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.av-tab:active { transform: translateY(3px); box-shadow: none; }
.av-tab.on {
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  border-color: var(--ice-3);
  color: #fff;
  box-shadow: 0 3px 0 #356a8e;
}

.av-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 8px;
  padding: 0 12px;
  border-radius: 12px;
  border: 2px solid rgba(99,171,215,0.2);
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.av-search-ico { color: #5BC8E8; flex-shrink: 0; }
.av-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
}
.av-search-input::placeholder { color: rgba(127,210,238,0.4); }

/* Filtro de gênero */
.av-gender-filter {
  display: flex;
  gap: 6px;
  padding: 0 14px 8px;
  position: relative;
  z-index: 5;
}

.av-gf-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: 150ms;
  background: rgba(7, 25, 43, 0.7);
  border: 1px solid rgba(99, 171, 215, 0.2);
  color: #63abd7;
}

.av-gf-btn.on {
  background: rgba(99, 171, 215, 0.15);
  border-color: rgba(99, 171, 215, 0.5);
  color: #fff;
}

/* Shop grid */
.av-shop-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 var(--pad-h) 10px;
  border-radius: 18px;
  border: 2px solid rgba(62, 184, 212, 0.2);
  background: linear-gradient(180deg, rgba(4, 16, 30, 0.92), rgba(2, 8, 18, 0.92));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}

.av-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 5px;
  min-height: 0;
  max-height: 100%;
  align-content: start;
}

.av-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px;
  font-size: 0.9rem;
  grid-column: 1/-1;
}

/* ── Card da loja (dark/compact) ── */
/* ── Avatar Item Card (layout loja) ── */
.av-item-card {
  border: 2px solid rgba(99,171,215,0.35);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.1s;
  background: #1a4a7a;
}
.av-item-card:active { transform: scale(0.97); }
.av-item-card.owned   { border-color: rgba(76,224,160,0.5); }
.av-item-card.equipped { border-color: #FFD33D; }


/* Área do meio: sprite branco + stats */
.aic-middle {
  display: flex;
}
.aic-sprite {
  width: 64px;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.aic-stats {
  width: 42px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,0.08);
}
.aic-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #1a2a3a;
}
.aic-stat-ico { font-size: 10px; }
.aic-stat-atk { color: #d84315; }
.aic-stat-def { color: #1565c0; }
.aic-stat-life { color: #c62828; }

/* Coluna de ações no card */
.aic-actions {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #091e38;
  border-left: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.aic-actions-header {
  padding: 4px 6px;
  background: #0d2d50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  flex-shrink: 0;
}
.aic-actions-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #FFD33D;
  padding: 4px 6px;
  text-align: center;
}
.aic-actions-footer {
  padding: 4px 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aic-btn {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(99,171,215,0.3);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  padding: 4px 6px;
  white-space: nowrap;
}
.aic-btn--buy {
  background: linear-gradient(180deg, #ffcc00, #e08000);
  color: #1a1a00;
  border-color: rgba(255,200,0,0.6);
}
.aic-btn--buy:disabled { opacity: 0.35; cursor: default; }
.aic-btn:active:not(:disabled) { filter: brightness(0.85); }

.aic-price--gold { color: #7dd4ff; }
.aic-price--cash { color: #FFD33D; }
.aic-price--free { color: #4CE0A0; }
.aic-price--owned { color: #4CE0A0; }
.aic-price--equipped { color: #FFD33D; }

/* Preview wrap: sprite + stats lado a lado */
.av-preview-wrap {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.av-preview-wrap .av-preview-area {
  flex: 1;
  min-width: 0;
}
.av-preview-stats {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px;
  background: rgba(0,0,0,0.25);
  border-left: 1px solid rgba(255,255,255,0.08);
}
.avps-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.avps-ico { font-size: 11px; }


/* Paginação */
/* Grid + paginação lado a lado */
.av-shop-area {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar da paginação: busca + botões */
.av-pag-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 52px;
  border-left: 1px solid rgba(62,184,212,0.1);
}

.av-search-trigger {
  width: 36px;
  height: 36px;
  margin: 4px auto;
  flex-shrink: 0;
}
.av-clear-search {
  width: 30px;
  height: 30px;
  margin: 0 auto 4px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ff9a9a 0%, #e84040 40%, #b00000 100%);
  border-color: #7a0000c7;
}

.av-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  flex: 1;
}

.av-pagination .rk-pag-btn {
  padding: 6px 8px;
}


.av-page-info {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

/* Offcanvas de compra */
.av-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  visibility: hidden;
}

.av-offcanvas.open {
  visibility: visible;
}

.av-offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 280ms;
}

.av-offcanvas.open .av-offcanvas-backdrop {
  opacity: 1;
}

.av-offcanvas-panel {
  position: relative;
  width: 100%;
  background: #ede9e3;
  border-top: 4px solid var(--ice-3);
  border-left: 3px solid rgba(99,171,215,0.3);
  border-right: 3px solid rgba(99,171,215,0.3);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -6px 0 #356a8e, 0 -14px 30px rgba(0,0,0,0.12);
}

.av-offcanvas.open .av-offcanvas-panel {
  transform: translateY(0);
}

.av-offcanvas-handle {
  width: 48px;
  height: 6px;
  border-radius: 4px;
  background: var(--ice-3);
  margin-bottom: 2px;
  box-shadow: 0 2px 0 #356a8e;
}

.av-buy-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.av-buy-rarity-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(0,0,0,0.25);
  border: 1px solid currentColor;
  margin-bottom: 6px;
}

.av-buy-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.av-buy-opt {
  padding: 9px 14px;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(20,58,92,0.95), rgba(6,30,54,0.95));
  border: 2px solid rgba(99,171,215,0.35);
  box-shadow: 0 4px 0 rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 72px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.av-buy-opt:active { transform: translateY(4px); box-shadow: none; }

.av-buy-opt.on {
  border-color: #FFD33D;
  background: linear-gradient(180deg, rgba(70,52,0,0.95), rgba(35,22,0,0.95));
  box-shadow: 0 4px 0 #7a5500;
}

.av-buy-opt-dur {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.av-buy-opt-price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.av-buy-opt-price.gold { color: #FFD33D; }
.av-buy-opt-price.cash { color: #b48bff; }

.av-buy-error {
  color: var(--coral);
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}

.av-offcanvas-divider {
  width: 100%;
  height: 1px;
  background: rgba(99,171,215,0.2);
}

.av-buy-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* action buttons no offcanvas */
.av-action-btn {
  flex: 1;
  padding: 13px 8px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
}
.av-action-btn:active { transform: translateY(4px); box-shadow: none; }

.av-action-btn--cancel {
  background: transparent;
  border-color: rgba(127,210,238,0.4);
  color: #63abd7;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
}
.av-action-btn--preview {
  background: linear-gradient(180deg, #63abd7, #4a8ab5);
  border-color: var(--ice-3);
  color: #fff;
  box-shadow: 0 4px 0 #356a8e;
}
.av-action-btn--buy {
  background: linear-gradient(180deg, #6de87a, #1e9630);
  border-color: #5edd6b;
  color: #fff;
  box-shadow: 0 4px 0 #0d5518;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Avatar Shop — layout landscape ── */

#screen-avatars.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Filtros de tipo dentro do bb-card-label da loja */
.av-panel-label .av-type-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.av-panel-label .bb-btn.av-tab {
  height: 32px;
  min-width: 58px;
  padding: 0 12px;
  font-size: 13px;
  background: linear-gradient(180deg, #ccf0ff 0%, #54d3f9 30%, #b8e8ff 65%, #0080cc 100%);
  border: 1px solid #07427ec7;
  border-radius: 14px;
  color: #fff;
  box-shadow: 1px 1px 3px 0px #000;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7), -1px -1px 0 rgba(0,0,0,0.7), 1px -1px 0 rgba(0,0,0,0.7), -1px 1px 0 rgba(0,0,0,0.7), 0 2px 3px rgba(0,0,0,0.5);
  -webkit-text-stroke: 0.3px rgba(0,0,0,0.5);
}

.av-panel-label .bb-btn.av-tab::before {
  background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.2) 45%, rgba(255,255,255,0.05) 100%);
}

.av-panel-label .bb-btn.av-tab.active {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Moedas centralizadas no header do avatar shop */
.av-header-coins {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 2;
}
.av-hc-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.av-hc-gold { color: #7dd4ff; }
.av-hc-cash { color: #FFD33D; }
.av-hc-sep {
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  font-weight: 300;
}
.av-hc-buy-btn {
  padding: 5px 10px;
  height: 30px;
  font-size: 11px;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffe566 0%, #ffc800 40%, #e07000 100%);
  border-color: #7a3a00c7;
  color: #3d1a00;
  text-shadow: none;
}
.av-hc-buy-btn::before { border-color: rgba(255, 200, 80, 0.6); }
.av-hc-buy-btn:active { filter: brightness(0.85); transform: scale(0.96); }
#screen-avatars .app-header-right {
  grid-column: 3;
  justify-self: end;
}

.av-landscape {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  padding: 4px var(--pad-hr) calc(4px + var(--safe-bottom)) var(--pad-h);
  gap: 8px;
}

/* Painel esquerdo — base */
.av-left-panel {
  display: flex;
  flex-direction: column;
}

/* bb-card como painel — overrides */
.av-left-panel.bb-card,
.av-right-panel.bb-card {
  animation: none;
  overflow: hidden;
  min-height: 0;
}

.av-left-panel.bb-card { flex: 0 0 68%; }
.av-right-panel.bb-card { flex: 0 0 32%; }

.av-panel-label {
  padding: 6px 10px;
}

.av-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px calc(6px + var(--safe-bottom));
  border-top: 2px solid #001428;
  flex-shrink: 0;
}

.av-panel-footer .av-coins-bar {
  padding: 0;
  gap: 6px;
}

.av-panel-body {
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Inventário no painel direito */
.av-right-panel .av-inventory-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.av-right-panel .av-inv-grid {
  grid-template-columns: repeat(2, 1fr);
}

.av-inv-search-wrap {
  margin: 4px 6px 2px;
}

.av-right-header .av-coins-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
}

.av-right-header .av-coin-chip {
  padding: 3px 7px;
  font-size: 11px;
}

.av-right-header .av-buy-cash-btn {
  padding: 3px 7px;
  font-size: 10px;
}

/* Preview no painel direito */
.av-preview-area {
  position: relative;
  height: 120px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(79,195,232,0.25) 0%, transparent 65%),
    rgba(0,0,0,0.2);
}

.av-preview-area .av-preview-sprite {
  position: absolute;
  bottom: 16px;
  width: 100%;
  height: 110px;
  overflow: visible;
}

.av-preview-area .av-hero-ground {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 5px;
  background: radial-gradient(ellipse, rgba(79,195,232,0.4) 0%, transparent 70%);
}


/* Modal de compra centrado */
.av-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.av-modal-overlay.hidden { display: none; }

.av-modal-box {
  background: linear-gradient(180deg, #0a2a4a 0%, #04101e 100%);
  border: 2px solid rgba(99,171,215,0.35);
  border-radius: 20px;
  padding: 20px 20px 16px;
  width: min(360px, 85vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 0 rgba(0,0,0,0.5), 0 0 40px rgba(0,0,0,0.4);
}

/* Slot de avatar animado na sala de espera */
.slot-av-sprite {
  width: 64px;
  height: 72px;
  margin: 4px auto 0;
  position: relative;
  overflow: visible;
}

.copy-inline {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #63abd7;
  opacity: 0.7;
  transition: opacity 150ms;
  line-height: 0;
}

.copy-inline:hover {
  opacity: 1;
}

.copy-inline.copied {
  color: var(--mint);
  opacity: 1;
}

/* ===== TOAST ===== */
.toast {
  position: absolute;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(252, 204, 114, 0.98), rgba(229, 168, 48, 0.98));
  color: #3d3530;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1.5px 0 rgba(255, 255, 255, 0.7);
  animation: toast-in 180ms cubic-bezier(.22, .9, .34, 1);
  max-width: 90%;
  text-align: center;
}

/* ===== LOADING ===== */
.loading-spinner {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.95rem;
}

/* ===== GAME ===== */
/* Cor de fundo = topo do gradiente do canvas (céu azul), sem borda preta visível ao dar zoom out */

/* ================================================================
   GAMEPLAY SCREEN — Layout fiel ao DragonBound
   ================================================================ */

.game-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  background: #000;
  overflow: hidden;
}

/* === VIEWPORT DO JOGO === */
#game-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

/* === CANVAS STACK === */
.canvas-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.canvas-container {
  position: absolute;
  overflow: hidden;
  background: linear-gradient(to bottom, #1a8ce8 0%, #4ab0f5 55%, #f5a623 88%, #d4622a 100%);
}

.canvas-container canvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* === TIMER — topo direito sobre o viewport (estilo DragonBound #turn_timer) === */
#hud-timer {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 30;
  font-size: 2.8rem;
  font-weight: 900;
  color: #ff2222;
  text-shadow: 0 0 14px rgba(255, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* === HP BOXES FLUTUANTES SOBRE OS JOGADORES (estilo DragonBound .PlayerHPBox) === */
/* Posicionadas pelo engine em world-to-screen coords */
.player-hp-box {
  position: absolute;
  pointer-events: none;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.player-hp-name {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  white-space: nowrap;
  text-align: center;
}

.player-hp-name.active {
  color: #ffcc00;
}

.player-hp-bar-wrap {
  width: 76px;
  height: 4px;
  background: #1a2a1a;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

.player-hp-bar-fill {
  height: 100%;
  background: #63b64a;
  transition: width 0.2s;
}

.player-shield-bar-wrap {
  width: 76px;
  height: 2px;
  background: #2f2921;
  border: 1px solid rgba(100,150,255,0.4);
  border-radius: 1px;
  overflow: hidden;
}

.player-shield-bar-fill {
  height: 100%;
  background: #4488ff;
  transition: width 0.2s;
}


/* === MENSAGEM DE TURNO (centralizada, cobre o viewport) === */
.turn-message {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.88);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  z-index: 9000;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 3px #000;
}

/* === WIND CONTAINER — topo centro do viewport (estilo DragonBound #wind_meter2) === */
#wind-container {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 30;
  pointer-events: none;
}

#wind-canvas {
  border-radius: 50%;
  display: block;
  opacity: 0.9;
}

#wind-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* === WEATHER DISPLAY — abaixo do vento === */
#weather-display {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(0,0,0,0.6);
  padding: 3px 10px 3px 6px;
  border-radius: 10px;
  pointer-events: none;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1);
}

/* === LISTA DE TURNOS — esquerda do viewport (estilo DragonBound #turns_list) === */
#turn-queue-container {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 30;
  pointer-events: none;
  min-width: 140px;
}

#turn-queue {
  list-style: none;
  margin: 0;
  padding: 2px 0;
}

#turn-queue li {
  font-size: 0.68rem;
  color: rgba(255,202,65,0.9);
  padding: 1px 6px;
  white-space: nowrap;
  font-weight: 600;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000;
}

#turn-queue li.current {
  color: #fff;
  font-weight: 900;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* === HUD INFERIOR (estilo DragonBound #gameui) === */
#game-hud {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: linear-gradient(180deg, #3a3028 0%, #28201a 100%);
  border-top: 2px solid #4a6a8a;
  padding: 6px 8px;
  gap: 8px;
  flex-shrink: 0;
  min-height: 82px;
  max-height: 100px;
  z-index: 20;
  position: relative;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.5);
}

#hud-shots {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 130px;
}

.hud-esc-btn {
  background: rgba(160, 20, 20, 0.85);
  color: #fff;
  border: 1px solid #ff4444;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.3;
}

.hud-esc-btn:active {
  filter: brightness(1.3);
}

#hud-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#hud-angle-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #7baacc;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#angle-display {
  font-weight: 900;
  color: #f0c030;
  font-size: 1.1rem;
  min-width: 28px;
}

#hud-move {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hud-vbtns {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ===== CONTROLES ===== */
.controls {
  background: #1a2a3a;
  border-top: 3px solid #3bbcd6;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.controls-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  background: #243447;
  border: 1px solid rgba(99,171,215,0.35);
  border-radius: 6px;
  color: #cce;
  font-size: 1rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  font-weight: 700;
}

.ctrl-btn:active {
  filter: brightness(1.3);
  transform: scale(0.95);
}

.ctrl-sm {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

.ctrl-zoom {
  width: 34px;
  height: 34px;
  font-size: 1rem;
  background: #1a2a3a;
}

.shot-selector-container {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.shot-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  gap: 3px;
  user-select: none;
  border: 2px solid transparent;
}

.shot-selector:active {
  filter: brightness(1.2);
}

.shot-selector.active {
  outline: 2px solid #fff;
  outline-offset: 1px;
  filter: brightness(1.25);
}

.shot-s1 {
  background: #2a7fc1;
  border-color: #4aaaf0;
}

.shot-s2 {
  background: #1e6aa0;
  border-color: #3a90d0;
}

.shot-ss {
  background: #b8900a;
  border-color: #f0c030;
  color: #fff8e1;
}

.light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}

#light1 {
  background: #2ecc71;
}

#light2 {
  background: #333;
}

#lightss {
  background: #333;
}

.angle-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.angle-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #99bbcc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.angle-box {
  background: #2f2921;
  border: 1px solid rgba(99,171,215,0.35);
  border-radius: 4px;
  min-width: 42px;
  padding: 2px 6px;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
  color: #f0c030;
}

#power-container {
  flex: 1;
  height: 18px;
  background: #2f2921;
  border: 1px solid rgba(99,171,215,0.35);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

#power-bar-fill {
  height: 100%;
  min-width: 5px;
  background: linear-gradient(90deg, #2ecc71, #f39c12, #e74c3c);
  position: relative;
}

#prev-power {
  position: absolute;
  top: 0;
  left: 5px;
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  transition: left 0.1s ease;
}

.angle-btns {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.controls-move {
  justify-content: space-between;
}

.powerups-bar {
  position: absolute;
  bottom: 100%;
  left: 12px;
  display: flex;
  gap: 6px;
  padding-bottom: 4px;
}

/* ===== RANKING (game compat) ===== */
/* (rank-item kept for compat) */

/* ===== SAFE AREA ===== */
@supports (padding: max(0px)) {
  .screen-inner {
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .controls {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* ── DEV INSPECT (Alt+click to source) ── */
body.dev-inspect * {
  cursor: crosshair !important;
}

.dev-hover {
  outline: 2px dashed #e53935 !important;
  outline-offset: 2px !important;
}

#dev-tooltip {
  display: none;
  position: fixed;
  z-index: 99999;
  background: #1a1a2e;
  color: #e53935;
  font: 600 11px/1 monospace;
  padding: 4px 8px;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#dev-tooltip.visible {
  display: block;
}

#dev-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 99999;
  background: #1a1a2e;
  color: #fff;
  font: 500 13px/1 system-ui, sans-serif;
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

#dev-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== GUNTANKS GAMEPLAY UI ===== */

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  pointer-events: none;
}

#overlay.hidden {
  display: none;
}

#text-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}



/* quit-modal migrado para .popup-overlay / .popup.is-error */
.quit-penalty {
  font-size: 0.85rem;
  color: #f99;
}

#canvas-move-controls {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  backdrop-filter: blur(2px);
}

#canvas-move-controls .ctrl-btn {
  opacity: 0.75;
}

#canvas-move-controls .ctrl-btn:active {
  opacity: 1;
}

#drag-fire-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  user-select: none;
  touch-action: none;
  cursor: grab;
  flex-shrink: 0;
}

#drag-fire-zone.disabled {
  opacity: 0.35;
  pointer-events: none;
}

#drag-fire-zone.dragging {
  cursor: grabbing;
}

#drag-fire-label {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  font-weight: 700;
}

#drag-fire-handle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe066, #e67e00);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 10px rgba(255, 160, 0, 0.5);
  transition: transform 0.1s, box-shadow 0.1s;
}

#drag-fire-zone.dragging #drag-fire-handle {
  transform: scale(0.88);
  box-shadow: 0 0 18px rgba(255, 80, 0, 0.7);
  background: radial-gradient(circle at 35% 35%, #ff9933, #cc3300);
}


#wind-canvas {
  border-radius: 50%;
  display: block;
}

#wind-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

#vol-container {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 50;
  cursor: pointer;
}

.vol {
  height: 36px;
  width: 36px;
}

.ctrl-zoom {
  font-size: 1.2rem;
  font-weight: bold;
  min-width: 36px;
  padding: 6px 10px;
}

#zoom-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 8px 18px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
}

#zoom-indicator.zoom-fade {
  animation: zoomFadeOut 1.2s forwards;
}

@keyframes zoomFadeOut {
  0% {
    opacity: 1;
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ── Popup de erro de servidor ───────────────────────────── */
/* srv-popup migrado para .popup-overlay / .popup.is-error */

/* ── Chat modal da sala de espera ───────────────────────── */
#wr-chat-modal {
  align-items: flex-end;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wr-chat-popup {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #0d2540 0%, #071828 100%);
  border-top: 2px solid rgba(99,171,215,0.35);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
  max-height: 55dvh;
}
.wr-chat-history {
  flex: 1;
  min-height: 120px;
  max-height: 40dvh;
  overflow-y: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,171,215,0.2) transparent;
}
.wr-chat-history::-webkit-scrollbar { width: 3px; }
.wr-chat-history::-webkit-scrollbar-thumb { background: rgba(99,171,215,0.2); border-radius: 2px; }
.wr-chat-history:empty::before {
  content: 'Nenhuma mensagem ainda...';
  color: rgba(127,210,238,0.35);
  font-size: 12px;
  text-align: center;
  margin: auto;
  display: block;
}
.wr-chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(99,171,215,0.12);
  flex-shrink: 0;
}
.wr-chat-input {
  flex: 1;
  background: rgba(0,0,0,0.35);
  border: 1.5px solid rgba(127,210,238,0.25);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  font-family: var(--font-body);
}
.wr-chat-input::placeholder { color: var(--text-muted); }
.wr-chat-input:focus { border-color: rgba(127,210,238,0.55); }
.wr-chat-send {
  background: var(--ice-4);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wr-chat-send:active { opacity: 0.7; }
.wr-chat-msg {
  display: flex;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  align-items: baseline;
}
.wr-chat-name {
  color: var(--ice-3);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.wr-chat-msg.me .wr-chat-name { color: var(--gem-yellow); }
.wr-chat-text {
  color: var(--text);
  word-break: break-word;
}
/* Slot com cursor pointer para abrir chat */
.wr-slot.occupied { cursor: pointer; }
.wr-slot.occupied:active { opacity: 0.88; }

/* ── Balão de fala no slot ───────────────────────────────── */
.wr-slot { position: relative; }
.wr-bubble {
  position: absolute;
  background: #fff;
  color: #1a2a3a;
  font-size: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 8px;
  padding: 4px 8px;
  white-space: normal;
  word-break: break-word;
  max-width: 90px;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 3px 12px rgba(0,0,0,0.45);
  animation: bubble-in 0.18s ease;
  min-width: 40px;
  text-align: center;
  line-height: 1.35;
}
.wr-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.8); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ===== TELAS WIP ===== */
.screen-wip {
  flex-direction: column;
  background: url('/assets/background-lobby.png') center center / cover no-repeat;
}

.wip-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 12px 14px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(255,255,255,0.08);
}

.wip-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  transition: all 80ms;
}
.wip-back-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

.wip-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.wip-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--pad-h);
}

.wip-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(4,14,28,0.88);
  border: 3px solid #1a3d5c;
  border-radius: 24px;
  padding: 36px 24px;
  box-shadow: 0 6px 0 #091828, 0 10px 30px rgba(0,0,0,0.6);
  text-align: center;
}

.wip-emoji {
  font-size: 56px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
  animation: wip-float 3s ease-in-out infinite;
}

@keyframes wip-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.wip-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 #0a3a5c, 0 3px 10px rgba(99,171,215,0.4);
}

.wip-desc {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: rgba(195,233,247,0.75);
  line-height: 1.5;
  max-width: 280px;
}

.wip-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2a8ab0, #1a6888);
  border: 2px solid #3eb8d4;
  border-bottom-color: rgba(99,171,215,0.35);
  border-radius: 20px;
  padding: 6px 18px;
  box-shadow: 0 3px 0 #0e4a60, 0 4px 12px rgba(99,171,215,0.3);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  letter-spacing: 0.3px;
}

.wip-badge--green {
  background: linear-gradient(135deg, #1ea060, #0b6038);
  border-color: #4CE0A0;
  border-bottom-color: #084a28;
  box-shadow: 0 3px 0 #084a28, 0 4px 12px rgba(76,224,160,0.3);
}

/* ===== SETUP SCREEN ===== */
#screen-setup {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + var(--safe-top));
  background: var(--bg2) url('/assets/bg-splash02.png') center center / cover no-repeat;
  overflow-y: auto;
}

#screen-setup .auth-step {
  overflow: visible;
}

#screen-setup .auth-step-label {
  border-radius: 18px 18px 0 0;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-nick-status {
  position: absolute;
  right: 12px;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
  transition: color 0.15s;
}

.setup-nick-status.ok   { color: var(--mint); }
.setup-nick-status.err  { color: var(--coral); }
.setup-nick-status.wait { color: var(--text-muted); }

.setup-nick-hint {
  font-size: 12px;
  color: var(--coral);
  margin: -4px 0 0;
  min-height: 14px;
}

.setup-country-field {
  position: relative;
}

#screen-setup .auth-gender-opt {
  background: #001020;
  border-color: #003d5c;
  color: rgba(189,243,255,0.5);
}

#screen-setup .auth-gender-opt:has(input:checked) {
  border-color: var(--ice-3);
  background: #001a2e;
  color: #e9fbff;
}

/* ===== ACCOUNT SCREEN ===== */
.ac-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 24px;
}

.ac-cards-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px var(--pad-h) 12px;
}

.ac-cards-wrap .bb-card {
  min-width: 0;
}

.ac-profile-inner {
  background-color: #033043;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ac-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ac-hero-avatar-wrap {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  border: 2px solid rgba(93,216,245,0.2);
  box-shadow: 0 0 14px rgba(0,140,232,0.2);
}

.ac-hero-level {
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.ac-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ac-hero-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
  line-height: 1.1;
}

.ac-hero-rank {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(93,216,245,0.12);
  border: 1px solid rgba(93,216,245,0.28);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 600;
  color: #5dd8f5;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ac-hero-email {
  font-size: 10px;
  color: rgba(255,255,255,0.36);
  word-break: break-all;
  line-height: 1.3;
}

.ac-hero-sep {
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.ac-hero-chips {
  display: flex;
  gap: 6px;
}

.ac-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-s);
  padding: 9px 4px;
}

.ac-chip--gp    { border-color: rgba(255,211,61,0.3);  background: rgba(255,211,61,0.07);  }
.ac-chip--gold  { border-color: rgba(210,170,60,0.3);  background: rgba(210,170,60,0.07);  }
.ac-chip--cash  { border-color: rgba(130,180,255,0.3); background: rgba(130,180,255,0.07); }
.ac-chip--ranking { border-color: rgba(255,130,80,0.3); background: rgba(255,130,80,0.07); }

.ac-chip--gp .ac-chip-lbl      { color: rgba(255,211,61,0.6);  }
.ac-chip--gold .ac-chip-lbl    { color: rgba(232,192,96,0.6);  }
.ac-chip--cash .ac-chip-lbl    { color: rgba(160,200,255,0.6); }
.ac-chip--ranking .ac-chip-lbl { color: rgba(255,144,96,0.6);  }

.ac-chip-icon { font-size: 12px; line-height: 1; }

.ac-chip-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.ac-chip-lbl {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ac-stats {
  display: flex;
  justify-content: space-around;
  padding: 6px 0 2px;
}

.ac-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ac-stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.ac-stat--wins .ac-stat-val   { color: #6ee67a; }
.ac-stat--losses .ac-stat-val { color: #ff6b6b; }
.ac-stat--winrate .ac-stat-val { color: #5dd8f5; }

.ac-stat-lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Barra de progresso de nível */
.ac-level-progress {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.ac-lp-levels {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-lp-icon {
  flex-shrink: 0;
  image-rendering: pixelated;
}

.ac-lp-icon--next {
  opacity: 0.5;
}

.ac-lp-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ac-lp-bar-track {
  height: 10px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

.ac-lp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a9fe8, #5dd8f5);
  border-radius: 6px;
  transition: width 0.6s ease;
  box-shadow: 0 0 6px rgba(93,216,245,0.5);
}

.ac-lp-gp-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.38);
  text-align: center;
  letter-spacing: 0.3px;
}

.ac-form-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ac-form-body .auth-input {
  width: 100%;
}

.ac-save-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #1e40af;
  transition: all 80ms;
  letter-spacing: .3px;
}

.ac-save-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.ac-success { color: var(--mint) !important; }

/* Preview do mobile selecionado (botão que abre o modal) */
.wr-mob-cur {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #0e3558 0%, #071c34 100%);
  border: 2px solid #1a4d72;
  border-radius: 10px;
  justify-content: center;
  padding: 0 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 4px 0 #040e1e,
    0 6px 14px rgba(0,0,0,0.4);
}
.wr-mob-cur:active {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 0 #040e1e;
  transform: translateY(2px);
}

.wr-mob-cur-scene {
  flex-shrink: 0;
  width: 60px;
  height: 64px;
  position: relative;
  overflow: hidden;
}

.wr-mob-cur-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wr-mob-cur-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #4a8ab5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wr-mob-cur-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: rgba(127,210,238,0.55);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Modal de seleção de mobiles */
.wr-mobiles-popup {
  max-width: 420px;
  max-height: 88vh;
}
.wr-mobiles-popup .popup-body {
  padding: 12px 14px;
}

.wr-mobiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.wr-mob-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 4px 6px;
  border-radius: 10px;
  border: 2px solid rgba(99,171,215,0.12);
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, rgba(var(--mob-glow, 62,184,212), 0.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20,52,82,0.97) 0%, rgba(4,12,22,0.99) 100%);
  box-shadow: 0 3px 0 rgba(0,0,0,0.5);
  transition: border-color 0.15s, background 0.15s, transform 0.08s, box-shadow 0.15s;
  user-select: none;
}
.wr-mob-card:hover {
  border-color: rgba(99,171,215,0.25);
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, rgba(var(--mob-glow, 62,184,212), 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20,52,82,0.97) 0%, rgba(4,12,22,0.99) 100%);
  box-shadow: 0 3px 0 rgba(0,0,0,0.5), 0 0 8px rgba(var(--mob-glow, 62,184,212), 0.18);
}
.wr-mob-card:active { transform: translateY(3px); box-shadow: none; }
.wr-mob-card.selected:hover {
  border-color: #FFD33D;
}
.wr-mob-card.selected {
  border-color: #FFD33D;
  background:
    radial-gradient(ellipse 95% 80% at 50% 42%, rgba(var(--mob-glow, 62,184,212), 0.22) 0%, transparent 72%),
    linear-gradient(180deg, rgba(20,52,82,0.99) 0%, rgba(2,8,16,1) 100%);
  box-shadow: 0 3px 0 rgba(var(--mob-glow, 62,184,212), 0.35), 0 0 12px rgba(var(--mob-glow, 62,184,212), 0.22);
}

.wr-mob-card-scene {
  width: 56px;
  height: 60px;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.wr-mob-card-name {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  color: #4a8ab5;
  text-align: center;
  line-height: 1.2;
}

/* Sprite de item */
.wr-item-sprite {
  background-image: url('/extract/items/items.png');
  background-repeat: no-repeat;
  height: 31px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* Grid de itens no modal */
.wr-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 0 6px;
}

/* Card de item */
.wr-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px 8px 6px;
  border-radius: 10px;
  border: 2px solid rgba(99,171,215,0.25);
  background: linear-gradient(180deg, rgba(20,58,92,0.95), rgba(6,30,54,0.95));
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  transition: border-color 0.12s, background 0.12s, transform 0.08s, box-shadow 0.08s;
  user-select: none;
  position: relative;
}
.wr-item-card:active { transform: translateY(3px); box-shadow: none; }
.wr-item-card.selected {
  border-color: #FFD33D;
  background: linear-gradient(180deg, rgba(70,52,0,0.95), rgba(35,22,0,0.95));
  box-shadow: 0 3px 0 #7a5500;
}
.wr-item-card.disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}
.wr-item-card-name {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: #4a8ab5;
  text-align: center;
  line-height: 1.2;
}
.wr-item-card-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #FFD33D;
  color: #3d3530;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  border-radius: 6px;
  padding: 0 4px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
  pointer-events: none;
}

/* Slots de itens selecionados */
.wr-items-slots-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.wr-item-slot {
  width: 56px;
  height: 44px;
  border-radius: 8px;
  border: 2px dashed rgba(99,171,215,0.4);
  background: rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wr-item-slot.filled {
  border-style: solid;
  border-color: var(--ice-3);
  cursor: pointer;
}
.wr-item-slot.filled:hover { border-color: #e85f5f; background: rgba(80,10,10,0.4); }
.wr-item-slot.filled:active { transform: scale(0.93); }

/* Seções e separadores no modal de itens */
.wr-items-section-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #63abd7;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.wr-items-hint {
  font-size: 9px;
  color: rgba(127,210,238,0.55);
  font-weight: 400;
}
.wr-items-sep {
  height: 1px;
  background: rgba(99,171,215,0.2);
  margin: 4px 0 10px;
}
.wr-items-empty {
  font-family: var(--font-display);
  font-size: 10px;
  color: rgba(127,210,238,0.4);
  text-align: center;
  padding: 10px 0;
}

/* Toast de notificação de itens alterados */
.wr-items-toast {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 22, 46, 0.97);
  border: 1px solid #9b5ff5;
  border-radius: 12px;
  padding: 8px 12px 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #d4b8ff;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  animation: wr-toast-in 0.22s ease;
}
@keyframes wr-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.wr-items-toast-btn {
  background: linear-gradient(180deg, #9b5ff5, #4a1fa0);
  border: 1px solid #b07ef8;
  border-radius: 7px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.wr-items-toast-btn:active { opacity: 0.7; }

#btn-items .wr-items-check {
  color: #4cff8a;
  font-size: 12px;
  font-weight: 900;
}

/* Popup de itens */
.wr-items-popup {
  max-width: 390px;
  max-height: 88vh;
}
.wr-items-popup .popup-body {
  padding: 14px 16px;
}
.setup-logout-btn:active { opacity: 0.6; }
/* ── Modal de perfil de jogador ─────────────────────────────────────────── */
.pp-popup { max-width: 300px; }
.pp-body { display: flex; gap: 14px; align-items: center; }
.pp-avatar {
  width: 72px; height: 72px; flex-shrink: 0; position: relative;
  border-radius: 8px; overflow: hidden; margin: 0 auto;
  background: linear-gradient(180deg, rgba(20,58,92,0.8), rgba(6,30,54,0.8));
  border: 1px solid rgba(99,171,215,0.3);
}
.pp-info {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(99,171,215,0.15);
}
.pp-nick {
  font-family: var(--font-display); font-size: 13px; font-weight: 900; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.pp-info-sub {
  display: flex; align-items: center; justify-content: center;
}
.pp-info-sub > * {
  padding: 0 10px;
  border-left: 1px solid rgba(99,171,215,0.2);
}
.pp-info-sub > *:first-child { border-left: none; }
.pp-level {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: #63abd7; font-family: var(--font-display);
}
.pp-level-img { width: 14px; height: 14px; object-fit: contain; }
.pp-gp {
  font-size: 10px; color: #FFD33D; font-family: var(--font-mono);
  font-weight: 700;
}
.pp-rank {
  font-size: 10px; color: rgba(99,171,215,0.8); font-family: var(--font-display);
  font-weight: 800;
}

/* ── Modal de gerenciamento de sala ─────────────────────────────────────── */
.popup-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #001428;
  display: block;
  margin-bottom: 4px;
}
.wr-banned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127,210,238,0.2) transparent;
}
.wr-banned-list::-webkit-scrollbar { width: 4px; }
.wr-banned-list::-webkit-scrollbar-thumb { background: rgba(127,210,238,0.2); border-radius: 2px; }
.wr-banned-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.05);
}
.wr-banned-level {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.wr-banned-name {
  flex: 1;
  font-size: 12px;
  color: #4a8ab5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wr-unban-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(231,76,60,0.35);
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.wr-unban-btn:hover { background: rgba(231,76,60,0.3); }
.wr-unban-btn:active { opacity: 0.7; }

/* ── Stats do perfil de jogador ─────────────────────────────────────────── */
.pp-popup { max-width: 320px; }
.pp-stats {
  background: #033043;
  border-radius: 8px;
  border: 1px solid #000;
  padding: 12px;
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 260px;
}
.pp-rank-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,211,61,0.1), rgba(255,211,61,0.04));
  border: 1px solid rgba(255,211,61,0.2);
}
.pp-rank-label { font-size: 10px; color: #9ab8cc; font-family: var(--font-display); font-weight: 700; }
.pp-rank-value { font-size: 12px; font-weight: 900; color: #FFD33D; font-family: var(--font-display); }
.pp-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.pp-stat {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 3px; border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,171,215,0.12);
}
.pp-stat--wide { grid-column: span 4; }
.pp-stat-val {
  font-family: var(--font-display); font-size: 11px; font-weight: 900; color: #fff;
}
.pp-stat-lbl { font-size: 8px; color: #63abd7; text-transform: uppercase; letter-spacing: 0.4px; }
.pp-stats-loading {
  text-align: center; font-size: 11px; color: #5a8aa0;
  padding: 8px 0; font-style: italic;
}

/* ── Buddy List ─────────────────────────────────────────────── */
.bl-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  width: 300px;
  height: 460px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #163954 0%, #0b2235 100%);
  border: 2px solid #2475a8;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  font-family: var(--font-display);
  user-select: none;
}

.bl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  background: linear-gradient(180deg, #2475a8 0%, #185580 100%);
  border-bottom: 2px solid #0f3d60;
  cursor: grab;
}
.bl-header:active { cursor: grabbing; }

.bl-header-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bl-header-icon {
  width: 20px;
  height: 20px;
  color: #a8d8ea;
  flex-shrink: 0;
}

.bl-count {
  font-size: 10px;
  font-weight: 700;
  color: #a8d8ea;
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.bl-header-actions {
  display: flex;
  gap: 3px;
}

.bl-hdr-btn {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}
.bl-hdr-btn:hover { background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.12)); }
.bl-hdr-btn--close { background: linear-gradient(180deg, #c0392b, #7b241c); border-color: #6c1f18; }
.bl-hdr-btn--close:hover { background: linear-gradient(180deg, #e74c3c, #962d22); }

.bl-list {
  flex: 1;
  overflow-y: auto;
  padding: 3px 0;
  scrollbar-width: thin;
  scrollbar-color: #2475a8 rgba(0,0,0,0.2);
}
.bl-list::-webkit-scrollbar { width: 6px; }
.bl-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.bl-list::-webkit-scrollbar-thumb { background: #2475a8; border-radius: 3px; }

.bl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bl-item:hover { background: rgba(255,255,255,0.07); }
.bl-modal.delete-mode .bl-item { cursor: default; }

.bl-item-level {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: pixelated;
}

.bl-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bl-item-name {
  font-size: 11px;
  font-weight: 700;
  color: #e0f0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bl-unread {
  font-size: 9px;
  background: #e74c3c;
  color: #fff;
  padding: 1px 4px;
  border-radius: 8px;
  font-weight: 900;
  flex-shrink: 0;
}

.bl-item-presence {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.bl-item-status {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.bl-item-status.online { color: #2ecc71; }
.bl-item-room {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,220,80,0.85);
  background: rgba(255,180,0,0.1);
  border: 1px solid rgba(255,180,0,0.25);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.2px;
}

.bl-item-remove {
  display: none;
  width: 18px;
  height: 18px;
  background: #c0392b;
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.bl-modal.delete-mode .bl-item-remove { display: flex; }

.bl-empty {
  text-align: center;
  padding: 18px 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
}

/* Pedidos de amizade */
.bl-requests-section {
  border-top: 1px solid rgba(36,117,168,0.5);
  padding: 4px 0;
}
.bl-requests-title {
  font-size: 9px;
  font-weight: 700;
  color: #FFD33D;
  padding: 2px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bl-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  gap: 6px;
}
.bl-req-name {
  font-size: 10px;
  color: #4a8ab5;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.bl-request-btns { display: flex; gap: 3px; flex-shrink: 0; }
.bl-req-btn {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1;
}
.bl-req-btn--accept { background: #27ae60; border-color: #1e8449; color: #fff; }
.bl-req-btn--reject { background: #c0392b; border-color: #962d22; color: #fff; }

/* Chat privado */
.bl-chat-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2001;
  width: 230px;
  background: linear-gradient(180deg, #163954 0%, #0b2235 100%);
  border: 2px solid #2475a8;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7);
  overflow: hidden;
  font-family: var(--font-display);
  user-select: none;
  display: flex;
  flex-direction: column;
}

.bl-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 7px;
  background: linear-gradient(180deg, #2475a8 0%, #185580 100%);
  border-bottom: 2px solid #0f3d60;
  cursor: grab;
}
.bl-chat-header:active { cursor: grabbing; }

.bl-chat-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bl-chat-msgs {
  height: 160px;
  overflow-y: auto;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: #2475a8 transparent;
}
.bl-chat-msgs::-webkit-scrollbar { width: 4px; }
.bl-chat-msgs::-webkit-scrollbar-thumb { background: #2475a8; border-radius: 2px; }

.bl-msg {
  max-width: 88%;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}
.bl-msg--mine {
  align-self: flex-end;
  background: #2475a8;
  color: #fff;
  border-bottom-right-radius: 2px;
}
.bl-msg--theirs {
  align-self: flex-start;
  background: rgba(255,255,255,0.1);
  color: #4a8ab5;
  border-bottom-left-radius: 2px;
}
.bl-msg-sender {
  font-size: 9px;
  font-weight: 700;
  color: #63abd7;
  margin-bottom: 2px;
}
.bl-msg-time {
  font-size: 8px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  text-align: right;
}
.bl-msg--theirs .bl-msg-time { text-align: left; }
.bl-msg-loading {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  padding: 8px;
  font-style: italic;
}

.bl-chat-footer {
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-top: 1px solid rgba(36,117,168,0.4);
}
.bl-chat-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 11px;
  color: #fff;
  outline: none;
  font-family: var(--font-display);
}
.bl-chat-input::placeholder { color: rgba(255,255,255,0.25); }
.bl-chat-input:focus { border-color: #2475a8; }
.bl-chat-send-btn {
  background: linear-gradient(180deg, #2475a8, #185580);
  border: 1px solid #0f3d60;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  cursor: pointer;
  font-family: var(--font-display);
  white-space: nowrap;
}
.bl-chat-send-btn:hover { background: linear-gradient(180deg, #2e88c4, #1e6a9e); }

/* ── Popup de pedido de amizade ─────────────────────────────── */
.bl-req-popup {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 3000;
  background: linear-gradient(180deg, #163954 0%, #0b2235 100%);
  border: 2px solid #2475a8;
  border-radius: 8px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.7);
  padding: 10px 14px;
  min-width: 230px;
  max-width: 280px;
  font-family: var(--font-display);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34,1.36,0.64,1), opacity 0.2s ease;
  pointer-events: none;
}
.bl-req-popup.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.bl-req-popup-text {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #4a8ab5;
  margin-bottom: 9px;
}
.bl-req-popup-text svg { flex-shrink: 0; color: #63abd7; }
.bl-req-popup-text strong { color: #fff; }
.bl-req-popup-btns {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ── Popup de convite para sala ──────────────────────────────── */
.bl-room-invite-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.88);
  z-index: 3000;
  background: linear-gradient(160deg, #0e2d4a 0%, #071828 100%);
  border: 2px solid rgba(99,171,215,0.5);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.75), 0 0 0 1px rgba(99,171,215,0.08);
  padding: 16px 18px 14px;
  min-width: 260px;
  max-width: 320px;
  width: calc(100vw - 32px);
  font-family: var(--font-display);
  opacity: 0;
  cursor: grab;
  transition: transform 0.3s cubic-bezier(0.34,1.36,0.64,1), opacity 0.2s ease;
  pointer-events: none;
}
.bl-room-invite-popup.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.bl-room-invite-popup.dragging {
  cursor: grabbing;
  transition: none;
}
.bl-rip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bl-rip-level {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.bl-rip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bl-rip-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(127,210,238,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bl-rip-username {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.bl-rip-room {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,171,215,0.08);
  border: 1px solid rgba(99,171,215,0.2);
  border-radius: 8px;
  padding: 7px 12px;
  margin-bottom: 12px;
}
.bl-rip-room-num {
  font-size: 13px;
  font-weight: 800;
  color: #63abd7;
}
.bl-rip-room-title {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bl-rip-btns {
  display: flex;
  gap: 8px;
}
.bl-rip-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s;
}
.bl-rip-btn:active { opacity: 0.75; }
.bl-rip-btn--accept {
  background: linear-gradient(180deg, #27ae60, #1a8a48);
  color: #fff;
}
.bl-rip-btn--reject {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ===== TOAST ===== */
#app-toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.app-toast {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.app-toast--info    { background: #ede9e3; border-color: var(--ice-3); color: var(--dark-2); }
.app-toast--success { background: var(--mint-dim); border-color: var(--mint); color: #fff; }
.app-toast--error   { background: #f8eeee; border-color: var(--coral); color: #7a3030; }
.app-toast--warn    { background: #fef8ee; border-color: var(--gem-yellow); color: #7a5200; }

/* ===== CONFIRM / GAME RESULT ===== */
.app-confirm-msg {
  font-size: 13px;
  color: var(--dark-1);
  line-height: 1.5;
}

.app-game-result-box {
  text-align: center;
  max-width: 280px;
}
.app-game-result-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-line;
}
.app-game-result-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.app-game-result-fill {
  height: 100%;
  width: 100%;
  background: var(--ice-3);
  border-radius: 99px;
  transform: scaleX(1);
  transform-origin: left;
  animation: game-result-drain 6s linear forwards;
  animation-play-state: paused;
}
@keyframes game-result-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ===== ONBOARDING ===== */
#screen-onboard {
  background: var(--bg2) url('/assets/bg-splash02.png') center center / cover no-repeat;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + var(--safe-top));
  overflow-y: auto;
}
#screen-onboard .auth-step {
  max-width: min(80vw, 560px);
  max-height: calc(100dvh - 80px - var(--safe-top) - var(--safe-bottom));
  display: flex;
  flex-direction: column;
}
#screen-onboard .popup-actions {
  flex-shrink: 0;
}

/* header do card: badge + botão pular */
.onb-card .auth-step-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.onb-skip-btn {
  position: relative;
  z-index: 1;
  background: #001428;
  border: 2px solid #000a14;
  border-radius: 8px;
  color: var(--gem-yellow);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px 3px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.onb-skip-btn:hover { opacity: 0.85; }

/* dots abaixo do header */
.onb-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0;
  flex-shrink: 0;
}
.onb-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,20,40,0.18);
  transition: background 0.25s, width 0.25s;
}
.onb-dot.active {
  width: 20px;
  background: #001428;
  opacity: 0.5;
}

/* área de conteúdo dos slides */
.onb-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

/* slide genérico (sem imagem) */
.onb-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
}

/* hero: centralizado, sem imagem */
.onb-slide--hero {
  align-items: center;
  text-align: center;
  gap: 12px;
}

/* slides com imagem: row layout */
.onb-slide--img {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 16px;
}
.onb-slide--img .onb-slide-img {
  flex-shrink: 0;
  width: min(110px, 22vw);
  height: auto;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0,20,40,0.35));
}
.onb-slide-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.onb-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #001428;
  line-height: 1.2;
  margin: 0;
}
.onb-slide--hero .onb-title {
  font-size: 1.5rem;
  background: linear-gradient(180deg, #FFE040 0%, #fff176 50%, #FFE040 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.onb-body {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: rgba(0, 20, 40, 0.7);
  line-height: 1.6;
  margin: 0;
  white-space: pre-line;
}
@keyframes onb-anim-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes onb-anim-back {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes onb-anim-hero {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.onb-anim-in   { animation: onb-anim-in   0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.onb-anim-back { animation: onb-anim-back 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.onb-anim-hero { animation: onb-anim-hero 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes onb-anim-hero {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.onb-anim-in   { animation: onb-anim-in   0.38s cubic-bezier(0.22, 1, 0.36, 1) both; }
.onb-anim-back { animation: onb-anim-back 0.38s cubic-bezier(0.22, 1, 0.36, 1) both; }
.onb-anim-hero { animation: onb-anim-hero 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ===== SERVER SELECT ===== */
#screen-servers {
  overflow: hidden;
  background: var(--bg2) url('/assets/bg-splash02.png') center center / cover no-repeat;
}

/* área central com o card */
.srv-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px max(16px, env(safe-area-inset-right)) max(16px, var(--safe-bottom)) max(16px, env(safe-area-inset-left));
  min-height: 0;
  overflow: hidden;
}

.srv-world-card {
  width: min(96vw, 680px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.srv-card-body-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.srv-list-inner {
  background-color: #033043;
      padding: 17px 25px;
  border-radius: 8px;
  border: 1px solid #000;
  max-height: 100%;
  overflow-y: auto;
}

/* grid 2 colunas para a lista de servidores */
.srv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  min-height: 210px;
}

.srv-col-title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-2);
  margin: 0;
  text-align: center;
  line-height: 1.1;
}

/* Lista */
.srv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.srv-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 30px 0;
  grid-column: 1 / -1;
}

/* Card "em breve" — single player */
.srv-sp-soon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(107,94,88,0.3);
  border-radius: var(--radius-m);
  min-height: 100px;
}

/* Card base */
.srv-card {
    position: relative;
    background: #008ac6;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.12s, box-shadow 0.18s, opacity 0.18s;
    color: #a8d0e8;
    box-shadow: inset 1px 1px 3px #ffffff82, 1px 2px 4px rgb(0 0 0 / 51%) !important;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
}
.srv-card-main {
display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 4px;
    min-width: 0;
}
.srv-card:not(:disabled):hover {
  border-color: #2a7a9a;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #020c18, 0 8px 20px rgba(0,0,0,0.4);
}
.srv-card:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #020c18;
}
.srv-card--disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.8);
  opacity: 0.5;
}
.srv-card--connecting {
  cursor: wait;
  animation: srv-connecting 0.9s ease-in-out infinite;
}
@keyframes srv-connecting {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.srv-card--level-locked { border-color: var(--load-locked-border); }

/* Ribbon de nome */
.srv-card-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #000;
  border-radius: 5px;
  background: #0d3a58;
  box-shadow: inset 0 0 2px 1px rgba(0,0,0,0.4);
}
.srv-card-name {
font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 500;
    color: #ffffff;
    /* text-transform: uppercase; */
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
/* Level badge dentro do header escuro */
.srv-card-zone .srv-level-badge {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.srv-card-zone .srv-lvl-sep {
  color: rgba(255,255,255,0.5);
}

/* Corpo */
.srv-card-body {
  display: flex;
  align-items: flex-start;
  padding: 6px 8px;
  background-color: #042233;
  gap: 6px;
  box-shadow: inset 0 0 2px 1px rgba(0,0,0,0.42);
  border-radius: 5px;
  border: 1px solid #000;
  flex: 1;
}
.srv-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.srv-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-s);
  padding: 2px 5px;
  width: fit-content;
}
.srv-lvl-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  image-rendering: pixelated;
}
.srv-lvl-sep {
  font-size: 0.55rem;
  color: var(--dark-0);
  margin: 0 1px;
}
.srv-desc {
  font-size: 0.65rem;
  color: #7ab8d8;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
}
.srv-badge-nostats {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  background: rgba(221,142,138,0.15);
  color: var(--coral-dim);
  border: 1px solid rgba(221,142,138,0.3);
}

/* Coluna do medidor */
.srv-meter-col {
    position: relative;
    width: 48px;
    overflow: hidden;
}

/* Medidor semicircular */
.srv-meter-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.srv-meter-svg {
  width: auto;
  height: 100%;
  display: block;
}
.srv-meter-label {
  display: none;
}
.srv-meter-label--full { color: var(--coral-dim); }

/* Badge de carga — quadrado colorido */
.srv-load-badge {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.2;
  background: #666;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.srv-load-badge--empty,
.srv-load-badge--low    { background: var(--load-low);   box-shadow: 0 2px 0 var(--load-low-shadow); }
.srv-load-badge--medium { background: var(--load-med);   box-shadow: 0 2px 0 var(--load-med-shadow); }
.srv-load-badge--high   { background: var(--load-high);  box-shadow: 0 2px 0 var(--load-high-shadow); }
.srv-load-badge--full,
.srv-load-badge--locked { background: var(--load-full);  box-shadow: 0 2px 0 var(--load-full-shadow); }
.srv-load-badge--offline { background: var(--load-off);  box-shadow: 0 2px 0 var(--load-off-shadow); }
.srv-load-badge--maintenance { background: var(--load-maint); box-shadow: 0 2px 0 var(--load-maint-shadow); }

/* Borda colorida por carga */
.srv-card--low        { border-color: var(--load-low-border); }
.srv-card--medium     { border-color: var(--load-med-border); }
.srv-card--high       { border-color: var(--load-high-border); }
.srv-card--full       { border-color: var(--coral-dark); }
.srv-card--locked     { border-color: var(--coral-dark); }
.srv-card--maintenance { border-color: var(--load-med-border); }

/* =====================================================
   GAMEPLAY — novos elementos DragonBound
   ===================================================== */

/* Botão PASS */
.hud-pass-btn {
  background: rgba(20, 100, 20, 0.85);
  color: #fff;
  border: 1px solid #44cc44;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.hud-pass-btn:active { filter: brightness(1.3); }
.hud-pass-btn:disabled { opacity: 0.4; cursor: default; }

/* Slots de item */
#hud-items {
  display: flex;
  flex-direction: row;
  gap: 2px;
  flex-shrink: 0;
  align-items: center;
}
.item-slot {
  width: 48px;
  height: 34px;
  background: #2a211c;
  border: 1px solid rgba(99,171,215,0.25);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  background-repeat: no-repeat;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.1s;
}
.item-slot.has-item {
  border-color: rgba(99,171,215,0.5);
}
.item-slot:hover { border-color: #7baacc; }
.item-slot:active { filter: brightness(1.3); }
.item-key {
  position: absolute;
  bottom: 1px;
  left: 2px;
  font-size: 0.42rem;
  color: rgba(123,170,204,0.65);
  pointer-events: none;
  line-height: 1;
  font-weight: 700;
}

/* Chat in-game (dentro de #game-viewport que tem position:relative) */
#game-chat {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 220px;
  z-index: 25;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}
#game-chat-messages {
  max-height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chat-msg {
  font-size: 0.68rem;
  color: #e0e8f0;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  padding: 2px 5px;
  word-break: break-word;
  text-shadow: 0 1px 2px #000;
}
#game-chat-form { display: flex; }
#game-chat-input {
  flex: 1;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(99,171,215,0.3);
  border-radius: 4px;
  color: #e0e8f0;
  font-size: 0.72rem;
  padding: 3px 6px;
  outline: none;
}
#game-chat-input:focus { border-color: #7baacc; }

/* Tela de resultado final */
#game-over-screen {
  position: absolute;
  inset: 0;
  background: rgba(0,0,8,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#game-over-inner {
  background: #2f2921;
  border: 2px solid rgba(99,171,215,0.4);
  border-radius: 12px;
  padding: 24px 32px;
  min-width: 260px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#game-over-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f0c030;
  margin: 0;
}
#game-over-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.go-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 12px;
}
.go-name { color: #ede9e3; font-size: 0.9rem; }
.go-gp   { font-weight: 700; font-size: 0.95rem; }
.go-gp.pos { color: #63b64a; }
.go-gp.neg { color: #ff5555; }

/* Ícone de clima */
#weather-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #ede9e3;
  text-shadow: 0 1px 3px #000;
}
#weather-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#weather-name {
  font-weight: 700;
  font-size: 0.75rem;
  color: #f0c030;
  line-height: 1;
}
#weather-round {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  line-height: 1;
}

/* ===== LANDSCAPE — SUPORTE HORIZONTAL ===== */

/* Overlay: aviso de orientação portrait */
#portrait-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #2f2921;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ede9e3;
  gap: 16px;
  text-align: center;
  padding: 32px;
}
.portrait-warning-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.portrait-warning-inner svg {
  opacity: 0.7;
}
.portrait-warning-inner p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ice-2);
  margin: 0;
}
@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  40%, 60% { transform: rotate(-90deg); }
}
#portrait-warning svg {
  animation: rotate-hint 2.4s ease-in-out infinite;
}

/* Mostra o overlay somente em portrait, exceto nas telas de jogo e waiting
   (onde o WebView normalmente já trava landscape na camada nativa) */
@media (orientation: portrait) {
  body:not(.game-active):not(.waiting-active) #portrait-warning {
    display: flex;
  }
}

/* Safe areas laterais em landscape — preserva padding base em dispositivos sem notch */
@media (orientation: landscape) {
  /* Variável de padding horizontal — landscape usa base 14px */
  :root {
    --pad-h:  max(14px, env(safe-area-inset-left,  0px));
    --pad-hr: max(14px, env(safe-area-inset-right, 0px));
  }
  /* Headers */
  .app-header  { padding-left: var(--pad-h); padding-right: var(--pad-hr); }
  .screen-head { padding-left: var(--pad-h); padding-right: var(--pad-hr); }
  /* .panel usa margin lateral */
  .panel {
    margin-left:  var(--pad-h);
    margin-right: var(--pad-hr);
  }
  /* Barras de ação: waiting room e lobby */
  .wr-action-bar,
  .wr-actions {
    padding-left:  var(--pad-h);
    padding-right: var(--pad-hr);
  }
  /* Menu lateral: empurra conteúdo para fora do Dynamic Island/notch */
  .lmenu-panel {
    padding-left: env(safe-area-inset-left, 0px);
  }
  /* Game: garante que o canvas não fique atrás do notch lateral */
  .game-wrapper {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* Splash: logo + card de auth lado a lado em landscape */
@media (orientation: landscape) {
  #screen-splash {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    gap: 0;
    justify-content: stretch;
    overflow: visible;
  }
  #screen-splash .splash-logo {
    flex: 1;
    padding: max(16px, env(safe-area-inset-top)) 24px
             max(16px, env(safe-area-inset-bottom))
             max(24px, env(safe-area-inset-left));
    justify-content: center;
    animation: splash-logo-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
  }
  #screen-splash .splash-auth {
    width: 340px;
    flex-shrink: 0;
    height: 100%;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: max(16px, env(safe-area-inset-top))
             max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) 20px;
    overflow-y: auto;
    overflow-x: visible;
    justify-content: center;
    animation: splash-auth-slide-in 0.42s cubic-bezier(0.32, 0.72, 0, 1) 0.18s both;
  }
}

@keyframes splash-auth-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Lobby landscape */
@media (orientation: landscape) {
  .lobby-body {
    padding: 6px var(--pad-hr) 8px var(--pad-h);
  }
}

/* Avatar shop landscape */
@media (orientation: landscape) {
  .av-landscape {
    padding: 4px var(--pad-hr) calc(8px + var(--safe-bottom)) var(--pad-h);
  }
}

/* Waiting: reduz padding para caber conteúdo em landscape */
@media (orientation: landscape) {
  .wr-layout {
    padding: 4px 12px 8px;
    padding-left:  max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    gap: 4px;
  }
  .wr-room-header {
    min-height: unset;
  }
  .wr-slots-area {
    flex-shrink: 1;
  }
}

/* Onboard: slide horizontal com imagem ao lado do texto */
@media (orientation: landscape) {
  #screen-onboard {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .onb-content {
    max-width: 100%;
  }
  .onb-slide {
    flex-direction: row;
    text-align: left;
    gap: 24px;
    align-items: center;
  }
  .onb-slide--hero {
    flex-direction: column;
    text-align: center;
  }
  .onb-hero-img {
    width: min(160px, 30vw);
  }
  .onb-slide-img {
    width: auto;
    height: min(120px, 40dvh);
    flex-shrink: 0;
  }
}

/* Game HUD: comprime proporcionalmente em landscape */
@media (orientation: landscape) {
  #game-hud {
    min-height: 64px;
    max-height: min(82px, 18dvh);
  }
}
@media (orientation: landscape) and (max-height: 420px) {
  #game-hud {
    min-height: 56px;
    max-height: 64px;
  }
  .hud-shot-icon {
    width: 28px;
    height: 28px;
  }
  .item-slot {
    width: 40px;
    height: 28px;
  }
}

/* ── Virtual Keyboard ─────────────────────────────────────────── */
#virtual-keyboard {
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: 999999;
  width: 370px;
  height: auto;
  background: #deeef8;
  border: 1.5px solid #1a3958;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.2);
  user-select: none;
  touch-action: none;
  overflow: hidden;
}

#virtual-keyboard.vk-dragged {
  transform: none;
}

.vk-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 5px;
  cursor: grab;
  background: #c4d9ec;
  border-bottom: 1px solid rgba(20,50,80,0.2);
}
.vk-handle:active { cursor: grabbing; }

.vk-drag-icon { color: rgba(10,30,60,0.3); font-size: 14px; line-height: 1; }
.vk-label { font-size: 10px; color: rgba(10,30,60,0.45); letter-spacing: .08em; flex: 1; }

.vk-close {
  background: none;
  border: none;
  color: rgba(10,30,60,0.4);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.vk-close:hover { color: var(--dark-2); background: rgba(0,0,0,0.08); }

.vk-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 7px 10px;
}

.vk-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.vk-key {
  position: relative;
  height: 44px;
  min-width: 24px;
  padding: 0 3px;
  border: 1px solid rgba(99,171,215,0.2);
  border-radius: 8px;
  background: #f8f5f2;
  color: var(--dark-2);
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, transform .08s;
  touch-action: manipulation;
  flex: 1;
  max-width: 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.vk-key:hover  { background: #c8e8f8; }
.vk-key:active { background: #88cde8; transform: scale(0.92); }

/* Hint de número no canto superior direito das letras */
.vk-hint {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 8px;
  font-weight: 600;
  color: rgba(10,30,60,0.4);
  line-height: 1;
  pointer-events: none;
}

/* Letras maiúsculas via classe no container */
#virtual-keyboard.vk-upper .vk-letter .vk-key-label { text-transform: uppercase; }

/* Backspace */
.vk-backspace {
  max-width: none;
  font-size: 20px;
  background: #f5e0e0;
  border-color: rgba(160,60,60,0.22);
  color: #8b2020;
}
.vk-backspace:hover         { background: #f0cccc; }
.vk-backspace:active,
.vk-backspace.pressing      { background: #e89090; color: #5a0000; transform: scale(0.93); }

/* Shift */
.vk-shift { max-width: none; font-size: 18px; background: #eef4f8; }
.vk-shift.active { background: #2aa6d0; color: #fff; border-color: #1585b2; }

/* Espaço */
.vk-space { max-width: none; font-size: 11px; color: rgba(10,30,60,0.3); }

/* Botão de modo 123 / ABC */
.vk-mode  { max-width: none; font-size: 13px; font-weight: 600; background: #ede9e3; color: #4a8ab5; }
.vk-mode:hover { background: #d4cfc9; }

/* OK */
.vk-ok {
  max-width: none;
  background: #63abd7;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-color: #4a8ab5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.vk-ok:hover  { background: #4a8ab5; }
.vk-ok:active { background: #356a8e; }
