/* Say It Clearly. Colors come from ../style.css; art from art/ (Synty renders and UI sprites). */

#app.wrap { max-width: 860px; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }

/* A Synty UI sprite used as a mask, so it takes the color of the text around it. */
.icon {
  display: inline-block; width: 24px; height: 24px; flex: none; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}

/* ---------- Home ---------- */
.hero {
  position: relative; margin: 4px -16px 0; overflow: hidden; background: #123a37; aspect-ratio: 5 / 2;
  border-radius: 0 0 var(--radius) var(--radius);
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 30, 31, 0) 45%, rgba(13, 28, 29, 0.85) 100%); }
.hero h1 { position: absolute; left: 18px; bottom: 12px; z-index: 1; margin: 0; color: #efe7cb; font-size: clamp(30px, 7vw, 48px); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.intro { margin: 12px 0 4px; font-size: 16px; line-height: 1.45; color: var(--muted); }
@media (min-width: 700px) {
  .hero { margin: 8px 0 0; border-radius: var(--radius); aspect-ratio: 7 / 2; }
  .hero h1 { left: 28px; bottom: 18px; }
}

.status {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  margin: 0 0 8px;
}
.medal {
  grid-row: 1 / span 3; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--mint) 35%, var(--card)), var(--bg-2) 72%);
}
.medal::after { content: ""; position: absolute; inset: -4px; background: var(--gold); -webkit-mask: url(art/ui-ring.webp) center / contain no-repeat; mask: url(art/ui-ring.webp) center / contain no-repeat; }
.medal img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.status .lvl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.status .level { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.1; }
.streak { display: grid; justify-items: center; color: var(--accent); line-height: 1; }
.streak .icon { width: 26px; height: 26px; }
.streak b { color: var(--text); font-size: 18px; margin-top: 2px; }
.streak small { color: var(--muted); font-size: 11px; }
.xpbar { grid-column: 2 / -1; display: flex; align-items: center; gap: 4px; }
.bar {
  flex: 1; height: 14px; border-radius: 999px; background: var(--bg-2); overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.35); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.bar > i {
  display: block; height: 100%; border-radius: inherit; transition: width 0.6s;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%), linear-gradient(90deg, var(--mint), var(--gold));
}
.status .xp { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }

h2 .count { font-family: var(--sans); color: var(--muted); font-size: 14px; font-weight: 400; }
h2 + .divider { margin: -6px 0 14px; color: var(--gold); opacity: 0.7; }
.divider .line { width: 160px; height: 10px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.steps b { display: block; color: var(--accent); font-size: 15px; }
@media (max-width: 699px) {
  .hero { aspect-ratio: 3 / 1; }
  .hero h1 { font-size: 32px; bottom: 8px; }
  .intro { margin: 10px 0 0; font-size: 15px; }
  #app h2 { margin: 18px 0 8px; font-size: 22px; }
  h2 + .divider { display: none; }
  .steps { grid-template-columns: 1fr 1fr; gap: 6px; }
  .steps li { gap: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.3; border-radius: 12px; }
  .steps b { font-size: 14px; }
  .step-icon { width: 22px; height: 22px; margin-top: 1px; }
}
.muted.small { font-size: 13px; margin-top: 10px; }
.step-icon { width: 34px; height: 34px; color: var(--gold); margin-top: 2px; }

.drills { display: grid; gap: 10px; }
.drill {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%; min-height: 88px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px 12px; box-shadow: var(--shadow);
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.drill:hover { border-color: var(--accent); background: var(--card-hi); transform: translateY(-1px); }
.drill:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.drill .txt { display: grid; gap: 2px; min-width: 0; }
.drill .part { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.drill h3 { font-size: 18px; }
.drill .meta { color: var(--muted); font-size: 14px; line-height: 1.4; }
.drill .best { font-size: 12px; color: var(--muted); text-align: center; min-width: 40px; }
.drill .best b { display: block; font-size: 17px; color: var(--text); }
.drill.endless { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }

.portrait {
  position: relative; display: block; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--mint) 40%, var(--card)) 0, var(--bg-2) 75%);
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.portrait::after { content: ""; position: absolute; inset: -5px; background: var(--gold); -webkit-mask: url(art/ui-ring.webp) center / contain no-repeat; mask: url(art/ui-ring.webp) center / contain no-repeat; }
.portrait.small { width: 52px; height: 52px; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.badge { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.badge b { display: block; font-size: 15px; color: var(--text); }
.gem {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; transform: rotate(45deg);
  background: var(--bg-2); border: 2px solid var(--line);
}
.gem img { width: 46px; height: 46px; object-fit: contain; transform: rotate(-45deg); filter: grayscale(1); opacity: 0.7; }
.badge.on .gem, .new-badge .gem { border-color: var(--gold); background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, var(--card)), var(--bg-2)); }
.badge.on .gem img, .new-badge .gem img { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); opacity: 1; }
.badge.on b { color: var(--gold); }

