/* ============ Shell (modelo C) + Pokédex Dex-2 ============ */

:root {
  --shell-bg: #060b16;
  --shell-nav-bg: linear-gradient(180deg, #0f1a32 0%, #080e1c 100%);
  --shell-main-bg: #050914;
  --shell-elev-1: #152a52;
  --shell-elev-2: #1a3170;
  --shell-border: rgba(244, 248, 255, 0.1);
  --shell-border-strong: rgba(244, 248, 255, 0.22);
  --shell-nav-w: 224px;
  --shell-nav-w-narrow: 68px;
  --shell-font-ui: system-ui, 'Segoe UI', sans-serif;
  --shell-text-muted: #8fa8d8;
  /* Tipografia shell (layout espaçoso) */
  --shell-fs-page-title: 26px;
  --shell-fs-h3: 22px;
  --shell-fs-body: 14px;
  --shell-fs-ui: 13px;
  --shell-fs-small: 12px;
  --shell-fs-caption: 11px;
  --shell-fs-nav: 12px;
  --shell-fs-nav-sub: 10px;
}

#app-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--shell-main-bg);
  color: var(--ink);
  font-size: var(--shell-fs-body);
}
#app-shell.hidden { display: none !important; }

#app-shell .shell-topbar {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 30;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 8px 12px;
  gap: 8px;
  background: rgba(5, 10, 25, 0.92);
  border-bottom: 2px solid var(--shell-border);
  font-size: var(--shell-fs-ui);
}
#app-shell .shell-topbar .btn.small {
  font-size: var(--shell-fs-small);
}

.shell-body {
  display: grid;
  grid-template-columns: var(--shell-nav-w) minmax(0, 1fr);
  min-height: 0;
}

.shell-nav {
  background: var(--shell-nav-bg);
  border-right: 2px solid var(--shell-border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}

.shell-brand {
  padding: 4px 6px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--shell-border);
}
.shell-brand .logo-img { width: 100%; max-width: 160px; display: block; margin: 0 auto; }

.shell-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: var(--shell-fs-nav)/1.3 var(--font);
  text-align: left;
  cursor: pointer;
  text-shadow: 1px 1px 0 var(--shadow);
}
.shell-nav-item .mi-ico { flex-shrink: 0; width: 26px; display: flex; justify-content: center; }
.shell-nav-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shell-nav-sub {
  display: block;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-nav-sub);
  font-weight: 400;
  line-height: 1.25;
  color: var(--shell-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell-nav-sub.gold { color: var(--gold); }
.shell-nav-item:hover, .shell-nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  outline: none;
}
.shell-nav-item.on {
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.18), transparent);
  color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold);
}
.shell-nav-item.settings-item { margin-top: auto; }

#shell-stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--shell-main-bg);
}

#app-shell .shell-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  animation: none;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  background: var(--shell-main-bg);
}
#app-shell .shell-view.hidden { display: none !important; }

#app-shell #scr-menu {
  padding: 0;
  background: var(--shell-main-bg);
}

.menu-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.menu-bg-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.menu-bg-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
}
.menu-home {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 48px);
  padding: 16px 24px 20px;
  flex-wrap: wrap;
}
#app-shell #scr-menu .menu-left {
  flex: 1 1 320px;
  max-width: 560px;
  padding: 0;
}
.menu-home-aside {
  flex: 0 1 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.menu-play-cta {
  font-size: 24px;
  padding: 16px 24px;
  width: 100%;
}
.menu-stats-panel {
  padding: 14px 16px;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-ui);
  line-height: 1.5;
  color: var(--muted);
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
}
.menu-stats-panel b { font-family: var(--font); }

#app-shell #credits-line {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 5;
  padding: 6px 12px;
  border-top: 1px solid var(--shell-border);
  background: rgba(5, 10, 25, 0.85);
  font-size: var(--shell-fs-caption);
}

