/* Escala adaptativa de la interfaz completa del juego. */
@media (max-width: 1599px), (max-height: 849px) {
  body.game-active #app {
    width: 83.333333vw;
    height: 83.333333vh;
    transform: scale(1.2);
  }

  .consumables-group {
    left: 12px;
  }

  .services-group {
    left: auto;
    right: 12px;
  }
}

@media (max-width: 1199px), (max-height: 699px) {
  body.game-active #app {
    width: 100vw;
    height: 100vh;
    transform: none;
  }
}

@media (max-width: 1420px) {
  .consumables-group {
    left: 12px;
  }

  .services-group {
    left: auto;
    right: 12px;
  }
}

@media (max-width: 1180px) {
  .global-topbar {
    grid-template-columns: minmax(150px, 1fr) auto minmax(315px, 1fr);
    gap: 14px;
    padding-inline: 12px;
  }

  .global-nav {
    gap: 16px;
  }

  .global-topbar .brand-link {
    width: max-content;
    min-width: 0;
  }

  .topbar-wallet {
    gap: 10px;
  }

  .topbar-wallet > span {
    min-width: 56px;
  }

  .combat-cluster {
    width: 760px;
    grid-template-columns: 250px 180px 250px;
    column-gap: 40px;
  }

  .fighter-column,
  .fighter-card {
    width: 250px;
  }

  .hud-side-group {
    display: none;
  }

  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .character-section-frame {
    width: calc(100vw - 40px);
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .character-section-frame .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-section-frame .character-slot {
    min-height: 430px;
  }

  .character-select-page {
    height: auto;
    min-height: 100vh;
    grid-template-rows: 43px auto 96px;
    overflow: visible;
  }

  .character-select-main {
    padding: 28px 20px;
  }

  .character-stage {
    height: auto;
    min-height: 0;
  }

  .character-select-page .character-grid {
    height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-select-page .character-slot {
    min-height: 460px;
  }
}

@media (max-width: 900px) {
  :root {
    --hud-height: 98px;
  }

  .page-content {
    padding: 20px 14px;
  }

  .welcome-layout,
  .server-layout {
    grid-template-columns: 1fr;
  }

  .welcome-copy {
    min-height: 390px;
    padding: 38px;
    border-right: 0;
    border-bottom: 1px solid #3d3d3d;
  }

  .welcome-panel {
    min-height: 240px;
  }

  .server-list {
    border-right: 0;
    border-bottom: 1px solid #3b3b3b;
  }

  .global-topbar {
    grid-template-columns: 125px minmax(250px, auto) minmax(270px, 1fr);
    gap: 9px;
  }

  .global-nav {
    display: flex;
    gap: 10px;
  }

  .nav-action {
    font-size: 9px;
  }

  .topbar-wallet {
    gap: 6px;
  }

  .topbar-wallet > span {
    min-width: 48px;
    gap: 4px;
  }

  .topbar-wallet small {
    font-size: 6px;
  }

  .topbar-wallet strong {
    font-size: 8px;
  }

  .portal-workspace {
    padding: 24px 22px 30px;
  }

  .boss-workspace {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .boss-inspection {
    grid-template-columns: 40% 60%;
  }

  .boss-detail {
    padding: 34px 26px;
  }

  .notify-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .combat-cluster {
    width: calc(100% - 150px);
    height: auto;
    grid-template-columns: 1fr 140px 1fr;
    column-gap: 18px;
  }

  .fighter-column,
  .fighter-card {
    width: 100%;
  }

  .fighter-card {
    height: 310px;
  }

  .fighter-placeholder {
    top: 0;
    width: calc(100% - 24px);
    height: calc(100% - 34px);
  }

  .fighter-footer {
    left: 12px;
    right: 12px;
    bottom: 0;
  }

  .combat-controls {
    padding-top: 24px;
  }

  .combat-toggle {
    width: 140px;
    font-size: 9px;
  }

  .city-hub {
    width: calc(100% - 130px);
    grid-template-columns: minmax(220px, 32%) minmax(0, 68%);
  }

  .city-scene {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 14px 18px;
  }

  .city-character-presence {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .city-character-art {
    width: 86px;
    height: 190px;
  }

  .city-service {
    min-height: 78px;
  }

  .hud-control-row {
    height: 75px;
  }

  .hud-core {
    top: 7px;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .character-section-frame .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-select-page .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-action-button {
    min-width: 150px;
  }

  .character-creator-layout {
    grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
  }

  .mu-skill-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mu-skill-branches {
    grid-template-columns: 1fr;
  }

  .mu-cashshop {
    grid-template-columns: 115px minmax(0, 1fr);
  }

  .mu-shop-account {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(150px, auto);
  }

  .mu-quest-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .mu-craft-layout {
    grid-template-columns: 185px minmax(0, 1fr);
  }

  .mu-craft-slots {
    grid-template-columns: 120px 24px 120px;
    gap: 8px;
  }

  .mu-guild {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 660px) {
  .site-header {
    padding: 0 12px;
  }

  .header-meta,
  .brand-subtitle {
    display: none;
  }

  .welcome-copy {
    padding: 30px 24px;
  }

  .welcome-actions,
  .character-toolbar,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .server-list,
  .account-panel,
  .character-body {
    padding: 16px;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .character-section-frame {
    width: calc(100vw - 28px);
  }

  .character-section-frame .character-grid {
    grid-template-columns: 1fr;
  }

  .character-select-header h1 {
    font-size: 10px;
  }

  .character-select-main {
    padding: 20px 14px;
  }

  .character-select-page .character-grid {
    grid-template-columns: 1fr;
  }

  .character-action-bar {
    min-height: 176px;
    flex-direction: column;
    padding: 20px;
  }

  .character-action-button {
    width: min(100%, 320px);
  }

  .character-slot {
    min-height: 230px;
  }

  .character-creator-dialog {
    width: min(96vw, 560px);
    height: 94vh;
    max-height: 94vh;
  }

  .character-creator-body {
    overflow-y: auto;
  }

  .character-creator-layout {
    height: auto;
    min-height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 270px auto;
  }

  .creator-preview {
    border-right: 0;
    border-bottom: 1px solid #444;
  }

  .creator-controls {
    overflow: visible;
  }

  .creator-controls .race-options {
    max-height: none;
    overflow: visible;
  }

  .game-shell {
    min-height: 560px;
  }

  .global-topbar {
    grid-template-columns: 76px minmax(210px, 1fr) minmax(168px, auto);
    gap: 6px;
    padding-inline: 7px;
  }

  .global-topbar .brand-mark {
    display: none;
  }

  .global-nav {
    gap: 6px;
  }

  .nav-action {
    font-size: 8px;
  }

  .notify-nav-action span {
    display: none;
  }

  .topbar-wallet {
    gap: 7px;
  }

  .topbar-wallet > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .topbar-wallet small {
    font-size: 5px;
  }

  .portal-workspace {
    padding: 18px 12px 24px;
    overflow: auto;
  }

  .portal-heading {
    min-height: 82px;
  }

  .portal-heading h1 {
    font-size: 19px;
  }

  .portal-heading > strong {
    display: none;
  }

  .boss-workspace,
  .notify-workspace {
    height: auto;
    grid-template-columns: 1fr;
  }

  .boss-catalog {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .boss-inspection {
    min-height: 410px;
  }

  .notify-schedule {
    min-height: 300px;
  }

  .ranking-table > header,
  .ranking-row {
    grid-template-columns: 54px minmax(150px, 1fr) 62px 90px;
  }

  .global-topbar .brand-link {
    width: auto;
    min-width: 0;
  }

  .topbar-status {
    gap: 8px;
  }

  .side-dock {
    display: none;
  }

  .combat-cluster {
    width: calc(100% - 24px);
    grid-template-columns: 1fr 82px 1fr;
    column-gap: 8px;
  }

  .fighter-heading {
    height: 50px;
  }

  .fighter-name {
    font-size: 12px;
  }

  .fighter-meta {
    font-size: 8px;
  }

  .fighter-card {
    height: 270px;
  }

  .fighter-placeholder {
    top: 0;
    width: calc(100% - 12px);
    height: calc(100% - 34px);
    font-size: 47px;
  }

  .fighter-footer {
    left: 6px;
    right: 6px;
  }

  .combat-controls {
    height: 320px;
    padding-top: 11px;
  }

  .zone-label {
    font-size: 7px;
  }

  .zone-name {
    margin-top: 12px;
    font-size: 12px;
  }

  .combat-toggle {
    width: 78px;
    height: 58px;
    padding: 5px;
    font-size: 8px;
  }

  .return-city-button {
    width: 78px;
    min-width: 78px;
    padding: 2px;
    font-size: 6px;
  }

  .city-hub {
    width: calc(100% - 20px);
    height: calc(100% - 16px);
    grid-template-columns: minmax(112px, 34%) minmax(0, 66%);
    grid-template-rows: minmax(0, 1fr);
  }

  .city-information-panel {
    grid-template-rows: 66px minmax(0, 1fr) 58px;
  }

  .city-portrait-caption {
    left: 10px;
    right: 10px;
    bottom: 12px;
  }

  .city-portrait-caption strong {
    font-size: 11px;
  }

  .city-portrait-caption small,
  .city-portrait-caption > span {
    font-size: 6px;
  }

  .city-heading {
    padding: 6px 12px;
  }

  .city-heading h1 {
    font-size: 16px;
  }

  .city-heading p {
    display: none;
  }

  .city-scene {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 9px;
  }

  .city-character-presence {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 7px;
  }

  .city-character-art {
    width: 72px;
    height: 166px;
  }

  .city-character-presence > div:last-child > span,
  .city-character-presence small {
    font-size: 6px;
  }

  .city-character-presence strong {
    font-size: 9px;
  }

  .city-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .city-service {
    min-height: 52px;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }

  .city-service-icon {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }

  .city-service-copy small,
  .city-service > i {
    display: none;
  }

  .city-service-copy strong {
    font-size: 7px;
  }

  .city-gate-panel {
    gap: 8px;
    padding: 6px 9px;
  }

  .city-gate-panel span,
  .city-gate-panel small {
    display: none;
  }

  .city-gate-panel > div {
    display: block;
  }

  .city-gate-panel button {
    min-width: 150px;
    height: 34px;
    font-size: 7px;
  }

  .hunting-window-open .window-body,
  .warehouse-window-open .window-body,
  .city-shop-window-open .window-body {
    overflow: auto;
  }

  .mu-hunting,
  .mu-warehouse,
  .mu-city-shop {
    min-height: 0;
  }

  .mu-hunting {
    grid-template-rows: auto auto 38px;
  }

  .mu-hunting > header,
  .mu-city-shop > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
  }

  .mu-hunting > header p,
  .mu-city-shop > header p {
    max-width: none;
    text-align: left;
  }

  .mu-hunting-grid,
  .mu-city-shop > section {
    grid-template-columns: 1fr;
  }

  .mu-warehouse {
    grid-template-rows: 62px 82px auto 34px;
  }

  .mu-warehouse-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .combat-status {
    font-size: 8px;
  }

  .combat-divider {
    height: 50px;
  }

  .hud-core {
    width: 100%;
    left: 0;
    justify-content: center;
    transform: scale(0.82);
    transform-origin: top center;
  }

  .experience-track {
    max-width: 82vw;
  }

  .inventory-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .inventory-window-open .window-body {
    padding: 10px;
  }

  .move-window-open .window-body {
    padding: 10px;
  }

  .attributes-window-open .window-body {
    padding: 10px;
  }

  .mu-attributes {
    grid-template-columns: 1fr;
  }

  .quests-window-open .window-body {
    overflow: auto;
  }

  .crafting-window-open .window-body {
    overflow: auto;
  }

  .guild-window-open .window-body {
    overflow: auto;
  }

  .mu-guild {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 480px 34px;
    grid-template-areas: "sidebar" "content" "status";
  }

  .mu-guild-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .mu-guild-identity {
    min-height: 90px;
  }

  .mu-guild-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mu-guild-tabs,
  .mu-guild-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mu-guild-actions {
    margin-top: 0;
  }

  .mu-guild-actions small {
    grid-column: 1 / -1;
  }

  .mu-crafting {
    min-height: 0;
    grid-template-rows: 36px auto 34px;
  }

  .mu-craft-layout {
    grid-template-columns: 1fr;
  }

  .mu-craft-recipes {
    grid-template-rows: 32px auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .mu-craft-recipes > footer {
    display: none;
  }

  .mu-craft-recipe-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mu-craft-recipe-list button {
    min-height: 36px;
  }

  .mu-craft-workbench {
    grid-template-rows: 54px 150px 118px auto;
  }

  .mu-craft-info p {
    max-width: 280px;
  }

  .mu-craft-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mu-craft-summary > div,
  .mu-craft-summary > button {
    min-height: 42px;
  }

  .mu-craft-status {
    min-height: 34px;
  }

  .mu-quest-hub {
    min-height: 0;
  }

  .mu-quest-layout,
  .mu-quest-layout.evolution {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .mu-quest-list-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .mu-quest-list,
  .mu-quest-layout.evolution .mu-quest-list {
    max-height: 260px;
  }

  .mu-quest-detail-scroll,
  .mu-quest-layout.evolution .mu-quest-detail-scroll {
    max-height: 430px;
  }

  .mu-evolution-route {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px;
  }

  .mu-evolution-route > span {
    width: 100%;
    margin-left: 0;
  }

  .mu-quest-rewards {
    grid-template-columns: 1fr;
  }

  .mu-quest-brief {
    grid-template-columns: 1fr;
  }

  .mu-quest-objective,
  .mu-quest-cost {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    border-left: 0;
  }

  .mu-move-head,
  .mu-move-row {
    grid-template-columns: minmax(0, 1fr) 62px 70px;
  }

  .mu-inventory-hint {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .mu-inventory-layout {
    gap: 14px;
  }

  .mu-inventory-footer {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

  .mu-inventory-zen {
    padding: 0 0 6px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  }

  .mu-inventory-status {
    white-space: normal;
  }

  .mu-skill-summary,
  .mu-cashshop {
    grid-template-columns: 1fr;
  }

  .mu-skill-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mu-shop-categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mu-shop-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mu-shop-account {
    grid-column: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto 150px minmax(190px, auto);
  }
}
