/* Focus: one singer up close, for learning (js/focus*.js). The articulation
   large on the left with the sound being made named over it, the part on a
   strip below, practice and the language's sounds at the side, where the
   choir keeps its library. On the choir's tokens: stone, vellum, gold,
   rubric. */
#app { position: relative; }
#focus { position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: 25; display: grid;
  grid-template-columns: minmax(0, 1fr) 356px; grid-template-rows: auto minmax(0, 1fr) clamp(150px, 24vh, 210px) auto;
  background: radial-gradient(ellipse at 35% 30%, #1b1e27 0%, var(--nave) 70%); }
#focus .label { white-space: nowrap; }
#focus kbd { font: 11px var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--vellum); }
#bFocus.on, #iFocus { border-color: var(--gold); }
#inspector .ifocus { width: 100%; background: color-mix(in srgb, var(--gold) 14%, var(--stone-2)); }

/* the head: who, what they sing, close */
.fx-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line); background: var(--stone); }
.fx-sw { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(236, 227, 207, 0.12); }
#fxWho { font-family: var(--display); font-size: 15px; max-width: 200px; }
.fx-lang { font-family: var(--label); font-size: 12.5px; letter-spacing: 0.08em; color: var(--gold); white-space: nowrap; }
.fx-line { flex: 1; min-width: 0; min-height: 41px; display: grid; align-content: center; line-height: 1.25; }
.fx-line .ws { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-line .ws .cur { color: var(--gold); }
.fx-line .ws .past { opacity: 0.5; }
.fx-line .tr { font-style: italic; color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-x { font-size: 18px; line-height: 1; padding: 3px 10px; flex: none; }

/* the view */
.fx-view { grid-column: 1; grid-row: 2; position: relative; min-height: 0; min-width: 0; overflow: hidden; }
#fxHead { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#fxHead:active { cursor: grabbing; }
.fx-zoom { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: nowrap; gap: 4px; }
.fx-zoom button { font-size: 12px; padding: 3px 9px; background: rgba(32, 36, 45, 0.88); }
.fx-zoom button.on { background: color-mix(in srgb, var(--gold) 26%, rgba(32, 36, 45, 0.88)); border-color: var(--gold); }
.fx-sep { width: 6px; }

/* the sound being made, large */
.fx-ph { position: absolute; right: 14px; top: 12px; width: min(370px, 42%); box-sizing: border-box; display: grid; gap: 10px;
  background: rgba(14, 16, 21, 0.84); border: 1px solid rgba(214, 168, 76, 0.28); border-radius: 12px; padding: 12px 14px 12px 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.fx-ph-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.fx-ipa { font-family: var(--display); font-size: 68px; line-height: 0.95; color: var(--gold); min-width: 1.1em; text-align: center; padding-top: 4px; }
.fx-ipa.rest { color: var(--dim); }
.fx-what { min-width: 0; }
.fx-what b { font-family: var(--label); font-weight: 700; letter-spacing: 0.05em; font-size: 14.5px; color: var(--vellum); display: block; }
.fx-what p { margin: 4px 0 0; font-size: 14px; line-height: 1.38; color: #d9cfb8; }
.fx-what .fx-trad { color: var(--gold); font-style: italic; font-size: 13.5px; }
.fx-what .fx-trad .sym { font-style: normal; font-size: 17px; margin-right: 3px; }
.fx-syl { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; color: var(--dim); }
.fx-syl .chips { display: inline-flex; gap: 3px; }
.fx-syl .chips span { font-size: 15px; min-width: 1.1em; text-align: center; padding: 0 5px; border-radius: 5px; color: var(--vellum); background: rgba(32, 36, 45, 0.9); border: 1px solid var(--line); }
.fx-syl .chips span.v { border-color: rgba(214, 168, 76, 0.35); }
.fx-syl .chips span.c { border-color: rgba(194, 69, 47, 0.45); }
.fx-syl .chips span.on { background: var(--gold); color: #17130a; border-color: var(--gold); }
.fx-syl .chips span.c.on { background: #e26046; border-color: #e26046; color: #fff6ec; }

/* what the voice is doing */
.fx-state { display: flex; flex-wrap: wrap; gap: 5px; border-top: 1px solid rgba(49, 55, 68, 0.8); padding-top: 9px; }
.fx-state .pill { font-family: var(--label); font-size: 12px; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 12px; background: rgba(14, 16, 21, 0.82); border: 1px solid var(--line); color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.fx-state .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #3a404d; display: inline-block; }
.fx-state .pill.on { color: #f1d69a; border-color: rgba(214, 168, 76, 0.6); }
.fx-state .pill.on .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.fx-state .pill.breath { color: #a9cdea; border-color: rgba(127, 176, 216, 0.55); }
.fx-state .pill.breath .dot { background: #7fb0d8; }
.fx-state .pill.nose { color: #f1d69a; border-color: rgba(214, 168, 76, 0.5); }
.fx-state .pill.closed { color: #f0a594; border-color: rgba(194, 69, 47, 0.7); }
.fx-vowel { position: absolute; right: 108px; bottom: 12px; width: 168px; height: 118px; opacity: 0.92; background: rgba(14, 16, 21, 0.84); border: 1px solid var(--line); border-radius: 8px; }
.fx-demo { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: rgba(14, 16, 21, 0.9); border: 1px solid var(--gold); border-radius: 18px; padding: 4px 6px 4px 12px; font-size: 14px; }
.fx-demo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: fxPulse 1s ease-in-out infinite alternate; }
.fx-demo button { font-size: 12px; padding: 2px 9px; }
@keyframes fxPulse { from { opacity: 0.35; } to { opacity: 1; } }

/* the strip */
.fx-strip { grid-column: 1; grid-row: 3; min-width: 0; border-top: 1px solid var(--line); }
#fxStrip { display: block; width: 100%; height: 100%; cursor: ew-resize; touch-action: none; }

/* the side: practice, sounds, voice */
.fx-side { grid-column: 2; grid-row: 2 / span 2; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border-left: 1px solid var(--line); background: var(--stone); padding: 4px 14px 14px; display: grid; gap: 4px; align-content: start; }
.fx-sec { border-bottom: 1px solid var(--line); padding: 8px 0 12px; display: grid; gap: 7px; }
.fx-sec:last-child { border-bottom: 0; }
.fx-sec h4 { margin: 0; font-family: var(--label); font-size: 13px; letter-spacing: 0.1em; font-weight: 700; color: var(--gold); text-transform: lowercase; }
.fx-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fx-row > .label:first-child { min-width: 38px; }
.fx-tr button { font-size: 13px; padding: 4px 10px; }
.fx-clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--gold); margin-left: auto; }
.fx-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.fx-seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 3px 9px; font-size: 12.5px; background: var(--stone-2); }
.fx-seg button:last-child { border-right: 0; }
.fx-seg button.on { background: color-mix(in srgb, var(--gold) 30%, var(--stone-2)); color: #fff4dc; }
.fx-note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--dim); }
.fx-note:empty { display: none; }
.spacer { flex: 1; }

/* the sounds of the language */
.fx-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; }
.fx-chips button { position: relative; display: grid; justify-items: center; gap: 0; padding: 4px 3px 3px; letter-spacing: 0; min-width: 0; }
.fx-chips button .sym { font-family: var(--display); font-size: 19px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fx-chips button .tl { font-family: var(--display); font-style: italic; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fx-chips button .n { position: absolute; right: 3px; top: 2px; font: 600 9.5px var(--mono); color: var(--gold); }
.fx-chips button.none { opacity: 0.55; }
.fx-chips button.on { background: color-mix(in srgb, var(--gold) 24%, var(--stone-2)); border-color: var(--gold); opacity: 1; }
.fx-card { display: grid; gap: 7px; }
.fx-card p { margin: 0; font-size: 14px; line-height: 1.42; }
.fx-card p .label { display: inline-block; min-width: 0; margin-right: 4px; color: var(--gold); }
.fx-card .kind { font-family: var(--label); letter-spacing: 0.05em; font-size: 13px; color: var(--dim); }
.fx-card-h { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0 2px; }
.fx-card-h .sym { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--gold); max-width: 140px; overflow-wrap: anywhere; }
.fx-card-h b { font-size: 17px; }
.fx-card-h .ipa { font-family: var(--display); color: var(--dim); }
.fx-card-h .nm { font-style: italic; font-size: 13.5px; color: #d9cfb8; line-height: 1.35; margin-top: 2px; }
.fx-card-h .unc { margin-left: 6px; font-family: var(--label); font-size: 11px; letter-spacing: 0.05em; color: var(--rubric); border: 1px solid color-mix(in srgb, var(--rubric) 60%, transparent); border-radius: 8px; padding: 0 6px; }
.fx-occ { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.fx-occl { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto; scrollbar-width: thin; }
.fx-occl button { font-family: var(--display); letter-spacing: 0; font-size: 13.5px; padding: 2px 8px; }
.fx-occl button small { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.fx-occl button.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 20%, var(--stone-2)); }
.fx-occ button:disabled { opacity: 0.4; cursor: default; }
.fx-lib { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; line-height: 1.3; }
.fx-lib i { color: var(--dim); }

/* the learner's voice */
.fx-score { font-size: 13px; display: grid; grid-template-columns: auto auto 1fr; gap: 2px 8px; align-items: baseline; }
.fx-score:empty { display: none; }
.fx-score b { font-size: 22px; color: #96cdf0; font-family: var(--display); }
.fx-score small { color: var(--dim); }
.fx-score .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--stone-2); overflow: hidden; }
.fx-score .bar span { display: block; height: 100%; background: #96cdf0; }
#fxMic.on { border-color: #96cdf0; background: color-mix(in srgb, #96cdf0 20%, var(--stone-2)); }

.fx-help { grid-column: 1 / -1; margin: 0; padding: 5px max(16px, env(safe-area-inset-left, 0px)); font-family: var(--label); font-size: 12px; letter-spacing: 0.03em; color: var(--dim); border-top: 1px solid var(--line); background: var(--stone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1100px) {
  #focus { grid-template-columns: minmax(0, 1fr) 300px; }
  #fxZo, #fxZi, .fx-sep { display: none; }
  .fx-ipa { font-size: 52px; }
  .fx-vowel { display: none; }
}
@media (max-width: 760px) {
  #focus { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(300px, 58vh) 150px auto auto; overflow-y: auto; }
  .fx-side { grid-column: 1; grid-row: 4; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .fx-help { grid-row: 5; white-space: normal; }
  .fx-head { flex-wrap: wrap; }
  .fx-line { flex-basis: 100%; order: 5; }
  .fx-ph { left: 12px; right: 12px; width: auto; top: 50px; padding: 8px 10px; }
  .fx-ph-main .fx-what p:not(.fx-trad) { display: none; }
  .fx-ipa { font-size: 42px; }
  .fx-zoom { flex-wrap: wrap; max-width: calc(100% - 24px); }
  .fx-state { display: none; }
  .fx-demo { bottom: 52px; }
}
