/* MIX-ED — Piano Visualiser page */

.pv-main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 48px; }
.pv-intro { margin: 8px 0 18px; }
.pv-intro .crumbs { color: var(--text-muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.pv-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px); margin: 6px 0 6px; letter-spacing: -0.01em; }
.pv-sub { color: var(--text-dim); max-width: 760px; margin: 0; line-height: 1.5; }

.pv-shell {
  background: #07080d; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.pv-stage { position: relative; height: clamp(360px, 62vh, 680px); user-select: none; }
.pv-stage canvas { display: block; position: absolute; inset: 0; }

.pv-hud { position: absolute; top: 14px; left: 16px; right: 200px; pointer-events: none; }
.pv-hud-title {
  font-family: Georgia, "Times New Roman", serif; font-size: clamp(18px, 2.4vw, 28px);
  background: linear-gradient(180deg, #fff3cf, #d9a441); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(244, 180, 0, 0.18);
}
.pv-hud-info { color: #9ea3b8; font-size: 13px; margin-top: 3px; max-width: 520px; }
.pv-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: #c4c6d4; flex-wrap: wrap; }
.pv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pv-legend i { display: inline-block; width: 10px; height: 16px; border-radius: 3px; box-shadow: 0 0 8px rgba(255,255,255,0.25); }

.pv-hud-right { position: absolute; top: 14px; right: 16px; pointer-events: none; }
.pv-chip {
  background: rgba(20, 22, 32, 0.85); border: 1px solid rgba(255,255,255,0.14); color: #f5f5fb;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px);
}
.pv-chip-wait {
  position: absolute; left: 50%; transform: translateX(-50%); top: 42%;
  font-size: 16px; padding: 9px 20px; border-color: var(--accent-pink);
  box-shadow: 0 0 24px rgba(238, 61, 139, 0.35); pointer-events: none;
}
.pv-drop {
  position: absolute; inset: 12px; border: 3px dashed var(--accent-amber); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
  color: #fff; background: rgba(7, 8, 13, 0.75); pointer-events: none;
}

.pv-transport {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: #10121b; border-top: 1px solid var(--border);
}
.pv-seek { flex: 1 1 200px; accent-color: var(--accent-amber); min-width: 120px; }
.pv-time { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; min-width: 86px; text-align: right; }
.pv-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; }

.pv-btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-3); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font: 600 14px var(--font); cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 80ms;
}
.pv-btn:hover { border-color: var(--accent-amber); }
.pv-btn:active { transform: translateY(1px); }
.pv-btn:disabled { opacity: 0.45; cursor: default; }
.pv-btn-play { background: linear-gradient(180deg, #ffcf5a, #e39a12); color: #1a1204; border-color: transparent; min-width: 104px; }
.pv-btn-play.is-playing { background: var(--surface-3); color: var(--text); border-color: var(--accent-amber); }
.pv-btn-rec.is-recording { background: #c0392b; border-color: #ff6b5b; color: #fff; animation: pv-pulse 1.2s ease-in-out infinite; }
@keyframes pv-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 90, 80, 0.2); } }

.pv-panels {
  display: grid; gap: 14px; margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.pv-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.pv-panel h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0.02em; }
.pv-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.pv-field select, .pv-inline select {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 9px; font: 500 14px var(--font);
}
.pv-field input[type="range"] { accent-color: var(--accent-amber); }
.pv-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.pv-check input { accent-color: var(--accent-amber); width: 16px; height: 16px; }
.pv-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.pv-note { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin: 6px 0; }
.pv-note.ok { color: var(--accent-green); }
.pv-panel kbd, .pv-ideas kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface-3); color: var(--text); font: 600 11px var(--font); text-align: center;
}

.pv-ideas { margin-top: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.pv-ideas summary { cursor: pointer; font-weight: 700; }
.pv-ideas ul { margin: 10px 0 4px; padding-left: 20px; color: var(--text-dim); line-height: 1.55; }
.pv-ideas li { margin: 5px 0; }

/* Full screen: the visualiser fills the projector */
.pv-shell:fullscreen { border-radius: 0; border: 0; }
.pv-shell:fullscreen .pv-stage { height: auto; flex: 1; }

@media (max-width: 640px) {
  .pv-main { padding: 12px 12px 36px; }
  .pv-hud { right: 16px; }
  .pv-hud-right { top: auto; bottom: 10px; }
  .pv-hud-info { display: none; }
  .pv-time { min-width: 0; }
}
.pv-drop[hidden], .pv-chip[hidden] { display: none; }

/* Composing */
.pv-stage.is-editing canvas { cursor: crosshair; touch-action: none; }
.pv-edit-hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(24% + 14px);
  background: rgba(20, 22, 32, 0.9); border: 1px solid var(--accent-amber); color: #f5f5fb;
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; white-space: nowrap; pointer-events: none;
  max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
}
.pv-edit-hint[hidden] { display: none; }
.pv-chip-wait.is-rec { border-color: #ff5b4f; box-shadow: 0 0 24px rgba(255, 91, 79, 0.4); }
.pv-btn-edit.is-on { background: var(--accent-amber); color: #1a1204; border-color: transparent; }
.pv-btn-quiet { background: transparent; }
.pv-field input[type="text"], .pv-field input[type="number"] {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 9px; font: 500 14px var(--font); width: 100%; box-sizing: border-box;
}
.pv-field input:disabled { opacity: 0.55; }
.pv-row-fields { gap: 10px; }
.pv-row-fields .pv-field { flex: 1 1 100px; margin-bottom: 4px; }
@media (max-width: 640px) { .pv-edit-hint { white-space: normal; text-align: center; border-radius: 12px; } }

/* Chords, game */
.pv-chip-chord {
  position: absolute; left: 16px; bottom: calc(24% + 14px); pointer-events: none;
  border-color: rgba(255,255,255,0.4); font-size: 15px;
}
.pv-results {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 6, 10, 0.72); backdrop-filter: blur(4px); padding: 16px;
}
.pv-results[hidden] { display: none; }
.pv-res-card {
  background: #12141d; border: 1px solid rgba(255,255,255,0.14); border-radius: 16px;
  padding: 22px 26px; max-width: 460px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.pv-res-card h3 { margin: 6px 0 2px; font-size: 18px; }
.pv-res-sub { color: var(--text-dim); margin: 0 0 10px; font-size: 13px; }
.pv-res-rank {
  font-family: var(--font-display); font-size: 58px; line-height: 1;
  background: linear-gradient(180deg, #fff3cf, #e39a12); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pv-rank-S { background-image: linear-gradient(180deg, #ffffff, #ffd873 40%, #ee3d8b); }
.pv-rank-C, .pv-rank-D { background-image: linear-gradient(180deg, #c4c6d4, #6b6f80); }
.pv-res-score { font-size: 34px; font-weight: 800; }
.pv-res-score span { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.pv-res-best { margin: 4px 0 12px; color: var(--accent-amber); font-size: 13.5px; }
.pv-res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-size: 13.5px; text-align: left; margin: 0 auto 12px; max-width: 320px; }
.pv-res-note { color: var(--text-muted); font-size: 12.5px; }
.pv-res-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.pv-res-submit { margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.pv-res-submit a { color: var(--accent-amber); }
.pv-res-form { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pv-res-form input, .pv-res-form select {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; font: 500 14px var(--font);
}
.pv-hud-right .pv-chip b { color: var(--accent-amber); }
