/* SAT Slayer - app shell. Same chunky "sticker" style as IELTS Conquer (black edges, hard shadows),
   re-themed for a fantasy hunt: royal purple, gold, teal, crimson. The exam room has its own exam.css. */
:root {
  --bg: #EDE6FF; --surface: #FFFFFF; --surface-2: #F5F0FF; --ink: #15101F; --ink-2: #4A4060; --muted: #5d5470; --edge: #000; --drop: #000;
  --royal: #4B2A9B; --royal-2: #6A3FD0; --gold: #F2B632; --gold-2: #FFD866; --teal: #14A3A3; --crimson: #C8324B; --mint: #6FD9A8;
  --ok: #1F9D55; --bad: #D33A4F; --card: #FFFFFF;
  --font: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #160F2A; --surface: #241A40; --surface-2: #2E2252; --ink: #F4EFFF; --ink-2: #C9BEE6; --muted: #B5A9D6; --edge: #E9E1FF;
    --royal: #2C1766; --royal-2: #4A2A9B; --card: #241A40; --ok: #4BD98C; --bad: #FF6B7E; color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  background: var(--bg) radial-gradient(rgba(255, 255, 255, .5) 1.6px, transparent 1.8px) 0 0 / 24px 24px; }
@media (prefers-color-scheme: dark) { body { background-image: radial-gradient(rgba(255, 255, 255, .06) 1.6px, transparent 1.8px); } }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: 2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.12rem; }
p { margin: 0 0 .6em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.boot { padding: 40px; font-weight: 700; }
.muted { color: var(--ink-2); } .small { font-size: .86rem; }
.ok { color: var(--ok); } .no { color: var(--bad); }
img.art { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- header ---------- */
.nav { padding: 14px max(16px, calc((100% - 960px) / 2)) 14px; background: linear-gradient(135deg, var(--royal) 0%, var(--royal-2) 100%); border-bottom: 3px solid #000; color: #fff; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; color: #fff; }
.brand .mark { width: 48px; height: 48px; border-radius: 14px; background: var(--gold); border: 3px solid #000; box-shadow: 3px 3px 0 #000; display: grid; place-items: center; font-size: 1.6rem; transform: rotate(-6deg); overflow: hidden; }
.brand b { font-size: 1.55rem; text-shadow: 3px 3px 0 #000; letter-spacing: -.03em; }
.pills { display: flex; gap: 8px; }
.pill { display: flex; align-items: center; gap: 5px; border: 3px solid #000; box-shadow: 3px 3px 0 #000; border-radius: 99px; padding: 2px 12px 2px 8px; font-weight: 800; font-size: .92rem; color: #000; background: var(--gold-2); white-space: nowrap; }
.pill.fire { background: #FF9F7A; }
.pill .pi { width: 20px; height: 20px; display: inline-grid; place-items: center; }
.nav nav { display: flex; gap: 8px; width: 100%; overflow-x: auto; padding-bottom: 4px; }
.nav nav a { text-decoration: none; font-weight: 800; padding: 7px 14px; border: 3px solid #000; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 3px 3px 0 #000; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav nav a .ni { width: 22px; height: 22px; display: inline-grid; place-items: center; }
.nav nav a.on { background: var(--gold); color: #000; }
#view { max-width: 960px; margin: 0 auto; padding: 24px 16px 60px; }
.sync-line { text-align: center; font-size: .8rem; color: var(--ink-2); padding: 0 0 30px; }
.sync-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); margin-right: 6px; }
.sync-dot.synced { background: var(--ok); } .sync-dot.syncing { background: var(--gold); } .sync-dot.badcode, .sync-dot.badserver { background: var(--bad); }

/* ---------- building blocks ---------- */
.page-head { margin-bottom: 18px; }
.page-head h1 { text-shadow: 3px 3px 0 #fff; }
@media (prefers-color-scheme: dark) { .page-head h1 { text-shadow: 3px 3px 0 #000; } }
.card { background: var(--card); border: 3px solid var(--edge); border-radius: var(--r); box-shadow: 5px 5px 0 var(--drop); padding: 18px 20px; margin: 0 0 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 3px solid #000; border-radius: 14px; padding: 9px 18px; font-weight: 800; color: #000; text-decoration: none;
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 100%); box-shadow: 4px 4px 0 #000; transition: transform .12s, box-shadow .12s; }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.purple { background: linear-gradient(180deg, var(--royal-2), var(--royal)); color: #fff; }
.btn.small { padding: 5px 12px; font-size: .9rem; box-shadow: 3px 3px 0 #000; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #000; }
@media (hover: hover) { .btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; } }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 3px solid var(--edge); border-radius: 16px; box-shadow: 4px 4px 0 var(--drop); padding: 10px 14px; }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.1; }
.kpi span { font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.bar { height: 14px; background: var(--surface-2); border: 2px solid var(--edge); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--gold) 0 10px, var(--gold-2) 10px 20px); }
.bar.hp i { background: var(--crimson); }
.tag { display: inline-block; font-size: .75rem; font-weight: 800; border: 2px solid var(--edge); border-radius: 99px; padding: 1px 9px; background: var(--surface-2); }
.tag.done { background: var(--mint); color: #000; } .tag.open { background: var(--gold); color: #000; } .tag.forging { background: #FFB8C3; color: #000; }

/* ---------- Today ---------- */
.hero { display: flex; gap: 16px; align-items: center; }
.hero .sage { width: 110px; height: 110px; flex: 0 0 110px; font-size: 76px; display: grid; place-items: center; animation: float 4s ease-in-out infinite; }
.hero .bubble { background: var(--card); border: 3px solid var(--edge); border-radius: 18px; padding: 12px 16px; box-shadow: 4px 4px 0 var(--drop); position: relative; font-weight: 600; }
.mission { border-top: 8px solid var(--royal-2); }
.mission .kind { font-weight: 800; color: var(--teal); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.note-rest { background: #FFF4D6; border: 2px dashed #B8860B; border-radius: 12px; padding: 8px 12px; margin: 10px 0; color: #4a3b00; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Plan ---------- */
.plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.plan-list li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 3px solid var(--edge); border-radius: 16px; padding: 10px 14px; box-shadow: 3px 3px 0 var(--drop); }
.plan-list .num { width: 40px; height: 40px; border-radius: 12px; border: 3px solid #000; display: grid; place-items: center; font-weight: 900; background: var(--surface-2); flex: 0 0 40px; }
.plan-list li.done .num { background: var(--mint); color: #000; } .plan-list li.open .num { background: var(--gold); color: #000; }
.plan-list li.boss { border-color: var(--crimson); }
.plan-list .what { flex: 1; } .plan-list .what b { display: block; }

/* ---------- Bestiary ---------- */
.beasts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.beast { background: var(--card); border: 3px solid var(--edge); border-radius: 18px; box-shadow: 4px 4px 0 var(--drop); padding: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; position: relative; }
.beast .pic { height: 96px; display: grid; place-items: center; font-size: 60px; }
.beast .pic img.art { width: 96px; height: 96px; }
.beast-detail .pic img.art { width: 180px; height: 180px; }
.beast.slain .pic { filter: grayscale(1); opacity: .55; }
.beast.slain::after { content: "✔"; position: absolute; top: 8px; right: 10px; background: var(--ok); color: #fff; border: 2px solid #000; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 900; }
.beast.unknown .pic { filter: brightness(.25); }
.beast h3 { margin: 0; font-size: 1rem; } .beast .lab { font-size: .78rem; color: var(--ink-2); font-weight: 700; }
.beast .stat { font-size: .8rem; color: var(--ink-2); }
.beast-detail { display: grid; grid-template-columns: 180px 1fr; gap: 18px; }
.beast-detail .pic { font-size: 120px; display: grid; place-items: center; }
.beast-detail dt { font-weight: 800; margin-top: 10px; } .beast-detail dd { margin: 2px 0 0; }
@media (max-width: 640px) { .beast-detail { grid-template-columns: 1fr; } }

/* ---------- Progress ---------- */
/* tables scroll sideways on small screens instead of overflowing the card */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th, table.tbl td { text-align: left; padding: 7px 8px; border-bottom: 2px dashed var(--surface-2); }
table.tbl th { font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.badge { text-align: center; font-size: .78rem; font-weight: 700; }
.badge .bp { width: 72px; height: 72px; margin: 0 auto 4px; font-size: 44px; display: grid; place-items: center; }
.badge.off .bp { filter: grayscale(1); opacity: .35; }
.cause-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; margin: 6px 0; font-weight: 700; font-size: .9rem; }
.scorebars { display: flex; align-items: flex-end; gap: 8px; height: 140px; border-bottom: 3px solid var(--edge); padding: 0 4px; }
.scorebars div { flex: 1; background: var(--teal); border: 2px solid #000; border-bottom: 0; border-radius: 8px 8px 0 0; position: relative; min-height: 4px; }
.scorebars div.boss { background: var(--crimson); }
.scorebars span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: .72rem; font-weight: 800; }
.scorelabels { display: flex; gap: 8px; padding: 4px; } .scorelabels span { flex: 1; text-align: center; font-size: .72rem; color: var(--ink-2); font-weight: 700; }

/* ---------- forms ---------- */
.form label { display: block; font-weight: 800; margin: 12px 0 4px; }
.form input, .form select, .form textarea { width: 100%; max-width: 420px; padding: 9px 12px; border: 3px solid var(--edge); border-radius: 12px; font: inherit; background: var(--surface); color: var(--ink); }
.form .pair { display: flex; gap: 12px; flex-wrap: wrap; } .form .pair > div { flex: 1; min-width: 140px; }
.disclaimer { font-size: .8rem; color: var(--ink-2); }

/* ---------- reward toast ---------- */
.toast-app { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 900; }

@media (max-width: 760px) {
  h1 { font-size: 1.6rem; }
  .plan-list li { flex-wrap: wrap; }
  .plan-list .what { flex-basis: calc(100% - 56px); }
  .plan-list .tag { margin-left: 52px; }
  .beasts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .beast .pic { height: 72px; font-size: 46px; }
  .beast .pic img.art { width: 72px; height: 72px; }
  .hide-sm { display: none; }
  #view { padding: 18px 12px 50px; }
  .brand b { font-size: 1.25rem; text-shadow: 2px 2px 0 #000; }
  .brand .mark { width: 40px; height: 40px; }
  .nav nav a { box-shadow: none; padding: 6px 10px; }
  .hero .sage { width: 80px; height: 80px; flex-basis: 80px; font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- interactive video lesson ---------- */
.ls-wrap { max-width: 900px; margin: 0 auto; }
.ls-stage { position: relative; border: 3px solid var(--edge); border-radius: 16px; overflow: hidden; box-shadow: 5px 5px 0 var(--drop); background: #000; }
.ls-frame { aspect-ratio: 16 / 9; }
.ls-frame iframe, .ls-frame #lsPlayer { width: 100%; height: 100%; display: block; border: 0; }
.ls-overlay { position: absolute; inset: 0; background: rgba(21, 16, 31, .86); display: flex; align-items: center; justify-content: center; padding: 18px; overflow: auto; }
.ls-overlay.hidden { display: none; }
.ls-q { background: #fff; color: #15101F; border: 3px solid #000; border-radius: 16px; padding: 16px 18px; max-width: 640px; width: 100%; box-shadow: 5px 5px 0 #000; }
.ls-qhead { font-weight: 900; color: var(--royal); margin-bottom: 6px; }
.ls-qtext { font-weight: 600; margin-bottom: 10px; }
.ls-ch { display: flex; flex-direction: column; gap: 8px; }
.ls-ch.ls-tf { flex-direction: row; }
.ls-opt { text-align: left; border: 2px solid #000; border-radius: 12px; padding: 8px 12px; background: #F5F0FF; font-weight: 600; color: #15101F; }
.ls-opt:hover { background: var(--gold-2); }
.ls-fill { display: flex; gap: 8px; } .ls-fill input { flex: 1; border: 2px solid #000; border-radius: 10px; padding: 8px 10px; font: inherit; }
.ls-why { margin: 6px 0 12px; line-height: 1.5; }
.ls-key { margin: 10px 0 0; color: var(--ok); }
.ls-track { position: relative; height: 14px; margin: 12px 4px 4px; background: var(--surface-2); border: 2px solid var(--edge); border-radius: 99px; }
.ls-dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--gold); border: 2px solid #000; }
.ls-dot.ok { background: var(--ok); } .ls-dot.no { background: var(--crimson); }
.ls-sum li { margin: 4px 0; }
