/* ============================================================
   SCHOOL REVIEWER — SHARED DESIGN TOKENS
   Block theme inspired by Johan's Multiplication Quest.
   ============================================================ */
:root {
  --ink: #2B2A4A;
  --bg: #F6F7FB;
  --paper: #FFFFFF;

  /* Subject accent colours */
  --math:    #5B5FEF;
  --math-dk: #4448C7;
  --math-lt: #D9DBFB;

  --science:    #2FBF71;
  --science-dk: #22994F;
  --science-lt: #D5F5E3;

  --religion:    #FFB238;
  --religion-dk: #E0951C;
  --religion-lt: #FFE7C2;

  --araling:    #FF6F59;
  --araling-dk: #E1543F;
  --araling-lt: #FFE0DA;

  --filipino:    #29C7C7;
  --filipino-dk: #1EA0A0;
  --filipino-lt: #CFF6F6;

  --english:    #A855F7;
  --english-dk: #7E22CE;
  --english-lt: #EDE9FE;

  /* Neutrals */
  --line: #DEE1F2;
  --muted: #6b6b8f;

  --radius: 16px;
  --shadow: 0 4px 0 rgba(0,0,0,0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1,h2,h3,h4 { margin: 0 0 8px 0; line-height: 1.2; }
p { margin: 0 0 10px 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.app {
  max-width: 780px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px 48px;
  display: flex;
  flex-direction: column;
}

/* ---- Cards ---- */
.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 24px 16px 28px;
}
.hero .block-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.mini-block {
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 2px solid var(--ink);
}
.hero h1 { font-size: clamp(24px, 7vw, 36px); color: var(--math-dk); }
.hero .sub { font-size: clamp(14px, 4vw, 17px); font-weight: 600; }

/* ---- Grade selector tiles ---- */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
@media (max-width: 480px) { .grade-grid { grid-template-columns: repeat(3, 1fr); } }
.grade-tile {
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--paper);
  transition: background .15s;
  user-select: none;
}
.grade-tile small { font-size: 9px; font-weight: 700; margin-top: 2px; }
.grade-tile:active { transform: translateY(3px); box-shadow: none; }
.grade-tile.selected { background: var(--math-lt); border-color: var(--math-dk); }

/* ---- Subject grid ---- */
.subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 460px) { .subject-grid { grid-template-columns: 1fr; } }

.subject-btn {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: opacity .15s;
  text-decoration: none;
  background: var(--paper);
}
.subject-btn:active { transform: translateY(3px); box-shadow: none; }
.subject-btn .emoji { font-size: 32px; }
.subject-btn.math     { background: var(--math-lt); }
.subject-btn.science  { background: var(--science-lt); }
.subject-btn.religion { background: var(--religion-lt); }
.subject-btn.araling  { background: var(--araling-lt); }
.subject-btn.filipino { background: var(--filipino-lt); }
.subject-btn.english  { background: var(--english-lt); }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; }

.iconbtn {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  width: 44px; height: 44px;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}
.iconbtn:active { transform: translateY(3px); box-shadow: none; }

.grade-badge {
  background: var(--math-lt);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* ---- Term tabs ---- */
.term-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.term-tab {
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--paper);
  color: var(--ink);
  flex: 1;
  min-width: 90px;
  text-align: center;
}
.term-tab:active { transform: translateY(3px); box-shadow: none; }
.term-tab.active { color: #fff; }

/* Subject-specific active tab colours */
.math-subject    .term-tab.active { background: var(--math); }
.science-subject .term-tab.active { background: var(--science); }
.religion-subject .term-tab.active { background: var(--religion-dk); }
.araling-subject .term-tab.active { background: var(--araling); }
.filipino-subject .term-tab.active { background: var(--filipino-dk); }
.english-subject .term-tab.active { background: var(--english); }

/* ---- Term panel ---- */
.term-panel { display: none; }
.term-panel.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Topic list ---- */
.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topic-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--paper);
  font-weight: 600;
  font-size: 15px;
}
.topic-list li .dot {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 3px;
  border: 2px solid var(--ink);
}

/* Subject dot colours */
.math-subject    .dot { background: var(--math); }
.science-subject .dot { background: var(--science); }
.religion-subject .dot { background: var(--religion); }
.araling-subject .dot { background: var(--araling); }
.filipino-subject .dot { background: var(--filipino); }
.english-subject .dot { background: var(--english); }

/* ---- Subject header banner ---- */
.subject-banner {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.subject-banner .emoji { font-size: 40px; display: block; margin-bottom: 6px; }
.subject-banner h2 { font-size: clamp(22px, 6vw, 30px); margin-bottom: 4px; }
.subject-banner p { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0; }

.math-subject    .subject-banner { background: var(--math-lt); }
.science-subject .subject-banner { background: var(--science-lt); }
.religion-subject .subject-banner { background: var(--religion-lt); }
.araling-subject .subject-banner { background: var(--araling-lt); }
.filipino-subject .subject-banner { background: var(--filipino-lt); }
.english-subject .subject-banner { background: var(--english-lt); }

/* ---- Callout ---- */
.callout {
  background: #FFF6D8;
  border: 3px dashed var(--religion-dk);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 700;
  text-align: center;
  font-size: 14px;
}

/* ---- Utility ---- */
.small-muted { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.mt8  { margin-top: 8px; }
.mt14 { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .term-panel.active { animation: none; }
}
