
:root{
  --bg:#070b14;
  --panel:#0f172a;
  --panel2:#111827;
  --text:#f8fafc;
  --muted:#94a3b8;
  --border:#273449;
  --accent:#38bdf8;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 50% 0%,rgba(56,189,248,.09),transparent 30%),
    linear-gradient(180deg,#070b14,#0b1020 55%,#0f172a);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input{font:inherit}
.app{
  width:min(100%,860px);
  margin:0 auto;
  padding:18px 14px calc(36px + env(safe-area-inset-bottom));
}
.hero{text-align:center;padding:10px 10px 16px}
.eyebrow{
  margin:0 0 5px;
  color:#7dd3fc;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.75rem;
  font-weight:900;
}
h1{margin:0 0 8px;font-size:clamp(2rem,7vw,3.2rem)}
h2,p{margin-top:0}
.hero p:last-child{margin-bottom:0;color:var(--muted);line-height:1.5}

.light-stage{
  position:relative;
  min-height:310px;
  margin:10px 0 16px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:28px;
  background:
    radial-gradient(circle at 76% 50%,rgba(255,255,255,.035),transparent 31%),
    linear-gradient(180deg,#050810,#0b1220);
}
.cannon-wrap{
  position:absolute;
  left:18px;
  top:50%;
  transform:translateY(-50%);
  width:52%;
  height:170px;
}
.cannon{
  position:absolute;
  left:0;
  bottom:10px;
  width:128px;
  height:120px;
  z-index:3;
}
.lens{
  position:absolute;
  left:60px;top:12px;
  width:64px;height:64px;border-radius:50%;
  background:#fff;
  box-shadow:0 0 24px rgba(255,255,255,.8);
  border:8px solid #334155;
}
.barrel{
  position:absolute;left:10px;top:32px;
  width:76px;height:44px;border-radius:20px 8px 8px 20px;
  background:linear-gradient(180deg,#64748b,#1e293b);
}
.stand{
  position:absolute;left:42px;top:76px;
  width:38px;height:40px;
  background:#334155;
  clip-path:polygon(20% 0,80% 0,100% 100%,0 100%);
}
.beam{
  position:absolute;
  left:104px;top:22px;
  width:470px;height:90px;
  transform-origin:left center;
  clip-path:polygon(0 37%,100% 0,100% 100%,0 63%);
  filter:blur(4px);
  opacity:.78;
  pointer-events:none;
}
.target{
  position:absolute;
  right:7%;
  top:50%;
  transform:translateY(-50%);
  width:160px;height:160px;
  display:grid;place-items:center;
}
.glow{
  position:absolute;
  width:150px;height:150px;border-radius:50%;
  background:#fff;filter:blur(33px);opacity:.72;
}
.target-disc{
  position:relative;
  width:115px;height:115px;border-radius:50%;
  background:#fff;
  border:3px solid rgba(255,255,255,.22);
  box-shadow:inset 0 0 20px rgba(255,255,255,.25);
}

.panel{
  background:rgba(15,23,42,.94);
  border:1px solid var(--border);
  border-radius:24px;
  padding:18px;
  margin-bottom:14px;
}
.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:17px;
}
.panel-head>div{display:flex;align-items:center;gap:9px}
.panel-head h2{margin:0;font-size:1.25rem}
.step{
  width:30px;height:30px;border-radius:50%;
  display:grid;place-items:center;
  background:#172554;color:#93c5fd;font-weight:900
}
.ghost-btn{
  min-height:42px;
  padding:8px 13px;
  border-radius:12px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.slider-group{
  padding:14px 0 18px;
  border-bottom:1px solid rgba(148,163,184,.14)
}
.slider-group:last-child{border-bottom:0;padding-bottom:4px}
.slider-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:11px;
}
.slider-head label{font-weight:850}
.slider-head output{
  min-width:50px;
  text-align:center;
  border-radius:999px;
  padding:5px 9px;
  background:#020617;
  border:1px solid var(--border);
  font-variant-numeric:tabular-nums;
}
input[type=range]{
  width:100%;
  height:34px;
  accent-color:var(--accent);
  cursor:pointer;
}
.red-channel input{accent-color:#ef4444}
.green-channel input{accent-color:#22c55e}
.blue-channel input{accent-color:#3b82f6}

.helper{color:var(--muted);margin:-5px 0 14px}
.presets{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}
.preset-btn{
  min-height:88px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:17px;
  border:1px solid var(--border);
  background:#0b1220;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  touch-action:manipulation;
  transition:transform .13s ease,border-color .13s ease,background .13s ease;
}
.preset-btn:active{transform:scale(.97)}
.preset-btn.active{
  border-color:#7dd3fc;
  background:#10233d;
}
.dot{
  width:35px;height:35px;border-radius:50%;
  border:1px solid rgba(255,255,255,.25)
}
.white-dot{border-color:#64748b}

.result-grid{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:18px;
  align-items:stretch;
}
.result-swatch{
  min-height:180px;
  border-radius:23px;
  border:1px solid rgba(255,255,255,.18);
  background:#fff;
  box-shadow:inset 0 0 20px rgba(255,255,255,.18)
}
.result-data{
  display:grid;
  gap:8px
}
.data-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 13px;
  background:#0b1220;
  border:1px solid rgba(148,163,184,.12);
  border-radius:14px;
}
.data-row span{color:var(--muted)}
.data-row strong{
  text-align:right;
  font-variant-numeric:tabular-nums
}
.info-panel h2{font-size:1.15rem;margin-bottom:13px}
.mix-rules{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:9px;
}
.mix-rules span{
  padding:11px;
  border-radius:13px;
  background:#0b1220;
  color:#cbd5e1;
}
.footer-note{
  text-align:center;
  color:var(--muted);
  font-size:.9rem;
  line-height:1.5;
  padding:0 12px
}

@media(max-width:620px){
  .light-stage{min-height:270px}
  .cannon-wrap{left:7px;transform:translateY(-50%) scale(.8);transform-origin:left center}
  .target{right:4%;width:130px;height:130px}
  .target-disc{width:90px;height:90px}
  .glow{width:120px;height:120px}
  .presets{grid-template-columns:repeat(2,1fr)}
  .preset-btn{min-height:74px;flex-direction:row}
  .dot{width:31px;height:31px}
  .result-grid{grid-template-columns:1fr}
  .result-swatch{min-height:145px}
  .mix-rules{grid-template-columns:1fr}
}
@media(max-width:380px){
  .target{right:1%}
  .cannon-wrap{left:-5px;transform:translateY(-50%) scale(.72)}
}
