@media (max-width: 900px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 640px) {
  .wrap { padding: 78px 10px 14px; }

  .panel { padding: 14px 13px; }
  .panel h2 { font-size: 15.5px; }

  .game-shell { display: flex; flex-direction: column; }
  .game-shell > .side-left { order: 2; }
  .game-shell > .col-center { order: 1; }
  .game-shell > .side-right { order: 3; }
  .game-shell > .side-right { display: block; }

  .side-left .panel:first-child { margin-top: 12px; }

  .fab-group { top: 6px; right: 6px; gap: 5px; }
  .fab { width: 58px; height: 58px; }
  .fab-shop-img { width: 50px !important; height: 50px !important; }

  table.hall,
  table.forge-table,
  table.adm-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  table.wiki-tbl {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fighters { gap: 10px; padding: 10px 0 6px; }
  .fighter { min-height: 210px; }
  .fighters.big { min-height: 230px; }
  .big .f-icon { font-size: 64px; }
  .big .f-icon img.gi { width: 76px; height: 76px; }
  .f-icon { font-size: 52px; }
  .f-name { max-width: 130px; }
  .big .f-name { font-size: 17px; max-width: 140px; }
  .fighters .vs { font-size: 28px; }
  .ab-slot { width: 34px; height: 34px; border-radius: 8px; }
  .ab-slot img.gi { width: 26px; height: 26px; }
  .ab-slot.mini { width: 28px; height: 28px; }
  .ab-slot.mini img.gi { width: 21px; height: 21px; }
  .big .f-icon img.outfit { width: 160px; height: 160px; }
  .f-icon img.outfit { width: 135px; height: 135px; }

  .potion-card { flex-wrap: wrap; row-gap: 8px; }
  .potion-buy { width: 100%; flex-direction: row; align-items: center; justify-content: flex-end; }
  .potion-icon { font-size: 24px; min-width: 34px; }

  .shop-card { flex-wrap: wrap; row-gap: 8px; }
  .shop-price { text-align: left; min-width: 0; }
  .shop-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .shop-grid { gap: 8px; }

  .dr-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dr-progress { text-align: left; width: 100%; }
  .dr-progress-bar { width: 100%; }
  .dr-current { flex-wrap: wrap; }
  .dr-claim { width: 100%; text-align: center; }
  .dr-grid { grid-template-columns: repeat(3, 1fr); }

  .throne-head { flex-direction: column; align-items: center; text-align: center; }
  .evo-target { flex-direction: column; align-items: center; text-align: center; }
  .throne-form { text-align: center; }

  .name-row { flex-direction: column; align-items: stretch; }
  .name-row input { width: 100%; min-width: 0; }
  .class-grid { grid-template-columns: 1fr 1fr; }
  .cc-icon { font-size: 34px; }
  .cc-name { font-size: 16px; }
  .cc-desc { font-size: 11.5px; }

  .inv-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }

  .city-map { margin: 10px 0; }

  .forge-item { flex-wrap: wrap; }
  .forge-item button { width: 100%; }
  .forja-crumb .crumb-here { font-size: 13px; }
  .forge-card .fc-head > .ic-icon { font-size: 30px; }
  .f-meta { gap: 4px; }
  .forge-subtabs .fst { font-size: 12px; padding: 5px 10px; }
  .forge-tbl th, .forge-tbl td { padding: 7px 8px; }
  .mat-pip { font-size: 11px; padding: 0 6px; }
  .npc-icon { width: 34px; height: 34px; font-size: 20px; border-width: 1.5px; }
  .npc-label { font-size: 9.5px; }
  .npc-label small { font-size: 9px; }

  .salao-head { flex-direction: column; text-align: center; }
  .hall-head { flex-direction: column; }

  .lp-top { flex-direction: column; align-items: center; gap: 8px; }
  .lp-online { padding: 5px 12px; font-size: 13px; }
  .lp2-sub { margin-top: clamp(196px, 22vh, 240px); font-size: 15.5px; }
  .lp2-title { font-size: clamp(40px, 12vw, 62px); letter-spacing: 0.08em; }

  .btn,
  .btn-sm,
  .btn-gold {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
  input[type="range"] { min-width: 0; }
  .qty-input { font-size: 16px; }

  .f-slot select { max-width: 100%; }

  .fw { flex-wrap: wrap; }
  .adm-nav a { padding: 8px 14px; }
  .adm-table { overflow-x: auto; }

  .wiki-sec { padding-top: 4px; }
  .wiki-toc a { padding: 5px 8px; font-size: 12px; }
  .wiki-grid { grid-template-columns: 1fr; }

  .th-evo .bar { width: 100%; }
  .chron-title { font-size: 0.7rem; }
  .log { font-size: 13px; }

  .shop-balance { font-size: 14px; }
  .city-leave .btn { width: 100%; }
  .city-actions { flex-direction: column; align-items: stretch; }
  .city-actions .btn { width: 100%; text-align: center; }

  .dng-current { flex-direction: column; align-items: flex-start; }
  .dng-cur-img { width: 100%; height: 90px; }
  .dng-grid { grid-template-columns: 1fr; }
  .dng-loot { padding-top: 6px; }
  .inv-mini { font-size: 18px; }

  .hero-card h1 { font-size: clamp(38px, 11vw, 56px); }
  .hero-sub { font-size: 15.5px; }
  .auth-wrap { min-height: 74vh; }
  .auth-card { padding: 20px 16px; }
}