/* ---------- Play ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.top .btn { padding: 10px 16px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px; background: var(--line); }
.dots i.good { background: var(--good); }
.dots i.bad { background: var(--bad); }
.dots i.now { outline: 2px solid var(--gold); outline-offset: 2px; }
.lives { display: flex; gap: 4px; }
.life { width: 26px; height: 26px; color: var(--accent); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3)); }
.life.lost { color: var(--line); }
.steps-done { font-size: 14px; }

.combo { display: flex; align-items: center; gap: 2px; min-width: 64px; justify-content: flex-end; color: var(--line); font-weight: 800; }
.combo .flame { width: 22px; height: 22px; transition: transform 0.25s, color 0.25s; }
.combo b { color: var(--gold); font-size: 18px; }
.combo.on { color: var(--gold); }
.combo.heat-1 .flame { transform: scale(1.15); color: var(--gold); }
.combo.heat-2 .flame { transform: scale(1.35); color: var(--accent); }
.combo.heat-3 .flame { transform: scale(1.55); color: var(--accent); animation: flicker 0.9s ease-in-out infinite alternate; }
@keyframes flicker { from { filter: drop-shadow(0 0 2px var(--gold)); } to { filter: drop-shadow(0 0 8px var(--accent)); transform: scale(1.65) rotate(-4deg); } }

.speaker { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.part { font-size: 13px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.how { color: var(--muted); margin: 2px 0 0; font-size: 15px; line-height: 1.45; }
.prompt {
  position: relative; font-size: clamp(20px, 4.8vw, 26px); line-height: 1.38; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); margin-bottom: 16px; font-family: var(--display); font-weight: 600;
}
.prompt::before { content: "“"; position: absolute; top: -18px; left: 14px; font-size: 56px; line-height: 1; color: var(--gold); font-family: var(--display); }
.choices { display: grid; gap: 10px; }
.choices.row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice {
  text-align: left; min-height: 52px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  border-bottom-width: 3px; font-size: 16px; line-height: 1.4; transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.choices.row .choice { text-align: center; font-weight: 700; }
.choice:hover:not([disabled]) { border-color: var(--accent); background: var(--card-hi); }
.choice:active:not([disabled]) { transform: translateY(2px); border-bottom-width: 1px; margin-bottom: 2px; }
.choice[disabled] { cursor: default; }
.choice.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, var(--card)); }
.choice.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 18%, var(--card)); animation: shake 0.3s; }
.choice.dim { opacity: 0.55; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.feedback {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; margin-top: 16px; padding: 14px 16px 16px 8px;
  border-radius: 16px; border: 1px solid var(--line); border-left: 5px solid var(--good); background: var(--card); box-shadow: var(--shadow);
  animation: rise 0.25s ease-out;
}
.feedback.bad { border-left-color: var(--bad); }
.feedback .guide { width: 84px; height: auto; margin-top: -6px; }
.feedback h3 { font-size: 18px; margin: 4px 0 4px; }
.feedback p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.gain { color: var(--gold); font-weight: 800; margin-left: 8px; font-family: var(--sans); font-size: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Results ---------- */
.result { text-align: center; padding: 8px 0 12px; }
.stage { position: relative; height: 170px; display: flex; justify-content: center; align-items: flex-end; gap: 0; }
.sigil { position: absolute; left: 50%; top: 0; width: 170px; height: 170px; margin-left: -85px; color: color-mix(in srgb, var(--mint) 55%, transparent); }
.sigil-ring { width: 100%; height: 100%; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage .lvl-art { position: relative; width: 110px; height: 110px; object-fit: contain; margin-bottom: 24px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.stage .guide { position: relative; width: 92px; height: auto; margin-left: -18px; }
.result .big { font-family: var(--display); font-size: 60px; font-weight: 600; line-height: 1; margin-top: 8px; }
.result .word { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; margin-top: 4px; }
.result .lines { margin: 16px auto; display: grid; gap: 6px; max-width: 340px; }
.result .lines div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.levelup { color: var(--gold); font-weight: 700; font-size: 20px; margin: 12px 0; font-family: var(--display); }
.new-badge { display: inline-flex; gap: 16px; align-items: center; text-align: left; margin: 6px auto; padding: 10px 18px 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--gold); color: var(--muted); font-size: 13px; animation: rise 0.4s ease-out; }
.new-badge b { display: block; color: var(--gold); font-size: 16px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.note { font-size: 13px; color: var(--muted); margin-top: 32px; }

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