/* ==========================================================================
   lite.css - Saber Lite.
   Tema scuro e basta, di proposito: la lama e' una luce e si legge solo sul
   buio. Tutto l'accento della pagina e' --c, il colore della lama (terna
   r,g,b), che app.js aggiorna ad ogni cambio.
   ========================================================================== */
:root {
  --c: 205, 214, 226;   /* metallico: vedi applyTheme() in app.js */
  --bg: #03040a;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.10);
  --text: #eef3ff;
  --muted: rgba(225, 233, 255, 0.55);
  --danger: 255, 80, 70;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .9, .25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid rgba(var(--c), .9); outline-offset: 3px; }
svg { width: 24px; height: 24px; flex: none; }
.hidden { display: none !important; }

#scene { position: fixed; inset: 0; z-index: 0; touch-action: none; }

/* ------------------------------------------------------------------ HUD */
#ui { position: fixed; inset: 0; z-index: 2; pointer-events: none; animation: rise .9s var(--ease) both; }
#ui > * { pointer-events: auto; }

.top {
  position: absolute; top: calc(12px + var(--safe-t)); left: 16px; right: 16px;
  display: flex; align-items: center; gap: 8px;
}
.top .grow { flex: 1; }
.pill, .icon-btn {
  height: 44px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
}
.icon-btn { width: 44px; padding: 0; justify-content: center; }
.icon-btn svg { width: 22px; height: 22px; opacity: .85; }

.batt-ico { width: 26px; height: 13px; border: 2px solid rgba(255,255,255,.75); border-radius: 4px; position: relative; padding: 1.5px; }
.batt-ico::after { content: ""; position: absolute; right: -5px; top: 3px; width: 3px; height: 5px; background: rgba(255,255,255,.75); border-radius: 0 2px 2px 0; }
.batt-fill { display: block; height: 100%; width: 0%; border-radius: 1.5px; background: rgb(var(--c)); box-shadow: 0 0 8px rgba(var(--c), .8); transition: width .6s var(--ease); }
.batt-txt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; min-width: 2ch; }
.batt-bolt { width: 14px; height: 14px; color: #ffd84a; display: none; }
#batt.charging .batt-bolt { display: block; }
#batt.low .batt-fill { background: rgb(var(--danger)); box-shadow: 0 0 8px rgba(var(--danger), .9); }
#batt.low { animation: lowPulse 1.6s ease-in-out infinite; }

/* --------------------------------------------------------- profili */
#crystals {
  position: absolute; left: 0; right: 0; bottom: calc(132px + var(--safe-b));
  display: flex; justify-content: center; gap: 14px; transition: transform .5s var(--ease), opacity .4s;
}
.crystal { width: 40px; height: 56px; position: relative; transition: transform .45s var(--ease), filter .4s; transform: scale(.82); filter: saturate(.8) brightness(.75); }
.crystal svg { width: 100%; height: 100%; overflow: visible; }
.crystal.on { transform: scale(1.08) translateY(-6px); filter: none; }
.crystal.on::after {
  content: ""; position: absolute; left: 50%; bottom: -14px; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--gc); box-shadow: 0 0 10px 2px var(--gc);
}
.crystal:active { transform: scale(.92); }
.crystal.busy { animation: wobble .6s ease-in-out infinite; }
body.sheet-open #crystals { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* ------------------------------------------------------------- dock */
.dock {
  position: absolute; left: 0; right: 0; bottom: calc(22px + var(--safe-b));
  display: flex; justify-content: center; align-items: center; gap: 34px;
}
.round {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .25s var(--ease), background .3s;
}
.round svg { width: 26px; height: 26px; }
.round:active { transform: scale(.9); }
.round.on { background: rgba(var(--c), .22); border-color: rgba(var(--c), .6); box-shadow: 0 0 22px rgba(var(--c), .35); }

