/* Morris English site: the collection wall (approved comp .impeccable/mocks/c2-day1-quiet.png).
   One flat graphite ground; colour lives only in today's three blister packs, in the day's top colour. */
:root {
  color-scheme: dark;
  --ground: #1e1f22;
  --rail: #1e1f22;
  --panel: #26272c;
  --panel-2: #303137;
  --line: #34353b;
  --ink: #f4f4f6;
  --ink-2: #b9bac2;          /* 8.9:1 on ground */
  --ink-3: #8d8f99;          /* 5.6:1 on ground: labels, never long text */
  --lock: #4a4c54;
  --go: #e2213a;             /* the one action colour: the button you can press now */
  --go-deep: #b5122a;
  --ok: #3fbf6f;
  --top: #c8102e;            /* today's top colour, set per day from units.js */
  --star: #f5c042;
  --zh: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --r: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body { font: 500 17px/1.55 var(--zh); -webkit-font-smoothing: antialiased; }
::selection { background: var(--go); color: #fff; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--star); outline-offset: 3px; border-radius: 8px; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.rail { background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 22px 28px; border-bottom: 1px solid var(--line); font-weight: 900; font-size: 30px; letter-spacing: .04em; text-decoration: none; }
.units { list-style: none; margin: 0; padding: 18px 16px; flex: 1; overflow: auto; }
.units > li + li { margin-top: 6px; }
.unit { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 22px; font-weight: 700; color: var(--ink); }
.unit .later { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.unit.off { color: var(--ink-3); }
.unit .chev { margin-left: auto; align-self: center; width: 18px; height: 18px; color: var(--ink-2); }
.vids { list-style: none; margin: 4px 0 0; padding: 0; }
.vids li { margin-top: 4px; }
.vids button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.vids button:hover { background: var(--panel); color: var(--ink); }
.vids .when { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.vids li.now button { background: var(--panel-2); color: var(--ink); }
.vids li .t { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.vids li.now .t { color: var(--ink-2); }
.vids li .done { color: var(--ok); width: 18px; height: 18px; margin-left: auto; }
.rfoot { padding: 16px 28px 22px; border-top: 1px solid var(--line); display: flex; gap: 18px; font-size: 14px; color: var(--ink-3); }
.rfoot button, .rfoot a { background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--ink-3); text-decoration: none; }
.rfoot button:hover, .rfoot a:hover { color: var(--ink); }

.main { padding: 24px clamp(20px, 3vw, 44px) 40px; min-width: 0; }
.top { display: flex; align-items: center; gap: 20px; }
.top h1 { margin: 0; font-size: clamp(24px, 2.6vw, 40px); font-weight: 900; line-height: 1.15; letter-spacing: .01em; }
.points { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #6a6c75; border-radius: 12px; padding: 7px 16px; font-size: 22px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.points .i { color: var(--ink); fill: var(--ink); stroke: none; width: 20px; height: 20px; }

/* the sentence for today: the biggest English on the page */
.say { margin-top: 18px; background: var(--panel); border-radius: var(--r); display: flex; align-items: center; gap: 22px; padding: 18px 26px; }
.day { flex: none; background: #c9cad1; color: #1b1c20; font-weight: 900; font-size: 26px; padding: 6px 22px; border-radius: 6px; transform: skewX(-12deg); }
.day span { display: inline-block; transform: skewX(12deg); }
.say .bar { width: 2px; align-self: stretch; background: #5a5c64; flex: none; }
.say p { margin: 0; font-size: clamp(28px, 3vw, 46px); font-weight: 800; line-height: 1.15; letter-spacing: .005em; text-wrap: balance; }

/* ---------- today's three packs ---------- */
.packs { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 48px); }
.step { display: flex; flex-direction: column; min-width: 0; }
.tag { align-self: flex-start; display: inline-flex; align-items: baseline; gap: 12px; padding: 4px 24px 6px 18px; background: var(--lock); transform: skewX(-12deg); border-radius: 4px; font-weight: 900; font-size: 24px; }
.tag > * { transform: skewX(12deg); }
.tag b { font-size: 34px; font-style: italic; line-height: 1; }
.step.now .tag { background: var(--go); }
.step.got .tag { background: #2f6b46; }

.pack { margin: 14px auto 0; width: 84%; aspect-ratio: .82; display: flex; justify-content: center; align-items: flex-end; }
.pack .art { position: relative; height: 100%; max-width: 100%; }
.pack .shell { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 22px rgba(0,0,0,.55)); }
.pack .name { position: absolute; left: 6%; right: 6%; display: flex; align-items: center; justify-content: center; gap: .4em;
  color: #fff; font-weight: 900; font-size: clamp(16px, 1.7vw, 26px); letter-spacing: .04em; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.pack .name .code { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pack .bubble { position: absolute; display: grid; place-items: center; }
.pack .part { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 14px 14px rgba(0,0,0,.55)); }
.step.locked .pack .part { filter: grayscale(.35) brightness(.62) drop-shadow(0 14px 14px rgba(0,0,0,.55)); }
.step.locked .pack .shell { filter: saturate(.55) brightness(.7) drop-shadow(0 18px 22px rgba(0,0,0,.55)); }
.stamp { position: absolute; right: -2%; top: 0; transform: translateY(-62%); box-shadow: 0 4px 10px rgba(0,0,0,.45); font-size: 1.15em; display: grid; place-items: center; width: 1.45em; height: 1.45em; background: var(--ok); color: #08200f; border-radius: 50%; }
.stamp .i { width: 70%; height: 70%; stroke-width: 3; }

.act { margin: 16px 8% 0; }
.btn { width: 100%; min-height: 64px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 12px; cursor: pointer;
  font-weight: 900; font-size: 28px; letter-spacing: .08em; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, #f0304a, var(--go-deep)); box-shadow: 0 10px 20px -10px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 26px -12px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.35); }
.btn:active { transform: translateY(1px); }
.btn.lock { background: var(--lock); box-shadow: none; color: #e6e7ea; font-size: 24px; cursor: default; }
.btn.lock:hover { transform: none; }
.btn.again { background: var(--panel-2); box-shadow: none; font-size: 20px; min-height: 52px; }
.btn .i { width: 24px; height: 24px; }
.note { margin: 10px 0 0; text-align: center; text-wrap: balance; font-size: 17px; font-weight: 700; color: var(--ink-2); }

/* ---------- the shelf ---------- */
.shelf { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; display: flex; align-items: center; gap: 28px; }
.shelf h2 { margin: 0; flex: none; font-size: 26px; font-weight: 900; padding-right: 28px; border-right: 2px solid #4a4c54; }
.shelf ol { scrollbar-width: thin; scrollbar-color: var(--lock) transparent; }
.shelf ol::-webkit-scrollbar { height: 8px; }
.shelf ol::-webkit-scrollbar-thumb { background: var(--lock); border-radius: 8px; }
.shelf ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; overflow-x: auto; padding-bottom: 4px; }
.shelf li { flex: none; width: 104px; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.shelf img { width: 104px; height: 104px; object-fit: contain; display: block; }
.shelf li.ghost img { filter: brightness(0) invert(.38); }   /* today's top, not yet earned: its own alpha as a grey silhouette */
.shelf li.landing img { animation: drop .9s var(--ease) .15s both; }
@keyframes drop { 0% { transform: translateY(-140px) rotate(-200deg) scale(1.25); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.shelf .won { flex: none; margin-left: auto; text-align: right; white-space: nowrap; }
.shelf .won b { display: block; font-size: 22px; font-weight: 900; }
.shelf .won span { font-size: 26px; font-weight: 900; color: var(--star); font-variant-numeric: tabular-nums; }
.shelf li.ghost { color: var(--ink-3); }

.shelf li.today { color: var(--ink); }

/* ---------- local test bar, login, parent ---------- */
.devbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 14px; background: #3a1418; border-top: 1px solid #6b2a31; font-size: 14px; }
.devbar b { color: #ffb3bd; }
.devbar button { background: #5a2028; border: 1px solid #8a3a44; color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 14px; }
.has-dev .app { padding-bottom: 48px; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 80px; text-align: center; }
.gate img { width: min(260px, 60vw); filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); }
.gate h1 { margin: 10px 0 6px; font-size: 40px; font-weight: 900; letter-spacing: .04em; }
.gate p { margin: 0 0 18px; color: var(--ink-2); }
.gate .bad { color: #ff8a98; margin-top: 14px; }
.gate .fake { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.gate .fake button { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 10px 16px; cursor: pointer; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }

.plain h1 { font-size: 30px; margin: 0 0 8px; }
.plain h2 { font-size: 20px; margin: 30px 0 8px; }
.plain p { color: var(--ink-2); margin: 0; }
.plain table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.plain th, .plain td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.plain th { color: var(--ink-3); font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 70px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: #f4f4f6; color: #17181b;
  font-weight: 700; padding: 12px 20px; border-radius: 12px; transition: .25s var(--ease); z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* the part arriving when a step is done: the one authored moment */
@keyframes land { from { transform: translateY(-18px) scale(.86) rotate(-40deg); opacity: .2; } to { transform: none; opacity: 1; } }
.step.just .pack .part { animation: land .7s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .step.just .pack .part, .shelf li.landing img { animation: none; } .btn { transition: none; } }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { border: 0; padding: 14px 16px; font-size: 22px; }
  .units, .rfoot .who { display: none; }
  .rfoot { border: 0; margin-left: auto; padding: 0 16px; }
  .main { padding: 16px 16px 32px; }
  .top h1 { font-size: 20px; }
  .points { font-size: 18px; padding: 5px 12px; }
  .say { gap: 12px; padding: 12px 14px; }
  .say .bar { display: none; }
  .day { font-size: 15px; padding: 3px 10px; }
  .say p { font-size: 24px; }
  .packs { grid-template-columns: 1fr; gap: 14px; }
  .packs { gap: 26px; }
  .step { display: grid; grid-template-columns: 54% 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 10px; }
  .tag { grid-column: 1 / -1; grid-row: 1; font-size: 18px; padding: 3px 14px 4px 12px; white-space: nowrap; }
  .tag b { font-size: 24px; }
  .pack { grid-column: 1; grid-row: 2; margin: 0; width: 100%; }
  .pack .name { font-size: 15px; }
  .act { grid-column: 2; grid-row: 2; margin: 0; align-self: center; }
  .btn { min-height: 54px; font-size: 22px; }
  .btn.lock { font-size: 18px; }
  .note { font-size: 14px; }
  .shelf { flex-wrap: wrap; gap: 12px; }
  .shelf ol { order: 3; flex-basis: 100%; }
  .shelf h2 { border: 0; padding: 0; font-size: 20px; }
  .stamp { font-size: 15px; width: 24px; height: 24px; }
  .shelf li, .shelf img { width: 76px; }
  .shelf img { height: 76px; }
}

/* ---------- the video screen ---------- */
.vtop { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.vtop h1 { margin: 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 900; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 700; padding: 8px 0; }
.back:hover { color: var(--ink); }
.stage { position: relative; margin-top: 18px; max-width: 1200px; }
.vbox { aspect-ratio: 16 / 9; background: #111214; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; }
.vbox iframe { width: 100%; height: 100%; border: 0; }
.vmsg { color: var(--ink-2); }
.pause { position: absolute; inset: 0; border-radius: var(--r); background: rgba(24,25,28,.97); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; text-align: center; }
.pause[hidden] { display: none; }
.tagred { background: var(--go); transform: skewX(-12deg); border-radius: 4px; padding: 6px 26px; font-weight: 900; font-size: clamp(24px, 3vw, 40px); }
.tagred span { display: inline-block; transform: skewX(12deg); }
.pq { margin: 0; font-size: clamp(22px, 2.6vw, 36px); font-weight: 800; max-width: 26em; text-wrap: balance; }
.pause .btn { width: auto; min-width: 240px; padding: 0 34px; }
.ph { margin: 0; color: var(--ink-2); font-size: 16px; }
.vnote { margin: 14px 0 0; color: var(--ink-2); font-weight: 700; }
.after { margin-top: 22px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--panel); border-radius: var(--r); padding: 16px 22px; }
.after[hidden] { display: none; }
.after p { margin: 0; font-size: 22px; font-weight: 900; }
.after .btn { width: auto; padding: 0 30px; }

/* ---------- five questions ---------- */
.dots { list-style: none; display: flex; gap: 10px; margin: 22px 0 0; padding: 0; }
.dots li { width: 44px; height: 8px; border-radius: 99px; background: var(--lock); }
.dots li.done { background: var(--ok); }
.dots li.now { background: var(--ink); }
.quiz { margin-top: 26px; max-width: 900px; background: var(--panel); border-radius: var(--r); padding: clamp(20px, 3vw, 40px); }
.qn { margin: 0; color: var(--ink-2); font-weight: 700; }
.qq { margin: 10px 0 0; font-size: clamp(26px, 3vw, 42px); font-weight: 800; line-height: 1.3; text-wrap: balance; }
.qq .blank { color: var(--star); letter-spacing: .05em; }
.opts { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.opt { min-height: 76px; border: 2px solid #4a4c54; border-radius: 14px; background: var(--panel-2); color: var(--ink); font-size: clamp(20px, 2vw, 28px); font-weight: 800; cursor: pointer; padding: 10px 16px; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.opt:hover:not(:disabled) { border-color: var(--ink-2); transform: translateY(-2px); }
.opt.right { border-color: var(--ok); background: #1f3a29; }
.opt.wrong { border-color: var(--go); background: #3a1d22; opacity: .8; }
.opt:disabled { cursor: default; }
.why { margin: 20px 0 0; font-size: 20px; font-weight: 700; color: #ffd27a; }
.why[hidden] { display: none; }
@media (max-width: 820px) { .opts { grid-template-columns: 1fr; } .pause { gap: 10px; } .pause .btn { min-width: 0; } }
.vids .no { flex: none; white-space: nowrap; }
