/* Lobby cabe no stage 16:9 — sem scroll interno. */
.lobby-panel {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(10px, 1.4vw, 18px);
}

.lobby-panel .panel-heading {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.lobby-panel .panel-heading .eyebrow {
  margin-bottom: 2px;
}

.lobby-panel .panel-heading h2 {
  font-size: clamp(0.78rem, 1.6vw, 1rem);
}

.lobby-panel .select-grid {
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  align-content: stretch;
}

.lobby-panel .select-card {
  min-height: 0;
  padding: 6px 8px;
  overflow: hidden;
}

.lobby-panel .select-art {
  height: clamp(48px, 10vh, 88px);
  margin-bottom: 6px;
}

.lobby-panel .lobby-actions {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 8px;
}

/* —— Character lobby (referência Brotato: flat escuro + preview + toggles + roster) —— */
#screen-character {
  background: #2a2a2a;
  backdrop-filter: none;
  place-items: stretch;
}

#screen-weapon {
  background: #2a2a2a;
  backdrop-filter: none;
  place-items: stretch;
}

.char-lobby {
  border: none;
  background: #2a2a2a;
  color: #ececec;
  box-shadow: none;
  clip-path: none;
}

.lobby-back {
  align-self: flex-start;
  flex: 0 0 auto;
  border: 0;
  background: #1a1a1a;
  color: #ececec;
  font: 600 0.9rem/1 "Space Grotesk", system-ui, sans-serif;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.lobby-back:hover,
.lobby-back:focus-visible {
  color: #fff;
  outline: none;
  background: #333;
}

.char-lobby-top {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(min(240px, 38%), 0.85fr);
  gap: var(--lobby-gap);
}

.char-preview {
  --select-accent: #c8c0b4;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 8px;
  border: 2px solid #141414;
  border-radius: 8px;
  background: #1c1c1c;
  overflow: hidden;
}

.char-preview-name {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  color: #f5f5f5;
}

.char-preview-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 8px;
}

.char-preview-art {
  flex: 0 1 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  max-width: min(52%, calc(var(--stage-h) * 0.42));
  display: grid;
  place-items: center;
  border: 3px solid #0e0e0e;
  border-radius: 4px;
  background:
    linear-gradient(160deg, #3a3a3a 0%, #2a2a2a 45%, #1f1f1f 100%);
  overflow: hidden;
}

.char-preview-art .asset-img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.4));
}

.char-preview-bonuses {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  color: #d0d0d0;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.char-preview-bonuses .bonus-val {
  color: #8fd46a;
  font-weight: 700;
}

.char-preview-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #141414;
  text-align: left;
}

.char-preview.is-locked {
  justify-content: center;
  align-items: stretch;
}

.char-lock-panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 12px;
}

.char-lock-badge {
  display: grid;
  place-items: center;
  width: min(42%, 128px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: #141414;
  color: #d0d0d0;
  box-shadow: inset 0 0 0 2px #333;
}

.char-lock-badge .lock-icon {
  width: 58%;
  height: 58%;
}

.char-lock-hint {
  margin: 0;
  max-width: 28ch;
  color: #f0f0f0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.char-lock-label {
  margin: 0;
  color: #8a8a8a;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.char-preview-desc {
  margin: 0;
  color: #b8b8b8;
  font-size: 0.78rem;
  line-height: 1.35;
}

.char-preview-passive {
  margin: 0;
  color: #f0f0f0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.char-preview-tags {
  margin: 0;
  color: #7a7a7a;
  font-size: 0.68rem;
}

.run-options {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #141414;
  border-radius: 8px;
  background: #1c1c1c;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.run-options legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: #f0f0f0;
  font-size: 1rem;
  font-weight: 700;
}

.run-options-ico {
  opacity: 0.85;
}

.run-option-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.run-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: #ececec;
  font: 600 0.92rem/1.2 "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
}

.run-option.is-locked {
  opacity: 0.38;
  cursor: not-allowed;
}

