@charset "UTF-8";
:root{
  --bg:#0f0f10;
  --panel:#121213;
  --text:#e7e7e8;
  --muted:#9a9a9c;
  --accent:#ff5a4d;
  --control-size:56px;
  --gap:12px;
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ...existing styles... */
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;overscroll-behavior-y: contain;touch-action: pan-y pinch-zoom;user-select:none}
#app{max-width:900px;margin:0 auto;padding:18px;display:flex;flex-direction:column;gap:18px}
.top{display:flex;flex-direction:column;gap:10px}
.bpm-block{display:flex;flex-direction:column;align-items:center}
#bpmValue{font-size:128px;font-weight:800;color:#ffffff;line-height:1}
/* new: elegant pulse + glow animation for bpm value */
@keyframes bpmPulseGlow {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(255,90,77,0); filter: drop-shadow(0 0 0 rgba(255,90,77,0)); }
  40% { transform: scale(1.08); text-shadow: 0 6px 20px rgba(255,90,77,0.28); filter: drop-shadow(0 10px 28px rgba(255,90,77,0.18)); }
  100% { transform: scale(1); text-shadow: 0 0 0 rgba(255,90,77,0); filter: drop-shadow(0 0 0 rgba(255,90,77,0)); }
}
.bpm-flash {
  animation: bpmPulseGlow 220ms ease-out both;
  will-change: transform, text-shadow, filter;
}
#tempoLabel{font-size:14px;color:var(--muted);margin-top:6px}
.controls-row{display:flex;align-items:center;gap:10px}
.controls-row button{width:44px;height:44px;border-radius:8px;border:0;background:#1a1a1b;color:var(--text);font-size:20px}
#bpmSlider{flex:1;height:28px}

/* main layout */
.main{display:flex;gap:18px;flex-direction:column}
.left, .right{background:var(--panel);padding:12px;border-radius:12px}
.play-row{display:flex;gap:12px;align-items:center;justify-content:flex-start;margin-bottom:12px}
#playPause{width:var(--control-size);height:var(--control-size);border-radius:999px;border:0;background:var(--accent);color:white;font-size:20px;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 18px rgba(0,0,0,0.6)}
#playPause.paused{background:#2a2a2b;color:var(--text)}
.tap{flex:1;height:var(--control-size);border-radius:10px;background:#1a1a1b;border:0;color:var(--text);font-weight:700}

.beats-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}
.beats-left{display:flex;align-items:center;gap:12px}
.beats-controls{display:flex;align-items:center;gap:8px}
.beats-controls button{width:44px;height:44px;border-radius:8px;border:0;background:#1a1a1b;color:var(--text);font-size:22px}
#beatsValue{min-width:44px;text-align:center;font-weight:700}

.accent{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:14px}

.sub-info{display:flex;justify-content:space-between;align-items:center}
/* ensure timer elements stay inline and compact on mobile */
.timer-inline{display:inline-flex;align-items:center;gap:8px}
.timer-set{gap:8px}
.timer-set button{width:38px;height:38px;border-radius:8px;border:0;background:#1a1a1b;color:var(--text);font-size:20px}
#timerValue{min-width:56px;text-align:center;font-weight:700;color:var(--muted)}

.subdivisions{display:flex;gap:8px;margin:10px 0}
.subdivisions button{padding:8px 12px;border-radius:8px;border:0;background:#151516;color:var(--muted);font-weight:700}
.subdivisions button[aria-checked="true"], .subdivisions button.active{background:var(--accent);color:white}

.beat-dots{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:center;padding:12px}
/* make dots take half the row (two per line) and preserve circular shape */
.dot{width:calc(50% - 8px);aspect-ratio:1;border-radius:50%;background:#222;opacity:0.6;transition:transform 0.12s ease, background 0.12s}
/* slightly larger active appearance */
.dot.active{
  background:#ffffff;
  transform:scale(1.35);
  opacity:1;
  box-shadow: 0 10px 30px rgba(255,255,255,0.18), 0 2px 8px rgba(255,255,255,0.08) inset;
  transition: transform 0.12s ease, background 0.12s, box-shadow 0.18s ease;
}

/* nueva fila: pulso (izquierda) y subdivisión (derecha) en la misma línea */
.pulse-sub-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pulse-sub-row .beat-dots{justify-content:flex-start;flex:1}
.pulse-sub-row .subdivisions{flex-shrink:0;margin-left:12px}

.counters{margin-top:12px;color:var(--muted);font-size:14px;display:flex;gap:18px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.counter-item{display:inline-flex;gap:8px;align-items:center;font-weight:700;text-align:right}
.counter-label{font-weight:600;color:var(--muted);font-size:13px}
.counter-value{min-width:28px;text-align:right;color:var(--text);font-weight:800}

.footer{display:flex;justify-content:center;align-items:center;color:var(--muted);font-size:13px}

/* app title in header */
.app-title{font-family:"Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;font-size:32px;font-weight:900;color:var(--accent);text-align:center;margin:30px 0 20px 6px}

/* responsive */
@media(min-width:820px){
  .main{flex-direction:row}
  .left{flex:1}
  .right{width:320px}
  #bpmValue{font-size:192px}
}

/* touch targets */
button, input[type=range]{touch-action:manipulation}

.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:120;pointer-events:none;opacity:0;transition:opacity .12s ease}
.modal[aria-hidden="false"]{pointer-events:auto;opacity:1}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.5)}
.modal-panel{position:relative;background:#0f0f10;border-radius:10px;padding:16px;max-width:420px;width:92%;box-shadow:0 20px 40px rgba(0,0,0,0.6);color:var(--text);transform:translateY(6px)}
.modal-header h3{margin:0 0 8px 0;font-size:16px;color:var(--accent)}
.modal-body{font-size:15px;color:var(--text);min-height:28px;margin-bottom:12px}
.modal-footer{display:flex;gap:8px;justify-content:flex-end;align-items:center}
.modal-input{flex:1;padding:8px;border-radius:8px;border:1px solid #222;background:#0b0b0c;color:var(--text)}
.modal-btn{background:#151516;color:var(--text);border:0;padding:8px 12px;border-radius:8px}
.modal-btn.primary{background:var(--accent);color:#fff}

/* allow selection inside inputs and textareas */
input, textarea, .modal-input { user-select: text; -webkit-user-select: text }

/* footer made-by styling */
.footer .made-by{font-size:13px;color:var(--muted); margin-top:8px;}
.footer .made-by a{color:var(--text);text-decoration:underline}