﻿:root {
  --bg-1: #fff4c9;
  --bg-2: #d9f8ff;
  --bg-3: #ffe3f4;
  --ink: #2a2850;
  --ink-soft: #5b5a85;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-edge: #ffd16f;
  --panel-shadow: #caa7ff;
  --card: #ffffff;
  --accent-a: #ff7b00;
  --accent-b: #ff4f7b;
  --ghost: #4e6dff;
  --danger: #d63c67;
  --ok: #18a76d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, #fffbd7 0%, transparent 32%),
    radial-gradient(circle at 88% 8%, #ffd5a8 0%, transparent 34%),
    radial-gradient(circle at 14% 86%, #b2f8f3 0%, transparent 30%),
    linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  padding: 1.8rem 1rem 3rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(82, 74, 142, 0.12) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  opacity: 0.35;
  z-index: 0;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  animation: floaty 9s ease-in-out infinite;
}

.ambient-a {
  width: 20rem;
  height: 20rem;
  right: -5rem;
  top: -6rem;
  background: radial-gradient(circle at 35% 35%, #ffb36f 0%, #ff739d 62%, transparent 100%);
}

.ambient-b {
  width: 21rem;
  height: 21rem;
  left: -7rem;
  bottom: -8rem;
  background: radial-gradient(circle at 40% 40%, #7ce8ff 0%, #7bc2ff 56%, transparent 100%);
  animation-delay: 1.2s;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.site-nav {
  position: relative;
  z-index: 20;
  max-width: 1120px;
  margin: 0 auto 1.25rem;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.2rem 0.1rem;
}

.site-nav-brand,
.site-nav-links a {
  color: #3152cf;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.site-nav-brand {
  flex: 0 0 auto;
  color: #34236e;
  font-size: 1.2rem;
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.site-nav-links a {
  line-height: 1.1;
}

.site-nav-links a:hover,
.site-nav-brand:hover {
  text-decoration: underline;
}

.site-footer {
  position: relative;
  z-index: 20;
  max-width: 1120px;
  margin: 1.5rem auto 0;
  color: var(--ink-soft);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 2px solid rgba(52, 35, 110, 0.14);
  padding: 1rem 0.1rem 0;
}

.site-footer p {
  margin: 0;
  max-width: 520px;
}

.site-footer nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer a {
  color: #3152cf;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.legal-page {
  gap: 1rem;
}

.legal-hero,
.legal-panel {
  border: 3px solid var(--panel-edge);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 9px 0 rgba(202, 167, 255, 0.88);
}

.legal-hero {
  border-radius: 24px;
  padding: 1.2rem;
}

.legal-hero h1 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  color: #34236e;
}

.legal-panel {
  border-radius: 22px;
  padding: 1.15rem;
}

.legal-panel h2 {
  margin: 1.1rem 0 0.35rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: #34236e;
}

.legal-panel h2:first-child {
  margin-top: 0;
}

.legal-panel p {
  margin: 0.45rem 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.legal-panel a {
  color: #3152cf;
  font-weight: 800;
}

.back-btn {
  justify-self: start;
  position: sticky;
  top: 0.4rem;
  z-index: 4;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.hero {
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 229, 0.86) 100%);
  border-radius: 28px;
  border: 3px solid #ffd776;
  box-shadow: 0 12px 0 #f2be6f;
  padding: 1.2rem 1.3rem;
  animation: popIn 420ms ease-out;
}

.hero h1 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2.1rem, 4.6vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: #34236e;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: "Baloo 2", cursive;
  font-size: 0.95rem;
  color: #ff5a89;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.subhead {
  margin: 0.55rem 0 0;
  max-width: 860px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.panel {
  border: 3px solid var(--panel-edge);
  background: var(--panel);
  border-radius: 26px;
  padding: 1rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 11px 0 var(--panel-shadow);
  animation: popIn 480ms ease-out;
}

.hidden {
  display: none;
}

.toast-layer {
  position: fixed;
  top: 0.95rem;
  right: 0.95rem;
  z-index: 1200;
  display: grid;
  gap: 0.55rem;
  width: min(90vw, 420px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border: 3px solid #8ec7ff;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: #2f2d66;
  box-shadow: 0 8px 0 rgba(107, 123, 214, 0.85);
  font-family: "Fredoka", sans-serif;
  font-size: 0.96rem;
  line-height: 1.25;
  padding: 0.68rem 0.78rem;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: transform 170ms ease, opacity 170ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.toast.ok {
  border-color: #73d8b0;
  box-shadow: 0 8px 0 rgba(53, 158, 115, 0.62);
}

.toast.error {
  border-color: #ff9ab4;
  box-shadow: 0 8px 0 rgba(190, 71, 108, 0.64);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}

.panel h2 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
  color: #402f8b;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
}

.saved-quiz-row {
  margin-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
}

.secondary-upload-form {
  margin-top: 0.65rem;
}

.library-head {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.library-head h2 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: #402f8b;
}

.saved-group {
  margin-top: 0.85rem;
}

.saved-group h3 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: #3e2c84;
}

.saved-quiz-list {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
}

.saved-quiz-card {
  border: 3px solid #89b8ff;
  background: var(--card);
  border-radius: 18px;
  padding: 0.8rem;
  display: grid;
  gap: 0.5rem;
  box-shadow: 0 6px 0 #97b4f5;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.saved-quiz-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 9px 0 #97b4f5;
}

.saved-quiz-card:nth-child(4n + 1) {
  border-color: #7dc6ff;
  box-shadow: 0 6px 0 #8eb8f5;
}

.saved-quiz-card:nth-child(4n + 2) {
  border-color: #ff9ec6;
  box-shadow: 0 6px 0 #f6a3c8;
}

.saved-quiz-card:nth-child(4n + 3) {
  border-color: #ffbf6f;
  box-shadow: 0 6px 0 #e8b77d;
}

.saved-quiz-card:nth-child(4n + 4) {
  border-color: #90e3b8;
  box-shadow: 0 6px 0 #8dd2b5;
}

.saved-quiz-card-last {
  outline: none;
  box-shadow: 0 0 0 3px #6a52dd, 0 6px 0 #8ea9e3;
}

.saved-quiz-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #3c2c7f;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.saved-quiz-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.saved-quiz-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.file-field {
  flex: 1 1 360px;
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.file-field input {
  width: 100%;
  background: #fff;
  border: 3px solid #96b8ff;
  color: #241f45;
  border-radius: 14px;
  padding: 0.62rem;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 0.58rem 1rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent-a) 0%, var(--accent-b) 100%);
  color: #fff;
  box-shadow: 0 5px 0 #cc4f63;
}

.ghost-btn {
  background: linear-gradient(120deg, #7da2ff 0%, #5f7fff 100%);
  color: #fff;
  box-shadow: 0 5px 0 #4f66cf;
}

.danger-btn {
  background: linear-gradient(120deg, #ff7f90 0%, #d63c67 100%);
  color: #fff;
  box-shadow: 0 5px 0 #ab3858;
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.08);
}

.primary-btn:active,
.ghost-btn:active,
.danger-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.hint,
.status,
.feedback {
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.status.error,
.feedback.error {
  color: #d73763;
  font-weight: 700;
}

.status.ok,
.feedback.ok {
  color: var(--ok);
  font-weight: 700;
}

.question-editor-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 1rem;
}

.editor-card {
  border: 3px solid #95b6ff;
  background: #fff;
  border-radius: 20px;
  padding: 0.85rem;
  display: grid;
  gap: 0.7rem;
  box-shadow: 0 7px 0 #8ea9e3;
}

.q-label {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.14rem;
  color: #3e2c84;
}

.q-image {
  width: 100%;
  max-height: 370px;
  object-fit: contain;
  border-radius: 14px;
  border: 3px solid #a0beff;
  background: #f8fbff;
}

.text-field {
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.q-prompt,
.option-input {
  width: 100%;
  border: 3px solid #9bbcff;
  background: #fff;
  color: #251f46;
  border-radius: 12px;
  font-family: "Nunito", sans-serif;
}

.q-prompt {
  padding: 0.62rem;
  resize: vertical;
}

.option-list {
  display: grid;
  gap: 0.48rem;
}

.option-editor-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.option-editor-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #ff6f88;
}

.option-input {
  padding: 0.48rem;
}

.option-remove {
  border: 0;
  background: #ffe3ee;
  color: #9f2f58;
  border-radius: 10px;
  padding: 0.38rem 0.52rem;
  cursor: pointer;
  font-weight: 700;
}

.review-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.quiz-question {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.8rem;
}

.quiz-prompt {
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
  color: #3c2c7f;
  font-size: 1.12rem;
  font-weight: 700;
}

.select-mode-badge {
  margin: 0;
  justify-self: start;
  background: #edf3ff;
  color: #2d4aa9;
  border: 2px solid #9eb7ff;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.85rem;
  font-family: "Fredoka", sans-serif;
}

.quiz-options {
  display: grid;
  gap: 0.58rem;
}

.quiz-option {
  width: 100%;
  border: 3px solid transparent;
  border-radius: 14px;
  color: #fff;
  text-align: left;
  padding: 0.72rem;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-size: 1.02rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.quiz-option:nth-child(4n + 1) {
  background: linear-gradient(135deg, #ff596b 0%, #ff3e8e 100%);
}

.quiz-option:nth-child(4n + 2) {
  background: linear-gradient(135deg, #1f8aff 0%, #5168ff 100%);
}

.quiz-option:nth-child(4n + 3) {
  background: linear-gradient(135deg, #ffbf14 0%, #ff8f1f 100%);
}

.quiz-option:nth-child(4n + 4) {
  background: linear-gradient(135deg, #2cbc6e 0%, #13a98e 100%);
}

.quiz-option:hover {
  transform: translateY(-2px);
}

.quiz-option.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(67, 29, 161, 0.25), 0 5px 0 rgba(0, 0, 0, 0.18);
}

.quiz-option.correct {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(20, 170, 110, 0.85) inset, 0 5px 0 rgba(0, 0, 0, 0.18);
  filter: saturate(1.18) brightness(1.12);
}

.quiz-option.wrong {
  border-color: #ffd6df;
  box-shadow: 0 0 0 3px rgba(200, 50, 90, 0.7) inset, 0 5px 0 rgba(0, 0, 0, 0.18);
  filter: grayscale(0.35) brightness(0.62);
}

.quiz-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.result-score {
  font-size: 1.24rem;
  font-family: "Fredoka", sans-serif;
  color: #3f2f88;
}

.result-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-14px) translateX(6px);
  }
}

@media (max-width: 760px) {
  body {
    padding: 1rem 0.62rem 2rem;
  }

  .site-nav-inner {
    align-items: flex-start;
    display: grid;
    padding: 0;
  }

  .site-nav-links {
    justify-content: flex-start;
    gap: 0.55rem 0.75rem;
  }

  .site-footer-inner {
    align-items: flex-start;
    display: grid;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .hero {
    border-radius: 20px;
    padding: 1rem;
  }

  .panel {
    border-radius: 20px;
    padding: 0.8rem;
  }

  .upload-form {
    align-items: stretch;
  }

  .saved-quiz-list {
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }

  .back-btn {
    width: auto !important;
  }

  .option-editor-row {
    grid-template-columns: auto 1fr;
  }

  .option-remove {
    grid-column: 2;
    justify-self: end;
  }
}

:root {
  --bg-spot-a: #fffbd7;
  --bg-spot-b: #ffd5a8;
  --bg-spot-c: #b2f8f3;
  --dot-overlay: rgba(82, 74, 142, 0.12);
}

:root[data-theme="dark-arcade"] {
  --bg-1: #0f1238;
  --bg-2: #171d5a;
  --bg-3: #271b4e;
  --bg-spot-a: #2f52ff;
  --bg-spot-b: #fb3e8a;
  --bg-spot-c: #13c68f;
  --ink: #e9edff;
  --ink-soft: #aeb8f4;
  --panel: rgba(14, 21, 56, 0.85);
  --panel-edge: #5f82ff;
  --panel-shadow: #213782;
  --card: #151f52;
  --accent-a: #ff4e6e;
  --accent-b: #f79b1d;
  --ghost: #4e7bff;
  --danger: #d63c67;
  --ok: #20db87;
  --dot-overlay: rgba(177, 193, 255, 0.16);
}

:root[data-theme="classroom"] {
  --bg-1: #f5f9ff;
  --bg-2: #e4fff2;
  --bg-3: #fff3de;
  --bg-spot-a: #d1ecff;
  --bg-spot-b: #ffe4b8;
  --bg-spot-c: #c6ffe2;
  --ink: #17364e;
  --ink-soft: #466b84;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-edge: #8bc6ff;
  --panel-shadow: #8ec1d8;
  --card: #ffffff;
  --accent-a: #2b8cfb;
  --accent-b: #42bdf3;
  --ghost: #1f74c9;
  --danger: #d2525f;
  --ok: #159b6b;
  --dot-overlay: rgba(65, 130, 176, 0.12);
}

body {
  background:
    radial-gradient(circle at 12% 14%, var(--bg-spot-a) 0%, transparent 32%),
    radial-gradient(circle at 88% 8%, var(--bg-spot-b) 0%, transparent 34%),
    radial-gradient(circle at 14% 86%, var(--bg-spot-c) 0%, transparent 30%),
    linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}

body::before {
  background-image: radial-gradient(var(--dot-overlay) 1.5px, transparent 1.5px);
}

.hero-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.mini-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.mini-field select {
  border: 2px solid #9ebfff;
  border-radius: 10px;
  background: #fff;
  color: #2a2850;
  font-family: "Fredoka", sans-serif;
  padding: 0.28rem 0.42rem;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.mini-check input {
  accent-color: #ff6790;
}

.mini-link,
.text-link {
  color: #3152cf;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.mini-link {
  border: 2px solid #9ebfff;
  border-radius: 10px;
  background: #fff;
  padding: 0.28rem 0.52rem;
}

.mini-link:hover,
.text-link:hover {
  text-decoration: underline;
}

.result-medal {
  margin: 0.25rem 0 0;
  font-family: "Fredoka", sans-serif;
  color: #2f4fcf;
  font-size: 1.03rem;
}

.burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.burst-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  opacity: 0.96;
  animation: burstOut 900ms ease-out forwards;
}

.burst-dot.ok {
  background: #2fc584;
}

.burst-dot.bad {
  background: #ff4f7b;
}

.burst-dot.medal {
  background: #ffb915;
}

.quiz-meta-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.bookmark-btn {
  border: 2px solid #ffb15c;
  border-radius: 999px;
  background: #fff7e8;
  color: #8f4a00;
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
}

.bookmark-btn.bookmarked {
  background: #ffe3ef;
  border-color: #ff80aa;
  color: #9c2454;
}

.result-time {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-weight: 700;
}

.attempt-review {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.attempt-review h3 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  color: #3e2c84;
}

.attempt-card {
  border: 3px solid #9bbcff;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 5px 0 #9bbcff;
  padding: 0.75rem;
}

.attempt-card.correct {
  border-color: #78d7a8;
  box-shadow: 0 5px 0 #89c9aa;
}

.attempt-card.wrong {
  border-color: #ff9cb6;
  box-shadow: 0 5px 0 #e9a0b7;
}

.attempt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.attempt-card h4 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
}

.attempt-card p {
  margin: 0.35rem 0 0;
}

.attempt-prompt {
  color: #3c2c7f;
  font-weight: 800;
  white-space: pre-wrap;
}

.attempt-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.attempt-badge {
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.78rem;
  padding: 0.13rem 0.5rem;
}

.attempt-badge.ok {
  background: #ddffef;
  color: #0a8053;
}

.attempt-badge.bad {
  background: #ffe3ed;
  color: #a72f58;
}

.attempt-badge.mark {
  background: #fff1d5;
  color: #925100;
}

.content-shell {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  gap: 1.1rem;
}

.content-hero,
.article-page,
.article-list-section {
  border: 3px solid var(--panel-edge);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 8px 0 var(--panel-shadow);
  padding: 1rem;
}

.content-hero h1,
.article-body h1 {
  margin: 0.2rem 0 0;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.article-list-section h2,
.article-body h2,
.article-cta h2 {
  margin: 0;
  color: #402f8b;
  font-family: "Fredoka", sans-serif;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.article-card {
  border: 2px solid #9bbcff;
  border-radius: 8px;
  background: #fff;
  padding: 0.8rem;
}

.article-card h3 {
  margin: 0.2rem 0 0;
  line-height: 1.2;
}

.article-card h3 a {
  color: #34236e;
  text-decoration: none;
}

.article-card h2 {
  margin: 0.2rem 0 0;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  line-height: 1.15;
}

.article-card h2 a {
  color: inherit;
  text-decoration: none;
}

.article-card p {
  color: var(--ink-soft);
}

.article-card-kicker,
.article-category {
  margin: 0;
  color: #ff5a89;
  font-family: "Baloo 2", cursive;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.article-body {
  display: grid;
  gap: 0.95rem;
  color: var(--ink);
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0;
  color: #35345f;
  font-size: 1.03rem;
  line-height: 1.7;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35rem;
}

.article-body a {
  color: #3152cf;
  font-weight: 800;
}

.article-cta {
  margin-top: 1.2rem;
  border: 3px solid #8bd6b0;
  border-radius: 12px;
  background: #f3fff8;
  padding: 0.9rem;
}

.article-cta p {
  color: var(--ink-soft);
}

.article-cta-btn {
  display: inline-block;
  text-decoration: none;
}

.article-hero {
  border: 3px solid #9bbcff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 0 #9bbcff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
  gap: 1rem;
  overflow: hidden;
  padding: 1rem;
}

.article-hero.evidence-based-study-techniques {
  border-color: #ff9bb3;
  box-shadow: 0 8px 0 #ef9db3;
}

.article-hero.quiz-based-learning-self-testing {
  border-color: #8eb9ff;
  box-shadow: 0 8px 0 #8ea9e3;
}

.article-hero.exam-preparation-student-productivity {
  border-color: #87dcb3;
  box-shadow: 0 8px 0 #8dd2b5;
}

.article-hero h1 {
  margin: 0.25rem 0 0;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.06;
}

.article-hero p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.article-hero img {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  object-fit: cover;
  align-self: stretch;
}

.animated-article-page {
  overflow: hidden;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.related-articles {
  border: 3px solid var(--panel-edge);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 8px 0 var(--panel-shadow);
  padding: 1rem;
}

.related-head {
  margin-bottom: 0.75rem;
}

.related-head h2 {
  margin: 0.15rem 0 0;
  color: #402f8b;
  font-family: "Fredoka", sans-serif;
}

.related-card {
  background: #fff;
}

.category-tabs {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.category-tab {
  border: 3px solid #9bbcff;
  border-radius: 999px;
  background: #fff;
  color: #34236e;
  box-shadow: 0 5px 0 #9bbcff;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

.category-tab.coral {
  border-color: #ff9bb3;
  box-shadow: 0 5px 0 #ef9db3;
}

.category-tab.blue {
  border-color: #8eb9ff;
  box-shadow: 0 5px 0 #8ea9e3;
}

.category-tab.green {
  border-color: #87dcb3;
  box-shadow: 0 5px 0 #8dd2b5;
}

.category-tab.active,
.category-tab:hover {
  transform: translateY(-2px);
  background: #fff7df;
}

.category-hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.category-feature-card {
  border: 3px solid #9bbcff;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 0 #9bbcff;
  color: var(--ink);
  overflow: hidden;
  padding: 0.8rem;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.category-feature-card:hover {
  transform: translateY(-3px);
}

.category-feature-card.coral {
  border-color: #ff9bb3;
  box-shadow: 0 8px 0 #ef9db3;
}

.category-feature-card.blue {
  border-color: #8eb9ff;
  box-shadow: 0 8px 0 #8ea9e3;
}

.category-feature-card.green {
  border-color: #87dcb3;
  box-shadow: 0 8px 0 #8dd2b5;
}

.category-feature-card img,
.category-page-hero img,
.visual-article-card img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.category-feature-card img {
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.category-feature-card h2 {
  margin: 0.2rem 0 0;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  line-height: 1.12;
}

.category-feature-card p {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.category-page-hero {
  border: 3px solid #9bbcff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 0 #9bbcff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 40%);
  gap: 1rem;
  overflow: hidden;
  padding: 1rem;
}

.category-page-hero.coral {
  border-color: #ff9bb3;
  box-shadow: 0 8px 0 #ef9db3;
}

.category-page-hero.blue {
  border-color: #8eb9ff;
  box-shadow: 0 8px 0 #8ea9e3;
}

.category-page-hero.green {
  border-color: #87dcb3;
  box-shadow: 0 8px 0 #8dd2b5;
}

.category-page-hero h1 {
  margin: 0.2rem 0 0;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.category-page-hero img {
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  align-self: stretch;
}

.visual-article-section {
  padding: 0.85rem;
}

.visual-article-grid {
  margin-top: 0;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
}

.visual-article-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.65rem;
  overflow: hidden;
}

.visual-article-card.coral {
  border-color: #ff9bb3;
}

.visual-article-card.blue {
  border-color: #8eb9ff;
}

.visual-article-card.green {
  border-color: #87dcb3;
}

.visual-article-card img {
  aspect-ratio: 16 / 10.5;
  border-radius: 6px;
}

.visual-article-copy {
  display: grid;
  gap: 0.35rem;
}

.visual-article-copy p {
  margin: 0;
  line-height: 1.42;
}

.home-info {
  padding: 1.5rem 1rem 2.4rem;
  background: rgba(255, 255, 255, 0.54);
}

.home-info-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.35rem 0;
}

.home-info h2 {
  margin: 0.25rem 0 0.85rem;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.home-info p {
  max-width: 860px;
  color: var(--ink-soft);
  line-height: 1.58;
}

.home-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.home-info-grid article {
  padding: 0.95rem;
  border: 2px solid rgba(74, 55, 130, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.home-info-grid h3 {
  margin: 0 0 0.45rem;
  color: #34236e;
  font-family: "Fredoka", sans-serif;
  font-size: 1.12rem;
}

.home-info-grid p {
  margin: 0;
  line-height: 1.48;
}

@keyframes burstOut {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 0.95;
  }
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.15);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .hero-tools {
    justify-content: flex-start;
  }

  .mini-field {
    width: 100%;
  }

  .mini-field select {
    flex: 1;
  }

  .content-hero,
  .article-page,
  .article-list-section {
    border-radius: 14px;
    padding: 0.82rem;
  }

  .category-hub,
  .category-page-hero,
  .article-hero {
    grid-template-columns: 1fr;
  }

  .category-tab {
    flex: 1 1 100%;
    text-align: center;
  }

  .home-info {
    padding: 1.1rem 0.85rem 1.55rem;
  }

  .home-info-grid {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