.run-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: #4a4a4a;
  box-shadow: inset 0 0 0 1px #111;
}

.run-option.is-on .run-switch {
  background: #e8e8e8;
}

.run-switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.run-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8a8a8a;
  transition: transform 0.15s ease, background 0.15s ease;
  pointer-events: none;
}

.run-option.is-on .run-switch-knob {
  transform: translateX(22px);
  background: #2a2a2a;
}

#danger-description {
  margin: 4px 0 0;
  color: #8f8f8f;
  font-size: 0.75rem;
  line-height: 1.35;
  flex: 1 1 auto;
}

.run-go {
  margin-top: auto;
  width: 100%;
  border: 0;
  background: #3a3a3a;
  color: #f2f2f2;
  font: 700 0.95rem/1 "Space Grotesk", system-ui, sans-serif;
  padding: 12px 14px;
  cursor: pointer;
}

.run-go:hover:not(:disabled) {
  background: #4a4a4a;
}

.run-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.run-go:focus-visible,
.char-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.char-icon-grid {
  grid-template-columns: repeat(10, var(--slot-size));
  grid-template-rows: repeat(2, var(--slot-size));
}

.char-icon {
  border: 2px solid #111;
  border-radius: 6px;
  background: #1a1a1a;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
}

.char-icon.empty {
  cursor: default;
  background: #222;
  border-color: #1a1a1a;
  pointer-events: none;
  opacity: 0.55;
}

.char-icon:hover:not(.empty) {
  background: #2a2a2a;
  border-color: #555;
}

.char-icon.selected,
.char-icon.selected:hover {
  border-color: #f0f0f0;
  background: #3a3a3a;
}

.char-icon.locked {
  background: #151515;
}

.char-icon-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.char-icon-art .asset-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.char-icon-lock {
  display: grid;
  place-items: center;
  width: 70%;
  height: 70%;
  color: #8a8a8a;
}

.char-icon-lock .lock-icon {
  width: 100%;
  height: 100%;
}

.weapon-lobby {
  --select-accent: #c8c0b4;
  background: #2a2a2a;
  color: #ececec;
}

.weapon-lobby-top {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--lobby-gap);
}

.weapon-char-preview {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 2px solid #141414;
  border-radius: 8px;
  background: #1c1c1c;
  overflow: hidden;
}

.weapon-char-preview .char-preview-art {
  max-width: min(100%, calc(var(--stage-h) * 0.36));
}

.weapon-detail {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #141414;
  border-radius: 8px;
  background: #1c1c1c;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.weapon-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weapon-detail-art {
  flex: 0 0 auto;
  width: clamp(64px, calc(var(--stage-w) * 0.08), 110px);
  height: clamp(64px, calc(var(--stage-w) * 0.08), 110px);
  display: grid;
  place-items: center;
  border: 3px solid #0e0e0e;
  border-radius: var(--panel-radius);
  background: linear-gradient(160deg, #3a3a3a 0%, #1f1f1f 100%);
  overflow: hidden;
}

.weapon-detail-art .asset-img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  image-rendering: pixelated;
}

.weapon-detail-name {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: #f2f2f2;
}

.weapon-detail-type {
  margin: 4px 0 0;
  color: #9a9a9a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.weapon-detail-desc {
  margin: 0;
  color: #b0b0b0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.weapon-stat-list {
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid #333;
  display: grid;
  gap: 8px;
  color: #d8d8d8;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.weapon-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.weapon-stat span {
  color: #8f8f8f;
}

.weapon-stat strong {
  color: #f0f0f0;
  font-weight: 700;
}

.weapon-icon-grid {
  grid-template-columns: repeat(6, var(--weapon-slot-size));
  grid-template-rows: var(--weapon-slot-size);
}

.weapon-icon {
  width: var(--weapon-slot-size);
  height: var(--weapon-slot-size);
  border: 2px solid #111;
  border-radius: 6px;
  background: #1a1a1a;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
}

.weapon-icon:hover {
  background: #262626;
}

