/* Layout 3 columnas — sin scroll de página; mapa tamaño fijo en el centro */
html,
body {
  height: 100%;
  overflow: hidden;
}


.view--country {
  height: 100%;
  max-width: none !important;
  width: 100%;
  padding: 12px 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.home-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  grid-template-rows: 1fr auto;
  gap: 12px;
  height: 100%;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  min-height: 0;
  overflow: hidden;
}

.home-layout > * {
  min-height: 0;
}

.home-col--left,
.home-col--right {
  grid-row: 1;
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  min-height: 0;
  padding-right: 2px;
}

.home-col--left.home-col,
.home-col--right.home-col {
  height: 100%;
}

.home-col--center {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.home-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-brand {
  flex-shrink: 0;
  margin: 0 0 4px;
}

.home-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.home-nav a {
  font-size: 7px;
  color: #777;
  text-decoration: none;
}

.home-nav a.is-active {
  color: var(--cl-rojo);
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-bg);
  padding: 12px 14px;
  flex-shrink: 0;
}

.panel__head {
  margin: 0 0 10px;
  font-size: 7px;
  color: #7a7a7a;
  letter-spacing: 0.06em;
}

.panel__stat {
  margin: 0;
  font-size: 14px;
  color: #f0f0f0;
}

.panel__stat-sub {
  margin: 6px 0 0;
  font-size: 7px;
  color: var(--cl-rojo);
}

.progress-track {
  margin-top: 10px;
  height: 8px;
  background: #0a0a0a;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #333;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--cl-rojo);
  transition: width 0.35s ease;
}

.panel--promo {
  text-align: center;
  padding: 16px 12px;
  background: #0a0a0a;
}

.panel--promo p {
  margin: 0;
  font-size: 8px;
  line-height: 1.65;
  color: #ccc;
}

.panel--promo strong {
  color: var(--cl-rojo);
  font-weight: 400;
}

/* Columnas laterales: bloques fijos arriba + zona flexible abajo (misma altura L/R) */
.home-col--left > .home-brand,
.home-col--left > .panel:not(.panel--chat) {
  flex-shrink: 0;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-shrink: 0;
  padding: 0 4px 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid #252525;
}

.map-toolbar .home-nav {
  flex: 1;
  min-width: 0;
}

.home-col--left > .panel--chat {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-col--right > .panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Chat lateral */
.panel--chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
}

.panel--chat > .panel__head {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.home-chat__nick[hidden],
.home-chat__room[hidden] {
  display: none !important;
}

.panel--chat--live .home-chat__nick {
  display: none !important;
}

.home-chat__hint {
  margin: 0 0 8px;
  font-size: 6px;
  color: #777;
  line-height: 1.6;
}

.home-chat__label {
  display: block;
  margin: 0 0 4px;
  font-size: 6px;
  color: #888;
}

.home-chat__input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 2px solid #444;
  background: #0a0a0a;
  color: #eee;
  font: inherit;
  font-size: 7px;
}

.home-chat__input:focus {
  outline: none;
  border-color: #888;
}

.home-chat__btn {
  width: 100%;
  font-size: 6px;
}

.home-chat__nick:not([hidden]) {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.home-chat__room:not([hidden]),
.panel--chat--live .home-chat__room {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  gap: 6px;
  width: 100%;
}

.home-chat__you {
  margin: 0;
  font-size: 6px;
  color: #888;
  flex-shrink: 0;
}

.home-chat__you strong {
  color: var(--cl-rojo);
}

.home-chat__change-nick {
  margin-left: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #666;
  font: inherit;
  font-size: 5px;
  cursor: pointer;
  text-decoration: underline;
}

.home-chat__change-nick:hover {
  color: #aaa;
}

.home-chat__messages {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #222;
  background: #050505;
  -webkit-overflow-scrolling: touch;
}

.home-chat__msg {
  padding: 6px 8px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 6px;
  line-height: 1.55;
}

.home-chat__msg:last-child {
  border-bottom: none;
}

.home-chat__msg--mine {
  background: rgba(29, 78, 216, 0.12);
}

.home-chat__msg-head {
  display: block;
  margin-bottom: 2px;
}

.home-chat__msg-head strong {
  color: #ccc;
}

.home-chat__msg--mine .home-chat__msg-head strong {
  color: #8ab4ff;
}

.home-chat__msg-time {
  color: #555;
  font-size: 5px;
}

.home-chat__msg-text {
  display: block;
  color: #ddd;
  word-break: break-word;
}

.home-chat__form {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
}

.home-chat__form .home-chat__input {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.home-chat__send {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 8px;
  line-height: 1;
}

.panel__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 6px;
  line-height: 1.75;
  color: #999;
}

.activity-feed {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.activity-feed li {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #222;
  font-size: 6px;
  line-height: 1.55;
}

.activity-swatch {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border: 1px solid #444;
}

.activity-feed__user {
  color: #eee;
  display: block;
}

.activity-feed__msg,
.activity-feed__time {
  display: block;
  color: #777;
  margin-top: 2px;
  font-size: 5px;
}

.owner-ranking {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.home-col--right > .panel .panel__head,
.home-col--left > .panel--chat .panel__head {
  flex-shrink: 0;
}

.owner-ranking li {
  padding: 10px 0;
  border-bottom: 1px solid #222;
  font-size: 6px;
  line-height: 1.65;
}

.owner-ranking li:last-child {
  border-bottom: none;
}

.owner-ranking__name {
  display: block;
  color: #eee;
  margin-bottom: 4px;
}

.owner-ranking__line {
  display: block;
  color: #888;
  margin-top: 3px;
}

.owner-ranking__title {
  color: var(--cl-rojo);
}

.owner-ranking__pct {
  color: #666;
}

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  font: inherit;
  font-size: 6px;
  color: #888;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  cursor: pointer;
}

.anthem-toggle {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid #444;
  border-radius: 0;
  background: #111;
  color: #888;
  font: inherit;
  font-size: 6px;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.anthem-toggle.is-on {
  color: var(--cl-rojo);
  border-color: #8b2e2e;
  background: #1a0808;
}

.anthem-toggle.is-off {
  color: #666;
}

.anthem-toggle:hover {
  border-color: #888;
  color: #eee;
}

.faq-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.8);
}

.faq-overlay[hidden] {
  display: none !important;
}

.faq-modal {
  position: relative;
  width: min(30rem, 94vw);
  max-height: min(78vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: 0 0 0 2px #000, 0 16px 48px rgba(0, 0, 0, 0.7);
  -webkit-overflow-scrolling: touch;
}

.faq-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 2rem;
  padding: 0.4rem 0.5rem;
  font-size: 8px;
  line-height: 1;
}

.faq-modal__title {
  margin: 0 2rem 14px 0;
  padding: 0;
}

.faq-modal__list {
  margin: 0;
  padding-left: 1.1rem;
}

.faq-modal__list li {
  margin-bottom: 12px;
}

.faq-modal__list li:last-child {
  margin-bottom: 0;
}

.faq-modal__list strong {
  color: var(--cl-rojo);
  font-weight: 400;
}

.faq-modal__message {
  margin: 0 0 16px;
  font-size: 7px;
  line-height: 1.85;
  color: #ddd;
}

.faq-modal__sign {
  margin: 0;
  font-size: 7px;
  line-height: 1.85;
  color: #aaa;
  text-align: right;
}

.faq-modal__sign strong {
  color: var(--cl-rojo);
  font-weight: 400;
}

.home-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  text-align: center;
  padding: 6px 0 0;
  font-size: 6px;
  color: #555;
  flex-shrink: 0;
}