.power {
  width: 86px; height: 86px; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), rgba(255,255,255,.03) 60%), rgba(8,10,18,.6);
  border: 1px solid rgba(var(--c), .45);
  box-shadow: 0 0 0 6px rgba(var(--c), .06), 0 0 40px rgba(var(--c), .25), inset 0 0 20px rgba(var(--c), .2);
  transition: transform .3s var(--ease), box-shadow .5s;
  animation: breathe 2.8s ease-in-out infinite;
}
.power .ico { width: 34px; height: 34px; color: rgb(var(--c)); filter: drop-shadow(0 0 8px rgba(var(--c), .9)); transition: color .4s; }
.power .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.power .ring circle { fill: none; stroke: rgba(var(--c), .9); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; }
.power:active { transform: scale(.92); }
.power.lit { animation: none; background: radial-gradient(circle at 50% 40%, rgba(var(--c), .55), rgba(var(--c), .12) 70%); box-shadow: 0 0 0 8px rgba(var(--c), .12), 0 0 70px rgba(var(--c), .6); }
.power.lit .ico { color: #fff; }
.power.busy .ring circle { stroke-dashoffset: 210; animation: spin 0.9s linear infinite; transform-origin: 50% 50%; }

/* ------------------------------------------------------------ splash */
#splash {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px 16px calc(24px + var(--safe-b));
  background: radial-gradient(ellipse at 50% 45%, rgba(var(--c), .10), transparent 60%);
  transition: opacity .7s var(--ease), transform .9s var(--ease);
}
#splash.gone { opacity: 0; transform: scale(1.15); pointer-events: none; }
.brand { font-weight: 300; letter-spacing: .55em; font-size: 15px; color: var(--muted); padding-left: .55em; }
.brand b { font-weight: 800; color: rgb(var(--c)); text-shadow: 0 0 14px rgba(var(--c), .8); }
/* Versione della pagina (APP_VERSION in app.js) */
.app-ver { font-size: 11px; letter-spacing: .08em; color: var(--muted); opacity: .75; white-space: nowrap; }
#splash .app-ver { margin-top: -8px; }
.top .app-ver { margin-right: 8px; }

.emitter { width: 168px; height: 168px; border-radius: 50%; position: relative; display: grid; place-items: center; }
.emitter .halo {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(8,10,18,1) 52%, transparent 53%),
    conic-gradient(from 0deg, rgba(var(--c),0), rgba(var(--c),.9), rgba(var(--c),0) 30%, rgba(var(--c),.6) 55%, rgba(var(--c),0) 70%, rgba(var(--c),.9) 92%, rgba(var(--c),0));
  filter: blur(1px) drop-shadow(0 0 22px rgba(var(--c), .55));
  animation: spin 6s linear infinite;
}
.emitter::before {
  content: ""; position: absolute; inset: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), rgba(255,255,255,0) 60%), #070912;
  border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 0 30px rgba(var(--c), .25);
}
.emitter .ico { width: 54px; height: 54px; position: relative; color: rgb(var(--c)); filter: drop-shadow(0 0 10px rgba(var(--c), .9)); }
.emitter .progress { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); }
.emitter .progress circle { fill: none; stroke-width: 3; }
.emitter .progress .track { stroke: rgba(255,255,255,.0); }
.emitter .progress .bar { stroke: rgb(var(--c)); stroke-linecap: round; stroke-dasharray: 352; stroke-dashoffset: 352; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 6px rgba(var(--c), 1)); }
.emitter:active { transform: scale(.95); }
#splash.working .emitter .halo { animation-duration: 1.2s; }
#splash.working .emitter .progress .track { stroke: rgba(255,255,255,.08); }
#splash.error .emitter { animation: shake .45s; }

.msg { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .04em; min-height: 1.3em; text-align: center; }
.hint { margin: -8px 0 0; max-width: 300px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--muted); }
.ghost { color: var(--muted); font-size: 14px; padding: 12px 18px; border-radius: 22px; border: 1px solid var(--line); }
.ghost:active { background: var(--glass); }

