/* Accueil, verrouillage et cadre de téléphone (ordinateur). */
.phone {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; overflow: hidden;
  color: #fff; background: #1a1412 var(--wall-home) center / cover no-repeat; -webkit-user-select: none; user-select: none;
}
.phone.lock { background-image: var(--wall-lock); }
.phone > * { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
.statusbar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 12px) 28px 4px;
  font-size: 15px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.sb-right { display: flex; align-items: center; gap: 7px; }
.sb-signal { display: flex; align-items: flex-end; gap: 2px; height: 11px; }
.sb-signal i { width: 3px; background: currentColor; border-radius: 1px; }
.sb-signal i:nth-child(1) { height: 4px; } .sb-signal i:nth-child(2) { height: 6px; }
.sb-signal i:nth-child(3) { height: 8px; } .sb-signal i:nth-child(4) { height: 11px; }
.sb-wifi { width: 17px; height: 13px; display: inline-flex; }
.sb-battery { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 15px;
  border-radius: 4px; background: rgba(128,128,128,.4); overflow: hidden; font-size: 11px; }
.sb-level { position: absolute; left: 0; top: 0; bottom: 0; background: currentColor; }
.sb-battery b { position: relative; color: #000; font-weight: 700; mix-blend-mode: normal; }

.home-pages { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.home-pages::-webkit-scrollbar { display: none; }
.home-page { flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: min-content; gap: 20px 8px; padding: 18px 20px; align-content: start; }
.home.enter .home-page > * { animation: icons-in .42s var(--ease) both; }
@keyframes icons-in { from { transform: scale(1.12); opacity: 0; } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; color: #fff; }
.tile:active .app-icon { transform: scale(.9); filter: brightness(.8); }
.app-icon { position: relative; width: min(16.5vw, 66px); aspect-ratio: 1; transition: transform .14s, filter .14s; }
.app-icon img { width: 100%; height: 100%; border-radius: 23%; display: block; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.app-fallback { width: 100%; height: 100%; border-radius: 23%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #8e8e93, #5f5f64); font-size: 26px; font-weight: 700; }
.app-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #ff3b30; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.tile-label { font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon.folder { border-radius: 23%; background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); padding: 13%; }
.folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9%; width: 100%; height: 100%; align-content: start; }
.folder-grid img { width: 100%; aspect-ratio: 1; border-radius: 22%; box-shadow: none; }
.cal-icon { width: 100%; height: 100%; border-radius: 23%; background: #fff; color: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0,0,0,.25); line-height: 1; }
.cal-icon small { color: #ff3b30; font-size: min(2.8vw, 11px); font-weight: 600; }
.cal-icon b { font-size: min(9vw, 34px); font-weight: 400; margin-top: 2px; }

.widget-cell { grid-column: span 2; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.widget { width: 100%; aspect-ratio: 1; border-radius: 22px; padding: 14px 16px; text-align: left; color: #fff;
  display: flex; flex-direction: column; box-shadow: 0 6px 18px rgba(0,0,0,.25); overflow: hidden; }
.widget:active { transform: scale(.97); }
.widget.weather { background: linear-gradient(180deg, #2f6fd1, #4d8fe0); }
.w-city { font-weight: 700; font-size: 16px; }
.w-big { font-size: 40px; font-weight: 600; margin-top: 2px; }
.w-small { margin-top: auto; font-size: 13px; opacity: .9; }
.widget.calendar { background: rgba(28,28,30,.92); padding: 12px 10px; }
.wc-month { color: #ff453a; font-size: 12px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.wc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; font-size: 11px; text-align: center; flex: 1; align-content: space-between; }
.wc-grid b { color: #8e8e93; font-weight: 600; font-size: 10px; }
.wc-grid .today { background: #ff3b30; border-radius: 50%; font-weight: 700; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }

.page-dots { display: flex; justify-content: center; gap: 7px; padding: 6px 0 10px; min-height: 22px; }
.page-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s; }
.page-dots i.on { background: #fff; }
.dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; padding: 14px 10px;
  margin-bottom: calc(var(--safe-bottom) + 26px); width: calc(100% - 24px) !important; border-radius: 32px;
  background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%); }

.folder-overlay { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: rgba(0,0,0,.2); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); color: #fff; animation: folder-in .26s var(--ease) both; }
@keyframes folder-in { from { opacity: 0; transform: scale(.8); } }
.folder-title { font-size: 30px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.folder-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; padding: 24px 20px; width: min(86vw, 360px);
  border-radius: 34px; background: rgba(255,255,255,.18); }

.lock-date { text-align: center; font-size: 19px; font-weight: 600; margin-top: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lock-date::first-letter { text-transform: uppercase; }
.lock-time { text-align: center; font-size: min(26vw, 108px); font-weight: 600; line-height: 1; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.lock-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 34px calc(var(--safe-bottom) + 34px); }
.lock-btn { width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  display: flex; align-items: center; justify-content: center; }
.lock-btn svg { width: 22px; height: 22px; }
.lock-notifs { font-size: 14px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.phone.lock.leaving { animation: unlock .34s var(--ease) both; }
@keyframes unlock { to { transform: translateY(-100%); opacity: .6; } }

/* --- Cadre de téléphone sur ordinateur --------------------------------------------------- */
#frame-status, #island { display: none; }
body.framed { overflow: hidden; height: 100vh; background: #0b0b0d var(--wall-home) center / cover no-repeat; }
body.framed::before { content: ""; position: fixed; inset: 0; z-index: 0; background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(34px) saturate(140%); backdrop-filter: blur(34px) saturate(140%); }
body.framed #device {
  --frame-h: min(94vh, 900px);
  position: relative; z-index: 1; height: var(--frame-h); aspect-ratio: 393 / 852; margin: calc((100vh - var(--frame-h)) / 2) auto 0;
  padding: 11px; border-radius: 60px; background: #050505;
  box-shadow: 0 0 0 4px var(--accent, #ed5700), 0 0 0 6px rgba(0,0,0,.6), 0 30px 90px rgba(0,0,0,.65);
}
body.framed #screen { position: relative; height: 100%; border-radius: 49px; overflow: hidden; background: var(--bg);
  transform: translateZ(0); --safe-top: 50px; --safe-bottom: 14px; }
body.framed #app { height: 100%; max-width: none; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; }
body.framed #app::-webkit-scrollbar { display: none; }
body.framed #app.boot { display: flex; }
body.framed #island { display: block; position: absolute; top: 11px; left: 50%; transform: translateX(-50%); z-index: 60;
  width: 31%; height: 33px; border-radius: 20px; background: #000; }
body.framed #frame-status { display: flex; position: absolute; top: 0; left: 0; right: 0; z-index: 55; height: 54px; padding: 4px 30px 0;
  align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; color: var(--text); pointer-events: none; }
body.framed #device.on-phone #frame-status, body.framed #device.dark-chrome #frame-status { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
body.framed .phone .statusbar { visibility: hidden; }
body.framed .phone > * { max-width: none; }
body.framed .home-indicator { bottom: 8px; }
body.framed .app-icon { width: calc(var(--frame-h) * 0.072); }
body.framed .lock-time { font-size: calc(var(--frame-h) * 0.11); }
body.framed .home-page { gap: calc(var(--frame-h) * 0.016) 6px; padding: 6px 16px; }
body.framed .widget { border-radius: 20px; }
body.framed .tile-label { font-size: 11px; }
body.framed .dock { padding: 10px 8px; margin-bottom: 22px; }
body.framed .sheet { top: 46px; }
body.framed .calc-out { font-size: calc(var(--frame-h) * 0.1); }
body.framed .ck { font-size: calc(var(--frame-h) * 0.036); }
body.framed .keypad { grid-template-columns: repeat(3, calc(var(--frame-h) * 0.085)); gap: calc(var(--frame-h) * 0.018) calc(var(--frame-h) * 0.03); }
body.framed .key { width: calc(var(--frame-h) * 0.085); height: calc(var(--frame-h) * 0.085); font-size: calc(var(--frame-h) * 0.034); }
/* Chiffre de la batterie lisible sur le niveau (noir sur blanc ou blanc sur noir, comme en jeu) */
.sb-battery b { color: var(--bg); }
.phone .sb-battery b, #device.on-phone .sb-battery b, #device.dark-chrome .sb-battery b, body.dark-chrome .sb-battery b { color: #000; }
