/* ===== Control Centre, Spotlight, icon menu, jiggle, rotate guard ===== */
#dim { position: absolute; inset: 0; z-index: 98; background: #000; opacity: 0; pointer-events: none; }

#cc { position: absolute; inset: 0; z-index: 75; visibility: hidden; touch-action: none; }
.cc-bg { position: absolute; inset: 0; background: rgba(20,12,36,.35); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); opacity: 0; }
.cc-grid { position: absolute; top: calc(var(--sat) + 44px); left: 0; right: 0; padding: 0 calc(var(--W) * .07);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--W) * .038); transform-origin: 20% 0; will-change: transform, opacity; }
.cc-mod { position: relative; border-radius: 26px; background: rgba(80,70,100,.42); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.22); color: #fff; transition: transform .25s ease-out, background .2s, color .2s; }
.cc-mod.pressed { transform: scale(.94); transition: transform .08s; }
.cc-conn { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 8%; }
.cc-r { width: 76%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; transition: background .2s, transform .2s; }
.cc-r svg { width: 48%; height: 48%; }
.cc-r.pressed { transform: scale(.9); }
.cc-r[data-k="air"].on { background: #ff9f0a; } .cc-r[data-k="cell"].on { background: #30d158; }
.cc-r[data-k="wifi"].on, .cc-r[data-k="bt"].on { background: #0a84ff; }
.cc-music { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; padding: 14% 12% 10%; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; }
.mu-art { width: 34%; aspect-ratio: 1; border-radius: 10px; background: rgba(255,255,255,.14); }
.cc-music.on .mu-art { background: linear-gradient(135deg, #f0c808, #6f2bd9); }
.mu-t { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); align-self: end; line-height: 1.3; }
.mu-c { display: flex; justify-content: space-between; align-items: center; direction: ltr; }
.mu-b { font-size: 15px; color: rgba(255,255,255,.85); width: 34px; height: 34px; display: grid; place-items: center; }
.mu-b svg { width: 26px; height: 26px; }
.cc-sq { aspect-ratio: 1; display: grid; place-items: center; }
.cc-sq svg { width: 40%; height: 40%; }
.cc-rot.on { background: #fff; color: #ff375f; }
.cc-flash.on { background: #fff; color: #1c1c1e; }
.cc-slider { grid-row: span 2; overflow: hidden; display: block; }
.cc-slider .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: #fff; transform-origin: bottom; transform: scaleY(.6); }
.cc-slider .si { position: absolute; left: 50%; bottom: 14%; width: 30%; transform: translateX(-50%); color: #8e8e93; mix-blend-mode: normal; }
.cc-slider.active { transform: scale(1.04); }
.cc-focus { grid-column: span 2; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: calc((var(--W) * .86 - var(--W) * .038 * 3) / 4); font-size: 15px; font-weight: 600; text-align: start; }
.fc-i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.fc-i svg { width: 18px; height: 18px; }
.cc-focus.on .fc-i { background: #fff; color: #5e5ce6; }
.cc-focus.on { background: rgba(94,92,230,.55); }
.rec-o { width: 46%; aspect-ratio: 1; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; }
.rec-i { width: 62%; aspect-ratio: 1; border-radius: 50%; background: #fff; transition: background .2s; }
.cc-rec.on .rec-i { background: #ff3b30; }
.cc-rec.counting .rec-o { opacity: 0; }
.cc-rec.counting::after { content: attr(data-count); position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 600; }
.rec-pill { position: absolute; top: calc(var(--sat) + 4px); left: 50%; transform: translateX(-50%); z-index: 72; display: flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 14px; background: #ff3b30; color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
html.desktop .rec-pill { top: 16px; }

#spot { position: absolute; inset: 0; z-index: 58; visibility: hidden; touch-action: none; }
/* the blur is fixed and only fades: animating filter: blur() on the whole home redraws it every frame */
.sp-bg { position: absolute; inset: 0; background: rgba(10,6,20,.38); opacity: 0; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sp-top { position: absolute; top: calc(var(--sat) + 10px); left: 14px; right: 14px; display: flex; align-items: center; gap: 10px; }
.sp-field { flex: 1; height: 40px; border-radius: 13px; display: flex; align-items: center; gap: 7px; padding: 0 11px; color: rgba(235,235,245,.7);
  background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.sp-field .ico { width: 18px; height: 18px; }
.sp-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: 17px var(--font); -webkit-appearance: none; appearance: none; }
.sp-field input::placeholder { color: rgba(235,235,245,.7); }
.sp-field input::-webkit-search-cancel-button { display: none; }
.sp-cancel { font-size: 17px; color: #fff; }
.sp-cancel.pressed { opacity: .5; }
.sp-body { position: absolute; top: calc(var(--sat) + 66px); left: 0; right: 0; bottom: 0; padding: 0 18px; overflow-y: auto; touch-action: pan-y; }
.sp-h { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.85); margin: 14px 4px 10px; }
.sp-apps { display: grid; grid-template-columns: repeat(4, 1fr); justify-items: center; padding: 12px 0; border-radius: 22px; background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.sp-list { border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.sp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.sp-row + .sp-row { border-top: .5px solid rgba(255,255,255,.12); }
.sp-row img { width: 34px; height: 34px; border-radius: 22%; }
.sp-row .ico { width: 22px; height: 22px; color: rgba(255,255,255,.8); margin: 0 6px; }
.sp-row span { display: grid; gap: 2px; min-width: 0; }
.sp-row b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row small { font-size: 13px; color: rgba(235,235,245,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row.pressed { background: rgba(255,255,255,.08); }

.im-layer { position: absolute; inset: 0; z-index: 85; }
.im-bg { position: absolute; inset: 0; background: rgba(0,0,0,.25); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; }
.im-icon { position: absolute; border-radius: 23%; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.35); will-change: transform; }
.im-icon img { width: 100%; height: 100%; display: block; }
.im-menu { position: absolute; width: 250px; border-radius: 16px; overflow: hidden; background: rgba(40,36,52,.82); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 16px 50px rgba(0,0,0,.4); will-change: transform, opacity; }
.im-menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; height: 46px; padding: 0 16px; font-size: 16px; color: #fff; }
.im-menu button + button { border-top: .5px solid rgba(255,255,255,.12); }
.im-menu button.danger { color: #ff453a; }
.im-menu button .ico { width: 19px; height: 19px; }
.im-menu button.pressed { background: rgba(255,255,255,.1); }
.app-icon.menu-src .img { visibility: hidden; }

body.jiggle #home .app-icon .img { animation: jiggle .26s ease-in-out infinite alternate; }
@keyframes jiggle { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.jg-done { position: absolute; top: max(4px, calc(var(--sat) - 28px)); left: 18px; z-index: 82; height: 32px; padding: 0 16px; border-radius: 16px; font-size: 15px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.jg-done.pressed { transform: scale(.94); }

#rotate-guard { display: none; }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  #rotate-guard { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; justify-items: center; gap: 8px; background: #0b0614; color: #fff; text-align: center; font-family: var(--font); }
  #rotate-guard b { font-size: 20px; } #rotate-guard span { font-size: 14px; color: rgba(255,255,255,.6); }
  .rg-phone { width: 34px; height: 60px; border: 3px solid #fff; border-radius: 9px; margin-bottom: 8px; animation: rg 1.8s ease-in-out infinite; }
  @keyframes rg { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0); } }
}
@media (prefers-reduced-motion: reduce) { body.jiggle #home .app-icon .img { animation: none; } }
