/* The Practise drill, full screen over the page: DrillActivity's layout. Colours come from app.css's
   variables, so the drill follows the language's theme and day/night. */
.drill {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 15px/1.4 var(--body);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.drill > * { width: 100%; max-width: 520px; margin: 0 auto; }
.drill [hidden] { display: none !important; }

.drill-top { display: flex; align-items: center; padding: 8px 20px 4px 8px; }
.drill-close { width: 48px; height: 48px; flex: none; border: 0; background: none; color: var(--text); font-size: 20px; border-radius: 24px; cursor: pointer; }
.drill-close:disabled { opacity: .35; cursor: default; }
.drill-close:not(:disabled):hover { background: color-mix(in srgb, var(--line) 35%, transparent); }
.drill-heading { flex: 1; min-width: 0; font: 500 12px var(--body); letter-spacing: .12em; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-streak { font: 500 14px var(--body); color: var(--soft); white-space: nowrap; }

.drill-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.drill-column { padding: 12px 20px; }
.drill-card { background: var(--card); border: 1px solid var(--card-edge, transparent); border-radius: 22px; box-shadow: var(--shadow); }
.drill-word-card { padding: 18px 20px; }
.drill-result { padding: 14px 16px; margin-top: 14px; }
.drill-title-row { display: flex; align-items: center; gap: 12px; }
.drill-title { flex: 1; min-width: 0; font: 500 15px var(--body); color: var(--soft); }
.drill-hear { font: 500 14px var(--body); height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; flex: none; }
.drill-hear:hover { background: color-mix(in srgb, var(--line) 30%, var(--card)); }

.drill-word { display: flex; justify-content: center; padding: 18px 0 6px; }
.drill-syl { display: inline-flex; gap: 22px; }
.drill-syl > span { display: inline-flex; flex-direction: column; align-items: center; }
.drill-syl b { font: 700 64px/1.1 var(--cjk); }
.drill-syl small { font: 500 20px var(--body); padding-top: 2px; }
.drill-sentence { font: 600 22px/1.35 var(--heading); text-align: center; color: var(--text); }
.drill-status { margin: 12px 0 0; font-size: 15px; }

.drill-curves { display: block; width: 100%; height: 110px; }
.drill-heard { font-size: 17px; padding-top: 10px; }
.drill-heard:empty { display: none; }
.drill-heard b { font-weight: 700; }
.drill-heard b.good { color: var(--good); }
.drill-heard b.bad { color: var(--bad); }
.drill-lines { font-size: 15px; padding-top: 8px; white-space: pre-line; }
.drill-note { font-size: 13px; color: var(--soft); padding: 14px 2px 0; margin: 0; }

[data-tone="soft"] { color: var(--soft); }
[data-tone="text"] { color: var(--text); }
[data-tone="good"] { color: var(--good); }
[data-tone="bad"] { color: var(--bad); }
[data-tone="warn"] { color: var(--warn); }

.drill-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 20px 12px; }
.drill-mic-box { display: flex; flex-direction: column; align-items: center; }
.drill-mic { width: 88px; height: 88px; border-radius: 50%; border: 0; padding: 0; background: var(--accent); color: #FFFFFF; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .12s; }
.drill.dark .drill-mic { color: var(--on-primary); }
.drill-mic svg { width: 88px; height: 88px; }
.drill-mic:active { transform: scale(.96); }
.drill-mic.on { animation: drill-breathe 1.4s ease-in-out infinite; }
.drill-meter { width: 120px; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--line); overflow: hidden; visibility: hidden; }
.drill-meter > div { height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
.drill-mic-label { font: 500 15px var(--body); padding-top: 4px; text-align: center; }
.drill-next { margin-top: 4px; }

.drill button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion (Motion.enter, pop, shake). */
.drill-enter { animation: drill-enter .48s cubic-bezier(.2, .8, .2, 1); }
.drill-pop { animation: drill-pop .33s ease-out; }
.drill-pop-big { animation: drill-pop-big .33s ease-out; }
.drill-shake { animation: drill-shake .36s linear; }
@keyframes drill-enter { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes drill-pop { 33% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes drill-pop-big { 33% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes drill-shake { 0%, 100% { transform: none; } 17% { transform: translateX(5px); } 33% { transform: translateX(-4px); } 50% { transform: translateX(3px); } 67% { transform: translateX(-2px); } 83% { transform: translateX(1px); } }
@keyframes drill-breathe { 50% { transform: scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  .drill-enter, .drill-pop, .drill-pop-big, .drill-shake, .drill-mic.on { animation: none; }
  .drill-mic, .drill-meter > div { transition: none; }
}

@media (max-width: 380px) {
  .drill-syl b { font-size: 52px; }
  .drill-syl { gap: 16px; }
}