/* ------------------------------------------------------------- sheet */
#scrim { position: fixed; inset: 0; z-index: 3; background: rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .35s; }
body.sheet-open #scrim { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; margin: 0 auto; max-width: 560px;
  padding: 10px 16px calc(22px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(18,22,36,.82), rgba(8,10,18,.94));
  border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 -20px 60px rgba(0,0,0,.5), 0 -1px 0 rgba(var(--c), .25);
  transform: translateY(110%); transition: transform .5s var(--ease);
  touch-action: none;
}
.sheet.open { transform: translateY(0); }
.sheet.tall { max-height: 64vh; display: flex; flex-direction: column; }
.handle { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); margin: 0 auto 14px; }

.seg { display: flex; margin: 0 auto 6px; width: max-content; padding: 4px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--line); position: relative; }
.seg button { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 18px; color: var(--muted); font-weight: 600; transition: color .3s, background .3s; }
.seg button svg { width: 20px; height: 20px; }
.seg button.on { color: #fff; background: rgba(var(--c), .25); box-shadow: inset 0 0 0 1px rgba(var(--c), .55); }

.dial-wrap { position: relative; margin: 0 -16px; }
.dial {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 26px calc(50% - 32px) 20px; touch-action: pan-x;
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.dial::-webkit-scrollbar { display: none; }
.orb {
  flex: none; width: 64px; height: 64px; border-radius: 50%; scroll-snap-align: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--oc) 34%, rgba(0,0,0,.35) 100%);
  box-shadow: 0 0 calc(var(--k, 0) * 30px) var(--oc), inset 0 -6px 12px rgba(0,0,0,.35);
  transform: scale(calc(.55 + var(--k, 0) * .45));
  will-change: transform;
}
.dial-lens { position: absolute; left: 50%; top: 18px; width: 80px; height: 80px; margin-left: -40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); pointer-events: none; box-shadow: 0 0 18px rgba(var(--c), .5); }
.dice { position: absolute; right: 16px; top: 12px; }
.dice:active svg { animation: roll .5s var(--ease); }

