/* =========================================
   metronomestyle.css — Metronome Tool
   Builds on shared/global.css
   ========================================= */

/* ── Full-height layout (no scroll) ── */
html, body { height: 100%; overflow: hidden; }

.metro-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}

/* Hero inherits global styles — already correct */

/* ── Game title ── */
.gameMainTitle {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0;
  padding-top: 4px;
  padding-bottom: 0px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Controls panel (tile) ── */
.controlsPanel {
  background: var(--bg-surface);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 16px 16px;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
  margin-bottom: 0px;
}
body.light-theme .controlsPanel { border-color: rgba(0,0,0,0.06); }

.actionsGrid {
  display: flex;
  gap: 8px;
  width: 100%;
}
.actionsGrid .icon-btn      { flex: 0 0 52px; height: 52px; padding: 0; font-size: 22px; }
.actionsGrid .flex-text-btn { flex: 1 1 0; padding: 0 4px; font-size: 14px; white-space: nowrap; }

/* Make the Play button turn red when active */
#btn-play.playing {
  background: var(--danger) !important;
  border-color: var(--danger-shadow) !important;
  box-shadow: 0 4px 0 var(--danger-shadow) !important;
  color: #fff !important;
}

/* ── Instructions ── */
.metro-instructions {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding: 0px 16px 4px;
}

/* ── Beat indicator dots (now inside ring area) ── */
.metro-dot {
  border-radius: 50%;
  opacity: 0.15;
  flex-shrink: 0;
}
.metro-dot-down1 { background: #10b981; }
.metro-dot-beat1 { background: #3b82f6; }
.metro-dot-down2 { background: #f97316; }
.metro-dot-beat2 { background: #eab308; }

.metro-dot-sep {
  width: 2px;
  border-radius: 1px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
  align-self: stretch;
}
body.light-theme .metro-dot-sep { background: rgba(0,0,0,0.18); }

/* ── Stacked column: canvas above, controls below ── */
.metro-stack {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 0 0px;
}

/* ── Shared tile base ── */
.metro-tile {
  background: var(--bg-surface);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
body.light-theme .metro-tile { border-color: rgba(0,0,0,0.06); }

/* ── Canvas tile: flex row — rings left, BPM right ── */
/* ↓↓↓ EDIT THIS VALUE to change the tile height ↓↓↓ */
.metro-canvas-tile {
  --metro-canvas-height: 250px;
/* ↑↑↑ ─────────────────────────────────────────── ↑↑↑ */
  flex: 0 0 var(--metro-canvas-height);
  height: var(--metro-canvas-height);
  display: flex;
  flex-direction: row;
}

/* Left ~2/3 — ring animation + dots stacked */
.metro-ring-area {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Canvas fills the upper portion of the ring area */
.metro-canvas-wrap {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
}

#visuals {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* Single-line dots strip at the bottom of the ring area */
/* ↓ Edit padding here: top value = gap above dots, bottom value = gap below dots */
.metro-dots-strip {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0px 8px 20px;   /* top | sides | bottom */
  overflow: hidden;
}

/* Right 1/3 — BPM number + drag */
#bpm-container {
  flex: 0 0 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  border-left: 2px solid rgba(255,255,255,0.07);
}

body.light-theme #bpm-container { border-left-color: rgba(0,0,0,0.07); }

#bpm-number {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

/* Inline BPM edit input — appears on click, matches the number style */
.metro-bpm-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: var(--text-main);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 900;
  text-align: center;
  outline: none;
  padding: 0;
  line-height: 1;
  -moz-appearance: textfield;
}
.metro-bpm-input::-webkit-outer-spin-button,
.metro-bpm-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

#bpm-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 5px;
}

.metro-bpm-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0.8;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* ── Controls tile (fixed height below canvas) ── */
.metro-ctrl-tile {
  flex-shrink: 0;
  padding: 12px 12px 10px;
}

/* Horizontal grid of 4 equal columns */
.metro-ctrl-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.metro-ctrl-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metro-ctrl-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs & selects */
.metro-ctrl-tile input[type="number"],
.metro-ctrl-tile select {
  width: 100%;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-elevated);
  background: var(--bg-base);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
  text-align: center;
}

.metro-ctrl-tile input[type="number"]:focus,
.metro-ctrl-tile select:focus {
  border-color: var(--accent);
}

.metro-tap-btn {
  width: 100%;
  font-size: 18px;
  font-weight: 900;
  margin-top: 10px;
  padding: 8px 4px;
  margin-bottom: 10px;
  white-space: nowrap;
}
