/* owner: Phase 3 (Ôn lại + Quiz) */

/* Ôn lại (focus mode; shared .sess-top/.sess-wrap/.sess-bar/.cta/.statusline come from style.css) */
.rv-wrap .flash { margin-bottom: .6rem; }
.rv-status { position: relative; display: flex; align-items: center; gap: .6rem; min-height: 40px; }
.rv-status .statusline { flex: 1; min-width: 0; margin: 0; }
.rv-flags { margin: 0 0 .4rem; }
.rv-q { margin: .4rem 0 .6rem; text-align: center; color: var(--muted); font-size: .98rem; }
.rv-bar { min-height: 76px; box-sizing: border-box; }
.rv-grades { display: grid; gap: 12px; }
.rv-grades.two { grid-template-columns: 1fr 1.4fr; }
.rv-grades.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rv-btn { font: inherit; cursor: pointer; min-height: 56px; padding: .5rem .4rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.05rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; box-sizing: border-box; }
.rv-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-btn.no { color: var(--bad); border-color: var(--bad); }
.rv-btn.yes { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rv-btn.no:active { background: var(--bad-bg); }
.rv-btn.grade { min-height: 84px; gap: .1rem; padding: .4rem .2rem; font-size: 1rem; }
.rv-btn.grade.again:active { background: var(--bad-bg); }
.rv-btn.grade.hard:active { background: var(--mid-bg); }
.rv-btn.grade.good:active { background: var(--good-bg); }
.rv-btn.grade.easy:active { background: var(--accent-soft); }
.rv-btn.grade .gn { font-weight: 700; }
.rv-btn.grade .gh { font-size: .72rem; font-weight: 500; opacity: .9; text-align: center; }
.rv-btn.grade .iv { font-size: .7rem; font-weight: 400; color: var(--muted); text-align: center; }
@media (hover: hover) { .rv-btn:not(.yes):hover { border-color: var(--accent); } .rv-btn.yes:hover { filter: brightness(1.05); } }
.rv-tip { display: flex; align-items: flex-start; gap: .4rem; margin: .5rem 0 0; }
.rv-tip span { flex: 1; }
.rv-tipx { flex: none; width: 36px; height: 36px; margin: -6px -6px -6px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 1.2rem; cursor: pointer; border-radius: 50%; }
.rv-tipx:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-end { display: flex; flex-direction: column; gap: 1rem; padding-top: 1rem; }
.rv-end-btns { display: flex; flex-direction: column; gap: .6rem; }
.undo { margin-left: auto; font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; padding: .3rem .2rem; cursor: pointer; min-height: 44px; white-space: nowrap; }
.undo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (hover: hover) { .undo:hover { color: var(--accent); } }
.rv-ghost { position: absolute; right: 6.5rem; top: .3rem; font-size: .85rem; color: var(--muted); pointer-events: none; opacity: 0; }
.done-card { position: relative; padding-top: 2.4rem; min-height: 150px; }

/* Flip (E5), card-in, ghost (E6): gated by data-fx */
@keyframes flip-out { to { transform: perspective(1000px) rotateY(90deg); } }
@keyframes flip-in { from { transform: perspective(1000px) rotateY(-90deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ghost-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-14px); } }
html[data-fx="on"] .flash.flip-out { animation: flip-out 140ms var(--e-in); animation-fill-mode: forwards; }
html[data-fx="on"] .flash.flip-in { animation: flip-in 180ms var(--e-out); }
html[data-fx="on"] .flash.card-in { animation: card-in 160ms var(--e-out); }
html[data-fx="on"] .rv-ghost { animation: ghost-up 700ms ease-out; }


/* 4-button mode help (above the card, closed by default) */
.gradehelp { margin: 0 0 .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; font-size: .9rem; }
.gradehelp summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.gradehelp summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.gradehelp p { margin: .4rem 0; }
.gradehelp ul { list-style: none; padding: 0; margin: .3rem 0; }
.gradehelp li { padding: .25rem 0; border-top: 1px dashed var(--line); }
.hg.again { color: var(--bad); } .hg.hard { color: var(--mid); } .hg.good { color: var(--good); } .hg.easy { color: var(--accent); }
.kbhint { display: none; }
@media (hover: hover) and (pointer: fine) { .kbhint { display: block; text-align: center; margin: .4rem 0 0; } }
@media (hover: none), (pointer: coarse) { .rv-btn kbd, .undo kbd { display: none; } }
@media (max-width: 480px) { .rv-btn.grade .pre { display: none; } .rv-btn.grade .gh { font-size: .66rem; } }


/* review: keep the whole screen inside one viewport (sess-top ~52px + main padding) */
.rv-wrap { min-height: calc(100vh - 150px); min-height: calc(100dvh - 130px - var(--safe-b)); }