/* ——— Dex-2 ——— */
#scr-dex.dex2-page-wrap { background: var(--shell-main-bg); }
#app-shell #scr-dex { padding: 0 !important; }
#app-shell .shell-view.scr { padding: 0; }

.dex2-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 12px 16px 14px;
}

.dex2-head { flex-shrink: 0; margin-bottom: 6px; }
.dex2-head h2 { margin: 0; font-size: var(--shell-fs-page-title); }

#app-shell .gen-tab {
  font-size: var(--shell-fs-small);
}
#app-shell .gen-tab small {
  font-size: var(--shell-fs-caption);
}
#app-shell .shell-toolbar input,
#app-shell .shell-toolbar select,
#scr-dex .dex-tools input,
#scr-dex .dex-tools select {
  font-size: var(--shell-fs-small);
}
#app-shell .chip {
  font-size: var(--shell-fs-small);
}

#scr-dex .gen-tabs { flex-shrink: 0; margin-bottom: 6px; }

#scr-dex .shell-toolbar.dex-tools {
  flex-shrink: 0;
  margin-bottom: 6px;
  padding: 10px 12px;
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
}

#scr-dex .filters { flex-shrink: 0; margin-bottom: 4px; }

.dex2-split {
  display: grid;
  grid-template-columns: min(340px, 42%) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.shell-pane {
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.shell-pane-list .dex-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
}

.shell-pane-detail {
  background: var(--shell-elev-2);
  border-color: rgba(255, 210, 63, 0.15);
}

#scr-dex #dex-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  border: none;
  background: var(--shell-elev-2);
  border-radius: 0;
}

#scr-dex #dex-detail .stage {
  width: min(220px, 80%);
  height: auto;
  max-height: 190px;
  margin: 4px auto 10px;
}

#scr-dex #dex-detail h3 { font-size: var(--shell-fs-h3); }

.dex-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #0f1a32;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dex-row:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--shell-border-strong); }
.dex-row.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.1); }
.dex-row.locked { cursor: pointer; color: var(--muted); }
.dex-row.locked .dex-row-txt b { color: var(--muted); }
.dex-row.locked:hover { transform: none; }

