/* Mobile — body.is-mobile uniquement. PC inchangé. */

html.is-mobile,
body.is-mobile {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  height: 100%;
  height: 100dvh;
  --m-side: 132px;
  --m-right: 64px;
}

body.is-mobile .sidebar {
  width: var(--m-side);
  padding: 8px 6px;
  font-size: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile .sidebar h3,
body.is-mobile .filter-heading { font-size: 11px; margin: 8px 0 4px; }
body.is-mobile .sidebar button,
body.is-mobile .sidebar input,
body.is-mobile .sidebar select {
  font-size: 12px;
  padding: 7px 6px;
  min-height: 36px;
}
body.is-mobile .rightbar {
  width: var(--m-right);
  padding: 8px 4px;
}
body.is-mobile .rightbar .btn-home,
body.is-mobile .rightbar .btn-nav {
  font-size: 10px;
  padding: 8px 3px;
  min-height: 38px;
}
body.is-mobile .main {
  margin-left: var(--m-side);
  margin-right: var(--m-right);
  padding: 6px 4px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100dvh;
  max-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

body.is-mobile .btn-mobile-orient {
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 6px;
  min-height: 40px;
  background: #2a2210;
  border: 1px solid #c9a227;
  color: #f0d78c;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
body.is-mobile .btn-mobile-orient.is-on {
  background: #3a3018;
  border-color: #e8c84a;
}

/* Les cartes galerie sont un WRAP (172x260) + .card interne déjà en scale(0.5). */
body.is-mobile:not(.is-mobile-portrait) #view-collection .page-collection > div,
body.is-mobile:not(.is-mobile-portrait) #galleryContainer .page > div,
body.is-mobile:not(.is-mobile-portrait) #view-deck .deck-card {
  width: 86px !important;
  height: 130px !important;
  transform: none !important;
  margin: 0 4px 6px 0 !important;
  flex-shrink: 0;
  overflow: hidden;
}
body.is-mobile:not(.is-mobile-portrait) #view-collection .page-collection .card:not(.zoom),
body.is-mobile:not(.is-mobile-portrait) #galleryContainer .page .card:not(.zoom),
body.is-mobile:not(.is-mobile-portrait) #view-deck .deck-card .card:not(.zoom) {
  transform: scale(0.25) !important;
  transform-origin: top left;
  margin: 0 !important;
}
body.is-mobile #galleryContainer .page,
body.is-mobile #collectionContainer .page-collection {
  flex-wrap: wrap !important;
  overflow: visible;
  align-content: flex-start;
}

body.is-mobile #view-collection.view.active { overflow: hidden; }
body.is-mobile #view-collection .sidebar {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile #view-collection .main {
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  padding-bottom: 80px !important;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile #collectionContainer,
body.is-mobile #collectionContainer .gallery-wrapper,
body.is-mobile #collectionContainer .pages {
  display: block !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: none !important;
}
body.is-mobile #collectionContainer .page-collection {
  height: auto !important;
  flex-wrap: wrap !important;
}
body.is-mobile #view-collection #collectionContainer .pagination {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  display: flex !important;
  width: 100% !important;
  margin: 16px 0 28px !important;
  padding: 8px 0 20px !important;
  z-index: 5;
  pointer-events: auto;
}

body.is-mobile .card-hit-zoom {
  height: 58%;
}
body.is-mobile .card-hit-use {
  height: 42%;
  background: rgba(0, 0, 0, 0.5);
}

body.is-mobile.is-mobile-portrait {
  overflow: auto;
}
body.is-mobile.is-mobile-portrait #view-collection .page-collection > div {
  width: 145px !important;
  height: 218px !important;
  transform: none !important;
  margin: 0 6px 8px 0 !important;
}
body.is-mobile.is-mobile-portrait #view-collection .page-collection .card:not(.zoom) {
  transform: scale(0.42) !important;
  margin: 0 !important;
}

body.is-mobile #view-deck #galleryContainer .pages {
  min-height: 0 !important;
}
body.is-mobile #view-deck #galleryContainer .pagination {
  margin-top: 4px !important;
  margin-bottom: 6px;
}
body.is-mobile #view-deck .deck-layout {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
body.is-mobile #view-deck .deck-characters {
  flex-direction: row;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  padding: 0;
  gap: 10px;
}
body.is-mobile #view-deck .deck-characters-row {
  width: auto;
  flex: 1;
  overflow: visible;
  flex-wrap: nowrap;
}
body.is-mobile #view-deck .deck-summary-icons {
  margin-top: 0;
  flex-shrink: 0;
  max-width: 42%;
}
body.is-mobile #view-deck .deck-others,
body.is-mobile #view-deck .deck-others-page {
  width: 100%;
  max-width: none;
  overflow: visible;
}
body.is-mobile #view-deck .deck-section {
  max-height: none;
  overflow: visible;
  margin-top: 8px;
}

