:root{
  --n:16;
  --d:34px;
  --gap:10px;

  --text: rgba(255,255,255,.86);
  --muted: rgba(255,255,255,.55);
  --line: rgba(255,255,255,.35);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  min-height:100vh;
  display:grid;
  place-items:center;
  background:#0b0b0b;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
}

.wrap{
  width:min(820px,92vw);
  display:grid;
  gap:14px;
}

/* TOP UI */
.top{
  display:grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap:10px;
}

.title{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.title strong{
  font-size:13px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.title span{
  font-size:12px;
  color:var(--muted);
}

/* Minimal slider */
.control{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
  user-select:none;

  justify-self:end;
}

.control label{
  font-size:12px;
  color:var(--muted);
}

.control span{
  font-size:12px;
  color:var(--text);
  min-width:58px;
  text-align:right;
}

input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  width:200px;
  height:1px;
  background:var(--line);
  outline:none;
}

input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#fff;
  cursor:pointer;
}

input[type="range"]::-moz-range-thumb{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#fff;
  border:none;
  cursor:pointer;
}

/* FRAME */
.frame{
  width:100%;
  margin:0 auto;
  max-width: 600px;
  aspect-ratio:1/1;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  position:relative;

  background:
    radial-gradient(circle at 50% 50%,
      #d6d6d6 0%,
      #9a9a9a 36%,
      #3f3f3f 70%,
      #111 100%);
}

.frame::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at 50% 50%,
    transparent 50%,
    rgba(0,0,0,.35) 92%,
    rgba(0,0,0,.55) 100%);
  pointer-events:none;
}

.grid{
  position:absolute;
  inset:6%;
  display:grid;
  grid-template-columns:repeat(var(--n),1fr);
  gap:var(--gap);
  align-content:center;
  justify-content:center;
}

.cell{
  position:relative;
  width:var(--d);
  height:var(--d);

  --base:#999;
  --sx:0px; --sy:0px;
  --hx:0px; --hy:0px;
  --ho:1; --so:1;
}

.shadow{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#000;
  transform:translate(var(--sx),var(--sy));
  opacity:var(--so);
  z-index:0;
}

.dot{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:var(--base);
  overflow:hidden;
  z-index:1;
}

.dot::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:999px;
  background:
    radial-gradient(circle at calc(50% + var(--hx)) calc(50% + var(--hy)),
      rgba(245,245,245,.98) 0 56%,
      transparent 58%),
    radial-gradient(circle at calc(50% + var(--hx) + 10px) calc(50% + var(--hy) + 8px),
      var(--base) 0 58%,
      transparent 60%);
  opacity:var(--ho);
  pointer-events:none;
}

@media (max-width:520px){
  :root{ --d:22px; --gap:7px; }
  input[type="range"]{ width:160px; }
  .frame{ border-radius:16px; }

  .control{
    justify-self:stretch;
  }

  input[type="range"]{
    width:100%;
  }
}
