/* La mise en scène iPad : la TV seule (« solo »), ou la TV et le téléphone côte à côte (« duo »). */
html, body { margin: 0; height: 100%; background: #0E0B09; overflow: hidden; overscroll-behavior: none; }
body { font-family: 'Archivo', system-ui, sans-serif; color: #F6ECDC; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; }

#scene { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 36px;
  padding: max(24px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  background: radial-gradient(1200px 800px at 30% 20%, #241B14, #0E0B09 70%);
  transition: padding .5s cubic-bezier(.2,.7,.2,1); }
#tv-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; transition: flex .5s; }
#tv-bezel { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100% - 40px); margin: 0 auto; padding: 10px; box-sizing: border-box;
  background: #050505; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); transition: padding .5s, border-radius .5s; }
#tv { position: absolute; inset: 10px; border-radius: 4px; transition: inset .5s, border-radius .5s; }
.cap { margin: 14px 0 0; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(246,236,220,.5); transition: opacity .4s; }

#phone-col { flex: none; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity .45s, transform .5s cubic-bezier(.2,.7,.2,1), width .5s; }
#phone-fit { position: relative; }
#phone { position: absolute; left: 0; top: 0; width: 390px; height: 844px; transform-origin: 0 0; box-sizing: border-box; padding: 12px;
  background: #121212; border-radius: 58px; box-shadow: 0 30px 80px rgba(0,0,0,.65), inset 0 0 0 2px #2b2b2b, 0 0 0 1px rgba(255,255,255,.08); }
#phone-screen { position: relative; width: 100%; height: 100%; border-radius: 46px; overflow: hidden; background: #FBF8F3; }
#phone-screen .ed { --top: 34px; }
#phone-screen .e-top { padding-top: 46px; }
#phone-screen .e-sh-head { padding-top: 46px; }
#phone-screen .e-tabs { padding-bottom: 16px; }
#phone-screen::before { content: ''; position: absolute; z-index: 20; left: 50%; top: 11px; width: 116px; height: 32px; margin-left: -58px; border-radius: 16px; background: #000; }

/* solo : la TV plein écran, sans cadre, comme au snack */
body.solo #scene { padding: 0; gap: 0; }
body.solo #tv-col { height: 100%; }
body.solo #tv-bezel { max-height: 100%; padding: 0; border-radius: 0; box-shadow: none; background: #000; height: 100%; aspect-ratio: auto; }
body.solo #tv { inset: 0; border-radius: 0; }
body.solo .cap { display: none; }
body.solo #phone-col { width: 0; opacity: 0; transform: translateX(60px); pointer-events: none; overflow: hidden; }

/* iPad en portrait : la TV en haut, le téléphone en dessous */
@media (orientation: portrait) {
  body:not(.solo) #scene { flex-direction: column; gap: 18px; }
  body:not(.solo) #tv-col { flex: none; width: 100%; height: auto; }
  body:not(.solo) #phone-col { flex: 1; min-height: 0; width: 100%; }
}

/* les commandes de la démo : visibles au toucher, puis s'effacent */
#ctl { position: fixed; z-index: 30; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); display: flex; gap: 10px;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .3s, transform .3s; }
#ctl.on { opacity: 1; transform: none; pointer-events: auto; }
#ctl button { height: 52px; padding: 0 20px; border-radius: 26px; border: 0; background: rgba(20,16,13,.86); color: #F6ECDC; font-weight: 700; font-size: 16px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 30px rgba(0,0,0,.4); }
#ctl #b-phone { background: #C8261C; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
body:not(.solo) #ctl { left: max(20px, env(safe-area-inset-left)); right: auto; }