body.is-mobile #view-boutique.theme-view { overflow: hidden; }
body.is-mobile #view-boutique .main {
  overflow-y: auto !important;
  padding-top: 0;
  padding-bottom: 48px;
}
body.is-mobile #view-boutique .boutique-tabs {
  padding: 6px 8px 10px;
  margin-top: 0;
  margin-bottom: 6px;
}
body.is-mobile #view-boutique .boutique-offers-grid,
body.is-mobile #view-boutique .boutique-direct-grid {
  grid-template-columns: repeat(4, max-content) !important;
  gap: 8px 10px !important;
  padding: 10px 8px 36px !important;
  margin-top: 0 !important;
  justify-content: start !important;
  justify-items: start !important;
}
body.is-mobile #view-boutique .boutique-pagination {
  margin: 2px 0 28px;
  position: relative;
  z-index: 5;
}
body.is-mobile #view-boutique .boutique-offer-btn {
  width: 118px !important;
  min-width: 0;
  padding: 6px 4px 8px;
  font-size: 11px;
}
body.is-mobile #view-boutique .boutique-offer-btn > img,
body.is-mobile #view-boutique .boutique-direct-card {
  width: 100% !important;
  height: auto !important;
  max-height: 22vh;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  overflow: hidden;
}
body.is-mobile #view-boutique .boutique-direct-card .card {
  transform: scale(0.26) !important;
  transform-origin: top center;
}

body.is-mobile .boutique-confirm-box,
body.is-mobile .login-box,
body.is-mobile .mail-box,
body.is-mobile .battle-mode-box,
body.is-mobile .battle-deck-box,
body.is-mobile .booster-box {
  max-height: 88dvh;
  overflow: auto;
}

body.is-mobile .home-frame-left,
body.is-mobile .home-frame-right { width: 22px; }
body.is-mobile .game-logo-home {
  height: 36px;
  max-width: 52vw;
  margin-bottom: 4px;
}
body.is-mobile .profile-stack {
  top: calc(6px + var(--vv-top, 0px));
  left: 56px;
  bottom: auto;
  width: min(240px, 38vw);
  max-height: calc(100dvh - 72px - var(--vv-bottom, 0px));
  gap: 6px;
  transform: none;
  z-index: 20;
  overflow: auto;
}
body.is-mobile .profile-panel {
  transform: none;
  width: 100%;
  padding: 8px 10px;
}
body.is-mobile .profile-compact {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
body.is-mobile .profile-info-col {
  width: 100%;
  min-height: 0;
  order: 1;
}
body.is-mobile .profile-avatar-col {
  order: 2;
  align-items: flex-start;
  width: 100%;
}
body.is-mobile .profile-avatar-frame {
  width: 52px;
  height: 52px;
}
body.is-mobile .profile-pseudo,
body.is-mobile .profile-title-text {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  max-width: none;
}
body.is-mobile .profile-pseudo { font-size: 13px; }
body.is-mobile .profile-title-text { font-size: 11px; }
body.is-mobile .profile-line2 .profile-xp-track,
body.is-mobile .profile-xp-track { height: 8px; }
body.is-mobile .profile-wallet {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
}
body.is-mobile .profile-stack > #homeChat { display: none !important; }
body.is-mobile #homeChatOverlay #homeChat,
body.is-mobile #homeChatOverlay .home-chat {
  display: flex !important;
  flex-direction: column;
  max-height: none;
  width: 100%;
}

body.is-mobile .home-chat-fab {
  min-width: 52px;
  font-size: 11px;
  color: #888;
  border-color: #555;
  background: #1a1a1a;
}
body.is-mobile .home-chat-fab.is-unread {
  color: #1a1a1a;
  background: #3a9a4a;
  border-color: #5c5;
  font-weight: bold;
}
body.is-mobile .home-chat-popup {
  width: min(420px, 92vw);
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
}
body.is-mobile .home-chat-popup .home-chat {
  display: flex !important;
  max-height: none;
  width: 100%;
}
body.is-mobile .home-chat-popup .home-chat-log {
  min-height: 180px;
  max-height: 42vh;
}