.dex-row-spr {
  flex-shrink: 0;
  width: 48px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dex-row-spr canvas { display: block; max-width: 48px; max-height: 44px; }

.dex-row-txt {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.dex-row-txt b {
  display: block;
  font-size: var(--shell-fs-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dex-row-txt small {
  display: block;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-small);
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-row-badges {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  align-items: center;
}

@media (max-width: 820px) {
  .shell-body { grid-template-columns: var(--shell-nav-w-narrow) minmax(0, 1fr); }
  .shell-nav-item .shell-nav-text { display: none; }
  .shell-brand .logo-img { max-width: 44px; }
  .dex2-split { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 38%) minmax(0, 1fr); }
}

@media (max-height: 520px) {
  .dex2-split { grid-template-columns: min(280px, 45%) 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .dex-row { transition: none; }
  .menu-bg { display: none; }
}

/* ——— páginas shell (dex, dificultad, …) ——— */
.shell-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 12px 16px 14px;
}
.shell-page-head { flex-shrink: 0; margin-bottom: 10px; }
.shell-page-head h2 { margin: 0; font-size: var(--shell-fs-page-title); }
.shell-page-desc { margin: 4px 0 0; font-family: var(--shell-font-ui); font-size: var(--shell-fs-ui); max-width: 520px; }

.shell-pane-label {
  padding: 8px 12px;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-caption);
  color: #7a94c8;
  border-bottom: 1px solid var(--shell-border);
  flex-shrink: 0;
}

#app-shell #scr-diff { padding: 0 !important; background: var(--shell-main-bg); }
.diff-page { background: var(--shell-main-bg); }

/* ——— dificultad (Dex-2 style split) ——— */
.diff2-split {
  display: grid;
  grid-template-columns: min(340px, 42%) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.diff-pane-pick { min-height: 0; }
.diff-pane-detail {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-2);
  border-color: var(--shell-border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shell-diff-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
#scr-diff .region-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  margin: 0 0 8px;
  flex: 0 0 auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}
#scr-diff .region-cards.dim { opacity: .45; pointer-events: none; }
#scr-diff .region-cards .diff-card { min-height: 0; min-width: 0; padding: 10px 10px; width: auto; }
#scr-diff .region-cards .diff-card b { font-size: 15px; }
#scr-diff .diff-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  padding: 12px 14px;
  min-height: 0;
  border-radius: 10px;
  background: #0f1a32;
  border: 2px solid var(--shell-border-strong);
  color: inherit;
  font: inherit;
  width: 100%;
}
#scr-diff .diff-card b { font-size: 17px; }
#scr-diff .diff-card small { color: var(--gold); font-size: var(--shell-fs-small); margin-top: 4px; display: block; }
#scr-diff .diff-card.on {
  border-color: var(--gold);
  background: #2a3a1a;
  box-shadow: none;
}
#scr-diff .diff-card.locked {
  color: var(--muted);
  background: #0f1a32;
  border-color: var(--shell-border);
}
#scr-diff .diff-card.locked b { color: var(--muted); }
#scr-diff .diff-detail {
  font-size: var(--shell-fs-ui);
  margin: 0;
  font-family: var(--shell-font-ui);
  line-height: 1.45;
}
#scr-diff .diff-detail p { color: var(--muted); }
#scr-diff .diff-hyper {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 210, 63, 0.08);
  border: 2px solid rgba(255, 210, 63, 0.28);
}
#scr-diff .diff-heat h3 { margin: 0 0 4px; font-size: 18px; }
#scr-diff .diff-heat .sub { margin: 0 0 8px; font-family: var(--shell-font-ui); font-size: var(--shell-fs-small); }
#scr-diff .heat-list { max-height: none; flex: 1; min-height: 0; }
.diff-start-row { margin-top: auto; padding-top: 8px; }
.diff-start-row .btn { width: 100%; padding: 14px; font-size: 17px; }

@media (max-width: 820px) {
  .diff2-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .shell-diff-cards {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 140px;
  }
  #scr-diff .diff-card { flex: 1 1 calc(50% - 6px); min-width: 120px; }
  #scr-diff .region-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
}

/* ——— mejoras ——— */
#app-shell #scr-upgrades { padding: 0 !important; background: var(--shell-main-bg); }
.upg-page { min-height: 0; }
.upg-page .gen-tabs { flex-shrink: 0; margin-bottom: 8px; }
.upg-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-1);
}
#scr-upgrades .upg-head {
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--shell-border-strong);
}
#scr-upgrades .upg-head .sub { font-family: var(--shell-font-ui); font-size: var(--shell-fs-ui); }
#scr-upgrades select.field { font-size: var(--shell-fs-small); }
#scr-upgrades select.field {
  background: #0f1a32;
  border: 2px solid var(--shell-border-strong);
  border-radius: 8px;
  color: inherit;
}
#scr-upgrades .upg {
  margin-top: 4px;
}
#scr-upgrades .upg-item.panel {
  background: var(--shell-elev-2);
  border: 2px solid var(--shell-border-strong);
  border-radius: 10px;
  padding: 12px;
  box-shadow: none;
  animation: none;
}
#scr-upgrades .upg-copy b {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
#scr-upgrades .upg-unit {
  display: block;
  margin-top: 3px;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-small);
  color: var(--muted);
  line-height: 1.3;
}
#scr-upgrades .upg-copy .pips,
#scr-upgrades .upg-copy .pips-row {
  margin-top: 6px;
}
#scr-upgrades .upg-respec-bar {
  background: #2a1520;
  border: 2px solid rgba(255, 95, 109, 0.45);
}
#scr-upgrades.in-respec-edit .upg-item [data-buy] {
  opacity: 1;
  pointer-events: none;
  filter: saturate(0.45);
}

