/* Look and feel on top of style.css: colour, depth and motion. The JS-driven effects (confetti, praise,
   combo, score ring) live in fx.js; their classes are styled at the end of this file. */
:root {
  --brand: #d23655;
  --brand-2: #ff7a59;
  --brand-deep: #8c1f37;
  --page: #fbf6f4;
  --surface: #ffffff;
  --ink: #1f2330;
  --shadow-sm: 0 1px 2px rgba(31, 35, 48, .05), 0 3px 10px rgba(31, 35, 48, .05);
  --shadow-md: 0 6px 16px rgba(31, 35, 48, .07), 0 18px 40px -12px rgba(31, 35, 48, .14);
  --shadow-glow: 0 10px 28px -8px rgba(210, 54, 85, .55);
  --grad-brand: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --bs-body-bg: var(--page);
  --bs-body-color: var(--ink);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-deep);
  --bs-border-color: #f0e4e4;
  --accent-soft: #ffeef1;
  --wk-radical: #00a1f1;
  --wk-kanji: #f100a1;
  --wk-vocabulary: #a100f1;
  --bs-body-font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}
[lang="ja"], .subject-chars { font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "Noto Sans JP", sans-serif; }

body {
  background:
    radial-gradient(900px 520px at 105% -8%, rgba(255, 143, 171, .28), transparent 60%),
    radial-gradient(760px 480px at -12% 18%, rgba(255, 209, 102, .22), transparent 60%),
    radial-gradient(700px 600px at 50% 110%, rgba(76, 201, 240, .12), transparent 60%),
    var(--page);
  background-attachment: fixed;
}
::selection { background: #ffc2d1; color: var(--ink); }

/* header */
header.border-bottom {
  position: sticky; top: 0; z-index: 30;
  border-color: rgba(240, 228, 228, .7) !important;
  background: rgba(251, 246, 244, .72);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
header .navbar { padding-block: 12px !important; }
.navbar-brand { font-weight: 750 !important; letter-spacing: -.01em; }
.brand-mark {
  background: var(--grad-brand); color: #fff; border-radius: 12px; box-shadow: var(--shadow-glow);
  transition: transform .4s var(--spring);
}
.navbar-brand:hover .brand-mark { transform: rotate(-10deg) scale(1.1); }
.sound-toggle { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--bs-border-color); background: var(--surface); line-height: 1; transition: transform .25s var(--spring); }
.sound-toggle:hover { transform: scale(1.12); }
.display-settings { position: relative; }
.display-settings-toggle {
  list-style: none; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--bs-border-color);
  background: var(--surface); font-size: .875rem; font-weight: 600; white-space: nowrap; transition: border-color .2s ease, transform .2s var(--spring);
}
.display-settings-toggle::-webkit-details-marker { display: none; }
.display-settings-toggle:hover, .display-settings[open] .display-settings-toggle { border-color: #f3b9c5; color: var(--brand-deep); }
.display-settings-toggle span { color: var(--brand); font-weight: 800; }
.display-settings-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(300px, calc(100vw - 32px));
  padding: 14px; background: var(--surface); border: 1px solid var(--bs-border-color); border-radius: 14px; box-shadow: var(--shadow-md);
  animation: fx-pop .25s var(--spring) both; transform-origin: top right;
}
.display-settings-menu label { display: block; margin-bottom: 6px; }
.sound-toggle:active { transform: scale(.92); }