/* ------------------------------------------------------------- suoni */
.pads { overflow-y: auto; touch-action: pan-y; padding: 0 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.pads::-webkit-scrollbar { display: none; }
.group { margin-bottom: 16px; }
.group h4 { margin: 0 0 10px 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.group h4 svg { width: 16px; height: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.big-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pad {
  position: relative; height: 56px; min-width: 56px; padding: 0 6px; border-radius: 18px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums;
  transition: transform .2s var(--ease), background .3s, border-color .3s, opacity .3s; overflow: hidden;
}
.big-row .pad { height: 84px; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: center; }
.big-row .pad svg { width: 28px; height: 28px; color: var(--text); }
.pad:active { transform: scale(.92); }
.pad.playing { background: rgba(var(--c), .22); border-color: rgba(var(--c), .7); box-shadow: 0 0 24px rgba(var(--c), .35); color: #fff; }
.pad.playing::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle, rgba(var(--c), .45), transparent 70%); animation: ping 1s ease-out infinite;
}
.pad.missing { opacity: .25; pointer-events: none; }
.pad.checking { opacity: .5; pointer-events: none; }
.pad.nope { animation: shake .4s; }

/* ------------------------------------------------------- impostazioni */
.battery-big { position: relative; width: 150px; height: 150px; margin: 2px auto 10px; flex: none; }
.battery-big > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.battery-big circle { fill: none; stroke-width: 8; }
.battery-big .track { stroke: rgba(255,255,255,.07); }
.battery-big .bar { stroke: rgb(var(--c)); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1s var(--ease); filter: drop-shadow(0 0 8px rgba(var(--c), .9)); }
.battery-big.low .bar { stroke: rgb(var(--danger)); filter: drop-shadow(0 0 8px rgba(var(--danger), .9)); }
.bb-txt { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 52px; }
.bb-txt b { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-txt small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.bb-bolt { position: absolute; left: 50%; top: 26px; width: 18px; height: 18px; margin-left: -9px; color: #ffd84a; display: none; filter: drop-shadow(0 0 6px #ffd84a); }
.battery-big.charging .bb-bolt { display: block; animation: lowPulse 1.4s ease-in-out infinite; }

.sheet h3 { display: flex; align-items: center; gap: 8px; margin: 6px 4px 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet h3 svg { width: 16px; height: 16px; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; touch-action: pan-x; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; width: 108px; height: 92px; position: relative; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); transition: all .3s var(--ease); }
.chip svg { width: 80px; height: 30px; }
.chip svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip svg line { stroke: rgba(255,255,255,.12); stroke-width: 1; stroke-dasharray: 2 3; }
.chip-ico { font-style: normal; font-size: 18px; line-height: 1; }
.chip.on { color: #fff; background: rgba(var(--c), .2); border-color: rgba(var(--c), .7); box-shadow: 0 0 20px rgba(var(--c), .3); }
.chip.on svg path { stroke: rgb(var(--c)); filter: drop-shadow(0 0 4px rgba(var(--c), .9)); }
.chip:active { transform: scale(.94); }

.audio-box { margin-bottom: 14px; flex: none; }
.vol-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.vol-ico { width: 22px; height: 22px; flex: none; color: rgb(var(--c)); }
.vol-val { width: 34px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
#volRange { flex: 1; min-width: 0; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: none; }
#volRange::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--c)) var(--p, 100%), rgba(255,255,255,.12) var(--p, 100%)); }
#volRange::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--c)) var(--p, 100%), rgba(255,255,255,.12) var(--p, 100%)); }
#volRange::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px rgba(var(--c), .9); }
#volRange::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 14px rgba(var(--c), .9); }
.switch-row { margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); cursor: pointer; }
.switch-row > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch-row small { font-size: 12px; color: var(--muted); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; position: relative; width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.14); transition: background .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch-row input:checked + .switch { background: rgb(var(--c)); box-shadow: 0 0 14px rgba(var(--c), .5); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 2px solid rgba(var(--c), .9); outline-offset: 3px; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; flex: none; }
.act { position: relative; height: 72px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; overflow: hidden; }
.act svg { width: 24px; height: 24px; color: var(--text); }
.act:active { transform: scale(.95); }
.hold-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: rgb(var(--danger)); box-shadow: 0 0 10px rgb(var(--danger)); }
.act.holding .hold-bar { width: 100%; transition: width 1.4s linear; }
.dev-name { text-align: center; font-size: 12px; color: rgba(255,255,255,.3); margin: 14px 0 0; }

/* ------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; top: calc(70px + var(--safe-t)); z-index: 9; transform: translate(-50%, -12px); opacity: 0;
  padding: 10px 18px; border-radius: 22px; background: rgba(14,18,30,.88); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-weight: 600; font-size: 15px; white-space: nowrap;
  display: flex; align-items: center; gap: 8px; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
#toast svg { width: 18px; height: 18px; color: rgb(var(--c)); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err svg { color: rgb(var(--danger)); }

.demo-badge { position: fixed; top: calc(18px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 6; font-size: 11px; font-weight: 800; letter-spacing: .3em; padding: 5px 10px 5px 13px; border-radius: 12px; color: rgba(var(--c), 1); border: 1px solid rgba(var(--c), .5); background: rgba(var(--c), .1); pointer-events: none; }

/* -------------------------------------------------------- animazioni */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 6px rgba(var(--c), .05), 0 0 30px rgba(var(--c), .18), inset 0 0 20px rgba(var(--c), .15); } 50% { box-shadow: 0 0 0 10px rgba(var(--c), .09), 0 0 55px rgba(var(--c), .38), inset 0 0 26px rgba(var(--c), .3); } }
@keyframes lowPulse { 50% { opacity: .45; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes wobble { 50% { transform: scale(1.08) translateY(-10px) rotate(4deg); } }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
@keyframes roll { from { transform: rotate(-200deg) scale(.6); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 700px) {
  .dock { gap: 48px; }
  .sheet { bottom: 18px; border-radius: 28px; border-bottom: 1px solid var(--line); }
}
@media (max-height: 600px) {
  #crystals { bottom: calc(118px + var(--safe-b)); }
  .crystal { width: 32px; height: 45px; }
}

/* ------------------------------------------------- aggiunte 2026-10-25 */
.temp svg { width: 18px; height: 18px; }
.temp .temp-txt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.temp[data-lvl="ok"] svg { color: #8fd3ff; }
.temp[data-lvl="warm"] { color: #ffc24a; border-color: rgba(255,194,74,.4); }
.temp[data-lvl="hot"] { color: rgb(var(--danger)); border-color: rgba(var(--danger),.5); animation: lowPulse 1.2s ease-in-out infinite; }



.apply {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px auto 0;
  height: 50px; padding: 0 26px; border-radius: 25px; font-weight: 700; font-size: 16px;
  background: rgba(var(--pc, var(--c)), .28); border: 1px solid rgba(var(--pc, var(--c)), .8);
  box-shadow: 0 0 26px rgba(var(--pc, var(--c)), .45); color: #fff;
  transition: opacity .3s, transform .2s var(--ease), box-shadow .3s;
}
.apply svg { width: 20px; height: 20px; }
.apply:active { transform: scale(.94); }
.apply.same { opacity: .35; box-shadow: none; background: var(--glass); border-color: var(--line); }

#sheetSettings .scroll { overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
#sheetSettings .scroll::-webkit-scrollbar { display: none; }
.gauges { display: flex; justify-content: center; gap: 22px; }
.gauges .battery-big { width: 130px; height: 130px; margin: 2px 0 10px; }
.gauges .bb-txt { padding-top: 44px; }
.gauges .bb-txt b { font-size: 34px; }
.temp-big .bar { stroke: #8fd3ff; filter: drop-shadow(0 0 8px #8fd3ff); }
.temp-big[data-lvl="warm"] .bar { stroke: #ffc24a; filter: drop-shadow(0 0 8px #ffc24a); }
.temp-big[data-lvl="hot"] .bar { stroke: rgb(var(--danger)); filter: drop-shadow(0 0 8px rgb(var(--danger))); }
.tb-ico { position: absolute; left: 50%; top: 22px; width: 18px; height: 18px; margin-left: -9px; color: var(--muted); }
.sheet .sub { margin: -4px 4px 10px; font-size: 13px; color: var(--muted); }
.actions.two { grid-template-columns: repeat(2, 1fr); }
.dev-name span + span::before { content: " \00b7  "; }
/* Le icone dentro gli anelli non sono l'anello: niente 100% e niente rotazione */
.battery-big > svg.bb-bolt, .battery-big > svg.tb-ico { width: 18px; height: 18px; transform: none; }

/* ------------------------------------------- aggiornamento firmware */
.fw-box { margin-top: 14px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fw-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 160px; }
.fw-ico { color: var(--muted); }
.fw-txt { display: flex; flex-direction: column; gap: 2px; }
.fw-txt b { font-size: 15px; }
.fw-txt small { font-size: 12px; color: var(--muted); }
.fw-box.new .fw-txt small { color: rgb(var(--c)); font-weight: 600; }
.fw-btn {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 23px; font-weight: 700;
  background: rgba(var(--c), .3); border: 1px solid rgba(var(--c), .85); box-shadow: 0 0 22px rgba(var(--c), .4);
  animation: breathe 2.8s ease-in-out infinite;
}
.fw-btn svg { width: 20px; height: 20px; }
.fw-btn:active { transform: scale(.95); }
.fw-file { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); }
#gear.badge { position: relative; }
#gear.badge::after { content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #ffc24a; box-shadow: 0 0 8px #ffc24a; }

.ota-layer {
  position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 16px calc(24px + var(--safe-b)); text-align: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(var(--c), .16), rgba(3,4,10,.96) 62%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.ota-layer.show { opacity: 1; pointer-events: auto; }
.ota-ring { position: relative; width: 200px; height: 200px; }
.ota-ring > svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); }
.ota-ring circle { fill: none; stroke-width: 7; }
.ota-ring .track { stroke: rgba(255,255,255,.07); }
.ota-ring .bar { stroke: rgb(var(--c)); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .4s linear; filter: drop-shadow(0 0 10px rgb(var(--c))); }
.ota-layer.busy .ota-ring .bar { stroke-dashoffset: 260; animation: spin 1.1s linear infinite; transform-origin: 50% 50%; }
.ota-pct { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 72px; }
.ota-pct b { font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ota-pct small { font-size: 18px; color: var(--muted); margin-left: 2px; }
.ota-ring .ota-ok { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; color: rgb(var(--c)); filter: drop-shadow(0 0 14px rgb(var(--c))); opacity: 0; transform: scale(.4); transition: all .5s var(--ease); }
.ota-layer.ok .ota-pct { opacity: 0; }
.ota-layer.ok .ota-ok { opacity: 1; transform: none; }
.ota-layer.err .bar { stroke: rgb(var(--danger)); filter: drop-shadow(0 0 10px rgb(var(--danger))); }
.ota-msg { margin: 6px 0 0; font-size: 20px; font-weight: 700; max-width: 320px; }
.ota-sub { margin: 0; font-size: 14px; color: var(--muted); max-width: 300px; line-height: 1.45; min-height: 1.4em; }

/* Timbri: griglia invece della fila a scorrimento, si vedono tutti */
#eqChips { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
#eqChips .chip { width: auto; }
.chip.busy { animation: lowPulse .8s ease-in-out infinite; }

/* Ruota dei colori (2026-11-12): si scorre liberamente, si tocca per
   applicare. Niente lente e niente ingrandimento al centro. */
.dial { scroll-snap-type: none; padding: 22px 28px 18px; gap: 12px; }
.orb { width: 54px; height: 54px; transform: none; box-shadow: 0 0 14px var(--oc), inset 0 -6px 12px rgba(0,0,0,.35); transition: transform .2s var(--ease); }
.orb:active { transform: scale(.9); }
.orb.on { box-shadow: 0 0 0 3px #fff, 0 0 26px var(--oc), inset 0 -6px 12px rgba(0,0,0,.35); }
.orb.on::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 10px;
  border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: translateY(-2px) rotate(-45deg);
  filter: drop-shadow(0 0 2px rgba(0,0,0,.8));
}

/* ------------------------------------------------ hub centrale (2026-11-12)
   Accensione al centro della camera del cristallo, i tre comandi in orbita
   sull'anello (Colore e Suono in alto, Sistema in basso). --R e' il raggio
   dell'orbita: scene.js lo misura dai pulsanti, quindi basta cambiarlo qui. */
.hub {
  --R: clamp(104px, 31vw, 150px);
  position: absolute; left: 50%; top: clamp(200px, 42%, calc(100% - 300px - var(--safe-b)));
  width: 0; height: 0;
  transition: opacity .35s, filter .35s;
}
body.sheet-open .hub { opacity: .12; filter: blur(2px); pointer-events: none; }

.hub .power { position: absolute; left: 0; top: 0; translate: -50% -50%; width: 96px; height: 96px; }

.sat {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 7px;
  translate: calc(-50% + var(--x)) calc(-50% + var(--y) + 12px);
  animation: satIn .8s var(--ease) both;
}
.sat-a { --x: calc(var(--R) * -0.866); --y: calc(var(--R) * -0.5); animation-delay: .12s; }
.sat-b { --x: calc(var(--R) *  0.866); --y: calc(var(--R) * -0.5); animation-delay: .22s; }
.sat-c { --x: 0px;                     --y: var(--R);              animation-delay: .32s; }

.sat-btn {
  position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.14), rgba(255,255,255,.03) 62%), rgba(10,13,22,.72);
  border: 1px solid rgba(var(--c), .35);
  box-shadow: 0 0 0 4px rgba(var(--c), .05), 0 8px 24px rgba(0,0,0,.45), inset 0 0 16px rgba(var(--c), .14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), box-shadow .35s, border-color .35s, background .35s;
  animation: satFloat 5s ease-in-out infinite;
}
.sat-b .sat-btn { animation-delay: -1.6s; }
.sat-c .sat-btn { animation-delay: -3.2s; }
.sat-btn svg { width: 27px; height: 27px; color: #eaf2ff; filter: drop-shadow(0 0 6px rgba(var(--c), .7)); }
.sat-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; padding-left: .18em;
  color: rgba(225,233,255,.75); text-shadow: 0 1px 6px rgba(0,0,0,.9);
}
.sat:hover .sat-btn, .sat:focus-visible .sat-btn { border-color: rgba(var(--c), .8); box-shadow: 0 0 0 5px rgba(var(--c), .1), 0 0 28px rgba(var(--c), .45), inset 0 0 18px rgba(var(--c), .25); }
.sat:active .sat-btn { scale: .9; }
.sat:focus-visible { outline: none; }
.sat.on .sat-btn { background: radial-gradient(circle at 50% 35%, rgba(var(--c), .55), rgba(var(--c), .15) 70%); border-color: rgba(var(--c), .9); }
.sat.on .sat-lbl { color: #fff; }

/* Aggiornamento disponibile: il pallino sta sul pulsante Sistema */
#gear.badge::after { content: none; }
#gear.badge .sat-btn::after { content: ""; position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%; background: #ffc24a; box-shadow: 0 0 10px #ffc24a; animation: lowPulse 1.6s ease-in-out infinite; }

/* Senza la barra in basso i cristalli scendono */
.dock { display: none; }
#crystals { bottom: calc(34px + var(--safe-b)); }

@keyframes satIn { from { opacity: 0; scale: .3; } }
@keyframes satFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@media (max-height: 600px) {
  .hub { --R: 96px; top: 44%; }
  .sat-btn { width: 54px; height: 54px; }
  .hub .power { width: 80px; height: 80px; }
  #crystals { bottom: calc(14px + var(--safe-b)); }
}

/* ------------------------------------- fogli che scorrono (2026-11-12) */
#sheetSettings.tall { max-height: 86vh; }
#sheetSettings .scroll { padding-bottom: 56px; }
.pads { padding-bottom: 56px; }
.scroll.more-below, .pads.more-below {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), transparent);
}
.scroll.more-above.more-below, .pads.more-above.more-below {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 70px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 70px), transparent);
}
.scroll.more-above:not(.more-below), .pads.more-above:not(.more-below) {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px);
          mask-image: linear-gradient(to bottom, transparent, #000 28px);
}
.more-hint {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); translate: -50% 12px;
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; color: #fff;
  background: rgba(var(--c), .28); border: 1px solid rgba(var(--c), .7); box-shadow: 0 6px 20px rgba(0,0,0,.5), 0 0 18px rgba(var(--c), .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .3s, translate .4s var(--ease);
}
.more-hint.show { opacity: 1; pointer-events: auto; translate: -50% 0; }
.more-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* Batteria e temperatura piu' compatte: lasciano vedere le voci sotto */
.gauges { gap: 18px; }
.gauges .battery-big { width: 104px; height: 104px; margin: 0 0 6px; }
.gauges .bb-txt { padding-top: 34px; }
.gauges .bb-txt b { font-size: 26px; }
.gauges .bb-txt small { font-size: 13px; }
.gauges .bb-bolt, .gauges .tb-ico { top: 16px; }

/* Cristalli = profili (2026-11-12): etichetta sopra la fila e numero dentro */
#crystals::before {
  content: "Profilo"; position: absolute; left: 0; right: 0; top: -26px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; padding-left: .22em;
  color: rgba(225,233,255,.55);
}
.cr-num { font: 800 15px system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 3px; }

/* Foglio Suono (2026-11-21): volume ed EQ in testa, poi i suoni da provare */
#sheetSounds.tall { max-height: 86vh; }
.pads-title { margin-top: 18px !important; }
.pad.playing::before {
  content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.8); z-index: 1;
}
