:root{
  --bg:#0f1720;
  --panel:#0b1220cc;
  --accent:#ff7b54;
  --muted:#9aa6b2;
  --glass: rgba(255,255,255,0.03);
}
*{box-sizing:border-box}
html,body,#app{height:100%;margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;color:#e6eef6;background:linear-gradient(180deg,var(--bg),#07101a);-webkit-font-smoothing:antialiased}
#app{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px;gap:12px;height:100vh}
canvas#bloch{width:min(92vw,420px);height:min(50vh,420px);background:transparent;border-radius:14px;box-shadow:0 8px 30px rgba(2,6,23,0.6);touch-action:none}

#controls{width:min(92vw,420px);background:var(--panel);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px;box-shadow:0 6px 18px rgba(2,6,23,0.5)}
.row{display:flex;align-items:center;gap:8px}
.row label{flex:1;color:var(--muted);font-size:13px}
.row input[type="range"]{flex:2;height:36px}
.row .value{width:54px;text-align:right;color:#dfeaf6;font-weight:600}
.row.small{justify-content:space-between;padding:4px 0;font-size:13px;color:var(--muted)}
#probabilities{flex:1;color:#e6eef6;font-weight:600;text-align:left}
.buttons{justify-content:space-between;padding-top:6px}
button{flex:1;background:linear-gradient(180deg,#133045,#0c2230);border:1px solid rgba(255,255,255,0.03);color:#eaf6ff;padding:10px 12px;border-radius:8px;font-weight:700;min-height:44px}
button#measure{background:linear-gradient(180deg,var(--accent),#d45b3a);color:white;margin-right:8px}
button:active{transform:translateY(1px)}
#toast{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;background:#0f2933;color:#e6fff9;padding:8px 12px;border-radius:10px;box-shadow:0 6px 20px rgba(3,8,12,0.6)}
.hidden{display:none}
@media (orientation:landscape){
  #app{flex-direction:row}
  canvas#bloch{height:min(70vh,520px);width:min(44vw,520px)}
  #controls{width:340px}
}