:root {
  color-scheme: light;
  font-family: ui-rounded, system-ui, sans-serif;
  color: #32261e;
  background: #fbf6ec;
  --ink: #32261e;
  --muted: #6c5344;
  --cream: #fbf6ec;
  --peach: #f5e4d4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { max-width: 42rem; min-height: 100dvh; margin: auto; display: flex; flex-direction: column; }
button, input, select { font: inherit; }
button { min-height: 44px; cursor: pointer; color: inherit; background: #fffaf2; border: 1px solid #c8b6a8; border-radius: 2rem; padding: .55rem 1rem; }
button:focus-visible, a:focus-visible { outline: 3px solid #8e470f; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
.header { display: flex; justify-content: space-between; align-items: center; padding: max(1rem, env(safe-area-inset-top)) 1.25rem .75rem; }
.brand { display: flex; gap: .55rem; align-items: center; font-size: 1.85rem; letter-spacing: -.08em; font-weight: 750; text-decoration: none; color: inherit; }
.brand i { width: .85rem; height: .85rem; border-radius: 50%; background: linear-gradient(135deg, #ffdba5, #ff8954); }
.quiet { background: transparent; }
main { width: 100%; flex: 1; text-align: center; padding: 1.25rem clamp(1.25rem, 5vw, 2rem) 2rem; }
h1 { margin: .5rem 0 1rem; letter-spacing: -.055em; font-size: clamp(1.5rem, 6vw, 2.25rem); font-weight: 650; }
#lesson { display: inline-block; background: #fcf0d6; border-radius: 2rem; padding: .55rem 1.1rem; font-size: .98rem; letter-spacing: 0; color: var(--muted); }
.orb { position: relative; margin: clamp(1.7rem, 6vh, 3rem) auto 1.9rem; width: clamp(9rem, 47vw, 14rem); aspect-ratio: 1; border-radius: 53% 47% 48% 52% / 52% 60% 40% 48%; background: radial-gradient(ellipse at 29% 12%, #ffe4a8, transparent 60%), radial-gradient(ellipse at 75% 86%, #c18fd2, transparent 58%), linear-gradient(135deg, #ffb46f, #fb9058 65%); box-shadow: 0 1rem 2.75rem #ec965a52; }
.orb i { position: absolute; width: .75rem; height: .75rem; border-radius: 50%; background: #fab888; top: 21%; right: -14%; }
.orb i + i { width: .45rem; height: .45rem; top: 74%; left: -12%; opacity: .65; }
.orb.active { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.045); } }
@media (prefers-reduced-motion: reduce) { .orb.active { animation: none; } }
#status, .detail, .learner, #translation, #translation-status, #empty, #position { color: var(--muted); }
.captions { min-height: 7.5rem; margin: 1.35rem auto; }
.captions p { margin: .4rem 0; overflow-wrap: anywhere; }
.original { font-size: clamp(1.35rem, 5vw, 1.75rem); font-weight: 600; max-height: 7rem; overflow-y: auto; }
#translation { max-height: 6rem; overflow-y: auto; }
.learner, #translation-status { font-size: .85rem; }
.learner > span:first-child { font-size: .7rem; letter-spacing: .09em; }
#error { color: #842e22; }
.controls, .card-nav { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.primary { background: #ee9b66; border-color: #bb6738; font-weight: 650; }
nav { display: flex; justify-content: center; gap: .4rem; border-top: 1px solid var(--peach); padding: .65rem 1rem max(.65rem, env(safe-area-inset-bottom)); }
nav button { border-color: transparent; background: transparent; width: min(8rem, 41vw); }
nav [aria-current] { background: #efdfcf; }
dialog { width: min(29rem, calc(100% - 2rem)); border: 1px solid #d7c3b4; background: var(--cream); color: var(--ink); border-radius: 1.4rem; padding: 1.5rem; }
dialog::backdrop { background: #2f211a55; }
h2 { margin-top: 0; }
label { display: grid; gap: .3rem; margin: .8rem 0; }
select, input { padding: .65rem; border-radius: .65rem; border: 1px solid #c8b6a8; background: #fffaf2; color: var(--ink); width: 100%; }
.detail { font-size: .88rem; }
.card { border-radius: 1.8rem; padding: 1.75rem; margin: 1.5rem auto; min-height: 17rem; background: #f9e9ce; }
#card-word { font-weight: 650; font-size: 2.2rem; overflow-wrap: anywhere; margin-bottom: .6rem; }
#card-meaning { overflow-wrap: anywhere; }
.card-nav { margin-top: 1.5rem; }