@media (max-width: 720px) {
  #scr-upgrades .upg { grid-template-columns: 1fr; }
  #scr-upgrades .upg-head { flex-direction: column; align-items: stretch; }
  #scr-upgrades .upg-head .stage { margin: 0 auto; }
}

/* ——— maestría ——— */
#app-shell #scr-mastery { padding: 0 !important; background: var(--shell-main-bg); }
.ms-page { min-height: 0; }
.ms-medals-line {
  flex-shrink: 0;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-ui);
}
#scr-mastery .ms-orb small { font-size: var(--shell-fs-caption); }
#scr-mastery .ms-detail { font-size: var(--shell-fs-ui); }
#scr-mastery .ms-head h3 { font-size: 18px; }
#scr-mastery .ms-detail h4 { font-size: 14px; }
#scr-mastery .ms-next b { font-size: var(--shell-fs-small); }
#scr-mastery .ms-perks li { font-size: var(--shell-fs-small); }
.ms2-split {
  display: grid;
  grid-template-columns: min(280px, 36%) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.ms-pane-types {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#scr-mastery .ms-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}
.ms-pane-detail {
  min-height: 0;
  background: var(--shell-elev-2);
  border-color: var(--shell-border-strong);
}
#scr-mastery .ms-detail {
  height: 100%;
  overflow-y: auto;
  padding: 14px 16px;
  min-width: 0;
}
#scr-mastery .ms-orb {
  background: #0f1a32;
  border: 2px solid var(--shell-border-strong);
  border-radius: 10px;
}
#scr-mastery .ms-orb.on {
  background: #1a2840;
  border-color: var(--c, var(--gold));
}
#scr-mastery .ms-next {
  background: #0f1a32;
  border: 2px solid var(--shell-border-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
#scr-mastery .ms-perks li {
  background: #0f1a32;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
}
#scr-mastery .ms-perks li.lock {
  opacity: 1;
  color: var(--muted);
}
#scr-mastery .ms-perks li.next {
  background: #2a3a1a;
  outline: none;
  border-color: var(--gold);
}
#scr-mastery .ms-mon {
  background: #0f1a32;
  border: 2px solid var(--shell-border-strong);
  border-radius: 10px;
}
#scr-mastery .ms-roster.dim { opacity: 1; }
#scr-mastery .ms-roster.dim .ms-mon { background: #0a1224; }

@media (max-width: 820px) {
  .ms2-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 34%) minmax(0, 1fr);
  }
  #scr-mastery .ms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
  }
}

/* ——— gacha ——— */
#app-shell #scr-gacha { padding: 0 !important; background: var(--shell-main-bg); }
.gacha-page { min-height: 0; }
.gacha-page .gen-tabs { flex-shrink: 0; margin-bottom: 8px; }
.gacha2-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(300px, 34%);
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.gacha-pane-main {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-1);
}
.gacha-pane-rates {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-2);
  border-color: var(--shell-border-strong);
  box-shadow: none;
  animation: none;
}
#scr-gacha .banner {
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
  margin-bottom: 12px;
}
#scr-gacha .banner h3 { font-size: var(--shell-fs-page-title); }
#scr-gacha .banner p,
#scr-gacha .banner .sub { font-size: var(--shell-fs-ui); }
#scr-gacha .banner .feat { margin-top: 8px; }
.gacha-pull-row {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}
#scr-gacha .note {
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-small);
  margin: 8px 0 0;
}
#scr-gacha .rates {
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-ui);
}
#scr-gacha .rates h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-family: var(--font);
}
#scr-gacha .rates div {
  border-bottom-color: var(--shell-border);
}

@media (max-width: 820px) {
  .gacha2-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .gacha-pane-rates { max-height: 38vh; }
}

