/* Silba. Mobile first, with one compact path from choosing to playing. */
:root {
  --ink: #173f35;
  --muted: #5d7267;
  --paper: #f8f7ef;
  --white: #fffefa;
  --lime: #d9edae;
  --lime-soft: #edf4df;
  --line: #dce3d6;
  --coral: #d77860;
  --sun: #f1d381;
  --red: #963d32;
  --focus: #a54e38;
  --card-shadow: 0 8px 28px rgba(23,63,53,.045), 0 1px 3px rgba(23,63,53,.035);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button {
  min-height: 48px;
  border: 0;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
button:disabled { opacity: .45; cursor: default; }
button:not(:disabled):active { transform: translateY(1px); }
button, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
p, button, a { overflow-wrap: break-word; }
.shell {
  max-width: 1200px;
  margin: auto;
  padding: 0 max(16px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-right));
}
.screen { padding: 24px 0 12px; min-height: calc(100svh - 170px); }
.screen, .card, .selection-copy { min-width: 0; }

/* Header and reusable controls */
.header {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 0 8px;
  min-height: 80px;
  padding: 7px 0 8px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; padding: 0; background: none; font-size: 29px; font-weight: 850; letter-spacing: -1.8px; }
.brand-mark { margin-right: 9px; font-size: 42px; font-weight: 450; letter-spacing: -5px; transform: rotate(-20deg); }
.brand-dot { color: var(--coral); }
.header nav { display: flex; justify-self: end; align-items: center; gap: 2px; }
.nav-link { padding: 10px 8px; border-radius: 10px; background: none; color: var(--muted); font-size: 12px; font-weight: 550; }
.nav-link.selected { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.help-link { min-width: 48px; font-size: 0; }
.help-link::after { content: "?"; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); font-size: 14px; }
.status { display: flex; grid-column: 1/-1; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 10px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #a5b1a1; }
.status.active::before { background: #678b35; box-shadow: 0 0 0 3px #e6efda; }
.eyebrow { margin: 0 0 12px; font-size: 10px; font-weight: 750; line-height: 1.6; letter-spacing: 1.3px; }
.page-title { margin: 12px 0 16px; font-size: 38px; font-weight: 780; line-height: 1.08; letter-spacing: -1.7px; }
.page-title > span { color: #8a9e4a; }
.lead { margin: 12px 0 20px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border: 1px solid #173f35;
  border-radius: 15px;
  background: linear-gradient(135deg,#24533f,#173f35);
  color: var(--white);
  box-shadow: 0 3px 0 rgba(12,42,31,.12), 0 5px 12px rgba(23,63,53,.08);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
}
.primary > span[aria-hidden="true"] { color: var(--lime); font-size: 22px; font-weight: 450; }
.primary > svg { flex-shrink: 0; width: 20px; height: 20px; fill: currentColor; }
.secondary { min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f4f5eb; font-size: 14px; line-height: 1.3; }
.text-button, .back-link, .inline-link { padding: 12px 8px; background: none; font-size: 13px; }
.back-link { margin-top: -12px; padding-left: 0; color: var(--muted); }
.inline-link { display: block; padding-left: 0; text-decoration: underline; }
.wide { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.privacy { margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.hint, .muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 23px; background: var(--white); box-shadow: var(--card-shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.pill { padding: 7px 10px; border: 1px solid #d2dfc4; border-radius: 30px; background: var(--lime-soft); font-size: 11px; line-height: 1.3; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.button-row:has(>[hidden]):not(:has(>:not([hidden]))) { display: none; }
select { width: 100%; min-width: 0; min-height: 50px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f5f6ed; color: var(--ink); font-size: 16px; font-weight: 600; }
.advanced { border-top: 1px solid var(--line); font-size: 12px; }
summary { min-height: 48px; padding: 16px 0; cursor: pointer; line-height: 1.4; }
.advanced label { display: block; margin: 12px 0; }
.advanced input[type="range"] { width: 100%; min-height: 48px; accent-color: var(--ink); }
.check-label { display: flex !important; align-items: center; gap: 10px; min-height: 48px; margin: 16px 0; font-size: 12px !important; line-height: 1.5; cursor: pointer; }
.check-label input { flex-shrink: 0; width: 22px; height: 22px; accent-color: var(--ink); }

/* Home: a confident headline and a small flash of sunshine. */
.home { max-width: 700px; min-height: auto; margin: auto; padding: 34px 0 24px; }
.hero-copy h1 { max-width: 12ch; margin: 14px 0 16px; font-size: 44px; font-weight: 790; line-height: 1.05; letter-spacing: -2.2px; }
.hero-copy h1 em { font-style: normal; background: linear-gradient(transparent 73%,var(--lime) 73%); }
.hero-copy > .eyebrow { color: #647a43; }
.hero-description { margin: 16px 0 20px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.hero-cta { max-width: 430px; min-height: 56px; }
.hero-visual { display: none; }
.quick-steps { display: flex; justify-content: space-between; gap: 8px; margin: 14px 0 0; padding: 16px 0; border-top: 1px solid var(--line); list-style: none; font-size: 12px; }
.quick-steps li { display: flex; align-items: center; gap: 7px; }
.quick-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 9px; background: #eaf0dc; font-size: 11px; }
.quick-steps li:nth-child(2) b { background: #f8e7c4; }
.quick-steps li:nth-child(3) b { background: #f5e1d6; }
footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 20px 0 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .6px; }
footer span:last-child { display: none; }

/* Familiar songs, still compact enough for Jugar at 360 x 640. */
.selection, .tuner-layout { display: grid; gap: 12px; }
.selection { padding-top: 16px; }
.selection-copy > .eyebrow, .selection-copy > .lead { display: none; }
.selection-copy .page-title { margin: 4px 0; font-size: 32px; }
.song-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.song-feature { position: relative; display: flex; align-items: flex-start; gap: 8px; width: 100%; min-width: 0; min-height: 72px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 2px 5px rgba(23,63,53,.025); text-align: left; }
.song-feature > span:nth-child(2) { align-self: center; min-width: 0; }
.song-feature strong { display: block; margin: 3px 0; font-size: 15px; font-weight: 750; line-height: 1.25; letter-spacing: -.2px; }
.song-feature small { display: none; color: var(--muted); font-size: 12px; font-weight: 450; line-height: 1.4; }
.song-feature.selected { padding: 9px; border: 2px solid #7e9e4e; background: linear-gradient(130deg,#e9f3d8,#f2f6e9); box-shadow: 0 3px 9px rgba(93,126,47,.08); }
.song-icon { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 10px; background: #edf1e2; font-size: 20px; }
.song-feature:nth-child(2) .song-icon { background: #f6edce; }
.song-feature:nth-child(3) .song-icon { background: #f5e2d8; }
.song-feature:nth-child(4) .song-icon { background: #e7ede0; }
.recommended .song-icon { background: var(--lime); }
.song-feature .song-recommendation { display: block; margin-top: 4px; color: #4d6b30; font-size: 10px; font-weight: 650; line-height: 1.2; }
.song-arrow { display: none; }
.config-card { padding: 16px; }
.config-card #selected-title { font-size: 15px; font-weight: 750; }
.config-card > .secondary { margin: 10px 0; }
.config-card > .primary { margin: 4px 0 8px; }
.config-card > details { margin-top: 10px; }
.config-card .register-row { display: block; margin: 8px 0 0; }
.register-row .field-label { display: none; }
.register-row strong { display: block; margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.stepper { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 4px; }
.stepper button { min-height: 48px; padding: 8px 5px; border: 1px solid #d8e3c8; border-radius: 11px; background: var(--lime-soft); font-size: 13px; }
.stepper > span { min-width: 54px; font-size: 11px; text-align: center; }
.config-card #range-warning { display: none; }
.tempo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 8px; }
.tempo-row label { flex-shrink: 0; font-size: 12px; }
.tempo-row select { max-width: 205px; }

/* Tutorial: the band keeps exactly the pitch geometry defined by the app. */
.narrow { max-width: 560px; margin: auto; }
#setup-screen .page-title { margin: 8px 0; font-size: 30px; }
#setup-screen .lead { margin: 8px 0 16px; }
#trial-stage > .eyebrow { margin: 0; }
.shell:has(#setup-screen:not([hidden])) .header #nav-play,
.shell:has(#setup-screen:not([hidden])) .header #nav-practice { display: none; }
.trial-card { padding: 16px; background: linear-gradient(150deg,var(--white),#f6f8ed); }
.trial-scale { color: var(--muted); font-size: 12px; text-align: right; }
.trial-map { position: relative; height: 174px; margin: 6px 0; border-radius: 12px; background: linear-gradient(90deg,transparent 49.7%,#dce3d6 50%,transparent 50.3%); }
.trial-target { position: absolute; left: 0; right: 0; bottom: 43.75%; display: flex; align-items: center; justify-content: flex-end; height: 12.5%; padding-right: 10px; border-top: 1px solid #8aa754; border-bottom: 1px solid #8aa754; background: var(--lime); font-size: 12px; }
.trial-player { position: absolute; left: calc(50% - 10px); display: flex; align-items: center; gap: 9px; transform: translateY(50%); font-size: 13px; }
.trial-player b { display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid var(--white); border-radius: 50%; background: var(--ink); color: var(--lime); box-shadow: 0 2px 8px #173f3525; font-size: 13px; }
.trial-map[data-direction="matched"] .trial-player b { background: #698b34; }
.trial-card .pitch-action { min-height: 28px; margin: 8px 0 14px; font-size: 22px; text-align: center; }
.hold-track { height: 8px; overflow: hidden; border-radius: 10px; background: #e9eee0; }
.hold-track > div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#89a94e,#bbd777); transition: width .1s linear; }
.trial-success { padding: 26px 0; text-align: center; }
.success-check { display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto 24px; border: 8px solid #eef4dc; border-radius: 36px; background: var(--lime); color: var(--ink); box-shadow: 0 8px 24px #647c3020; font-size: 66px; animation: arrive .35s ease-out; }
.trial-success .page-title { font-size: 36px; }
.trial-success .secondary { justify-content: center; margin-top: 12px; }
.trial-help { margin-top: 12px; padding: 4px 14px; border: 1px solid #e4e4c8; border-radius: 14px; background: #f8f1da; }

/* Fixed-height map: marker positions stay owned by JavaScript. */
.target-row { display: flex; flex-direction: column; gap: 12px; }
.target-row label { display: block; margin: 12px 0 8px; font-size: 12px; }
.target-row .secondary { width: 100%; }
.pitch-guide { margin-top: 14px; }
.pitch-guide-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pitch-guide-top .eyebrow { margin: 0; font-size: 9px; letter-spacing: .6px; }
.pitch-scale { color: var(--muted); font-size: 10px; white-space: nowrap; }
.pitch-map { position: relative; height: clamp(140px,25svh,200px); overflow: hidden; border: 1px solid #dde6d2; border-radius: 16px; background: #eef3e5; }
.pitch-map::before { content: ""; position: absolute; inset: 22px 10px; background: repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#d9e3cc calc(25% - 1px),#d9e3cc 25%); }
.pitch-map::after { content: ""; position: absolute; top: 20px; bottom: 20px; left: 61%; width: 1px; background: #d2ddc4; }
.pitch-anchor { position: absolute; z-index: 1; left: 10px; right: 10px; border-top: 2px dashed #728c61; }
.pitch-anchor > span { position: absolute; top: 14px; left: 4px; padding: 2px 6px; border: 1px solid #b4c59f; border-radius: 6px; background: #eef3e5; font-size: 10px; }
.pitch-target { position: absolute; z-index: 2; left: 10px; right: 10px; display: flex; flex-direction: column; justify-content: center; min-height: 38px; padding: 5px 10px; border: 1px solid #91af62; border-radius: 10px; background: #dcebbd; transform: translateY(50%); }
.pitch-target > strong { font-size: 13px; }
.pitch-target small { display: none; }
.pitch-player { position: absolute; z-index: 3; right: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 31%; min-height: 36px; padding: 5px 8px; border: 2px solid var(--white); border-radius: 30px; background: var(--ink); color: var(--white); box-shadow: 0 3px 10px #173d3220; transform: translateY(50%); transition: bottom .08s linear; }
.pitch-player > strong { font-size: 13px; }
.pitch-direction { font-size: 24px; line-height: 1; }
.pitch-guide[data-direction="matched"] .pitch-player { background: #537821; }
.pitch-guide-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0; }
.pitch-guide-footer [id$="-pitch-relation"] { font-size: 11px; line-height: 1.4; }
.pitch-action { min-height: 29px; margin: 12px 0 5px; font-size: 24px; font-weight: 720; line-height: 1.15; letter-spacing: -.6px; text-align: center; }
.pitch-guide [id$="-pitch-detail"] { max-width: 390px; min-height: 35px; margin: 0 auto; font-size: 12px; line-height: 1.45; text-align: center; }
.tuner > .primary { margin-top: 16px; }
.reading { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px; }
.reading > strong { font-size: 45px; }
.reading > span { font-size: 12px; }
.meter { position: relative; height: 28px; border-radius: 12px; background: #edf0e3; }
.sweet-zone { position: absolute; left: 43.75%; top: 0; bottom: 0; width: 12.5%; background: var(--lime); }
.center-line { position: absolute; left: 50%; width: 1px; height: 100%; background: var(--ink); }
.needle { position: absolute; top: -3px; width: 3px; height: 34px; background: var(--ink); }
.meter-labels { display: flex; justify-content: space-between; margin: 8px 0; font-size: 10px; }
.feedback { display: none; }

/* Practice and challenge: compact while playing, roomier on larger screens. */
.game { max-width: 820px; margin: auto; padding-top: 16px; }
.game-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-header > div { min-width: 0; }
.game-header h1 { margin: 5px 0; font-size: 25px; font-weight: 780; letter-spacing: -.9px; }
.game .eyebrow { margin: 0 0 5px; font-size: 9px; }
.game-header > .secondary { padding: 10px; font-size: 12px; }
.game-topline { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.game-card { position: relative; padding: 14px; }
.practice-step { margin: 0 0 6px; font-size: 18px; font-weight: 740; line-height: 1.2; letter-spacing: -.4px; }
.practice-caption, #practice-next, #game-pitch-target-note { display: none; }
.practice-listen { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 8px; margin: 8px 0; }
.practice-listen .secondary { padding: 10px 8px; font-size: 12px; }
.anchor-listen { background: transparent; }
.game .pitch-guide { margin-top: 12px; }
.game .pitch-guide-top { justify-content: flex-end; }
.game .pitch-guide-top .eyebrow { display: none; }
.game .pitch-map { height: 122px; }
.game .pitch-action { margin: 10px 0 4px; font-size: 22px; }
.game .pitch-guide [id$="-pitch-detail"] { display: none; }
.game .pitch-target { min-height: 0; padding: 0; overflow: visible; border-radius: 0; }
.game .pitch-target > strong { position: absolute; right: 6px; bottom: 100%; padding-bottom: 3px; font-size: 12px; }
.game .pitch-player { width: auto; min-width: 76px; min-height: 28px; padding: 3px 8px; }
.game .pitch-direction { font-size: 18px; }
#practice-hold { margin-top: 12px; text-align: center; }
#hold-message { min-height: 17px; margin: 8px 0 0; font-size: 12px; }
.game-feedback { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 32px; margin: 6px 0; padding: 4px 0 0; text-align: center; }
.game-feedback strong { display: block; color: var(--ink); font-size: 21px; line-height: 1.2; }
.game-feedback > span { display: none; }
.sequence { display: flex; gap: 3px; margin-top: 10px; }
.sequence > span { flex: 1; min-width: 0; height: 5px; border-radius: 5px; background: #e4e9dc; font-size: 0; }
.sequence > .current { background: var(--ink); }
.sequence > .complete { background: #8cad56; }
.sequence > .skipped { background: #ca9378; }
.game-actions { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 0; }
.game-actions button { padding: 10px 4px; font-size: 12px; }
#practice-help { margin-top: 0; }
.countdown { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 25px; border-radius: 22px; background: #faf9f0fa; text-align: center; }
.countdown > strong { color: #456b37; font-size: 74px; font-weight: 750; line-height: 1; }
.countdown > small { max-width: 250px; color: var(--muted); font-size: 12px; line-height: 1.5; }
#retry-intro { max-width: 250px; }
#challenge-view { margin: 0; }
.score-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.score-line > span { font-size: 10px; letter-spacing: .6px; }
.score-line strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.score-line small { font-size: 12px; font-weight: 450; }
canvas { display: block; width: 100%; height: 200px; border-radius: 13px; background: #f0f4e7; }
#timeline-description { min-height: 34px; margin: 6px 0 0; font-size: 12px; line-height: 1.4; }

/* Result: a small celebration with useful next actions. */
.result { max-width: 640px; margin: auto; }
.result > .eyebrow { margin-bottom: 8px; font-size: 9px; }
.result .page-title { font-size: 30px; }
.result-card { background: radial-gradient(ellipse at 100% 0,#eef4dc 0,transparent 47%),var(--white); text-align: center; }
.result-stars { color: #9b792a; font-size: 29px; line-height: 1.5; letter-spacing: 5px; }
.result-number { color: var(--ink); font-size: 68px; font-weight: 800; line-height: 1.1; letter-spacing: -3.5px; font-variant-numeric: tabular-nums; }
.result-number small { color: var(--muted); font-size: 22px; font-weight: 450; letter-spacing: -.5px; }
.result-card > .lead { margin: 10px 0; font-size: 16px; }
.result-card > .primary { margin: 16px 0 10px; }
.result-card > .secondary { width: 100%; }
.result-details { margin-top: 20px; text-align: left; }
.journey-card { margin: 18px 0; padding: 18px; border: 1px solid #d2dfb8; border-radius: 17px; background: var(--lime-soft); text-align: left; }
.journey-kicker { color: #506f36; font-size: 9px; font-weight: 750; line-height: 1.5; letter-spacing: 1px; }
.journey-title { margin: 9px 0; font-size: 25px; line-height: 1.15; letter-spacing: -.7px; }
.journey-copy { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics:has(>div:nth-child(3)) { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.metrics > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.metrics span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.metrics strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.result-advice { color: var(--muted); font-size: 13px; line-height: 1.5; }
.result-notes { margin: 16px 0; font-size: 12px; text-align: left; }
.result-note { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.4; }
.result-note span { text-align: right; }
.result-celebration .journey-card, .result-celebration .result-stars { animation: arrive .35s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Incoming invitations and result sharing, including the no-native-share fallback. */
.challenge-invite {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #e7d5b6;
  border-left: 4px solid var(--coral);
  border-radius: 16px;
  background: linear-gradient(115deg,#fbf0d8,#f8f4e7);
  color: var(--ink);
}
.challenge-invite:empty { display: none; }
.challenge-invite h2, .challenge-invite h3 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.4px; }
.challenge-invite p { margin: 0; font-size: 13px; line-height: 1.45; }
.challenge-invite .text-button { justify-self: start; padding: 8px 0; font-size: 12px; }
.challenge-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 6px 10px; border: 1px solid #e8cf93; border-radius: 30px; background: #fcf0cc; color: #6f5725; font-size: 11px; font-weight: 700; line-height: 1.4; }
#challenge-select { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 10px; }
#challenge-settings-status { grid-column: 1/-1; }
#challenge-select > .button-row { grid-column: 1/-1; }
#challenge-select button { min-width: 0; min-height: 48px; padding: 8px; font-size: 12px; }
#challenge-target { margin-top: 4px; }
.challenge-result { margin: 16px 0; padding: 16px; border: 1px solid #d8e2c6; border-radius: 18px; background: linear-gradient(145deg,#edf4dc,#f7f7ed); text-align: center; }
.challenge-result h2, .challenge-result h3 { margin: 8px 0; font-size: 23px; line-height: 1.15; letter-spacing: -.6px; }
.challenge-result p { margin: 8px 0; font-size: 14px; line-height: 1.5; }
.challenge-result button { width: 100%; margin-top: 6px; }
.share-card { display: grid; gap: 10px; min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 3px 14px rgba(23,63,53,.035); text-align: left; }
.share-card h2, .share-card h3 { margin: 0; font-size: 21px; font-weight: 750; line-height: 1.2; letter-spacing: -.5px; }
.share-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.share-card button, .share-card a { width: 100%; min-width: 0; min-height: 48px; }
.share-card .button-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; }
.share-card .button-row:has(#share-score[hidden]) { grid-template-columns: 1fr; }
.share-card [role="status"] { color: var(--muted); font-size: 12px; line-height: 1.5; }
.share-card [role="status"]:empty { display: none; }
#share-whatsapp { justify-content: center; gap: 9px; min-height: 54px; border-color: #226843; background: #226843; color: var(--white); text-decoration: none; text-align: center; }
#share-whatsapp > svg { flex-shrink: 0; width: 20px; height: 20px; fill: currentColor; }
#share-score, #copy-challenge { justify-content: center; min-width: 0; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; background: #f4f5eb; color: var(--ink); font-size: 13px; text-align: center; }
#challenge-link { width: 100%; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 16px; }

/* Notices and help */
.error, .notice { margin: 16px 0; padding: 14px; border: 1px solid #e6c5b6; border-radius: 13px; background: #f7e7de; color: #733829; font-size: 13px; line-height: 1.5; }
.notice { border-color: #cddbbd; background: #edf2e4; color: var(--ink); }
.notice button { display: block; padding-left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
dialog { width: calc(100% - 24px); max-width: 540px; max-height: calc(100svh - 24px); padding: 24px; overflow-y: auto; border: 1px solid var(--line); border-radius: 23px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 80px #173f3533; }
dialog::backdrop { background: #173d3266; }
dialog h2 { font-size: 32px; line-height: 1.1; letter-spacing: -1px; }
.dialog-close { float: right; width: 48px; background: none; font-size: 28px; }
.how-steps { padding-left: 23px; font-size: 14px; line-height: 1.5; }
.how-steps li { margin: 18px 0; padding-left: 5px; }
.how-steps p { margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (hover: hover) {
  .primary:hover { background: #2a583f; box-shadow: 0 4px 0 rgba(12,42,31,.1), 0 7px 18px rgba(23,63,53,.12); }
  .secondary:hover, .stepper button:hover { border-color: #c4d2b7; background: #e7eedb; }
  .nav-link:hover { background: #edf1e2; color: var(--ink); }
  .song-feature:hover { border-color: #9db77d; box-shadow: 0 4px 12px rgba(23,63,53,.06); }
  .text-button:hover, .inline-link:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  #share-whatsapp:hover { background: #195b36; }
  #share-score:hover, #copy-challenge:hover { background: #e7eedb; }
}

@media (min-width: 600px) {
  .shell { padding-left: 32px; padding-right: 32px; }
  .header { grid-template-columns: auto minmax(0,1fr) auto; gap: 20px; min-height: 84px; }
  .header nav { gap: 12px; }
  .nav-link { font-size: 14px; }
  .help-link { font-size: 13px; }
  .help-link::after { display: none; }
  .status { grid-column: auto; padding: 0; font-size: 11px; }
  .screen { padding-top: 36px; }
  .home { padding-top: 42px; }
  .hero-copy h1 { max-width: 15ch; font-size: 64px; }
  .hero-description { font-size: 17px; }
  .page-title { font-size: 48px; }
  .card { padding: 28px; }
  .selection { gap: 28px; }
  .selection-copy .page-title { font-size: 44px; }
  .song-catalog { gap: 12px; }
  .song-feature { min-height: 108px; padding: 16px; gap: 12px; }
  .song-feature.selected { padding: 15px; }
  .song-feature strong { font-size: 18px; }
  .song-feature small { display: block; margin-top: 7px; }
  .song-icon { width: 36px; height: 36px; font-size: 24px; }
  .config-card .register-row { margin-top: 16px; }
  .config-card #range-warning { display: block; margin: 6px 0 10px; font-size: 11px; }
  #setup-screen .page-title { font-size: 38px; }
  .trial-map { height: 220px; }
  .trial-card .pitch-action { font-size: 26px; }
  .game { max-width: 820px; margin: auto; }
  .game-card { padding: 24px; }
  .game-header h1 { font-size: 34px; }
  .game .pitch-map { height: 220px; }
  .game .practice-step { font-size: 25px; }
  .practice-listen { max-width: 440px; margin: 12px auto; }
  .practice-listen .secondary { font-size: 14px; }
  .pitch-guide { max-width: 600px; margin-left: auto; margin-right: auto; }
  .pitch-map { height: 240px; }
  .game-actions { justify-content: center; gap: 30px; }
  .result .page-title { font-size: 44px; }
  .result-number { font-size: 82px; }
  .metrics span { font-size: 10px; }
  .share-card { padding: 20px; }
  footer span:last-child { display: block; }
}

@media (min-width: 1000px) {
  .shell { padding-left: 48px; padding-right: 48px; }
  .header { min-height: 100px; }
  .brand { font-size: 34px; }
  .header nav { gap: 18px; }
  .home { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; max-width: none; padding-top: 50px; }
  .hero-copy h1 { max-width: 12ch; font-size: 66px; letter-spacing: -3px; }
  .hero-visual { display: flex; flex-direction: column; align-self: center; min-height: 390px; padding: 24px; overflow: hidden; border: 1px solid #dce2d0; border-radius: 28px; background: radial-gradient(circle at 80% 10%,#f4e6bc,transparent 42%),#edf2df; box-shadow: var(--card-shadow); }
  .visual-top, .visual-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
  .visual-top .eyebrow { margin: 0; font-size: 9px; }
  .sound-orbit { position: relative; display: grid; flex: 1; place-items: center; min-height: 265px; }
  .orbit { position: absolute; aspect-ratio: 1; border: 1px solid #cdd8be; border-radius: 50%; }
  .orbit-1 { width: 150px; }
  .orbit-2 { width: 220px; }
  .orbit-3 { width: 280px; }
  .whistle-art { position: relative; width: 220px; height: 180px; }
  .floating-note { position: absolute; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid #e0e6d6; border-radius: 14px; background: var(--white); box-shadow: 0 5px 12px #173f3508; font-size: 17px; font-weight: 720; }
  .note-a { top: 40px; left: 0; transform: rotate(-10deg); }
  .note-b { right: 0; bottom: 35px; transform: rotate(8deg); }
  .spark { position: absolute; color: var(--coral); font-size: 25px; }
  .spark-a { top: 22px; right: 55px; }
  .spark-b { left: 55px; bottom: 22px; color: #9d8136; }
  .mini-timeline { display: flex; align-items: center; gap: 10px; height: 45px; margin-bottom: 16px; border-bottom: 1px solid #cbd6bf; }
  .mini-timeline i { flex: 1; height: 8px; border-radius: 6px; background: #adbd95; }
  .mini-timeline i:nth-child(3), .mini-timeline i:nth-child(4) { transform: translateY(-9px); }
  .mini-timeline i:nth-child(5), .mini-timeline i:nth-child(6) { transform: translateY(-20px); }
  .match-pill { padding: 7px 9px; border-radius: 20px; background: var(--lime); }
  .selection, .tuner-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 60px; align-items: start; }
  .selection-copy > .eyebrow, .selection-copy > .lead { display: block; }
  .selection-copy .page-title { font-size: 54px; }
  .selection-copy .lead { max-width: 360px; }
  .selection .config-card { position: sticky; top: 24px; max-width: 520px; margin-top: 75px; }
  .game { padding-top: 28px; }
  .game-header h1 { font-size: 38px; }
  .game-topline { margin: 16px 0; }
  .home > .challenge-invite { grid-column: 1/-1; margin-top: 0; }
}

@media (max-width: 359px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 26px; }
  .nav-link { padding-left: 6px; padding-right: 6px; }
  .hero-copy h1 { font-size: 39px; }
  .quick-steps { font-size: 11px; }
  .quick-steps li { gap: 5px; }
  .selection-copy .page-title { font-size: 28px; }
  .song-feature { gap: 6px; padding: 9px; }
  .song-feature.selected { padding: 8px; }
  .song-icon { width: 24px; height: 26px; font-size: 19px; }
  .song-feature strong { font-size: 13px; letter-spacing: -.15px; }
  .stepper button { font-size: 12px; }
  .tempo-row { gap: 8px; }
  .tempo-row select { max-width: 184px; }
  .game-header h1 { font-size: 22px; }
  .game-feedback strong { font-size: 19px; }
  .result .page-title { font-size: 28px; }
  .result-number { font-size: 62px; }
  .challenge-invite, .challenge-result, .share-card { padding: 12px; border-radius: 14px; }
  #share-whatsapp, #share-score, #copy-challenge { padding-left: 8px; padding-right: 8px; font-size: 12px; }
  .share-card h2, .share-card h3 { font-size: 19px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .screen { padding-top: 12px; }
  .game { max-width: 700px; }
  .game canvas { height: 160px; }
  .trial-map { height: 120px; }
  .trial-success { padding: 10px 0; }
  .success-check { width: 70px; height: 70px; margin-bottom: 12px; font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