.home-footer p {
  margin: 0;
  line-height: 1.7;
}

.country-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #252525;
  border-radius: var(--panel-radius);
  background: #000;
  overflow: hidden;
}

.country-stage canvas {
  flex-shrink: 0;
}

/* Vista región */
.view--region {
  height: 100%;
  max-width: none !important;
  padding: 12px 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.region-shell {
  height: 100%;
  max-width: 1680px;
  margin: 0 auto;
  grid-template-columns: 11rem minmax(0, 1fr) 240px;
  column-gap: 12px;
}

.region-brand-mini {
  margin: 0 0 10px;
  font-size: 6px;
  line-height: 1.55;
}

.region-brand-mini .brand-logo__tagline {
  margin-top: 6px;
  font-size: 5px;
}

.region-panel,
.region-side--left .panel--nav {
  border-radius: var(--panel-radius);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.region-side--left .panel--nav {
  padding: 12px;
}

.region-side--left .btn-back {
  width: 100%;
  text-align: center;
  font-size: 7px;
}

.region-panel {
  width: 100%;
  max-width: 240px;
}

.region-map-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--panel-radius);
  border: 1px solid var(--panel-border);
}

.region-map-scroll-size {
  flex-shrink: 0;
  margin: auto;
}

.btn-primary {
  background: var(--cl-azul) !important;
  border-color: #2a5fc9 !important;
}

/* Pantalla ranking completo — scroll de toda la vista (nada recortado) */
.view--ranking:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: none !important;
  padding: 16px 20px 32px;
  overflow-x: hidden;
  overflow-y: auto !important;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  background: #000;
  -webkit-overflow-scrolling: touch;
}

.ranking-page {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.ranking-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.ranking-page__brand {
  margin: 0;
}

#btn-ranking-back {
  align-self: center;
  font-size: 7px;
  padding: 0.55rem 0.75rem;
}

.ranking-page__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: none;
  align-items: start;
  overflow: visible;
}

.ranking-page__col.panel {
  display: block;
  height: auto;
  max-height: none;
  min-width: 0;
  overflow: visible;
}

.ranking-page__col .panel__head {
  flex-shrink: 0;
}

.panel__head-count {
  color: #aaa;
  font-weight: normal;
}

.ranking-scroll-hint {
  margin: 0 0 8px;
  font-size: 6px;
  color: #666;
  flex-shrink: 0;
}

.ranking-full-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
}

.ranking-full-list li {
  padding: 10px 0;
  border-bottom: 1px solid #222;
  font-size: 7px;
  line-height: 1.65;
}

.ranking-full-list li:last-child {
  border-bottom: none;
}

.ranking-full-list__name {
  display: block;
  color: #eee;
  margin-bottom: 3px;
}

.ranking-full-list__meta {
  display: block;
  color: #777;
}

.ranking-full-list__title {
  display: block;
  color: var(--cl-rojo);
  margin-top: 3px;
}

@media (max-width: 760px) {
  .ranking-page__columns {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    overflow-y: auto;
  }

  html,
  body {
    overflow: auto;
  }

  .home-col--center {
    grid-row: 1;
    min-height: 45vh;
  }

  .home-col--left,
  .home-col--right {
    height: auto;
    overflow-y: visible;
  }

  .home-col--left {
    grid-row: 2;
  }

  .home-col--left > .panel--chat,
  .home-col--right > .panel {
    flex: none;
    min-height: auto;
  }

  .map-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .map-toolbar .home-nav {
    justify-content: center;
  }

  .panel--chat {
    min-height: 220px;
  }

  .home-chat__messages {
    min-height: 140px;
    max-height: 240px;
  }

  .activity-feed {
    min-height: 100px;
    max-height: 200px;
  }

  .owner-ranking {
    min-height: 120px;
    max-height: 220px;
  }

  .home-col--right {
    grid-row: 3;
  }

  .home-footer {
    grid-row: 4;
  }
}
