*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
:root{--blue:#2563eb;--red:#ef4444;--dark:#222222;}
button:focus,button:focus-visible,.red-btn:focus{outline:none;}

body{
  background:var(--dark);min-height:100vh;overflow-x:hidden;
  font-family:-apple-system,'SF Pro Display','Segoe UI',sans-serif;
  display:flex;flex-direction:column;align-items:center;
}

/* STARS */
#stars{display:none;}


/* HEADER */
.site-header{position:relative;z-index:10;text-align:center;padding:32px 0 24px;}
.site-header h1{
  font-size:32px;font-weight:900;letter-spacing:6px;text-transform:uppercase;
  background:linear-gradient(135deg,#60a5fa,#a78bfa,#34d399);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
}
.site-header p{color:rgba(255,255,255,.35);font-size:12px;letter-spacing:3px;margin-top:6px;}

/* SCENE */
.scene{
  position:relative;z-index:1;display:flex;align-items:center;
  justify-content:space-between;padding:0 24px 60px 40px;
  perspective:1400px;flex-wrap:wrap;width:100%;
}

/* PHONE */
.phone-wrapper{
  flex-shrink:0;
  position:relative;
  margin-left:18%;
  filter: none;
}
.phone-frame{
  width:290px;height:610px;
  background:linear-gradient(160deg,#1c1c2e,#12122a,#0d0d20);
  border-radius:50px;padding:10px;position:relative;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 -1px 0 rgba(0,0,0,.5),
    0 16px 24px rgba(0,0,0,.65),
    0 35px 50px rgba(0,0,0,.5),
    0 60px 80px rgba(0,0,0,.35),
    0 90px 110px rgba(0,0,0,.2),
    4px 22px 12px rgba(0,0,0,.3),
    8px 45px 20px rgba(0,0,0,.18);
}
/* side buttons */
.phone-frame::before{
  content:'';position:absolute;right:-3px;top:130px;
  width:3px;height:55px;background:#1a1a30;border-radius:0 3px 3px 0;
  box-shadow:0 70px 0 #1a1a30;
}
.phone-frame::after{
  content:'';position:absolute;left:-3px;top:110px;
  width:3px;height:38px;background:#1a1a30;border-radius:3px 0 0 3px;
  box-shadow:0 52px 0 #1a1a30;
}
.phone-screen{
  width:100%;height:100%;background:#1b1d1e;
  border-radius:40px;overflow:hidden;position:relative;
}

/* notch */
.notch{
  position:absolute;top:0;left:50%;transform:translateX(-50%);
  width:110px;height:28px;background:#111314;
  border-radius:0 0 20px 20px;z-index:20;
  display:flex;align-items:center;justify-content:center;gap:10px;
}
.notch-dot{width:10px;height:10px;border-radius:50%;background:#111;border:1.5px solid #333;}
.notch-bar{width:42px;height:4px;background:#111;border-radius:2px;border:1px solid #2a2a3a;}

/* APP PAGES */
.app-page{
  position:absolute;inset:0;display:flex;flex-direction:column;
  background:#1b1d1e;
  transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .35s ease;
}
.app-page.hidden{transform:translateX(100%);opacity:0;pointer-events:none;}
.app-page.slide-out{transform:translateX(-30%);opacity:0;pointer-events:none;}

/* status bar */
.status-bar{
  height:32px;padding:0 20px 4px;flex-shrink:0;
  display:flex;align-items:flex-end;justify-content:space-between;
  font-size:11px;font-weight:700;color:#e2e8f0;
}

/* CONTROL PAGE */
.ctrl-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:4px 18px 0;flex-shrink:0;
}
.ctrl-title{font-size:16px;font-weight:500;color:#6b7280;flex:1;text-align:center;}
.power-btn{
  width:30px;height:30px;border-radius:50%;border:none;cursor:pointer;
  font-size:14px;display:flex;align-items:center;justify-content:center;
  transition:all .3s;
}
.power-btn.is-on{background:var(--blue);color:#fff;}
.power-btn.is-off{background:var(--red);color:#fff;}

/* active timer pill */
.active-timer{
  display:none;align-items:center;gap:8px;
  margin:0 14px 2px;padding:7px 12px;
  background:#1e2b3c;border-radius:12px;
  font-size:11px;font-weight:600;color:var(--blue);flex-shrink:0;
}
.cancel-timer-btn{
  background:none;border:none;color:#9ca3af;cursor:pointer;
  font-size:12px;padding:0 2px;line-height:1;margin-left:auto;
}

/* knob */
.knob-area{
  flex:1;display:flex;align-items:center;justify-content:center;
  padding:8px 0;min-height:0;
}
.knob-svg{
  width:210px;height:210px;
  cursor:grab;touch-action:none;user-select:none;
}
.knob-svg:active{cursor:grabbing;}

/* schedule section */
.sched-section{padding:0 14px 14px;flex-shrink:0;display:flex;flex-direction:column;}
.sched-btn{
  display:flex;align-items:center;gap:10px;width:100%;
  background:#252829;border:none;border-radius:18px;
  padding:13px 18px;font-size:14px;font-weight:500;color:#e2e8f0;
  cursor:pointer;transition:all .2s;
}
.sched-btn:hover{background:#2e3133;transform:scale(1.01);}
.sched-icon{font-size:18px;color:var(--blue);}
.sched-list{margin-top:8px;height:145px;overflow-y:auto;}
.sched-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 0;border-bottom:1px solid rgba(255,255,255,.06);
}
.sched-bar{width:3px;height:34px;background:var(--blue);border-radius:2px;flex-shrink:0;}
.sched-info{flex:1;}
.sched-time{font-size:12px;font-weight:600;color:#e2e8f0;}
.sched-date{font-size:10px;color:#9ca3af;margin-top:1px;}
.sched-del{
  width:28px;height:28px;background:#2a1f1f;border:none;border-radius:7px;
  cursor:pointer;color:#ef4444;font-size:13px;
  display:flex;align-items:center;justify-content:center;transition:background .2s;
}
.sched-del:hover{background:#332020;}
.empty-state{
  display:flex;flex-direction:column;align-items:center;
  gap:8px;padding:20px 0;color:#9ca3af;font-size:12px;
}
.empty-icon{
  width:44px;height:44px;background:var(--blue);border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:22px;font-weight:700;
}

/* SCHEDULE PAGE */
.page-schedule{background:#1b1d1e;overflow-y:auto;}
.sched-pg-header{
  display:flex;align-items:center;padding:10px 14px 6px;flex-shrink:0;
  border-bottom:1px solid rgba(255,255,255,.06);position:sticky;top:0;background:#1b1d1e;z-index:5;
}
.sched-pg-title{font-size:13px;font-weight:700;color:#e2e8f0;flex:1;text-align:center;}
.back-btn{
  width:28px;height:28px;background:none;border:none;font-size:16px;
  color:#e2e8f0;cursor:pointer;border-radius:50%;
  display:flex;align-items:center;justify-content:center;transition:background .2s;
}
.back-btn:hover{background:#252829;}

/* drum time picker */
.time-picker{
  display:flex;align-items:stretch;height:160px;
  overflow:hidden;position:relative;flex-shrink:0;margin:6px 0;
}
.time-picker::before,.time-picker::after{
  content:'';position:absolute;left:0;right:0;height:55px;z-index:2;pointer-events:none;
}
.time-picker::before{top:0;background:linear-gradient(to bottom,#1b1d1e,transparent);}
.time-picker::after{bottom:0;background:linear-gradient(to top,#1b1d1e,transparent);}
.picker-highlight{
  position:absolute;top:50%;left:8%;right:8%;height:40px;
  transform:translateY(-50%);background:#252829;border-radius:10px;z-index:1;
}
.drum-col{
  flex:1;overflow:hidden;position:relative;z-index:3;
  cursor:ns-resize;user-select:none;
  display:flex;flex-direction:column;align-items:center;
}
.drum-items{
  display:flex;flex-direction:column;align-items:center;
  will-change:transform;position:relative;z-index:3;
}
.drum-item{
  height:40px;min-width:70px;display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:500;color:#c0c7d6;
  transition:font-size .12s,color .12s,font-weight .12s;
}
.drum-item.near{font-size:12px;color:#6b7280;}
.drum-item.sel{font-size:18px;font-weight:700;color:#e2e8f0;}

/* presets */
.presets{display:flex;gap:7px;padding:0 14px 8px;flex-shrink:0;}
.preset{
  flex:1;padding:7px 4px;background:#252829;border:1.5px solid rgba(255,255,255,.1);
  border-radius:20px;font-size:10px;font-weight:500;color:#9ca3af;cursor:pointer;transition:all .2s;
}
.preset:hover,.preset.active{background:#1e2b3c;border-color:var(--blue);color:var(--blue);}

/* timer */
.timer-box{padding:8px 14px;flex-shrink:0;}
.timer-label{font-size:12px;font-weight:700;color:#e2e8f0;margin-bottom:6px;}
.timer-vals{display:flex;gap:8px;margin-bottom:8px;}
.timer-val{
  flex:1;background:#1e2b3c;border-radius:8px;padding:6px;
  font-size:11px;font-weight:700;color:var(--blue);text-align:center;
}
.slider-group{margin-bottom:8px;}
.styled-slider{
  width:100%;height:16px;appearance:none;outline:none;cursor:pointer;
  background:transparent;
}
.styled-slider::-webkit-slider-runnable-track{
  height:4px;border-radius:2px;
  background:linear-gradient(to right,var(--blue) var(--p,0%),#2e3133 var(--p,0%));
}
.styled-slider::-moz-range-track{
  height:4px;border-radius:2px;border:none;
  background:linear-gradient(to right,var(--blue) var(--p,0%),#2e3133 var(--p,0%));
}
.styled-slider::-webkit-slider-thumb{
  appearance:none;width:16px;height:16px;border-radius:50%;
  background:var(--blue);cursor:grab;box-shadow:0 2px 6px rgba(37,99,235,.4);
  margin-top:-6px;
}
.styled-slider::-moz-range-thumb{
  width:16px;height:16px;border-radius:50%;border:none;
  background:var(--blue);cursor:grab;box-shadow:0 2px 6px rgba(37,99,235,.4);
}
.styled-slider:active::-webkit-slider-thumb{cursor:grabbing;}
.styled-slider:active::-moz-range-thumb{cursor:grabbing;}
.slider-ticks{
  display:flex;justify-content:space-between;
  font-size:9px;color:#9ca3af;margin-top:3px;
}

/* timer type */
.timer-type-row{
  display:flex;align-items:center;gap:8px;padding:6px 14px 8px;flex-shrink:0;
}
.tt-label{font-size:12px;font-weight:600;color:#e2e8f0;flex:1;}
.tt-once,.tt-repeat{font-size:10px;font-weight:500;}
.toggle{
  width:40px;height:22px;background:#2e3133;border-radius:11px;
  position:relative;cursor:pointer;transition:background .3s;flex-shrink:0;
}
.toggle.on{background:var(--blue);}
.toggle-knob{
  position:absolute;top:2px;left:2px;width:18px;height:18px;
  background:#fff;border-radius:50%;transition:transform .3s;
  box-shadow:0 1px 4px rgba(0,0,0,.2);
}
.toggle.on .toggle-knob{transform:translateX(18px);}

/* day picker */
.day-picker{display:flex;justify-content:space-between;padding:8px 14px 10px;flex-shrink:0;}
.day-picker.hidden{display:none;}
.day-btn{
  width:28px;height:28px;border-radius:50%;border:1.5px solid rgba(255,255,255,.15);
  background:#252829;font-size:9px;font-weight:600;color:#6b7280;
  cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;
}
.day-btn.active{background:var(--blue);border-color:var(--blue);color:#fff;}

/* confirm */
.confirm-wrap{display:flex;justify-content:center;padding:10px 0 16px;flex-shrink:0;}
.confirm-btn{
  width:56px;height:56px;background:var(--blue);border:none;border-radius:50%;
  color:#fff;font-size:28px;cursor:pointer;
  box-shadow:0 4px 20px rgba(37,99,235,.5);
  transition:transform .2s,box-shadow .2s;
  display:flex;align-items:center;justify-content:center;
}
.confirm-btn:hover{transform:scale(1.1);box-shadow:0 6px 28px rgba(37,99,235,.65);}

/* phone label */
.phone-label{
  text-align:center;margin-top:16px;color:rgba(255,255,255,.65);
  font-size:11px;letter-spacing:2px;text-transform:uppercase;
  text-shadow:0 1px 8px rgba(0,0,0,.9);
  position:relative;z-index:2;
}

/* DEVICE SECTION */
.device-wrapper{
  flex-shrink:0;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  margin-left:auto;
}
.device-label{
  color:rgba(255,255,255,.4);font-size:11px;
  letter-spacing:2px;text-transform:uppercase;
}
.device-scene{
  display:flex;flex-direction:column;align-items:center;
  filter:
    drop-shadow(0 16px 22px rgba(0,0,0,.7))
    drop-shadow(0 38px 45px rgba(0,0,0,.55))
    drop-shadow(0 65px 65px rgba(0,0,0,.4))
    drop-shadow(0 100px 90px rgba(0,0,0,.22))
    drop-shadow(6px 35px 18px rgba(0,0,0,.25));
}

/* full device image */
.device-full-sizer{
  position:relative;width:780px;
  /* Fixed aspect ratio based on the OFF image (4384×2287) so both images
     always occupy identical pixel space — prevents layout shift on toggle */
  aspect-ratio:4384/2287;
  overflow:hidden;
  -webkit-mask-image:linear-gradient(to right,transparent 0%,black 35%);
  mask-image:linear-gradient(to right,transparent 0%,black 35%);
}
.device-off-img{
  display:block;width:100%;height:100%;
  object-fit:cover;object-position:center;
  opacity:1;transition:opacity .6s ease;
}
.device-on-img{
  position:absolute;top:0;left:0;width:100%;height:100%;
  object-fit:cover;object-position:center;
  opacity:0;transition:opacity .6s ease;
}

/* button overlay — positioned over the round button on the device face */
.red-btn{
  position:absolute;
  left:33%;top:61%;
  transform:translate(-50%,-50%);
  width:30px;height:30px;border-radius:50%;
  cursor:pointer;z-index:20;
  transition:transform .15s;
}
.red-btn:hover{transform:translate(-50%,-50%) scale(1.6);}
.red-btn:active{transform:translate(-50%,-50%) scale(.85);}

.device-hint{
  color:rgba(255,255,255,.25);font-size:11px;letter-spacing:1px;margin-top:2px;
}

/* scrollbar */
::-webkit-scrollbar{width:3px;}
::-webkit-scrollbar-thumb{background:rgba(37,99,235,.3);border-radius:2px;}

@media(max-width:700px){
  .scene{
    flex-direction:column;
    align-items:center;
    gap:16px;
    padding:0 16px 40px;
  }
  .phone-wrapper{
    margin-left:0;
    transform:scale(0.75)!important;
    transform-origin:top center;
    margin-bottom:-160px;
  }
  .device-wrapper{
    transform:none!important;
    width:100%;
    max-width:380px;
    margin-left:0;
  }
  .device-full-sizer{
    width:100%;
    -webkit-mask-image:none;
    mask-image:none;
  }
}