.weapon-icon.selected,
.weapon-icon.selected:hover {
  border-color: #f0f0f0;
  background: #3a3a3a;
}

.weapon-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.weapon-icon-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.weapon-icon-art .asset-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.weapon-lobby-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.danger-select {
  min-width: 0;
  margin: 0 0 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.danger-select legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.875rem;
}

.danger-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.danger-options .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.danger-options input {
  margin: 0;
  accent-color: var(--accent);
}

.danger-options .btn:has(:checked) {
  border-color: var(--accent);
  color: var(--coin);
}

.danger-options .btn:has(:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.danger-select + #danger-description,
.danger-select #danger-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

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

/* Faixa de ícones de arma: colunas definidas em .weapon-icon-grid */

.weapon-type {
  align-self: flex-start;
  width: fit-content;
  padding: 2px 5px;
  border: 1px solid #4a4a4a;
  background: #2a2a2a;
  color: #d0d0d0;
  font-size: 0.65rem;
  font-weight: 700;
}

.shop-card .weapon-type {
  font-size: inherit;
}

.select-card {
  --select-accent: var(--accent);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 2px solid #3a3a3a;
  background: #1c1c1c;
  padding: clamp(8px, 1.3vw, 14px);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.select-card:hover:not(:disabled) {
  border-color: #6a6a6a;
  background: #262626;
}

.select-card.selected,
.select-card.selected:hover {
  border-color: #f0f0f0;
  background: #2e2e2e;
  box-shadow: inset 0 0 0 1px #111;
}

.select-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.select-art {
  display: grid;
  place-items: center;
  height: clamp(82px, 15vh, 124px);
  margin-bottom: 11px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at center, #333, #151515 75%);
  box-shadow: inset 0 -2px 0 var(--select-accent);
}

.select-art .asset-img {
  width: clamp(80px, 12vw, 116px);
  height: clamp(80px, 12vh, 106px);
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.46));
}

.select-name {
  font-size: clamp(1rem, 2.1vw, 1.4rem);
  font-weight: 700;
}

.select-desc {
  margin: 3px 0 9px;
  color: #b0b0b0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.character-tags {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.character-passive {
  align-self: flex-start;
  margin: 0 0 9px;
  padding: 3px 6px;
  border: 1px solid #5a5a5a;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 0.75rem;
  font-weight: 700;
}

.select-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: auto;
}

.select-meta > span {
  display: grid;
  gap: 1px;
  min-width: 0;
  border: 1px solid #3a3a3a;
  background: var(--bg);
  padding: 4px 6px;
}

.select-meta .stat-label-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.select-meta small {
  color: #a8a8a8;
  font-size: 0.65rem;
}

.select-meta strong {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* Bolinha ? compartilhada (lobby + loja) */
.stat-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid #5a5a5a;
  border-radius: 50%;
  background: #1a1a1a;
  color: var(--accent);
  font: 700 10px/1 "Space Grotesk", system-ui, sans-serif;
  cursor: help;
  z-index: 2;
}

.stat-help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 7px 8px;
  border: 1px solid var(--accent);
  background: #1a1a1a;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.stat-help:hover::after,
.stat-help:focus-visible::after,
.stat-help.is-open::after {
  opacity: 1;
  visibility: visible;
}

.lobby-actions,
.levelup-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #3a3a3a;
}

@media (max-width: 740px) {
  .char-lobby-top,
  .weapon-lobby-top {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

@media (max-width: 540px) {
  .danger-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .weapon-icon-grid {
    grid-template-columns: repeat(3, var(--weapon-slot-size));
  }
  .char-lobby-top,
  .weapon-lobby-top {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.9fr);
  }
  .char-preview-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .lobby-panel .select-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
  }
  .lobby-panel .select-art {
    grid-column: 1;
    grid-row: 1 / 5;
    height: 48px;
    margin: 0;
  }
  .lobby-panel .select-card > :not(.select-art) { grid-column: 2; }
  .lobby-panel .select-art .asset-img { width: 42px; height: 42px; }
}
