/* =====================================================================
   « Aero Phone » — Windows Phone start screen with a Frutiger Aero skin
   Active only when <body class="phone"> (set by phone.js on real phones)
   ===================================================================== */
#phone[hidden], body:not(.phone) #phone { display: none; }
body.phone { overflow: hidden; }
body.phone .screen .desk-icons, body.phone .sidebar, body.phone .taskbar, body.phone .startmenu, body.phone .toast { display: none !important; }
body.phone .bubbles img:nth-child(n+4) { display: none; }
body.phone:not(.ph-app) .win { display: none !important; }

.ph { position: fixed; inset: 0; z-index: 2000; color: #fff; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(0, 20, 50, .55) 0, rgba(0, 20, 50, .15) 220px, rgba(0, 0, 0, .05) 60%, rgba(0, 10, 30, .45) 100%); }
.ph-status { height: calc(26px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; display: flex; justify-content: space-between; align-items: center; font: 600 13px var(--ui); text-shadow: 0 1px 2px rgba(0,0,0,.5); flex: none; }
.ph-net { width: 18px; height: 10px; background: linear-gradient(90deg, #fff 0 3px, transparent 3px 5px, #fff 5px 8px, transparent 8px 10px, #fff 10px 13px, transparent 13px 15px, #fff 15px 18px); clip-path: polygon(0 100%, 100% 0, 100% 100%); opacity: .5; }
.ph-net.ok { opacity: 1; }
.ph-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 14px calc(84px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ph-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 14px; }
.ph-head h1 { margin: 0; font: 200 44px/1 var(--ui); letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(0,30,80,.55); }
.ph-me { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: #fff; font: 14px var(--ui); padding: 4px; }
.ph-me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 2px 8px rgba(0,0,0,.4); background: #fff; }
.ph-foot { text-align: center; font-size: 12px; opacity: .65; margin: 18px 0 0; }

/* ---------- tile grid (4 columns; s = 1x1, m = 2x2, w = 4x2) ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: calc((100vw - 28px - 3 * 8px) / 4); gap: 8px; grid-auto-flow: dense; }
@media (orientation: landscape) { .ph-grid { grid-template-columns: repeat(8, 1fr); grid-auto-rows: calc((100vw - 28px - 7 * 8px) / 8); } }
.tile { position: relative; overflow: hidden; border-radius: 7px; border: 1px solid rgba(255,255,255,.5); padding: 0; color: #fff; text-align: left; font: inherit;
  background: linear-gradient(160deg, var(--t1) 0%, var(--t2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -10px 24px -12px rgba(0,0,0,.35), 0 4px 12px rgba(0,20,60,.35);
  transition: transform .18s ease, filter .18s; transform-style: preserve-3d; -webkit-tap-highlight-color: transparent; }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48%; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.06)); border-radius: 6px 6px 40% 40% / 6px 6px 18px 18px; }
.tile::after { content: ""; position: absolute; right: -18%; bottom: -30%; width: 70%; aspect-ratio: 1; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), rgba(255,255,255,.05) 45%, rgba(255,255,255,0) 70%); border: 1px solid rgba(255,255,255,.18); }
.tile:active { filter: brightness(1.1); }
.t-s { grid-column: span 1; grid-row: span 1; } .t-m { grid-column: span 2; grid-row: span 2; } .t-w { grid-column: span 4; grid-row: span 2; }
.c-sky { --t1: #43b6f5; --t2: #0b5fb8; } .c-aqua { --t1: #3fd6e8; --t2: #0a7fa8; } .c-green { --t1: #6fdc5a; --t2: #1b8a2d; }
.c-night { --t1: #3d4a5c; --t2: #0c1118; } .c-violet { --t1: #b48cff; --t2: #5a2fb8; } .c-teal { --t1: #3be0c0; --t2: #0b8a76; }
.c-blue { --t1: #5aa8ff; --t2: #1452c4; } .c-orange { --t1: #ffb347; --t2: #d0620e; } .c-indigo { --t1: #8a8fff; --t2: #3b35b8; }
.c-pink { --t1: #ff8ccf; --t2: #c42e86; } .c-lime { --t1: #b8f05a; --t2: #4a9a12; } .c-lavender { --t1: #d2b8ff; --t2: #7a5cc4; } .c-steel { --t1: #9fb6cf; --t2: #45617f; }
.t-face { position: absolute; inset: 0; z-index: 1; padding: 10px 10px 24px; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  backface-visibility: hidden; transition: transform .6s cubic-bezier(.4,.1,.2,1); text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.t-back { transform: rotateX(180deg); justify-content: center; }
.tile.flipped .t-front { transform: rotateX(-180deg); } .tile.flipped .t-back { transform: rotateX(0); }
.t-label { position: absolute; left: 8px; bottom: 5px; z-index: 3; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.5); max-width: calc(100% - 40px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-s .t-label { font-size: 10.5px; left: 6px; bottom: 4px; max-width: calc(100% - 10px); }
.t-count { position: absolute; right: 7px; top: 6px; z-index: 3; font: 300 22px/1 var(--ui); text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.t-s .t-count { font-size: 15px; right: 6px; top: 5px; }
.t-ico { width: 44%; max-width: 72px; aspect-ratio: 1; object-fit: contain; margin: auto; filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)); }
.t-s .t-ico { width: 56%; margin: 8% auto auto 10%; }
.t-big { font: 200 40px/1 var(--ui); } .t-big small { font-size: .5em; }
.t-w .t-big { font-size: 46px; }
.t-sub { font-size: 12.5px; opacity: .92; } .cap { text-transform: capitalize; }
.t-inline { display: flex; align-items: center; gap: 4px; }
.t-row { font-size: 14px; } .t-row.big { font: 300 20px var(--ui); }
.t-wi { width: 52px; height: 52px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.t-wi.sm { width: 22px; height: 22px; }
.t-bar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.3); margin: 6px 0 2px; overflow: hidden; }
.t-bar i { display: block; height: 100%; background: linear-gradient(#fff, #c9f7ff); border-radius: 3px; }
.t-art { position: absolute; left: 0; top: 0; bottom: 0; width: 48%; object-fit: cover; border-right: 1px solid rgba(255,255,255,.3); }
.t-np { position: absolute; left: 52%; right: 52px; top: 12px; display: flex; flex-direction: column; gap: 2px; }
.t-np b { font: 400 16px var(--ui); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-play { position: absolute; right: 10px; top: 50%; transform: translateY(-60%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; z-index: 4;
  background: radial-gradient(circle at 50% 28%, #e0f4ff, #5ab4f2 38%, #0e58ad 70%); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 0 12px rgba(60,160,255,.6); }

/* ---------- app bar (WP) ---------- */
.ph-appbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 50%, rgba(0,0,0,.35) 51%, rgba(0,0,0,.55)), rgba(var(--tb-tint, 10, 18, 28), .6);
  border-top: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }
body.ph-app .ph-appbar { display: none; }
.ph-appbar button { flex: 1; max-width: 90px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #fff; font: 11px var(--ui); padding: 2px 0; }
.pa-ico { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); display: grid; place-items: center; box-shadow: 0 0 8px rgba(120,200,255,.35); }
.pa-ico svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pa-ico.off svg path:last-child { stroke: #ff8a8a; }
.ph-appbar button:active .pa-ico { background: rgba(255,255,255,.3); }

/* ---------- full-screen apps (the desktop windows, phone-dressed) ---------- */
body.phone.ph-app #phone .ph-scroll, body.phone.ph-app #phone .ph-status { visibility: hidden; }
body.phone .win { position: fixed !important; inset: 0 !important; width: auto !important; height: auto !important; z-index: 2500 !important; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border-radius: 0; border: 0; min-width: 0;
  animation: ph-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes ph-in { from { opacity: 0; transform: perspective(900px) rotateY(-18deg) translateX(30px); } }
body.phone .win .win-title { height: 50px !important; padding: 0 8px; gap: 10px; }
body.phone .win .win-title h2:not(.sr), body.phone .win .caption, body.phone .win .grip, body.phone .win .win-ico { display: none; }
body.phone .win .ex-nav { padding: 0 8px; }
body.phone .win .ex-nav .navbtn { display: none; }
body.phone .win .win-client { border-left: 0; border-right: 0; min-height: 0; flex: 1; }
body.phone .win.collapsed .win-client { display: flex; }
.ph-back, .ph-wtitle { display: none; }
body.phone .ph-back { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); background: rgba(255,255,255,.12); padding: 0; box-shadow: 0 0 10px rgba(120,200,255,.4); }
.ph-back::before { content: ""; width: 10px; height: 10px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateX(2px) rotate(45deg); }
body.phone .ph-wtitle { display: block; font: 300 24px var(--ui); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone.light-glass .ph-wtitle { color: #10243c; text-shadow: 0 0 6px #fff; }
body.phone .win .tabpage { overflow: auto; }
body.phone #w-wmp .win-client { height: auto; }
body.phone .game-win .win-client { height: auto; }

/* weather sheet */
.ph-sheet { position: fixed; inset: 0; z-index: 2600; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: rgba(var(--aero), .55); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); animation: ph-in .28s cubic-bezier(.2,.8,.2,1); }
.ph-sheet[hidden] { display: none; }
.ph-sheet-h { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 12px; flex: none; }
.ph-sheet-h h2 { margin: 0; font: 300 26px var(--ui); }
.ph-sheet-b { flex: 1; overflow: auto; padding: 4px 14px 20px; display: grid; gap: 14px; align-content: start; }
.ph-sheet-b .g-weather { cursor: default; padding: 14px; }
.ph-sheet-b .gw-ico { width: 84px; height: 84px; }
.ph-sheet-b .gw-temp b { font-size: 48px; }
.ph-sheet-b .gw-days { font-size: 13px; } .ph-sheet-b .gw-days .wi { width: 36px; height: 36px; }
