/* Expérience Paranormal — adaptation mobile, iPhone et tablette complète */
:root{--ep-mobile-gap:clamp(10px,3vw,18px);--ep-mobile-pad:clamp(12px,4vw,24px)}
*,*::before,*::after{box-sizing:border-box}
html{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;min-width:0;overflow-x:hidden;margin:0;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
img,video,canvas,svg,iframe,audio{max-width:100%;height:auto}
input,select,textarea,button{font:inherit;max-width:100%}
input,select,textarea{font-size:16px!important}
pre,code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
:is(.wrap,.container,.page,.content,.main,.main-content,.dashboard,.admin-content,.community-container){width:min(100%,1280px);max-width:100%;min-width:0;margin-left:auto;margin-right:auto}
:is(.card,.panel,.box,section,article,.profile-card,.member-card,.offer-card,.game-card,.story-card,.music-card){min-width:0;max-width:100%;overflow-wrap:anywhere}
:is(h1,h2,h3,h4,p,li,label,a,span){overflow-wrap:anywhere}
.table-wrap,.table-responsive{width:100%;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
table{max-width:100%}

@media (max-width:1024px){
  body{background-attachment:scroll!important}
  :is(.wrap,.container,.page,.content,.main,.main-content,.dashboard,.admin-content,.community-container){padding-left:var(--ep-mobile-pad)!important;padding-right:var(--ep-mobile-pad)!important}
  :is(.grid,.grid-2,.grid-3,.two-col,.three-col,.columns,.cards-grid,.profile-grid,.shop-grid,.games-grid,.stories-grid){min-width:0}
  .site-header{position:sticky!important;top:0!important;z-index:10000!important}
  .site-header .header-inner{max-width:100%!important}
  .site-footer{padding-bottom:calc(16px + env(safe-area-inset-bottom))!important}
  .ep-panel-universal{right:10px!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;top:auto!important}
}

@media (max-width:820px){
  :is(.grid-2,.grid-3,.two-col,.three-col,.columns,.cards-grid,.profile-grid,.shop-grid,.games-grid,.stories-grid){grid-template-columns:minmax(0,1fr)!important}
  :is(.hero,.hero-content,.profile-header,.member-header,.shop-header){display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:var(--ep-mobile-gap)!important}
  :is(.hero-actions,.actions,.button-group,.btn-group,.toolbar,.filters){display:flex!important;flex-wrap:wrap!important;gap:10px!important;align-items:stretch!important}
  :is(.hero-actions,.actions,.button-group,.btn-group,.toolbar,.filters)>*{min-width:0}
  .stats{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .stat-card{width:100%!important;min-width:0!important}
  .table-wrap{border-radius:12px;overflow:auto!important}
  .table-wrap>table{width:max-content;min-width:100%}
  th,td{white-space:nowrap}
  td.actions,.actions-cell{white-space:normal!important;min-width:220px}
  form{max-width:100%}
  form[style*="display:grid"],.form-grid{grid-template-columns:minmax(0,1fr)!important}
  form[style*="display:flex"]{flex-wrap:wrap!important}
  form input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=color]),form select,form textarea{width:100%!important;min-width:0!important}
  [style*="grid-template-columns"]{max-width:100%}
  .modal,.popup,.dialog,[id$="-modal"],[id$="-popup"]{max-width:100vw!important}
  .modal-content,.popup-content,.dialog-content,[id$="-modal"] .box,[id$="-popup"] .box{width:calc(100vw - 28px)!important;max-width:none!important;max-height:calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overflow:auto!important;margin:calc(14px + env(safe-area-inset-top)) auto!important}
}

@media (max-width:600px){
  :root{--ep-mobile-pad:14px}
  .stats{grid-template-columns:minmax(0,1fr)!important}
  h1{font-size:clamp(1.7rem,8vw,2.5rem)!important;line-height:1.08!important}
  h2{font-size:clamp(1.35rem,6vw,2rem)!important}
  .card,.panel,.box,section,article{padding:14px!important;border-radius:14px!important}
  .btn,a.btn,button,input[type=submit]{min-height:44px;max-width:100%;white-space:normal;text-align:center}
  :is(.hero-actions,.button-group,.btn-group,.toolbar) .btn{flex:1 1 150px!important}
  .filters{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  .filters>*{width:100%!important;margin:0!important}
  .pagination{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:7px!important}
  .pagination a,.pagination span{min-width:42px;min-height:42px;display:inline-flex;align-items:center;justify-content:center}
  .ep-panel-universal{min-width:50px!important;width:auto!important;padding:10px 12px!important;font-size:0!important}
  .ep-panel-universal::first-letter{font-size:18px!important}
}

/* Panel admin : utilisable sans zoom horizontal forcé */
@media (max-width:1024px){
  body.admin-page,.admin-page body{min-width:0!important}
  .wrap{margin-top:18px!important}
  .wrap>h1{text-align:center}
  .grid-2{grid-template-columns:minmax(0,1fr)!important}
  .card[style*="max-width:1240px"]{margin-left:var(--ep-mobile-pad)!important;margin-right:var(--ep-mobile-pad)!important}
  .card>div[style*="grid-template-columns:minmax(120px,220px) 1fr"]{grid-template-columns:minmax(0,1fr)!important}
  .card>div[style*="grid-template-columns:minmax(120px,220px) 1fr"] img{height:auto!important;max-height:160px!important}
  .table-wrap.table-members{max-height:68svh!important;overflow:auto!important}
  .table-wrap table{font-size:13px!important}
  .table-wrap th,.table-wrap td{padding:9px 10px!important}
  .actions form{display:inline-flex!important;vertical-align:top;margin:0 6px 7px 0!important}
  .actions .btn,.actions button{min-height:40px}
  #links-list,#links-table-wrap{overflow:auto!important;-webkit-overflow-scrolling:touch}
  #links-list table,#links-table-wrap table{width:max-content!important;min-width:100%!important}
  body>a[href="/suggestions_admin.php"]{position:static!important;display:flex!important;width:max-content!important;max-width:calc(100% - 28px)!important;margin:12px auto!important;justify-content:center!important}
}
@media (max-width:600px){
  .table-wrap.table-members{max-height:none!important}
  .actions{min-width:180px!important}
  .actions form{display:flex!important;width:100%!important;margin:0 0 7px!important}
  .actions .btn,.actions button{width:100%!important}
  .tag-input-wrap{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important}
  .tag-input-wrap input[type=text]{grid-column:1/-1}
}

/* Boutique, communauté, profils et médias */
@media (max-width:820px){
  :is(.comparison-table,.grade-compare,.pricing-table){display:block!important;overflow:auto!important;-webkit-overflow-scrolling:touch}
  :is(.comparison-table,.grade-compare,.pricing-table) table{width:max-content!important;min-width:100%!important}
  :is(.chat-layout,.voice-layout,.community-layout,.messages-layout,.friends-layout){grid-template-columns:minmax(0,1fr)!important}
  :is(.chat-sidebar,.voice-sidebar,.messages-sidebar){position:static!important;width:100%!important;max-height:none!important}
  :is(.profile-banner,.cover,.banner){min-height:150px!important;height:auto!important}
  :is(.avatar,.profile-avatar){max-width:120px!important;max-height:120px!important}
  audio,video{width:100%!important}
}

/* Adaptation spécifique de chaque thème : identité conservée, géométrie mobile optimisée */
@media (max-width:820px){
  html.ep-theme-vip-forest :is(.card,.panel,section,article){border-radius:18px 8px 18px 8px!important;border-left-width:4px!important}
  html.ep-theme-vip-forest .site-header{background:linear-gradient(180deg,rgba(5,26,13,.98),rgba(8,20,12,.98))!important}

  html.ep-theme-vip-victorian :is(.card,.panel,section,article){border-radius:8px!important;box-shadow:inset 0 0 0 1px rgba(211,166,112,.18),0 8px 20px rgba(0,0,0,.28)!important}
  html.ep-theme-vip-victorian .site-header{border-bottom:3px double rgba(211,166,112,.55)!important}

  html.ep-theme-vip-ectoplasm :is(.card,.panel,section,article){border-radius:24px!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  html.ep-theme-vip-ectoplasm .site-header{background:rgba(5,43,35,.98)!important}

  html.ep-theme-plus-neon :is(.card,.panel,section,article){clip-path:none!important;border-radius:4px!important;border-left:3px solid #ff3bd4!important}
  html.ep-theme-plus-neon .site-header{box-shadow:0 2px 0 #32f5ff!important}

  html.ep-theme-plus-arctic :is(.card,.panel,section,article){border-radius:16px 16px 6px 6px!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  html.ep-theme-plus-arctic .site-header{background:rgba(10,43,67,.98)!important}

  html.ep-theme-plus-cathedral :is(.card,.panel,section,article){border-radius:28px 28px 8px 8px!important;border-top-width:3px!important}
  html.ep-theme-plus-cathedral .site-header{border-bottom:2px solid rgba(190,109,255,.45)!important}

  html.ep-theme-mvp-abyss :is(.card,.panel,section,article){border-radius:0!important;border-left:2px solid #caa85e!important;box-shadow:0 8px 18px rgba(0,0,0,.45)!important}
  html.ep-theme-mvp-abyss .site-header{background:#000!important;border-bottom:1px solid #caa85e!important}

  html.ep-theme-mvp-eclipse :is(.card,.panel,section,article){border-radius:22px 6px 22px 6px!important;box-shadow:0 8px 22px rgba(92,20,0,.32)!important}
  html.ep-theme-mvp-eclipse .site-header{background:linear-gradient(90deg,#140300,#351006)!important}

  html.ep-theme-mvp-signal :is(.card,.panel,section,article){border-radius:0!important;border:1px dashed rgba(82,255,137,.55)!important;box-shadow:none!important}
  html.ep-theme-mvp-signal .site-header{background:#010704!important;border-bottom:1px dashed #52ff89!important}

  html.ep-theme-mvp-celestial :is(.card,.panel,section,article){border-radius:22px!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:0 10px 24px rgba(70,73,140,.14)!important}
  html.ep-theme-mvp-celestial .site-header{background:rgba(244,246,255,.98)!important}
}

@media (orientation:landscape) and (max-height:520px){
  .site-header{position:relative!important}
  .modal-content,.popup-content,[id$="-modal"] .box,[id$="-popup"] .box{max-height:90vh!important;margin:5vh auto!important}
}