/* ——— tienda Kecleon ——— */
#app-shell #scr-shop {
  padding: 0 !important;
  background: var(--shell-main-bg);
}
.shop-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 12px 16px 14px;
  gap: 10px;
}
.shop2-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
}
#app-shell .shop-pane-stall {
  position: relative;
  flex-shrink: 0;
  height: clamp(200px, 28vh, 280px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #6fb8f0;
  box-shadow: none;
}
#app-shell .shop-pane-stall .shop-scene {
  border-radius: inherit;
}
.shop-pane-goods {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
}
#scr-shop #shop-body h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}
#scr-shop #shop-body h3:first-child {
  margin-top: 0;
}
#scr-shop #shop-body .upg {
  gap: 8px;
}
#scr-shop #shop-body .upg-item.panel {
  background: var(--shell-elev-2);
  border: 2px solid var(--shell-border-strong);
  border-radius: 10px;
  padding: 12px;
  box-shadow: none;
  animation: none;
  grid-template-columns: 40px 1fr auto;
}
#scr-shop #shop-body .upg-item .sub {
  font-family: var(--shell-font-ui);
  font-size: var(--shell-fs-ui);
  line-height: 1.35;
}
#scr-shop #shop-body .upg-item b {
  font-size: 15px;
}
#scr-shop .shop-bubble {
  font-size: var(--shell-fs-ui);
}
#scr-shop .shop-sign {
  font-size: 20px;
}

@media (min-width: 900px) {
  .shop2-layout {
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }
  #app-shell .shop-pane-stall {
    height: auto;
    min-height: 0;
  }
}

/* ——— páginas shell comunes (misiones, amigos, ranking, novedades, wiki, ajustes) ——— */
.shell-page.goals-page,
.shell-page.friends-page,
.shell-page.rank-page,
.shell-page.news-page,
.shell-page.wiki-page,
.shell-page.settings-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 12px 16px 14px;
  gap: 10px;
}

#app-shell #scr-goals,
#app-shell #scr-friends,
#app-shell #scr-rank,
#app-shell #scr-news,
#app-shell #scr-wiki,
#app-shell #scr-settings {
  padding: 0 !important;
  background: var(--shell-main-bg);
}

.goals-pane,
.friends-pane,
.rank-pane,
.news-pane,
.wiki-pane,
.settings-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
}

#scr-goals .goals-tabs {
  flex-shrink: 0;
  margin: 0;
}
#scr-goals .goals-body {
  max-height: none;
  padding-right: 2px;
}

#scr-friends .friends-add {
  flex-shrink: 0;
  margin: 0;
}
#scr-friends .friends-msg {
  margin: 0;
  flex-shrink: 0;
}
#scr-friends .fr-list {
  max-height: none;
}

#scr-rank .rank-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#scr-rank .rank-head-sub {
  font-size: var(--shell-fs-ui);
  font-family: var(--shell-font-ui);
}
#scr-rank .rk-tools {
  flex-wrap: wrap;
  gap: 8px;
}
#rk-region { flex-wrap: wrap; }
#rk-region.dim { opacity: .45; pointer-events: none; }
#scr-rank .rk-list {
  max-height: none;
}
#scr-rank .rk-me {
  margin-top: 10px;
  flex-shrink: 0;
}

#scr-news .news-body,
#scr-wiki .wiki-body,
#scr-settings .set-body {
  max-height: none;
  min-height: 0;
}
#scr-wiki .wiki-body p {
  font-size: var(--shell-fs-ui);
}
#scr-settings .set-tabs-shell {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

/* Ajustes desde pausa: overlay modal (fuera del shell visible) */
#scr-settings.settings-pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: radial-gradient(circle at 50% 40%, rgba(10, 20, 50, 0.55), rgba(3, 6, 16, 0.88));
}
#scr-settings.settings-pause-overlay.hidden {
  display: none !important;
}
#scr-settings.settings-pause-overlay .settings-page {
  width: min(640px, 100%);
  max-height: calc(100dvh - 24px);
  height: auto;
  background: var(--shell-elev-1);
  border: 2px solid var(--shell-border-strong);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