/* type */
h1, .h1 { letter-spacing: -.025em; }
#dashboard-heading, #login-heading {
  font-size: clamp(2rem, 6vw, 2.9rem); font-weight: 800 !important;
  background: linear-gradient(100deg, var(--ink) 30%, var(--brand) 75%, var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow { color: var(--brand); font-size: .78rem; font-weight: 750; letter-spacing: .16em; }

/* buttons */
.btn { border-radius: 10px; font-weight: 600; transition: transform .2s var(--spring), box-shadow .2s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:not(:disabled):active { transform: scale(.95); }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-bg: #e3a3b0; --bs-btn-disabled-border-color: transparent;
  position: relative; overflow: hidden; background-image: var(--grad-brand); box-shadow: var(--shadow-glow);
}
.btn-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(210, 54, 85, .6); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
}
.btn-primary:not(:disabled):hover::after { animation: fx-sheen .8s ease; }
.btn-primary:disabled { background-image: none; box-shadow: none; }
.btn-outline-secondary { --bs-btn-color: #4b5160; --bs-btn-border-color: #e4d9da; --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-color: var(--brand-deep); --bs-btn-hover-border-color: #f3b9c5; --bs-btn-active-bg: #ffe0e7; --bs-btn-active-color: var(--brand-deep); background: var(--surface); }
.btn-outline-secondary:not(:disabled):hover { transform: translateY(-1px); }
.btn-outline-success { --bs-btn-color: #138a4a; --bs-btn-border-color: #9fdcb9; --bs-btn-hover-bg: #17a25a; --bs-btn-hover-border-color: #17a25a; }
.btn-danger { --bs-btn-bg: #e5384f; --bs-btn-border-color: #e5384f; }
/* the button Enter / Go presses while the answer field keeps the keyboard open (touch screens) */
.btn.is-default { outline: 3px solid rgba(210, 54, 85, .4); outline-offset: 2px; }
.btn-outline-success.is-default { outline-color: rgba(23, 162, 90, .45); }
.form-control, .form-select { border-radius: 10px; border-color: #eadedf; }
.form-control:focus, .form-select:focus { border-color: #f39aac; box-shadow: 0 0 0 .25rem rgba(210, 54, 85, .14); }

/* nav pills */
.nav-pills { padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--bs-border-color); display: inline-flex; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; transition: background-color .25s ease, color .25s ease, transform .2s var(--spring); }
.nav-pills .nav-link:hover { color: var(--brand); }
.nav-pills .nav-link.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }

/* cards */
.stat-card, .pg-card, .pg-tile, .routine, .quiz-card, .grammar-lesson, .pg-achievement {
  background: var(--surface); border-color: rgba(240, 228, 228, .9); border-radius: 18px; box-shadow: var(--shadow-sm);
}
/* no overflow:hidden here: the conjugation forms menu drops out of its card */
.stat-card {
  position: relative; padding: 22px;
  --card-accent: linear-gradient(90deg, #d7cfd0, #ece6e7);
  --card-tint: rgba(120, 110, 112, .06);
  background: radial-gradient(circle at 100% 0, var(--card-tint) 0 110px, transparent 111px), var(--surface);
  transition: transform .35s var(--spring), box-shadow .3s ease;
}
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 18px 18px 0 0; background: var(--card-accent); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card:has(details[open]) { z-index: 5; }
.stat-lessons { --card-accent: linear-gradient(90deg, #f100a1, #ff6fcf); --card-tint: rgba(241, 0, 161, .07); }
.stat-reviews { --card-accent: linear-gradient(90deg, #00a1f1, #5fd3ff); --card-tint: rgba(0, 161, 241, .08); }
.stat-burned { --card-accent: linear-gradient(90deg, #ff6a00, #ffb347); --card-tint: rgba(255, 106, 0, .07); }
.stat-vocab { --card-accent: linear-gradient(90deg, #a100f1, #d67bff); --card-tint: rgba(161, 0, 241, .07); }
.stat-conjugation { --card-accent: linear-gradient(90deg, #12a36d, #6ee7b7); --card-tint: rgba(18, 163, 109, .08); }
.stat-grammar { --card-accent: linear-gradient(90deg, #e09b00, #ffd166); --card-tint: rgba(224, 155, 0, .08); }
.col-sm-6:nth-child(3) .stat-card { --card-accent: linear-gradient(90deg, #6366f1, #a5b4fc); --card-tint: rgba(99, 102, 241, .07); }
.stat-value { font-size: 2.75rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; display: inline-block; }
.stat-burned .stat-value { color: #e25d00; }
.col-sm-6:nth-child(3) .stat-value { color: #5458e0; }
.stat-label { font-size: .74rem; letter-spacing: .12em; }

/* staggered entrance of dashboard pieces */
#dashboard:not([hidden]) .row > *, #dashboard:not([hidden]) .pg-banner, #dashboard:not([hidden]) .routine {
  animation: fx-rise .6s var(--spring) both;
}
#dashboard .pg-banner { animation-delay: .02s; }
#dashboard .routine { animation-delay: .06s; }
#dashboard .row > :nth-child(1) { animation-delay: .1s; }
#dashboard .row > :nth-child(2) { animation-delay: .15s; }
#dashboard .row > :nth-child(3) { animation-delay: .2s; }
#dashboard .row > :nth-child(4) { animation-delay: .25s; }
#dashboard .row > :nth-child(5) { animation-delay: .3s; }
#dashboard .row > :nth-child(6) { animation-delay: .35s; }
#dashboard .row > :nth-child(7) { animation-delay: .4s; }
#grammar-view:not([hidden]), #progress-view:not([hidden]), #quiz-view:not([hidden]), #lesson-session:not([hidden]), #login-section:not([hidden]) {
  animation: fx-rise .5s var(--spring) both;
}

/* assignment list */
.subject-row { background: var(--surface); border-radius: 14px; border-color: rgba(240, 228, 228, .9); transition: transform .25s var(--spring), box-shadow .25s ease, border-color .2s ease; }
a.subject-row:hover { background: var(--surface); transform: translateX(4px); box-shadow: var(--shadow-md); border-color: #f3b9c5; }
.subject-list li { animation: fx-rise .45s var(--spring) both; }
.subject-list li:nth-child(2) { animation-delay: .03s; } .subject-list li:nth-child(3) { animation-delay: .06s; }
.subject-list li:nth-child(4) { animation-delay: .09s; } .subject-list li:nth-child(5) { animation-delay: .12s; }
.subject-list li:nth-child(n+6) { animation-delay: .15s; }
.subject-tile { border-radius: 12px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 10px -4px rgba(0, 0, 0, .3); }
.type-radical { background: linear-gradient(145deg, #2bb8ff, #0089d1); }
.type-kanji { background: linear-gradient(145deg, #ff3cbf, #c7008a); }
.type-vocabulary { background: linear-gradient(145deg, #b93cff, #8500c9); }
.srs-badge { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }

/* progress banner and routine */
.pg-banner { background: linear-gradient(100deg, #fff0f3, #fff6e6); border: 1px solid #fbdce3; border-radius: 18px; box-shadow: var(--shadow-sm); }
.pg-bar { background: #f5ecee; }
.pg-bar-fill { background: var(--grad-brand); position: relative; overflow: hidden; transition: width 1s var(--spring); }
.pg-bar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: fx-sheen 2.6s ease-in-out infinite; }
.routine-step { border-radius: 12px; transition: transform .25s var(--spring), box-shadow .2s ease, border-color .2s ease; }
.routine-step:not(:disabled):hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.routine-step-done { background: linear-gradient(135deg, #e9fbf1, #d4f5e3); border-color: #9fe1bd; position: relative; }
.routine-step-done .pg-bar-fill { background: linear-gradient(90deg, #17a25a, #4ade80); }
.pg-flame { filter: drop-shadow(0 4px 8px rgba(255, 106, 0, .35)); }
.pg-level-badge { background: var(--grad-brand); box-shadow: 0 0 0 5px #ffe0e7, var(--shadow-glow); animation: fx-float-y 4s ease-in-out infinite; }
.pg-unlocked .pg-achievement-icon { animation: fx-shine 3s ease-in-out infinite; }
.pg-achievement { transition: transform .25s var(--spring); }
.pg-achievement:hover { transform: translateY(-3px) rotate(-.4deg); }

/* review / lesson session */
.review-card { position: relative; }
#review-card, .lesson-card-wrap { animation: none; }
.review-subject {
  min-height: 150px; border-radius: 22px 22px 0 0; position: relative; overflow: hidden;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.review-subject::after { /* soft glare */
  content: ""; position: absolute; inset: 0; background: linear-gradient(155deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 50%); pointer-events: none;
}
.review-subject .subject-chars { font-size: clamp(2.75rem, 12vw, 4.5rem); text-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.review-prompt { border-radius: 0 0 22px 22px; font-weight: 500; padding: 10px 14px; box-shadow: var(--shadow-sm); }
.prompt-reading, .prompt-conjugation { background: linear-gradient(90deg, #232838, #353c52); }
.prompt-meaning { background: #f1eef0; }
.review-input { border-radius: 14px; border-width: 2px; font-weight: 600; transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--spring); }
.review-input:focus { transform: scale(1.01); }
.review-input.is-valid { border-color: #17a25a !important; background-color: #effcf4 !important; box-shadow: 0 0 0 .3rem rgba(23, 162, 90, .18) !important; }
.review-input.is-invalid { border-color: #e5384f !important; background-color: #fff2f4 !important; box-shadow: 0 0 0 .3rem rgba(229, 56, 79, .16) !important; }
.review-verdict { border-radius: 14px; font-weight: 500; animation: fx-pop .45s var(--spring) both; }
.verdict-correct { background: linear-gradient(90deg, #dcfce7, #effcf4); color: #0f7a40; }
.verdict-incorrect { background: linear-gradient(90deg, #ffe1e6, #fff2f4); color: #b0182f; }
.review-result { animation: fx-rise .35s var(--spring) both; }
/* "Show answer": a small pill instead of a full-width banner */
.review-verdict.verdict-revealed {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; margin-bottom: 10px;
  border: 1px solid #e4dcfb; border-radius: 999px; background: linear-gradient(90deg, #f3efff, #faf8ff);
  color: #4c3a8f; font-size: .85rem; font-weight: 400;
}
.verdict-revealed .verdict-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(76, 58, 143, .18); font-size: .8rem;
}
.verdict-revealed strong { font-weight: 700; }
.verdict-revealed .verdict-question { color: #7a6db0; }
.verdict-revealed .verdict-question::before { content: "·"; margin-right: 6px; color: #c4b8ee; }
/* "Count this answer as:" / "Report this answer to WaniKani as:": a small label with a fading rule */
.decide-prompt {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  color: #8a8296; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.decide-prompt::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #e6dff5, transparent); }
.review-progress { height: 10px; border-radius: 999px; background: #f2e6e9; overflow: visible; }
.review-progress .progress-bar {
  border-radius: 999px; position: relative; overflow: visible;
  background: linear-gradient(90deg, #ff4d6d, #ff8f5a, #ffd166); background-size: 200% 100%;
  animation: fx-flow 3s linear infinite; transition: width .6s var(--spring);
  box-shadow: 0 0 14px rgba(255, 99, 99, .45);
}
.review-progress .progress-bar::after { /* spark at the leading edge */
  content: ""; position: absolute; right: -6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 25%, #ffd166 45%, transparent 70%); animation: fx-pulse 1.2s ease-in-out infinite;
}
.lesson-dot { border-radius: 10px; transition: transform .25s var(--spring), opacity .2s ease; }
.lesson-dot:hover { transform: translateY(-2px); opacity: .8; }
.lesson-dot.active { transform: scale(1.08); }
.quiz-choice { border-radius: 14px; transition: transform .2s var(--spring), box-shadow .2s ease; }
.quiz-choice:not(:disabled):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quiz-choice-right { animation: fx-pop .45s var(--spring); }
.quiz-choice-wrong { animation: fx-shake .45s ease; }

/* combo badge in the session header */
.combo {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .9rem;
  background: linear-gradient(90deg, #ffe08a, #ffc15e); color: #7a3d00; box-shadow: 0 6px 16px -6px rgba(255, 166, 0, .7);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.combo.combo-hot { background: linear-gradient(90deg, #ff9a3c, #ff5e62); color: #fff; box-shadow: 0 6px 18px -4px rgba(255, 94, 98, .8); }
.combo.combo-blazing { background: linear-gradient(90deg, #ff2d75, #a100f1, #ff2d75); background-size: 200% 100%; color: #fff; animation: fx-flow 1.5s linear infinite; box-shadow: 0 0 22px rgba(255, 45, 117, .7); }

/* score card after a session or quiz */
.session-hero {
  display: flex; align-items: center; gap: 28px; padding: 26px 28px; margin-bottom: 24px; border-radius: 24px;
  background: var(--surface); box-shadow: var(--shadow-md); position: relative; overflow: hidden;
  animation: fx-pop .6s var(--spring) both;
}
.session-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 200px at 0% 0%, rgba(255, 143, 171, .22), transparent 70%), radial-gradient(420px 220px at 100% 100%, rgba(255, 209, 102, .25), transparent 70%); pointer-events: none; }
.session-hero > * { position: relative; }
.hero-ring-wrap { position: relative; flex: none; width: 132px; height: 132px; }
.hero-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-ring-track { fill: none; stroke: #f5e9ec; stroke-width: 11; }
.hero-ring-fill { fill: none; stroke: url(#hero-grad); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.22, 1, .36, 1) .15s; filter: drop-shadow(0 3px 6px rgba(255, 77, 109, .35)); }
.hero-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-percent { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-sub { color: var(--bs-secondary-color); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.hero-info { flex: 1; min-width: 0; }
.hero-grade { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; line-height: 1.1; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; animation: fx-pop .7s var(--spring) .3s both; }
.hero-perfect .hero-grade { background: linear-gradient(90deg, #ff2d75, #ffb347, #06d6a0, #4cc9f0, #a100f1, #ff2d75); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; animation: fx-pop .7s var(--spring) .3s both, fx-flow 3s linear infinite; }
.hero-grade-en { color: var(--bs-secondary-color); font-weight: 600; margin-bottom: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stat { padding: 8px 14px; border-radius: 12px; background: #fbf4f5; min-width: 84px; animation: fx-rise .5s var(--spring) both; }
.hero-stat:nth-child(1) { animation-delay: .45s; } .hero-stat:nth-child(2) { animation-delay: .55s; } .hero-stat:nth-child(3) { animation-delay: .65s; } .hero-stat:nth-child(4) { animation-delay: .75s; }
.hero-stat-value { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.hero-stat-label { color: var(--bs-secondary-color); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 575.98px) {
  .session-hero { flex-direction: column; text-align: center; padding: 22px 18px; gap: 16px; }
  .hero-stats { justify-content: center; }
}

/* fx.js overlay pieces */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }
.fx-float {
  position: fixed; z-index: 1001; pointer-events: none; transform: translate(-50%, -50%);
  font-size: 1.6rem; font-weight: 900; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .18), 0 0 18px rgba(255, 77, 109, .8), 0 0 2px #ff4d6d;
  -webkit-text-stroke: 1px rgba(210, 54, 85, .6);
  animation: fx-float-up 1.1s cubic-bezier(.22, 1, .36, 1) forwards;
}
.fx-float-big { font-size: 2.6rem; color: #ffd166; -webkit-text-stroke: 1.5px #c2410c; text-shadow: 0 3px 0 #9a3412, 0 0 30px rgba(255, 166, 0, .9); animation-duration: 1.5s; }
.fx-bump { animation: fx-bump .45s var(--spring); }
.fx-glow { animation: fx-glow .7s ease-out; }
.fx-shake { animation: fx-shake .45s ease; }
.fx-enter { animation: fx-card-in .45s var(--spring) both; }

@keyframes fx-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fx-pop { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fx-bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes fx-shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-10px) rotate(-1deg); } 30% { transform: translateX(9px) rotate(1deg); } 45% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes fx-glow { 0% { filter: drop-shadow(0 0 0 rgba(23, 162, 90, 0)); transform: scale(1); } 30% { filter: drop-shadow(0 0 22px rgba(23, 162, 90, .55)); transform: scale(1.02); } 100% { filter: drop-shadow(0 0 0 rgba(23, 162, 90, 0)); transform: scale(1); } }
@keyframes fx-card-in { from { opacity: 0; transform: translateX(40px) rotate(1.5deg) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fx-float-up { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes fx-sheen { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }
@keyframes fx-flow { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes fx-pulse { 0%, 100% { transform: scale(.8); opacity: .8; } 50% { transform: scale(1.3); opacity: 1; } }
@keyframes fx-float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes fx-shine { 0%, 100% { box-shadow: 0 0 0 3px #fdf1d8, 0 0 0 rgba(255, 209, 102, 0); } 50% { box-shadow: 0 0 0 3px #fdf1d8, 0 0 18px rgba(255, 190, 60, .8); } }

/* ---------- phones and touch screens ---------- */

/* Touch: a tap leaves :hover on, so lift / slide effects would stay stuck after it. */
@media (hover: none) {
  .stat-card:hover, a.subject-row:hover, .routine-step:not(:disabled):hover, .pg-achievement:hover,
  .btn-primary:not(:disabled):hover, .btn-outline-secondary:not(:disabled):hover, .quiz-choice:not(:disabled):hover,
  .lesson-dot:hover, .sound-toggle:hover, .navbar-brand:hover .brand-mark { transform: none; }
  .stat-card:hover, a.subject-row:hover, .routine-step:not(:disabled):hover, .quiz-choice:not(:disabled):hover { box-shadow: var(--shadow-sm); }
  .btn-primary:not(:disabled):hover { box-shadow: var(--shadow-glow); }
  .btn-primary:not(:disabled):hover::after { animation: none; }
  button, a, summary, select { -webkit-tap-highlight-color: transparent; }
}

/* Touch: fields under 16px make iOS Safari zoom the page on focus; small buttons are hard to hit. */
@media (pointer: coarse) {
  input, select, textarea, .form-control, .form-control-sm, .form-select, .form-select-sm { font-size: 16px !important; }
  .btn-sm, .form-select-sm, .form-control-sm, .forms-picker > summary { min-height: 38px; }
  .btn-sm { display: inline-flex; align-items: center; justify-content: center; }
  .form-check-input { width: 1.25em; height: 1.25em; }
  .forms-menu .form-check { margin: 8px 0; }
}

@media (max-width: 575.98px) {
  body { background-attachment: scroll; } /* fixed backgrounds jank or are ignored on mobile browsers */
  /* The header scrolls away on phones: sticky it would cover headings and eat space next to the keyboard. */
  header.border-bottom { position: static; }
  header .navbar { gap: 8px; }
  header .navbar > .d-flex { position: relative; width: 100%; flex-wrap: wrap; gap: 6px !important; }
  header .navbar .btn-sm { padding-inline: 8px; white-space: nowrap; }
  #user-badge { display: none; }
  #logout-button { margin-left: auto; }
  /* the Display menu spans the header's width instead of hanging off the left edge */
  .display-settings { position: static; }
  .display-settings-menu { left: 0; right: 0; width: auto; transform-origin: top center; }
  .stat-value { font-size: 2.4rem; }
  .review-subject { min-height: 120px; }
  .fx-float { font-size: 1.3rem; }
  .fx-float-big { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
