/* Chord Match — a quiet, tactile practice room. Mobile is the default layout. */
:root {
  --bg: #102422;
  --bg-2: #142c29;
  --panel: #1b3330;
  --panel-2: #25443e;
  --text: #f0eee4;
  --paper: #f3efe3;
  --muted: #aabbb1;
  --line: #a3b9aa2b;
  --match: #a5d8b9;
  --gold: #dac18d;
  --gold-2: #eddbb5;
  --radius: 12px;
  --serif: Georgia, "Times New Roman", serif;
}
html { color-scheme: dark; }
body { background: var(--bg); }
.wrap { max-width: 1040px; padding: 20px 20px 28px; }
header { min-height: 46px; padding: 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 0; }
.brand { width: 182px; }
.actions { gap: 0; margin-left: auto; }
.actions .btn { border-radius: 8px; color: var(--muted); }
.actions .btn:hover { color: var(--paper); background: var(--panel); }
.actions .btn[aria-pressed="true"] { color: var(--muted); }
button, summary, select { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid var(--match); outline-offset: 4px; }
.modes {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0; margin: 10px 0 0; padding: 0; order: 3; flex-basis: 100%;
  border: 0; border-radius: 0;
  background: none; width: 100%;
}
.modes .mode {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  position: relative; width: auto; min-width: 0; height: 48px;
  padding: 10px 4px !important; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 500;
}
.modes .mode svg { width: 18px; height: 18px; }
.modes .mode[aria-selected="true"] { color: var(--match); background: none; box-shadow: none; }
.modes .mode[aria-selected="true"]::after { content: ""; position: absolute; height: 2px; inset: auto 14px -1px; background: var(--match); }
.mode:hover { color: var(--paper); }
.workspace-bar { display: block; margin: 22px 0 18px; }
.workspace-bar > div:first-child { display: block; }
.workspace-bar h2 { font-size: 28px; font-weight: 500; letter-spacing: -.055em; line-height: 1.15; }
.workspace-bar p { margin: 9px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.mission { font-size: 11px; line-height: 1.5; margin: 0 0 9px; }
.mission strong { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.track { height: 3px; border-radius: 0; background: #d8e8d814; }
.track span { background: var(--match); border-radius: 0; }
.round-track { margin-bottom: 20px; }
.prompt {
  border: 1px solid var(--line); border-radius: 12px; box-shadow: none;
  background: var(--panel); padding: 16px 18px; margin-bottom: 22px;
}
.prompt[data-prompt="name"] { display: grid; grid-template-columns: max-content minmax(0,1fr) auto; grid-template-rows: 20px 50px; column-gap: 10px; align-items: baseline; }
.prompt[data-prompt="name"] .head { display: contents; }
.prompt[data-prompt="name"] .label { grid-column: 1 / 3; grid-row: 1; }
.prompt[data-prompt="name"] .chord { grid-column: 1; grid-row: 2; align-self: baseline; font-size: 50px; }
.prompt[data-prompt="name"] .quality { grid-column: 2; grid-row: 2; align-self: baseline; }
.prompt[data-prompt="name"] .hear { grid-column: 3; grid-row: 1 / 3; align-self: center; margin: 0; }
.prompt .head { margin: 0 0 8px; grid-column: 1 / -1; align-items: center; }
.prompt .label { font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.prompt .chord { font: 400 60px/.95 var(--serif); letter-spacing: -.045em; color: var(--paper); }
.prompt .quality { font-size: 13px; letter-spacing: .015em; text-transform: lowercase; margin: 0; color: var(--muted); }
.prompt .hear, #earView .prompt .hear {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-width: 92px; height: 44px; min-height: 44px; padding: 10px 12px !important;
  border: 1px solid #a5d8b94d; border-radius: 8px; background: none;
  color: var(--match); font-size: 12px; margin: -5px -4px -5px auto;
}
.prompt .hear svg { width: 16px; height: 16px; }
.prompt .hear:hover { background: #a5d8b915; }
.prompt .paper { max-width: 340px; margin-top: 16px; }
#bSteps { display: grid; grid-template-columns: minmax(0,1fr); gap: 22px; }
.step { min-width: 0; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.step h3 { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: -.01em; min-height: 22px; margin: 0 0 12px; gap: 9px; }
.step h3 .num { height: 21px; width: 21px; border: 1px solid #a5d8b94d; background: none; color: var(--match); font-size: 10px; }
.step h3 .mark { font-size: 11px; }
.tools { margin-bottom: 10px; gap: 6px; }
.tools .k { font-size: 11px; margin-right: 6px; }
.tools .chip { width: 42px; min-width: 42px; height: 40px; padding: 0; border-radius: 6px; }
.chip { border-color: var(--line); border-radius: 8px; }
.chip[aria-pressed="true"] { border-color: #dac18d80; color: var(--gold-2); background: #dac18d12; }
.tools .linkbtn { height: 40px; min-height: 40px; width: 40px; padding: 9px !important; border-radius: 6px; }
.paper { border-radius: 9px; background: var(--paper); }
.gstaff { max-width: none; width: 100%; }
.gstaff svg { width: 100%; height: auto; max-height: 254px; }
.picked { min-height: 22px; margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.picked:has(.linkbtn) { min-height: 44px; }
.piano { height: 136px; padding: 6px 6px 8px; border: 1px solid #65857957; border-radius: 9px; background: #091714; box-shadow: 0 4px 0 #08120f; margin: 0 0 5px; }
.piano.small { height: 112px; }
.key.white { background: linear-gradient(#f7f4eb 0%, #e6dfce 100%); border-radius: 0 0 4px 4px; color: #6a6b5b; font-size: 10px; padding-bottom: 9px; box-shadow: inset 0 -3px 0 #b9b6a7; }
.key.black { background: linear-gradient(#2d3631 0%, #101815 95%); border-radius: 0 0 3px 3px; }
.key.white.sel { background: linear-gradient(#c5e4cc, #95c8aa); color: #153e2a; box-shadow: inset 0 -3px 0 #699e7b; }
.key.black.sel { background: linear-gradient(#a5d8b9, #508c65); }
.key.white.sounding { box-shadow: inset 0 -1px 0 #9a9d92; }
.submit-row, #earView .submit-row {
  position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 26px; padding: 18px 0 0; border-top: 1px solid var(--line); background: none;
}
.submit-hint { flex: 1 1 130px; max-width: none; font-size: 12px; color: var(--muted); }
.submit-row .btn.primary {
  display: flex; flex-direction: row-reverse; align-items: center; justify-content: center; gap: 10px;
  width: auto; min-width: 148px; min-height: 48px; height: 48px; padding: 12px 16px !important;
  border-radius: 8px; border: 1px solid var(--match); background: var(--match); color: #103322; box-shadow: none;
  font-size: 12px; font-weight: 600;
}
.submit-row .btn.primary svg { width: 18px; height: 18px; }
.submit-row .btn.primary:hover:not(:disabled) { background: #b8e3c8; }
.submit-row .btn.primary:disabled { opacity: 1; color: #9eaea4; background: #223c34; border-color: #65857957; box-shadow: none; }
.feedback:not(:empty) { padding: 14px 16px; margin: 20px 0 0; border-left: 2px solid currentColor; background: #ffffff05; font-size: 13px; line-height: 1.6; }
.namepick { gap: 10px; }
.namepick .row { gap: 6px; }
.namepick .chip { min-width: 38px; min-height: 44px; }
.namepick .row.q .chip { padding: 8px 18px; text-transform: capitalize; }
.board, .board.big { max-width: none; gap: 10px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { aspect-ratio: 4/5; border-radius: 9px; }
.back { background: #234139; border: 1px solid #527864; box-shadow: 0 3px 0 #081b14; }
.back::after { inset: 7px; border-radius: 4px; border-color: #a5d8b930; }
.back .mono { font-size: 32px; color: var(--gold-2); transform: none; }
.front.name { background: #244139; }
.face { border-radius: 9px; }
.card:hover:not(.flipped) .inner { transform: translateY(-2px); }
.chart { grid-template-columns: minmax(0,1fr); gap: 22px; }
.chart-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.chart-card .top { padding: 16px 16px 13px; align-items: center; }
.chart-card .chord { font: 400 34px/1 var(--serif); color: var(--paper); }
.chart-card .quality { font-size: 10px; }
.playbtn svg { width: 16px; height: 16px; }
.playbtn { width: 40px; height: 40px; color: var(--match); background: none; border-color: #a5d8b949; }
.chart-card .staff { aspect-ratio: auto; height: 182px; }
.chart-card .staff svg { height: 156px; width: 100%; }
.chart-card .staff .flipbtn { width: 36px; height: 36px; }
.chart-card .staff .viewtag { bottom: 13px; left: 16px; }
.chart-card .notes { padding: 15px 16px; color: var(--muted); font-size: 12px; }
.chart-card > .piano { margin: 0 14px 18px; height: 112px; }
#chartView > .hint { font-size: 12px; line-height: 1.6; margin: -2px 0 22px; }
dialog#settings { background: #19332c; border-color: #64806d; border-radius: 14px; padding: 24px; }
#settings .pill { min-height: 44px; }
#settings .givebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#settings .givebar .chip { display: flex; width: 100%; gap: 10px; align-items: center; justify-content: center; height: 44px; border-radius: 8px; }
#settings .givebar .chip svg { width: 18px; height: 18px; }
.step[data-filled="true"] h3 .num { background: #304b3c; border-color: #78927c; color: var(--paper); }
@media (max-width: 719px) {
  .workspace-bar { margin-block: 20px 16px; }
  .workspace-bar h2 { font-size: 27px; }
  .workspace-bar p { margin-top: 7px; }
  .prompt[data-prompt="name"] { grid-template-rows: 50px; min-height: 82px; }
  .prompt[data-prompt="name"] .label { display: none; }
  .prompt[data-prompt="name"] .chord, .prompt[data-prompt="name"] .quality, .prompt[data-prompt="name"] .hear { grid-row: 1; }
  .board .card:nth-last-child(2):nth-child(4n+1) { grid-column: 2; }
  .compare-stage .paper { max-width: 280px; }
}
.settings-head h2 { font-size: 26px; font-weight: 500; }
.settings-note { line-height: 1.6; }
.stat { border-radius: 8px; background: #102a21; }
.dialog { background: #19332c; border-color: #64806d; border-radius: 14px; }
.dialog h2 { font-size: 34px; }
#earView .prompt { min-height: 138px; display: block; }
#earView .ear-copy { font-size: 12px; line-height: 1.6; margin: 18px 0 0; max-width: 48ch; }
#earView #bSteps { gap: 22px; }
#earView #bSteps .step:first-child { grid-column: 1/-1; }
#earView #bSteps .namepick .row { margin: 0; }
.compare-choice { flex-wrap: wrap; }
.compare-choice select { max-width: 100%; min-height: 44px; }
.compare-head h3 { font-size: 17px; }
.correction { margin-bottom: 0; padding-top: 22px; }
@media (min-width: 720px) {
  .wrap { padding: 32px 40px 48px; }
  header { padding: 0 0 22px; flex-wrap: nowrap; gap: 26px; }
  header .actions { order: 3; margin: 0; }
  .brand { width: 210px; }
  .modes { width: auto; min-width: 360px; flex-basis: auto; margin: 0 auto; border-bottom: 0; gap: 4px; order: 2; }
  .modes .mode { gap: 8px; padding: 12px 14px !important; font-size: 13px; }
  .modes .mode[aria-selected="true"]::after { inset-inline: 18px; }
  .workspace-bar { margin: 34px 0 24px; }
  .workspace-bar h2 { font-size: 38px; letter-spacing: -.055em; }
  .workspace-bar p { font-size: 13px; margin-top: 10px; }
  .mission { font-size: 12px; }
  .round-track { margin-bottom: 24px; }
  .prompt { padding: 18px 24px; margin-bottom: 28px; }
  .prompt[data-prompt="name"] { grid-template-columns: max-content minmax(0,1fr) auto; grid-template-rows: 20px 52px; column-gap: 12px; align-items: baseline; min-height: 108px; }
  .prompt[data-prompt="name"] .head { display: contents; }
  .prompt[data-prompt="name"] .label { grid-column: 1/3; grid-row: 1; align-self: start; margin: 0; }
  .prompt[data-prompt="name"] .chord { grid-column: 1; grid-row: 2; margin: 0; font-size: 52px; }
  .prompt[data-prompt="name"] .quality { grid-column: 2; grid-row: 2; font-size: 15px; align-self: baseline; padding: 0; margin: 0; }
  .prompt[data-prompt="name"] .hear { grid-column: 3; grid-row: 1/3; margin: 0; }
  #bSteps { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 32px; }
  .step h3 { font-size: 14px; margin-bottom: 18px; }
  .step[data-step="keys"] .piano { margin-top: 0; }
  .step[data-step="keys"] h3 { margin-bottom: 68px; }
  .piano { height: 212px; }
  .picked { font-size: 12px; margin-top: 14px; }
  .submit-row { margin-top: 28px; padding-top: 20px; }
  .submit-hint { font-size: 12px; }
  .submit-row .btn.primary { min-width: 172px; font-size: 13px; }
  .board, .board.big { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 14px; }
  .board .back .mono { font-size: 40px; }
  .chart { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
  .chart-card .staff { height: 176px; }
  .namepick .chip { min-width: 42px; }
}
@media (min-width: 720px) and (max-width: 940px) {
  header { gap: 16px; }
  .brand { width: 176px; }
  .modes { min-width: 300px; }
  .modes .mode { padding-inline: 8px !important; }
  .modes .mode svg { display: none; }
  .wrap { padding-inline: 28px; }
}
@media (max-width: 359px) {
  .wrap { padding-inline: 14px; }
  .brand { width: 155px; }
  .modes .mode { gap: 5px; font-size: 11px; }
  .workspace-bar h2 { font-size: 27px; }
  .namepick .row.l { gap: 4px; }
  .namepick .row.l .chip { min-width: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