body.is-mobile .home-menu {
  position: fixed !important;
  left: 56px;
  transform: none;
  right: auto;
  bottom: calc(8px + var(--vv-bottom, 0px));
  gap: 6px;
  flex-wrap: nowrap;
  max-width: none;
  width: auto;
  z-index: 80;
  pointer-events: auto;
}
body.is-mobile .home-menu > button,
body.is-mobile .home-menu > button#btnGoBoutique,
body.is-mobile .home-menu > button#btnGoCollection,
body.is-mobile .home-menu > button#btnGoDeck,
body.is-mobile .home-menu > button#btnStartBattle,
body.is-mobile .home-menu > .btn-start-battle,
body.is-mobile #btnStartBattle {
  position: static !important;
  margin: 0 !important;
  min-width: 108px !important;
  width: 108px !important;
  max-width: 108px !important;
  padding: 8px 6px !important;
  font-size: 11px !important;
  box-sizing: border-box !important;
  white-space: nowrap;
}

body.is-mobile .periodic-dock {
  top: calc(6px + var(--vv-top, 0px));
  transform: none;
  right: 56px;
  bottom: calc(56px + var(--vv-bottom, 0px));
  width: 168px;
  gap: 3px;
  z-index: 25;
  max-height: none;
  overflow: auto;
}
body.is-mobile .periodic-heading { font-size: 10px; }
body.is-mobile .periodic-card {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  cursor: pointer;
}
body.is-mobile .periodic-card-rew,
body.is-mobile .periodic-status,
body.is-mobile .periodic-card-main .quest-claim-btn {
  display: none !important;
}
body.is-mobile .periodic-card-main { padding: 3px 6px; }
body.is-mobile .periodic-card-main .quest-card-title {
  font-size: 11px;
  margin: 0;
}
body.is-mobile .periodic-card-main .quest-bar-wrap {
  height: 10px;
  margin-top: 2px;
}
body.is-mobile #periodicQuestOverlay .login-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.is-mobile #periodicQuestOverlay .periodic-popup-rew,
body.is-mobile #periodicQuestOverlay .periodic-card-rew {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: none;
  border: 0;
  background: transparent;
  padding: 8px 0;
  margin: 0 auto;
}
body.is-mobile #periodicQuestOverlay .quest-reward {
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}
body.is-mobile #periodicQuestOverlay .quest-reward-booster,
body.is-mobile #periodicQuestOverlay .quest-reward-canette,
body.is-mobile #periodicQuestOverlay .quest-reward img {
  display: block;
  margin: 0 auto;
  max-height: 88px;
  width: auto;
}

body.is-mobile .battle-mode-overlay,
body.is-mobile .battle-deck-overlay {
  align-items: center;
  justify-content: center;
  padding: 12px;
}
body.is-mobile .battle-mode-overlay.visible,
body.is-mobile .battle-deck-overlay.visible {
  display: flex !important;
}
body.is-mobile .battle-mode-box,
body.is-mobile .battle-deck-box {
  margin: auto;
}

body.is-mobile #view-pvp .pvp-main {
  padding: 12px 72px 12px 12px !important;
  justify-content: flex-end !important;
}
body.is-mobile #view-pvp .pvp-panel {
  width: min(480px, calc(100% - 200px));
  margin: 20px 8px 0 0;
}
body.is-mobile #view-pvp .pvp-recap {
  transform: scale(0.78);
  transform-origin: top left;
}

body.is-mobile .booster-card-reveal {
  width: 86px !important;
  height: 130px !important;
  overflow: hidden;
}
body.is-mobile .booster-card-reveal .card:not(.zoom) {
  transform: scale(0.25) !important;
  transform-origin: top left;
}

body.is-mobile .battle-mode-view-body {
  overflow: hidden !important;
  justify-content: center !important;
  align-items: center !important;
}
body.is-mobile .battle-training-form {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  max-width: 420px;
}
body.is-mobile .battle-mode-view-box,
body.is-mobile .battle-mode-view-overlay .battle-mode-box {
  overflow: hidden !important;
}

body.is-mobile #view-battle .battle-combat-zone {
  width: min(90vw, 980px);
  right: 4px;
}
body.is-mobile #view-battle .fullart-text {
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
  font-size: 28px;
  padding-left: 8px;
}
body.is-mobile #view-battle .fullart-spec {
  font-size: 30px;
}
body.is-mobile #view-battle .fullart-desc {
  white-space: normal;
  font-size: 28px;
}
body.is-mobile #view-battle .battle-combat-mid {
  justify-content: flex-end;
  padding-right: 2px;
  gap: 10px;
}
body.is-mobile #view-battle .battle-combat-hint {
  text-align: right;
  font-size: 18px;
  white-space: normal;
}
body.is-mobile #view-battle .battle-btn-validate {
  margin-right: 0;
  font-size: 20px;
  padding: 10px 18px;
}

body.is-mobile .zoom {
  transform: scale(0.58) !important;
  top: 54% !important;
}

body.is-mobile #rotateLock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #0b1018;
  color: #f0d78c;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.4;
}
body.is-mobile.is-portrait-blocked #rotateLock {
  display: flex;
}