/* =============================================================
   Dani's Templates — shell
   Control panel, modals and onboarding. Layer B, outside the stage.
   Shared by every simulator. Edit here and both change together.
   ============================================================= */

/* a simulator fills the window; the homepage does not, so this lives here */
body{overflow:hidden}

/* ============================================================
   LAYER B — simulator chrome
   ============================================================ */
#chrome{transition:opacity .2s ease}
#chrome.hidden{pointer-events:none}
#chrome.hidden #hint{opacity:0}

/* the one thing that stays behind when the menu bar is hidden too */
#reveal{
  position:fixed; left:20px; bottom:20px; z-index:501;
  width:34px; height:34px; border-radius:50%; display:none; place-items:center;
  background:var(--panel); border:1px solid var(--panel-line); color:var(--panel-ink-dim);
  box-shadow:0 6px 18px rgba(20,16,24,.20); opacity:.42; transition:opacity .2s;
}
#reveal.on{display:grid}
#reveal:hover{opacity:1; color:var(--panel-ink)}

/* ============================================================
   Control panel, in the language of iOS Control Centre:
   grey translucent means off, solid white means on.
   ============================================================ */
#panel{
  /* Control Centre convention: off is a quiet tinted circle with a dark glyph,
     on is a solid high-contrast fill. Local tokens so the panel can follow the
     Appearance switch rather than the viewer's own OS theme. */
  --off:#e8e6ec;
  --on:#ffffff;
  --ink-off:#9c99a5;
  --ink-on:#3a383f;
  --p-ink:#26242a;
  --p-dim:#9a97a2;
  --p-sel:#5a5860;
  --p-card:rgba(120,118,130,.085);
  --p-line:rgba(30,26,38,.07);
  --lift:0 1px 2px rgba(20,18,24,.10), 0 0 0 .5px rgba(30,26,38,.06);
  --p-bg:rgba(250,250,252,.90);
  --p-edge:rgba(255,255,255,.92);
  position:fixed; left:20px; top:60px; z-index:500; width:300px;
  padding:15px; border-radius:28px;
  background:var(--p-bg);
  backdrop-filter:blur(26px) saturate(180%); -webkit-backdrop-filter:blur(26px) saturate(180%);
  border:.5px solid var(--p-edge);
  box-shadow:0 18px 44px rgba(24,20,30,.20);
  display:flex; flex-direction:column; gap:10px;
  font-family:var(--os);
  transform-origin:8px -18px;
  transition:transform .30s cubic-bezier(.18,1.3,.4,1), opacity .16s ease,
             background .22s ease, border-color .22s ease;
}
#panel[data-mode="dark"]{
  --off:rgba(150,150,162,.20);
  --on:#f4f2f7;
  --ink-off:#c9c6d0;
  --ink-on:#2f2d36;
  --p-ink:#f2f0f4;
  --p-dim:#8f8c98;
  --p-sel:#f4f2f7;
  --p-card:rgba(255,255,255,.06);
  --p-line:rgba(255,255,255,.09);
  --lift:0 1px 2px rgba(0,0,0,.22);
  --p-bg:rgba(40,38,46,.90);
  --p-edge:rgba(255,255,255,.10);
}
#chrome.hidden #panel{transform:scale(.68); opacity:0}
@media (prefers-reduced-motion: reduce){ #panel{transition:opacity .12s ease} }

.phead{display:flex; align-items:center; justify-content:space-between; padding:1px 5px 2px}
.ptitle{font-size:13px; font-weight:500; letter-spacing:-.005em; color:var(--p-ink)}
.pkao{font-size:11px; color:var(--p-dim); letter-spacing:.05em}

/* four round toggles, each with its name and its state beneath */
.circles{display:flex; justify-content:space-between; margin-bottom:32px}
.circ{
  width:58px; height:58px; border-radius:50%; background:var(--off);
  display:grid; place-items:center; color:var(--ink-off); position:relative;
  transition:background .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.circ.on{background:var(--on); color:var(--ink-on); box-shadow:var(--lift)}
.circ:active{transform:scale(.93)}
.circ i{
  position:absolute; top:calc(100% + 7px); left:50%; transform:translateX(-50%);
  font-style:normal; white-space:nowrap; text-align:center; line-height:1.28;
}
.circ i b{display:block; font-size:10px; font-weight:500; letter-spacing:-.005em; color:var(--p-ink)}
.circ i s{display:block; text-decoration:none; font-size:9.5px; font-weight:400; color:var(--p-dim); margin-top:.5px}

/* wallpaper card */
.card{
  background:var(--p-card); border-radius:22px; padding:13px 15px;
  display:flex; flex-direction:column; gap:9px; color:var(--p-ink);
}
.cardhead{font-size:12.5px; font-weight:500; display:flex; justify-content:space-between; align-items:baseline}
.cardhead span{font-weight:400; color:var(--p-dim); font-size:10.5px}
.walls{display:flex; gap:8px}
.walls button{
  flex:1; height:38px; border-radius:13px; border:1.5px solid transparent;
  background-size:cover; background-position:center; box-shadow:0 0 0 .5px var(--p-line) inset;
}
.walls button.on{border-color:var(--p-sel); box-shadow:none}
.walls .up{display:grid; place-items:center; background:var(--off); color:var(--ink-off)}

/* primary action */
.go{
  height:50px; border-radius:25px; background:var(--on); box-shadow:var(--lift);
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:500; letter-spacing:-.005em; color:var(--ink-on);
  transition:transform .12s ease, filter .12s ease;
}
.go:hover{opacity:.88}
.go:active{transform:scale(.98)}
.go[disabled]{opacity:.6}
.credit{
  text-align:center; font-size:10.5px; color:var(--p-dim); padding-top:1px;
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing:-.01em;
}
/* the kaomoji needs the system font, monospace has no glyphs for it */
.credit .kao{
  font-family:"Apple Color Emoji","Hiragino Sans","Segoe UI Symbol","Noto Sans Symbols 2",var(--os);
  letter-spacing:0; margin-left:6px; font-size:11px;
}
.credit a{color:inherit}

#hint{
  position:fixed; left:50%; top:14px; transform:translateX(-50%); z-index:400;
  background:var(--panel); border:1px solid var(--panel-line); border-radius:11px;
  padding:8px 14px; font-size:12.5px; color:var(--panel-ink-dim);
  box-shadow:0 10px 26px rgba(20,16,24,.16); display:flex; gap:8px; align-items:center;
  transition:opacity .2s ease;
}
#hint.gone{display:none}
.kbd{
  display:inline-grid; place-items:center; min-width:16px; height:16px; padding:0 4px;
  border-radius:4px; background:var(--panel-hover); font-size:10.5px; font-weight:600;
}

@media (max-width: 900px){
  #panel{left:8px; right:8px; top:auto; bottom:8px; width:auto; transform-origin:50% 100%}
  #hint{display:none}
}

/* ---- Layer C: modals ---- */
.modal{
  position:fixed; inset:0; z-index:900; display:none;
  place-items:center; background:rgba(14,12,17,.5); backdrop-filter:blur(6px); padding:20px;
}
.modal.on{display:grid}
.sheet{
  width:min(420px,100%); background:var(--panel); border-radius:16px; padding:22px;
  box-shadow:0 30px 70px rgba(0,0,0,.4); border:1px solid var(--panel-line);
  display:flex; flex-direction:column; gap:13px;
}
.sheet h2{margin:0; font-size:17px; font-weight:600; letter-spacing:-.015em; text-wrap:balance}
.sheet p{margin:0; font-size:13.5px; line-height:1.55; color:var(--panel-ink-dim)}
.sheet ol{margin:0; padding-left:19px; font-size:13px; line-height:1.7; color:var(--panel-ink-dim)}
.sheet ol b{color:var(--panel-ink); font-weight:600}
.sheet .acts{display:flex; gap:8px; margin-top:3px}
.sheet .acts button{flex:1; height:38px; border-radius:10px; font-size:13.5px; font-weight:600}
.sheet .acts .pri{background:var(--accent); color:var(--accent-ink)}
.sheet .acts .sec{background:var(--panel-hover); color:var(--panel-ink)}

/* mobile: panel becomes a bottom sheet */
@media (max-width: 900px){
  #panel{left:8px; right:8px; top:auto; bottom:8px; width:auto; border-radius:18px}
  #hint{display:none}
}
