/* Town-specific DOM overlay styles — mostly Lesson 1 UI. */

.l1-card { max-width: 720px; }

.l1-beat-row {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  margin: 12px 0;
}
.l1-beat-dot {
  height: 28px;
  border-radius: 4px;
  background: #2a3848;
  color: #99a7b6;
  font-family: monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a4a5e;
  transition: background 0.08s;
}
.l1-beat-dot.has-hit { background: #455a73; color: #e7ecf2; }
.l1-beat-dot.active  { background: #ffca28; color: #111; border-color: #f57f17; }

.l1-pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.l1-pad {
  height: 110px;
  border-radius: 8px;
  border: 2px solid #111;
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.05s, filter 0.08s;
}
.l1-pad:active { transform: scale(0.97); filter: brightness(1.2); }

.l1-status {
  margin: 8px 0;
  font-family: monospace;
  font-size: 13px;
  color: #c0cad6;
}

/* ===== Lesson 3 — 16-step sequencer ====================================== */

.l3-card { max-width: 920px; }

.l3-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0;
  background: #0e151d;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #2a3848;
  overflow-x: auto;
}

.l3-row {
  display: grid;
  grid-template-columns: 70px repeat(16, 1fr);
  gap: 3px;
  min-width: 720px;
}

.l3-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  color: #111;
  border-radius: 4px;
  padding: 4px;
}
.l3-row-label--blank { background: transparent; }

.l3-head-cell {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 11px;
  color: #6b7a8c;
  background: #161f2a;
  border-radius: 3px;
}
.l3-head-cell--down { color: #c0cad6; font-weight: bold; }
.l3-head-cell.playhead { background: #ffca28; color: #111; }

.l3-cell {
  height: 36px;
  background: #1a2330;
  border: 1px solid #2a3848;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.08s, transform 0.05s;
  padding: 0;
}
.l3-cell:hover { background: #243140; }
.l3-cell:active { transform: scale(0.95); }
.l3-cell.on {
  background: var(--cell-color, #ffca28);
  border-color: #111;
}
.l3-cell.playhead {
  outline: 2px solid #ffca28;
  outline-offset: -2px;
}
.l3-cell.on.playhead {
  filter: brightness(1.3);
}
/* Recreate-the-Beat: ghost = target hint; check result colors. */
.l3-cell.ghost::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  margin: 14px auto 0;
  border-radius: 50%;
  border: 2px dashed var(--cell-color, #ffca28);
  opacity: 0.5;
}
.l3-cell.on.ghost::after { display: none; }
/* Higher specificity (.l3-grid ancestor) so check colors beat .on's fill. */
.l3-grid .l3-cell.correct { background: #2e7d32; border-color: #1b5e20; }
.l3-grid .l3-cell.wrong   { background: #c62828; border-color: #8e0000; }
.l3-grid .l3-cell.missing { background: #1a2330; outline: 2px dashed #ef5350; outline-offset: -2px; }

/* ===== Lesson 4 — piano-roll melody match ================================ */

.l4-card { max-width: 720px; }

.l4-section-label {
  font-family: monospace;
  font-size: 12px;
  text-transform: uppercase;
  color: #99a7b6;
  margin: 14px 0 6px;
  letter-spacing: 1px;
}

.l4-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.l4-slot {
  width: 56px;
  height: 48px;
  border-radius: 6px;
  background: #1a2330;
  border: 1px solid #2a3848;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
  color: #99a7b6;
  transition: background 0.15s, transform 0.1s;
}
.l4-slot.flash { transform: scale(1.08); box-shadow: 0 0 0 2px #ffca28; }
.l4-slot.match { box-shadow: 0 0 0 2px #43a047; }
.l4-slot.miss  { box-shadow: 0 0 0 2px #e53935; opacity: 0.7; }

.l4-piano {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin: 12px 0;
}
.l4-key {
  height: 130px;
  border-radius: 8px;
  border: 2px solid #111;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  color: #111;
  transition: transform 0.05s, filter 0.08s;
}
.l4-key:active { transform: scale(0.96); filter: brightness(1.2); }

/* ===== Lesson 2 — loop layering ========================================= */

.l2-card-outer { max-width: 760px; }

.l2-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.l2-card {
  background: #1a2330;
  border: 2px solid var(--card-color, #ffca28);
  border-radius: 10px;
  padding: 16px 14px;
  font-family: monospace;
  color: #e7ecf2;
  cursor: pointer;
  transition: background 0.12s, transform 0.06s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
}
.l2-card:hover { background: #243140; }
.l2-card:active { transform: scale(0.98); }
.l2-card.on {
  background: var(--card-color, #ffca28);
  color: #111;
}
.l2-card.on .l2-card-hint { color: #1a1a1a; }
.l2-card.pulse { box-shadow: 0 0 0 3px #ffca28; }
.l2-card.shake { animation: l2-shake 0.32s; box-shadow: 0 0 0 3px #e53935; }
@keyframes l2-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.l2-card-label {
  font-size: 18px;
  font-weight: bold;
}
.l2-card-hint {
  font-size: 12px;
  color: #99a7b6;
}
.l2-card-state {
  margin-top: auto;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0.7;
}

/* ===== Completion indicators (town) ===================================== */
/* (Phaser handles its own visuals; see TownScene for in-canvas markers.) */
