/* Couche mobile Box or Bust. Les règles ordinateur restent inchangées. */
@media (max-width: 768px) {
  html{-webkit-text-size-adjust:100%;scroll-padding-top:138px}body{width:100%;overflow-x:hidden}button,a,select{touch-action:manipulation}button,.primary,.secondary,.text-button{min-height:44px}
  .topbar{position:relative;height:auto;min-height:126px;padding:7px 12px 9px;display:grid;grid-template-columns:64px minmax(0,1fr) auto;grid-template-rows:55px auto;gap:5px 9px;align-items:center}
  .topbar .brand{grid-column:1;grid-row:1}.topbar .brand .site-logo{width:62px;height:51px}.topbar-tools{grid-column:3;grid-row:1;display:flex;align-items:center;gap:7px}.topbar .icon-button{display:grid;place-items:center;width:42px;height:42px}.topbar .admin-statistics-link{min-height:40px;display:grid;place-items:center;padding:7px 9px}
  .topbar .stats{grid-column:1/-1;grid-row:2;width:100%;display:grid;grid-template-columns:minmax(100px,1.15fr) minmax(76px,.8fr) minmax(82px,.9fr) auto;gap:7px;align-items:stretch}
  .topbar .balance-shop,.topbar .stat,.topbar .topbar-daily,.topbar .account-user,.topbar .account-login{min-width:0;margin:0}.topbar .balance-shop{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px}.topbar .credit-shop-link{padding:2px 0;border:0;font-size:7px;white-space:normal}.topbar .stat{display:flex;flex-direction:column;justify-content:center}.topbar .stat span{font-size:7px;letter-spacing:.7px}.topbar .stat strong{overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.topbar .level-wrap,.topbar .credit-button{display:none!important}.topbar .topbar-daily{max-width:none;padding:7px 5px;font-size:7px;line-height:1.2;white-space:normal}.topbar .account-login{display:grid;place-items:center;font-size:8px;text-align:center}.topbar .account-login[hidden]{display:none!important}.topbar .account-user{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-start;gap:8px;padding-top:2px}.topbar .account-user[hidden]{display:none!important}.topbar .account-user .account-profile-link{max-width:calc(100% - 54px);padding:6px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .account-user>a:last-child{width:auto;min-height:32px;padding:6px 4px;overflow:visible;font-size:0;text-align:center}.topbar .account-user>a:last-child::after{content:"Sortir";font-size:7px}
  main{width:100%;padding:0 12px 60px}.hero.showcase-only{width:calc(100% + 24px);min-height:0;margin-left:-12px;margin-right:-12px;transform:none}.hero .garage-viewport.permanent-showcase,.hero .garage-viewport.permanent-showcase.expanded{width:100%;height:600px}.permanent-showcase .premium-showcase-header{left:50%;top:54px;width:calc(100% - 24px);transform:translateX(-50%)}.permanent-showcase .premium-showcase-header h2{font-size:25px;letter-spacing:4px}.hero .permanent-showcase .container-3d,.hero .permanent-showcase.expanded .container-3d{left:3%;top:180px;width:94%;height:365px}
  .tabs{top:0;margin-inline:-12px;padding:0 12px;gap:22px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;scroll-snap-type:x proximity}.tabs::-webkit-scrollbar{display:none}.tabs button{flex:0 0 auto;min-height:52px;padding:14px 0;font-size:11px;scroll-snap-align:start}.tabs button:nth-child(n){display:block!important;margin:0}.panel{padding-top:28px}
  .section-heading{align-items:flex-start;flex-direction:column;gap:13px;margin-bottom:18px}.section-heading h2{font-size:23px;line-height:1.08}.section-heading>div,.section-tools{width:100%}.section-tools{align-items:stretch;flex-direction:column;gap:8px}.section-tools .quality-filter{width:100%;min-height:44px}.stock-value{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border:1px solid var(--line);border-radius:7px}.stock-value b{margin-left:8px}
  .lots,.inventory-grid,.showcase-grid,.achievement-grid,.badges-grid{grid-template-columns:1fr!important;gap:14px}.lot-visual{height:200px}.lot-info{padding:17px}.lot-info p{min-height:0}.lot-footer{gap:12px}.buy-btn{min-width:132px}.item-icon{height:210px}.item-actions{gap:8px}.item-actions button{min-height:44px}.tip{align-items:flex-start;padding:13px}.odds-grid{grid-template-columns:1fr 1fr}.odds{min-height:52px}.moon-counter{padding:15px}.moon-counter-copy strong{font-size:18px}.moon-counter-copy small{line-height:1.55}
  .collection-album>header{align-items:flex-start;flex-direction:column;gap:12px;padding:20px 17px}.collection-progress{text-align:left}.collection-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px}.collection-object{min-width:0;padding:8px}.collection-object-visual{height:105px}.collection-object strong{white-space:normal;line-height:1.25}.collection-collapsible>footer{align-items:flex-start;flex-direction:column;padding:15px}.collection-collapsible>footer em{text-align:left}.achievement-card{padding:16px 14px;gap:11px}.achievement-emblem{width:38px;height:43px}.achievement-content h3{font-size:16px}.achievement-notice{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));max-width:none;padding:16px}
  .ranking-switch{grid-template-columns:1fr 1fr;gap:7px}.ranking-switch button{min-height:52px;padding:9px 6px;font-size:9px;line-height:1.25}.leader-row{grid-template-columns:34px minmax(0,1fr) 78px;gap:7px;padding:13px 9px}.leader-row .avatar{min-width:0;gap:8px}.leader-row .avatar i{flex:0 0 34px;width:34px;height:34px}.leaderboard-profile{min-width:0}.leaderboard-profile b,.leaderboard-profile small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leader-sales{font-size:11px;text-align:right}
  .modal-backdrop{align-items:flex-end;padding:0}.modal{width:100%;max-height:calc(100dvh - env(safe-area-inset-top));overflow-y:auto;padding:25px 14px max(18px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.modal h2{padding-inline:28px;font-size:22px}.opening-stage{height:205px}.parcel-opening{width:190px;height:155px}.reveal-item{padding-inline:5px}.reveal-item .object-inspector{width:min(330px,92vw);height:235px}.reveal-actions{position:sticky;bottom:0;z-index:8;padding-top:8px;background:linear-gradient(transparent,#1a1630 18%)}.reveal-actions button{min-height:48px}.object-value-details{width:100%;gap:5px;padding:8px 5px}.object-value-details span{min-width:0;flex:1}.object-value-details small{font-size:5px}.object-value-details b{font-size:12px}.toast{bottom:max(14px,env(safe-area-inset-bottom));width:calc(100% - 24px);text-align:center}
  .landing-header{height:68px;padding:4px 14px}.landing-brand .site-logo{width:66px;height:54px}.landing-account{min-width:0}.landing-account .account-user{gap:3px}.landing-account .account-user .account-profile-link{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.landing-hero{min-height:calc(100svh - 68px);padding:40px 16px 58px}.hero-content{width:100%;min-width:0}.hero-kicker{max-width:100%;line-height:1.55;overflow-wrap:anywhere}.hero-content h1{max-width:100%;margin:19px 0;font-size:clamp(37px,12.5vw,50px);line-height:.92;letter-spacing:-2px;overflow-wrap:anywhere}.hero-lead,.unexpected-note{max-width:100%}.hero-lead{font-size:14px;line-height:1.6}.hero-buttons{flex-direction:column}.hero-buttons a{min-height:50px;display:flex;align-items:center;justify-content:center;text-align:center}.hero-signals{display:grid;grid-template-columns:1fr 1fr;gap:13px}.rules-section{padding:65px 16px}.rules-heading h2{font-size:32px}.rules-grid article{min-height:0;padding:22px}.rarity-line{grid-template-columns:repeat(2,1fr)}.final-cta{grid-template-columns:1fr auto;padding:20px 18px}
  .profile-topbar{min-height:68px;padding:4px 12px}.profile-topbar .site-logo{width:66px;height:54px}.profile-topbar nav{min-width:0;gap:8px}.profile-topbar nav>a,.profile-topbar .account-user a{font-size:8px}.profile-topbar .account-user{min-width:0}.profile-topbar .account-profile-link{max-width:94px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-shell{width:calc(100% - 24px);padding:26px 0 55px}.profile-identity{grid-template-columns:68px minmax(0,1fr);padding:18px;gap:13px}.profile-identity h1{font-size:29px;letter-spacing:-1px;overflow-wrap:anywhere}.profile-showcase-hero{grid-column:1/-1;padding:17px 0 0;border-top:1px solid var(--line);border-left:0}.profile-private,.profile-admin,.profile-panel{padding:18px}.private-grid,.profile-stats,.profile-achievements,.profile-friends{grid-template-columns:1fr!important}.profile-stats{grid-template-columns:1fr 1fr!important}.profile-stats article{padding:17px}.profile-feature-grid,.profile-trophy-summary{grid-template-columns:1fr!important}.most-valuable-panel .valuable-object{grid-template-columns:120px minmax(0,1fr);gap:14px}.most-valuable-panel .valuable-object img{width:120px;height:115px}.profile-showcase,.profile-badges{grid-template-columns:1fr 1fr}.showcase-object img{height:105px}.profile-tooltip{position:fixed;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));width:auto;max-width:none;transform:translateY(8px)}.profile-tooltip::after{display:none}.profile-tooltip-card:hover .profile-tooltip,.profile-tooltip-card:focus-visible .profile-tooltip{transform:none}.profile-modal,.deletion-modal{align-items:flex-end;padding:0}.profile-modal>div,.deletion-modal>div{width:100%;max-height:92dvh;overflow-y:auto;padding:24px 17px max(18px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.profile-modal>button{z-index:2;top:auto;bottom:calc(92dvh - 48px)}.avatar-choices{grid-template-columns:1fr 1fr}.friend-request-actions{width:100%}.friend-request-actions button{flex:1;min-height:44px}
  .statistics-header,.credit-page-header{min-height:68px;padding:4px 12px}.statistics-header .site-logo,.credit-page-header .site-logo{flex:0 0 auto;width:66px;height:54px}.statistics-header nav,.credit-page-header nav{min-width:0;gap:8px}.statistics-header nav>a:first-child,.credit-page-header nav>a:first-child{min-width:54px;overflow:hidden;font-size:0;white-space:nowrap}.statistics-header nav>a:first-child::after,.credit-page-header nav>a:first-child::after{content:"← Jeu";font-size:9px}.statistics-main,.credit-page-main{padding:36px 12px 60px}.statistics-title{align-items:flex-start;flex-direction:column;gap:15px}.statistics-title h1,.credit-page-title h1{font-size:34px}.statistics-grid.two,.statistics-grid.four{grid-template-columns:1fr}.statistics-grid article.wide-stat{grid-column:auto}.statistics-grid article{min-height:118px;padding:18px}.statistics-grid strong{margin-top:15px}.statistics-group-title{align-items:flex-end;gap:10px}.statistics-chart-link{min-height:38px}.statistics-chart-backdrop{align-items:flex-end;padding:0}.statistics-chart-modal{width:100%;max-height:94dvh;overflow:auto;padding:24px 14px max(16px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.statistics-chart-canvas{max-width:100%;overflow-x:auto}.statistics-chart-canvas canvas{min-width:620px}.statistics-chart-tooltip{left:12px!important;right:12px;bottom:max(12px,env(safe-area-inset-bottom));top:auto!important;min-width:0}
  .credit-packs{grid-template-columns:1fr}.credit-pack{min-height:190px}.credit-beta-backdrop{align-items:flex-end;padding:0}.credit-beta-dialog{width:100%;padding:27px 18px max(20px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.legal-shell{width:calc(100% - 24px);padding:28px 0 55px}.legal-card{padding:20px 17px}
}
@media (max-width:390px){.topbar .stats{grid-template-columns:minmax(92px,1fr) 70px 76px auto;gap:4px}.topbar .account-user .account-profile-link{max-width:calc(100% - 50px)}.odds-grid,.ranking-switch{grid-template-columns:1fr}.profile-stats,.profile-showcase,.profile-badges{grid-template-columns:1fr!important}.most-valuable-panel .valuable-object{grid-template-columns:100px minmax(0,1fr)}.most-valuable-panel .valuable-object img{width:100px;height:100px}}
@media (max-width:768px) and (orientation:landscape){.modal,.profile-modal>div,.deletion-modal>div,.statistics-chart-modal{max-height:100dvh;border-radius:0}.opening-stage{height:145px}.parcel-opening{width:155px;height:125px}}

/* Centrer l’ouverture du colis sans modifier le zoom des objets du stock/vitrine. */
@media (max-width:768px) {
  #modalBackdrop:has(> #openingModal:not(.stored-item-preview)) {
    top:0;
    align-items:center;
  }
  #openingModal:not(.stored-item-preview) {
    max-height:calc(100dvh - 2 * max(env(safe-area-inset-top), env(safe-area-inset-bottom)));
    border-radius:18px;
  }
}
