/* /review — spaced repetition of the learned words (pages/js/review.js). The site's own look (dashboard). */
:root {
  --bg: #f6f8fb; --card: #fff; --text: #172033; --muted: #66708a; --line: #dce3ee;
  --green: #58cc02; --green-dark: #3f9a00; --green-soft: #ecfbdc;
  --blue: #1cb0f6; --blue-dark: #0b86c2; --blue-soft: #e5f6fe;
  --orange: #ff9600; --orange-soft: #fff1dd; --purple: #8b5cf6; --purple-soft: #f1ebff;
  --red: #e5484d; --red-dark: #b4232a; --red-soft: #fde8e8;
  --shadow: 0 18px 45px rgba(29, 45, 73, .10); --r: 28px;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; color: var(--text); background: radial-gradient(circle at top left, #e9f8ff 0, #f6f8fb 36%, #f7f7fb 100%); }
[hidden] { display: none !important; }
.app { max-width: 1180px; margin: 0 auto; padding: 22px; }

.review { max-width: 640px; margin: 28px auto 40px; }
.review-panel {
  position: relative; padding: 32px 28px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(220, 227, 238, .9); border-radius: 34px; box-shadow: var(--shadow);
  animation: rise .35s cubic-bezier(.2, .8, .2, 1) both;
}
.review-eyebrow { display: inline-block; padding: 6px 12px; font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; }
.review h1 { margin: 12px 0 8px; font-size: clamp(28px, 6vw, 38px); line-height: 1.08; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 14px 22px;
  font-size: 17px; font-weight: 900; text-decoration: none; text-align: center; border: 0; border-radius: 18px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn--primary { color: #fff; background: var(--green); box-shadow: 0 6px 0 var(--green-dark); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--green-dark); }
.btn--ghost { color: var(--green-dark); background: var(--green-soft); }
.btn--wide { width: 100%; margin-top: 16px; }
.link-btn { display: block; margin: 14px auto 0; padding: 8px 12px; font-size: 15px; font-weight: 800; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- 1. intro ---------- */
.intro-art { position: relative; float: right; width: 112px; height: 112px; margin: -6px -4px 0 12px; }
.card-stack { position: absolute; inset: 10px; display: grid; place-items: center; font-size: 46px; background: #fff; border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 10px 22px rgba(29, 45, 73, .10); }
.card-stack--3 { transform: rotate(-12deg) translate(-8px, 4px); background: var(--orange-soft); }
.card-stack--2 { transform: rotate(8deg) translate(8px, 2px); background: var(--purple-soft); }
.card-stack--1 { background: var(--blue-soft); animation: bob 3.2s ease-in-out infinite; }
.intro-lead { font-size: 17px; line-height: 1.55; color: var(--muted); font-weight: 600; }
.intro-stats { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.stat { padding: 14px 8px; text-align: center; border-radius: 20px; border: 1px solid var(--line); background: #f7f9fc; }
.stat strong { display: block; font-size: 28px; line-height: 1.1; }
.stat span { display: block; margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.stat--due { background: var(--blue-soft); border-color: #bfe7fb; }
.stat--due strong { color: var(--blue-dark); }
.stat--strong { background: var(--green-soft); border-color: #cdeeb0; }
.stat--strong strong { color: var(--green-dark); }
.strength { height: 12px; margin-top: 14px; overflow: hidden; background: #edf1f7; border-radius: 99px; }
.strength i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.intro-note { min-height: 1em; margin-top: 12px; font-weight: 800; color: var(--muted); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.intro-actions .btn { flex: 1 1 220px; }
.how { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.how summary { font-weight: 900; cursor: pointer; color: var(--blue-dark); }
.how p { margin-top: 10px; line-height: 1.6; color: var(--muted); font-weight: 600; }

/* ---------- 2. session ---------- */
.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.session-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-size: 18px; font-weight: 900; color: var(--muted); text-decoration: none; background: #f1f4f9; border-radius: 50%; }
.session-close:hover { color: var(--text); }
.session-track { flex: 1; height: 14px; overflow: hidden; background: #edf1f7; border-radius: 99px; }
.session-track i { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width .45s cubic-bezier(.2, .8, .2, 1); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08); }
.session-count { flex: none; min-width: 52px; text-align: right; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }

.flashcard.is-entering { animation: card-in .38s cubic-bezier(.2, .8, .2, 1) both; }
.mode-chip { display: inline-block; padding: 6px 12px; font-size: 13px; font-weight: 900; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; }
.mode-chip[data-kind="listen"] { color: #6d3fe0; background: var(--purple-soft); }
.mode-chip[data-kind="gap"] { color: #b86400; background: var(--orange-soft); }
.prompt { display: grid; justify-items: center; gap: 8px; min-height: 170px; padding: 22px 8px 6px; text-align: center; align-content: center; }
.prompt-emoji { font-size: 56px; line-height: 1; animation: bob 3s ease-in-out infinite; }
.prompt-uz { font-size: clamp(26px, 6vw, 34px); font-weight: 900; line-height: 1.15; }
.prompt-sub { font-size: 16px; font-weight: 700; color: var(--muted); line-height: 1.5; }
.prompt-sentence { font-size: clamp(21px, 5vw, 27px); font-weight: 800; line-height: 1.45; }
.gap-blank { display: inline-block; margin: 0 4px; min-width: 4em; border-bottom: 4px dashed var(--orange); }
.prompt-hint { margin-top: 4px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .06em; color: var(--blue-dark); white-space: pre; }
.listen-big {
  display: grid; place-items: center; width: 108px; height: 108px; font-size: 46px; color: #fff; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #4cc4ff, var(--blue)); border: 0; border-radius: 50%;
  box-shadow: 0 8px 0 var(--blue-dark), 0 0 0 0 rgba(28, 176, 246, .4); animation: ping 2.2s ease-out infinite;
}
.listen-big:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--blue-dark); }

.answer { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; }
.answer-input {
  width: 100%; min-width: 0; min-height: 56px; padding: 14px 16px; font-size: 20px; font-weight: 800; color: var(--text);
  background: #fff; border: 2px solid var(--line); border-radius: 18px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.answer-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(28, 176, 246, .18); }
.answer-input.is-wrong { border-color: var(--red); background: var(--red-soft); animation: shake .38s ease both; }
.answer-input.is-right { border-color: var(--green); background: var(--green-soft); }

.verdict { margin-top: 18px; padding: 18px; border-radius: 22px; animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.verdict--right, .verdict--close { background: var(--green-soft); border: 2px solid #c6ec9f; }
.verdict--wrong { background: var(--red-soft); border: 2px solid #f6c3c5; }
.verdict--hint { background: #fff8e8; border: 2px solid #ffe2a8; font-weight: 800; color: #8a5a00; }
.verdict-head { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; }
.verdict--right .verdict-head, .verdict--close .verdict-head { color: var(--green-dark); }
.verdict--wrong .verdict-head { color: var(--red-dark); }
.verdict-icon { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--green); border-radius: 50%; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.verdict--wrong .verdict-icon { background: var(--red); }
.verdict-word { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 30px; font-weight: 900; }
.mini-listen { display: grid; place-items: center; width: 42px; height: 42px; font-size: 20px; background: #fff; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.verdict-uz { margin-top: 2px; font-size: 17px; font-weight: 700; color: var(--muted); }
.verdict-example { margin-top: 12px; padding: 12px 14px; font-size: 17px; font-weight: 700; background: rgba(255, 255, 255, .8); border-radius: 14px; }
.verdict-example b { color: var(--blue-dark); }
.verdict-example span { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
.verdict-later { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--red-dark); }

.combo { margin: 14px auto 0; width: max-content; max-width: 100%; padding: 8px 16px; font-weight: 900; color: #b45309; background: #fff3d6; border: 2px solid #ffd27a; border-radius: 999px; }
.combo.is-popping { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }

/* ---------- 3. done ---------- */
.review-done { text-align: center; overflow: hidden; }
.done-burst { position: absolute; left: 50%; top: 110px; width: 0; height: 0; pointer-events: none; }
.done-burst i { position: absolute; font-style: normal; font-size: 22px; opacity: 0; animation: burst 1.1s cubic-bezier(.2, .8, .2, 1) var(--d) both; }
.done-score { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 18px; text-align: left; }
.ring {
  --p: 0; flex: none; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%;
  background: radial-gradient(closest-side, #fff 76%, transparent 77%), conic-gradient(var(--green) calc(var(--p) * 1%), #edf1f7 0);
}
.ring span { font-size: 26px; font-weight: 900; }
.done-list { list-style: none; display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
.done-list b { color: var(--text); font-size: 20px; }
.done-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.word-chip { padding: 6px 12px; font-weight: 800; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); }
.word-chip--hard { background: #fff3d6; color: #b45309; }
.word-chip--again { background: var(--red-soft); color: var(--red-dark); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateX(16px) rotate(.6deg); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes ping { 0% { box-shadow: 0 8px 0 var(--blue-dark), 0 0 0 0 rgba(28, 176, 246, .45); } 70%, 100% { box-shadow: 0 8px 0 var(--blue-dark), 0 0 0 22px rgba(28, 176, 246, 0); } }
@keyframes burst { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .app { padding: 14px; }
  .review { margin-top: 18px; }
  .review-panel { padding: 24px 18px; border-radius: 28px; }
  .intro-art { width: 88px; height: 88px; }
  .card-stack { font-size: 36px; border-radius: 18px; }
  .answer { grid-template-columns: 1fr; }
  .answer .btn { width: 100%; }
  .done-score { flex-direction: column; text-align: center; }
  .stat strong { font-size: 24px; }
}
