/* Ilan: one design file. The look he approved on 22 Nov 2026 (round 3): off-white page with a faint navy and gold glow,
   navy glass hero with the tree, light frosted cards, navy rail, Fredoka for titles and numbers, Plus Jakarta Sans for the rest,
   gold only for XP, progress and the level badge. Tokens first, then shell, then pages. */

@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/font-fredoka-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(fonts/font-pjs-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(fonts/font-pjs-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(fonts/font-pjs-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* colour: navy, white, a little gold */
  --bg: #F3F5FB;
  --paper: rgba(255, 255, 255, .72);
  --paper-solid: #FFFFFF;
  --card: var(--paper);
  --ink: #0E1540;
  --slate: #5B6690;
  --slate2: #8A93B8;
  --line: rgba(14, 21, 64, .08);
  --line2: rgba(14, 21, 64, .16);
  --navy: #121A47;
  --navy2: #1B2560;
  --navy3: #27337A;
  --navy-deep: #0E1540;
  --on-navy: #C7CEEE;
  --glass-line: rgba(255, 255, 255, .14);
  --glass-fill: rgba(255, 255, 255, .07);
  /* the old names the games still use: they now mean the navy family */
  --blue: #141C44;
  --blue-h: #1B2560;
  --blue-d: #080C22;
  --blue-bright: #27337A;
  --blue-pale: rgba(20, 28, 68, .08);
  --green: #2E9C6E;
  --green-d: #23805A;
  --green-bg: rgba(46, 156, 110, .12);
  --red: #CF3F5A;
  --red-bg: rgba(207, 63, 90, .10);
  --amber: #8A6A1E;
  --amber-bg: rgba(230, 201, 138, .28);
  --amber-ink: #8A6A1E;
  --gold: #E6C98A;
  --gold-d: #C9A75E;
  --gold-2: #F4E3B6;
  --warm: rgba(230, 201, 138, .14);
  --warm2: rgba(230, 201, 138, .28);
  --purple: #27337A;
  --flame: #C9A75E;
  /* type */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: "Fredoka", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  /* shape */
  --r-card: 22px;
  --r-btn: 14px;
  --sh-card: 0 20px 40px -30px rgba(14, 21, 64, .35);
  --sh-navy: inset 0 1px 0 rgba(255, 255, 255, .14), 0 24px 50px -28px rgba(14, 21, 64, .7);
  /* layout */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --top: 72px;
  --rail: 104px;
  --tabbar: 88px;
  --side: 300px;
  --gap: 24px;
  --board: min(
    calc(100dvh - var(--top) - var(--sat) - var(--sab) - 2 * var(--gap)),
    calc(100vw - var(--side) - 3 * var(--gap) - var(--sal) - var(--sar))
  );
}
@media (orientation: portrait) {
  :root {
    --board: min(
      calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar)),
      calc(100dvh - var(--top) - var(--sat) - var(--sab) - 380px)
    );
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}
/* the page: off-white with a faint navy glow top left and a faint gold glow bottom right */
body {
  background:
    radial-gradient(1000px 640px at 12% -8%, rgba(39, 51, 122, .20), transparent 62%),
    radial-gradient(800px 560px at 104% 106%, rgba(230, 201, 138, .34), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#stage *, .scrim *, .toast, .xp-fly, #top *, #tabs *, .confetti { font-family: var(--font); }
:where(#stage) button { font-size: 15px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
img.ui { display: block; object-fit: contain; }

/* ---------- Top band: light frosted glass, one solid band, always fixed ---------- */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: calc(var(--top) + var(--sat));
  padding: var(--sat) calc(24px + var(--sar)) 0 calc(24px + var(--sal));
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(243, 245, 251, .82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-title {
  flex: 1;
  font: 400 30px/1.3 var(--title);
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 0;
}
#top .top-title.brand { font: 400 32px/1 var(--title); }
.top.is-game .top-title { text-align: center; font-size: 26px; }
.top-left, .top-right { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.top-right { justify-content: flex-end; }
.hud { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 10px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font: 600 15px/1 var(--font); color: var(--ink); }
.chip img { width: 26px; height: 26px; }
.chip i { font: 500 14px/1 var(--font); font-style: normal; color: var(--slate); margin-left: -2px; }
.top-xp { display: flex; align-items: center; gap: 10px; }
.top-xp:empty { display: none; }
.tx-lv { width: 42px; height: 42px; border-radius: 14px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font: 500 20px/1 var(--title); }
.tx-bar { width: 140px; height: 10px; border-radius: 99px; background: rgba(14, 21, 64, .10); overflow: hidden; }
.tx-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); box-shadow: 0 0 12px rgba(230, 201, 138, .6); transition: width .6s ease; }
.tx-n { font: 600 15px/1 var(--font); white-space: nowrap; color: var(--ink); }
.top-xp.bump .tx-lv, .top-xp.bump .tx-bar { animation: xpbump .45s ease; }
@keyframes xpbump { 40% { transform: scale(1.18); } }
.xp-fly { position: fixed; z-index: 80; pointer-events: none; font: 500 32px/1 var(--title); color: var(--gold-2); letter-spacing: 0; white-space: nowrap;
  -webkit-text-stroke: 1.2px #7A5A12; text-shadow: 0 4px 14px rgba(122, 90, 18, .45); transform: translate(-50%, -50%); }
.xp-fly.big { font-size: 64px; }
@media (max-width: 1100px) { .tx-bar { width: 90px; } }
@media (max-width: 760px) { .tx-bar, .tx-n { display: none; } }

/* ---------- Rail: navy on the left (landscape), bar at the bottom (portrait) ---------- */
.tabs { display: none; }
body.shell .tabs {
  display: flex;
  position: fixed;
  z-index: 30;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--rail) + var(--sal));
  padding: calc(var(--sat) + 16px) 10px calc(var(--sab) + 18px) calc(var(--sal) + 10px);
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: linear-gradient(180deg, #141C4E 0%, #0F1640 100%);
  border-right: 1px solid rgba(255, 255, 255, .08);
}
.tabs .brand { width: 58px; height: 58px; border-radius: 17px; margin: 0 auto 18px; display: block; box-shadow: 0 0 0 1px var(--glass-line), 0 10px 24px -12px rgba(0, 0, 0, .7); }
.tab {
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #AEB7E0;
  height: 86px;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font: 600 13px/1 var(--font);
  transition: background .15s, transform .08s;
}
.tab img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); transition: transform .18s cubic-bezier(.3, 1.5, .5, 1); }
.tab:active { transform: scale(.95); }
.tab.on { background: rgba(255, 255, 255, .12); border-color: var(--glass-line); color: #fff; }
.tab.on img { transform: scale(1.08) translateY(-1px); }

body.shell #stage { left: calc(var(--rail) + var(--sal)); }
body.shell .top { left: calc(var(--rail) + var(--sal)); padding-left: 30px; }
@media (orientation: portrait) {
  body.shell .tabs {
    top: auto; width: auto; right: 0; left: 0;
    height: calc(var(--tabbar) + var(--sab));
    padding: 8px calc(10px + var(--sar)) calc(var(--sab) + 8px) calc(10px + var(--sal));
    flex-direction: row;
    gap: 6px;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .tabs .brand { display: none; }
  .tab { flex: 1; height: auto; padding: 6px 0; gap: 4px; font-size: 12px; }
  .tab img { width: 40px; height: 40px; }
  body.shell #stage { left: var(--sal); bottom: calc(var(--tabbar) + var(--sab)); }
  body.shell .top { left: 0; padding-left: calc(22px + var(--sal)); }
}

#stage {
  position: fixed;
  top: calc(var(--top) + var(--sat));
  left: var(--sal); right: var(--sar); bottom: var(--sab);
}

/* ---------- Shared game layout ---------- */
.layout { display: flex; height: 100%; gap: var(--gap); padding: var(--gap); }
.board-area { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.side { width: var(--side); flex: none; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (orientation: portrait) {
  .layout { flex-direction: column; }
  .board-area { flex: none; }
  .side { width: 100%; flex: 1; min-height: 0; }
}

/* ---------- Buttons: navy primary, quiet secondary, press down on tap ---------- */
.btn {
  height: 46px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line2);
  background: var(--paper-solid);
  color: var(--ink);
  font: 600 15px/1 var(--font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(14, 21, 64, .06);
  transition: transform .06s ease, box-shadow .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 10px 20px -12px rgba(14, 21, 64, .6); }
.btn.primary:active { box-shadow: none; }
.btn.amber { background: var(--amber-bg); border-color: rgba(201, 167, 94, .5); color: var(--amber-ink); }
.btn.lg { height: 54px; padding: 0 26px; font-size: 17px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .btn-ico { width: 26px; height: 26px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; padding: 0 14px; }
/* buttons inside a navy card: white on navy */
.hero .btn, .shop-hero .btn, .pair-card .btn { background: #fff; border-color: #fff; color: var(--navy); box-shadow: 0 1px 0 rgba(14, 21, 64, .12); }
.hero .btn.primary, .shop-hero .btn.primary, .pair-card .btn.primary { background: #fff; color: var(--navy); }

.seg { display: flex; background: rgba(14, 21, 64, .05); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 40px; border: 0; background: none; border-radius: 10px; font: 600 15px/1 var(--font); color: var(--slate); padding: 0 8px; transition: background .15s, color .15s; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- Cards: light frosted glass, one thin even outline ---------- */
.card {
  background: var(--paper);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 22px;
  box-shadow: var(--sh-card);
}
.muted { color: var(--slate); }

/* ---------- Pages ---------- */
.page { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 26px 32px 56px; }
.page-in { max-width: 1140px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; animation: pagein .22s ease both; }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } }
.h1 { font: 400 40px/1.05 var(--title); letter-spacing: 0; }
.h2, .mp-head h2 { font: 500 24px/1.15 var(--title); letter-spacing: 0; color: var(--ink); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font: 500 21px/1.2 var(--title); letter-spacing: 0; }
.big-frac { font: 600 15px/1 var(--font); color: var(--slate); white-space: nowrap; }
.big-frac b { font: 500 26px/1 var(--title); color: var(--ink); margin-right: 3px; }
.offline { background: var(--amber-bg); color: var(--amber-ink); border-radius: 12px; padding: 12px 16px; font: 600 15px/1.2 var(--font); }
.mp-sec { display: flex; flex-direction: column; gap: 14px; }
.mp-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.wk-sec { margin-top: 10px; }
.wk-sec .mp-head { align-items: center; }
.wk-nav { display: flex; align-items: center; gap: 10px; }
.wk-arr { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--paper-solid); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.wk-arr:active { transform: translateY(1px); }
.wk-arr svg { width: 18px; height: 18px; }
.wk-arr[data-a="wknext"] svg { transform: rotate(180deg); }
.wk-range { font: 600 15px/1 var(--font); min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.wk-rule { margin: 4px 0 10px; }
.wk-date { display: block; margin-top: 5px; font: 500 18px/1 var(--title); color: var(--ink); font-variant-numeric: tabular-nums; }
.wk-h.today .wk-date { color: #fff; background: var(--navy); width: 30px; height: 30px; line-height: 30px; border-radius: 10px; margin: 5px auto 0; }
.mp-sub { font: 600 16px/1.2 var(--font); color: var(--slate); flex: 1; }
.week-total { margin-left: auto; font: 600 15px/1 var(--font); color: var(--slate); }
.week-total b { font: 500 24px/1 var(--title); color: var(--ink); margin-right: 4px; }
.done-note { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; font: 600 15px/1 var(--font); color: var(--green); }
.done-note svg { width: 20px; height: 20px; }

/* bars: gold is for progress only */
.xpbar { display: block; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); box-shadow: 0 0 14px rgba(230, 201, 138, .45); transition: width .7s cubic-bezier(.3, .7, .3, 1); min-width: 8px; }
.xp-bar { display: block; height: 12px; border-radius: 99px; background: rgba(14, 21, 64, .10); overflow: hidden; margin: 8px 0 18px; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); border-radius: 99px; transition: width .6s ease; }
.big-bar { display: block; height: 14px; border-radius: 99px; background: rgba(14, 21, 64, .10); overflow: hidden; }
.big-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); transition: width .7s cubic-bezier(.3, .7, .3, 1); }
.g-bar { display: block; height: 10px; border-radius: 99px; background: rgba(14, 21, 64, .10); overflow: hidden; margin-top: 8px; }
.g-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); transition: width .6s ease; }

/* level badge (small, in dialogs and lists) */
.lvl { flex: none; width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--navy); box-shadow: inset 0 0 0 1px var(--glass-line); }
.lvl b { font: 500 24px/1 var(--title); }
.lvl.xl { width: 84px; height: 84px; border-radius: 24px; }
.lvl.xl b { font-size: 40px; }

/* ---------- Hero (player card): navy glass with the tree ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1B2560 0%, #121A47 55%, #0E1540 100%);
  border: 0; color: #fff; padding: 26px 28px 24px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--sh-navy);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 260px at 85% 0%, rgba(230, 201, 138, .18), transparent 65%); pointer-events: none; }
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 360px; height: 360px; background: url(pictures/ui/logo-clear-512.png) center/contain no-repeat; opacity: .22; filter: saturate(.7); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; gap: 18px; }
.hero-txt { min-width: 0; }
.hi { font: 400 44px/1.02 var(--title); letter-spacing: 0; }
.hero-rank { font: 500 18px/1.3 var(--font); color: var(--on-navy); margin-top: 6px; white-space: nowrap; }
.hero-rank b { color: #fff; font-weight: 600; }
.hero-xp { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.hero-xpn { font: 500 15px/1.2 var(--font); color: var(--on-navy); }
.hero-xpn b { color: var(--gold); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { display: flex; align-items: center; gap: 12px; background: var(--glass-fill); border: 1px solid rgba(255, 255, 255, .10); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat img { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
.stat div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat b { font: 500 26px/1 var(--title); letter-spacing: 0; }
.stat span { font: 500 13px/1.2 var(--font); color: var(--on-navy); }

/* ---------- Home ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.home-mid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (orientation: portrait), (max-width: 980px) {
  .home-top, .home-mid { grid-template-columns: 1fr; }
  .page { padding: 22px 22px 40px; }
}
.cont { position: relative; border-radius: var(--r-card); overflow: hidden; min-height: 280px; display: flex; align-items: flex-end; cursor: pointer; box-shadow: var(--sh-navy); transition: transform .1s; }
.cont:active { transform: scale(.985); }
.cont img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cont-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 21, 64, 0) 28%, rgba(14, 21, 64, .88) 100%); }
.cont-body { position: relative; padding: 24px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: #fff; }
.cont-name { font: 400 34px/1.05 var(--title); text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }
.cont-skill { font: 500 16px/1.3 var(--font); opacity: .95; margin-bottom: 8px; }
.cont .btn.primary { pointer-events: none; }

.todaycard { cursor: pointer; padding: 22px; }
.trows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tr { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font: 600 16px/1.2 var(--font); }
.tr:first-child { border-top: 0; }
.tr-i { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; }
.tr-i img { width: 32px; height: 32px; }
.tr-ring { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--line2); }
.tr-no { width: 26px; height: 26px; color: var(--red); display: flex; }
.tr-no svg { width: 100%; height: 100%; }
.tr-n { flex: 1; min-width: 0; }
.tr-tag { font: 600 13px/1 var(--font); color: var(--amber-ink); background: var(--amber-bg); padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.tr.rejected .tr-tag { color: var(--red); background: var(--red-bg); }
.tr-p { font: 600 15px/1 var(--font); color: var(--gold-d); min-width: 34px; text-align: right; }
.tr.approved .tr-n { color: var(--green-d); }
.tr-foot { margin-top: 10px; font-weight: 600; }
.todaycard.connect { display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: default; padding: 18px 22px; flex-wrap: wrap; }
.connect-row { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.connect-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.connect-ico img { width: 38px; height: 38px; }
.connect-txt h3 { font: 500 21px/1.2 var(--title); }
.connect-txt .muted { font: 500 14px/1.3 var(--font); margin-top: 3px; }
.todaycard.connect .btn { flex: none; }
.big-ico { width: 72px; height: 72px; }

.verse { display: flex; flex-direction: column; gap: 10px; padding: 24px 26px; }
.verse .v-title { font: 500 21px/1.2 var(--title); letter-spacing: 0; color: var(--ink); }
.v-text { font: 400 26px/1.32 var(--title); color: var(--ink); letter-spacing: 0; max-width: 24ch; }
.v-text::before { content: "\201C"; color: var(--gold-d); font-size: 40px; line-height: 0; vertical-align: -14px; margin-right: 4px; }
.verse.week .v-text { font-size: 22px; }
.v-ref { font: 600 15px/1 var(--font); color: var(--slate); }
.v-act { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.v-pts { font: 600 15px/1 var(--font); color: var(--gold-d); }
.verses { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (orientation: portrait), (max-width: 980px) { .verses { grid-template-columns: 1fr; } }

/* goals */
.goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.goal { background: var(--paper); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--sh-card); }
.goal .g-ico { width: 52px; height: 52px; flex: none; padding: 6px; border-radius: 14px; background: var(--navy); object-fit: contain; }
.g-txt { min-width: 0; flex: 1; }
.g-name { font: 500 19px/1.05 var(--title); letter-spacing: 0; }
.g-line { font: 500 13px/1.3 var(--font); color: var(--slate); margin-top: 4px; }
.g-sign { font: 600 13px/1.25 var(--font); color: var(--ink); margin-top: 6px; }
.goals.full { grid-template-columns: 1fr; gap: 10px; }
.goals.full .goal { box-shadow: none; background: rgba(14, 21, 64, .04); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.goals-card { display: flex; flex-direction: column; }
@media (max-width: 980px) and (orientation: landscape) { .goals { grid-template-columns: 1fr; } }
@media (orientation: portrait) { .goals { grid-template-columns: 1fr; } }

/* ---------- Games tab ---------- */
.gsec { display: flex; flex-direction: column; gap: 12px; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
.gcard { padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); text-align: left; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-card); transition: transform .12s ease, box-shadow .12s ease; }
.gcard:active { transform: scale(.975); }
.gc-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.gc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(180deg, transparent, rgba(14, 21, 64, .55)); pointer-events: none; }
.gc-play { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); }
.gc-play svg { width: 18px; height: 18px; margin-left: 2px; }
.gc-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.gc-name { font: 500 20px/1.1 var(--title); letter-spacing: 0; }
.gc-skill { font: 500 13px/1.2 var(--font); color: var(--slate); }
.gc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.gs { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 9px; background: rgba(14, 21, 64, .06); font: 600 12px/1 var(--font); color: var(--ink); }
.gs b { font-weight: 600; color: var(--ink); }
.gs img { width: 18px; height: 18px; }
.gs-best { background: rgba(230, 201, 138, .28); }

/* ---------- My page ---------- */
.mine-top { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.mine-mid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
@media (orientation: portrait), (max-width: 980px) { .mine-top, .mine-mid { grid-template-columns: 1fr; } }
.stats.four { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.profile .hi { font-size: 42px; }
.pts-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 24px 26px; }
.pts-main { display: flex; align-items: center; gap: 16px; }
.pts-ico { width: 64px; height: 64px; }
.pts-n { font: 400 56px/1 var(--title); letter-spacing: 0; color: var(--ink); }
.pts-l { font: 500 15px/1.1 var(--font); color: var(--slate); }
.pts-hold { font: 600 14px/1.2 var(--font); color: var(--amber-ink); background: var(--amber-bg); border-radius: 10px; padding: 8px 10px; align-self: flex-start; }
.pair-card { background: linear-gradient(160deg, #1B2560 0%, #121A47 55%, #0E1540 100%); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; box-shadow: var(--sh-navy); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pair-card .muted { color: var(--on-navy); }

.chart-card { display: flex; flex-direction: column; }
.chart { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: stretch; min-height: 200px; }
.bcol { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.bv { font: 500 18px/1 var(--title); height: 22px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.bstar { width: 20px; height: 20px; }
.btrack { flex: 1; width: 100%; max-width: 64px; align-self: center; min-height: 140px; border-radius: 14px; background: rgba(14, 21, 64, .06); display: flex; align-items: flex-end; overflow: hidden; }
.btrack i { display: block; width: 100%; border-radius: 12px; background: linear-gradient(180deg, var(--navy3), var(--navy)); transition: height .7s cubic-bezier(.3, .7, .3, 1); }
.bcol.today .btrack i { background: linear-gradient(180deg, var(--gold-2), var(--gold-d)); }
.bd { font: 600 14px/1 var(--font); color: var(--slate); align-self: center; text-align: center; }
.bcol.today .bd { background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 9px; }

/* week table (header row sticks to the top of the page area) */
.wk-card { padding: 0; overflow: hidden; }
.wk { display: grid; align-items: stretch; }
.wk > div { border-bottom: 1px solid var(--line); }
.wk-h { position: sticky; top: 0; z-index: 3; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-align: center; padding: 14px 4px 10px; font: 600 13px/1 var(--font); color: var(--slate); border-bottom: 1px solid var(--line) !important; }
.wk-h.today { color: var(--ink); }
.wk-h.wk-first { border-top-left-radius: var(--r-card); }
.wk-h:nth-child(8) { border-top-right-radius: var(--r-card); }
.wk-first { text-align: left; padding-left: 22px; }
.wk-task { padding: 12px 12px 12px 22px; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.wk-name { font: 600 15px/1.2 var(--font); letter-spacing: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wk-pts { font: 500 13px/1 var(--font); color: var(--slate); }
.wk-note { font: 500 13px/1.3 var(--font); color: var(--slate); }
.wk-c { display: flex; align-items: center; justify-content: center; padding: 8px 5px; min-height: 64px; }
.wk-c.today { background: rgba(14, 21, 64, .03); }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; font: 600 12px/1.15 var(--font); text-align: center; }
.cell svg { width: 100%; max-width: 86px; height: 40px; padding: 10px; border-radius: 12px; }
.cell.ok svg { background: var(--navy); color: #fff; }
.cell.ok { color: var(--ink); }
.cell.ok b { font-size: 15px; }
.cell.ask svg { background: rgba(230, 201, 138, .32); color: var(--amber-ink); }
.cell.ask { color: var(--amber-ink); }
.cell.no svg { background: var(--red-bg); color: var(--red); }
.cell.no { color: var(--red); }
.cell.empty { width: 100%; max-width: 86px; height: 40px; border-radius: 12px; background: rgba(14, 21, 64, .05); border: 0; }
.wk-c.today .cell svg { height: 44px; padding: 11px; }
.cell.todo { height: 44px; max-width: 86px; width: 100%; border-radius: 12px; border: 2px solid var(--navy); color: var(--navy); background: #fff; font-size: 12px; }
.cellbtn { width: 100%; min-height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.cellbtn:active { transform: scale(.95); }
.cellbtn.pop { animation: popcell .4s ease; }
@keyframes popcell { 40% { transform: scale(1.12); } }
.wk-sum { padding: 12px 4px; flex-direction: column; gap: 4px; min-height: 0; border-bottom: 0 !important; }
.wk-sum.wk-first { display: flex; padding-left: 22px; align-items: flex-start; justify-content: center; }
.wk-sum.wk-first span { font: 500 12px/1.2 var(--font); color: var(--slate); }
.wk-sum.wk-first b { font: 600 14px/1.2 var(--font); }
.wk-sum b { font: 500 22px/1 var(--title); }
.bonus { display: inline-flex; align-items: center; gap: 3px; font: 600 12px/1 var(--font); color: var(--amber-ink); background: var(--amber-bg); padding: 4px 8px; border-radius: 99px; }
.bonus svg { width: 12px; height: 12px; }
@media (max-width: 900px) { .wk-note { display: none; } .wk-task { padding-left: 14px; } .wk-first { padding-left: 14px; } .wk-name { font-size: 14px; } }

/* extra points */
.extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.extra { display: flex; flex-direction: column; gap: 10px; position: relative; padding: 20px; }
.ex-pic { height: 72px; display: flex; align-items: center; }
.ex-img { height: 72px; width: 72px; object-fit: contain; }
.gold-ico { display: inline-flex; align-items: center; justify-content: center; color: #E6C98A; filter: drop-shadow(0 0 6px rgba(230, 201, 138, .75)) drop-shadow(0 0 14px rgba(230, 201, 138, .35)); }
.gold-ico svg { width: 100%; height: 100%; }
.gold-ico.ex-img { width: 64px; height: 64px; }
.ex-svg { width: 64px; height: 64px; border-radius: 18px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; }
.ex-svg svg { width: 32px; height: 32px; }
.ex-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ex-name { font: 500 19px/1.2 var(--title); letter-spacing: 0; }
.ex-pts { position: absolute; top: 18px; right: 18px; font: 500 22px/1 var(--title); color: var(--gold-d); }

/* highscores */
.hs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hs { display: flex; gap: 14px; text-align: left; padding: 14px; align-items: flex-start; }
.hs:active { transform: scale(.98); }
.hs-img { width: 84px; height: 84px; flex: none; border-radius: 16px; overflow: hidden; }
.hs-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hs-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hs-name { font: 500 19px/1.1 var(--title); letter-spacing: 0; }
.hs-xp { display: flex; align-items: center; gap: 6px; font: 600 14px/1 var(--font); color: var(--ink); }
.hs-xp img { width: 20px; height: 20px; }
.hs-row { display: flex; justify-content: space-between; gap: 8px; font: 500 13px/1.25 var(--font); color: var(--slate); }
.hs-row b { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* badges: picture in a navy square, won ones bright, the rest quiet */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: 16px; border: 1px solid transparent; background: rgba(14, 21, 64, .04); text-align: center; font: 600 12px/1.2 var(--font); color: var(--ink); }
.badge .b-pic { position: relative; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--navy); display: inline-flex; align-items: center; justify-content: center; }
.badge .b-pic img.b-ico { width: 34px; height: 34px; object-fit: contain; }
.badge:not(.got) { opacity: .42; }
.badge:not(.got) .b-pic { background: rgba(14, 21, 64, .14); }
.badge:not(.got) .b-pic img.b-ico { filter: grayscale(1); }
.b-lock { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; }
.b-lock .ui { width: 100%; height: 100%; }

/* ranks */
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.rank { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; background: rgba(14, 21, 64, .04); border: 1px solid transparent; border-radius: 16px; text-align: center; }
.rank .rk-pic { position: relative; flex: none; width: 68px; height: 68px; display: inline-flex; align-items: center; justify-content: center; }
.rank .rk-pic > img { width: 100%; height: 100%; object-fit: contain; }
.rank .rk-name { font: 500 14px/1.1 var(--title); color: var(--ink); }
.rank .rk-lv { font: 500 12px/1.2 var(--font); color: var(--slate); }
.rank:not(.got) { opacity: .45; }
.rank:not(.got) .rk-pic > img { filter: grayscale(1); }
.rank.now { opacity: 1; background: var(--navy); color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.rank.now .rk-name { color: #fff; }
.rank.now .rk-lv { color: var(--on-navy); }

/* ---------- Shop ---------- */
.shop-hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #1B2560 0%, #121A47 55%, #0E1540 100%); border: 0; color: #fff; padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: center; box-shadow: var(--sh-navy); -webkit-backdrop-filter: none; backdrop-filter: none; }
.shop-hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 320px; height: 320px; background: url(pictures/ui/logo-clear-512.png) center/contain no-repeat; opacity: .16; pointer-events: none; }
.shop-hero > * { position: relative; z-index: 1; }
@media (orientation: portrait), (max-width: 980px) { .shop-hero { grid-template-columns: 1fr; } }
.sh-pts { display: flex; align-items: center; gap: 18px; }
.sh-ico { width: 84px; height: 84px; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .4)); }
.sh-n { font: 400 72px/.95 var(--title); letter-spacing: 0; }
.sh-l { font: 500 20px/1.15 var(--font); color: var(--on-navy); margin-top: 4px; }
.sh-hold { font: 600 15px/1.2 var(--font); color: var(--gold); margin-top: 8px; }
.saving { display: flex; align-items: center; gap: 18px; background: var(--glass-fill); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 14px 18px; min-width: 0; }
.saving.empty { justify-content: center; min-height: 100px; text-align: center; }
.sv-img { width: 84px; height: 84px; object-fit: contain; flex: none; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); }
.sv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-t { font: 500 22px/1.15 var(--title); letter-spacing: 0; }
.sv-s { font: 600 16px/1.1 var(--font); color: var(--gold); }
.saving .big-bar { background: rgba(255, 255, 255, .16); height: 14px; }

.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; }
.reward { display: flex; flex-direction: column; gap: 6px; padding: 22px; text-align: center; align-items: stretch; }
.reward.big { background: linear-gradient(180deg, rgba(230, 201, 138, .18) 0%, var(--paper) 60%); }
.reward.is-goal { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(230, 201, 138, .25), var(--sh-card); }
.rw-pic { height: 160px; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 2px; }
.rw-pic::before { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 201, 138, .45) 0%, rgba(230, 201, 138, .15) 60%, rgba(230, 201, 138, 0) 100%); }
.reward.big .rw-pic { height: 190px; }
.reward.big .rw-pic::before { width: 180px; height: 180px; }
.rw-img { position: relative; width: 130px; height: 130px; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(14, 21, 64, .25)); animation: floaty 4.5s ease-in-out infinite; }
.reward.big .rw-img { width: 156px; height: 156px; }
.gold-ico.rw-img, .gold-ico.sent-img, .gold-ico.sv-img { filter: drop-shadow(0 0 6px rgba(230, 201, 138, .75)) drop-shadow(0 0 16px rgba(230, 201, 138, .35)); }
.gold-ico.rw-img { width: 112px; height: 112px; }
.reward.big .gold-ico.rw-img { width: 132px; height: 132px; }
.reward:nth-child(2n) .rw-img { animation-delay: -1.3s; }
.reward:nth-child(3n) .rw-img { animation-delay: -2.4s; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(2deg); } }
.rw-name { font: 500 23px/1.12 var(--title); letter-spacing: 0; }
.rw-cost { display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 16px/1 var(--font); color: var(--slate); margin-top: 2px; }
.rw-cost b { font: 500 30px/1 var(--title); color: var(--ink); letter-spacing: 0; }
.rw-coin { width: 28px; height: 28px; }
.rw-note { font: 500 14px/1.3 var(--font); color: var(--slate); min-height: 20px; }
.reward .big-bar { margin-top: 8px; height: 14px; }
.reward.big .big-bar { height: 16px; }
.rw-prog { display: flex; justify-content: space-between; gap: 8px; font: 600 14px/1.1 var(--font); color: var(--slate); margin-top: 2px; }
.rw-left { color: var(--ink); font-weight: 600; }
.rw-left.enough { color: var(--green); }
.rw-why { font: 600 13px/1.2 var(--font); color: var(--amber-ink); }
.reward .ask { margin-top: 10px; height: 54px; font-size: 17px; }
.goalbtn { margin-top: 6px; height: 44px; border-radius: var(--r-btn); border: 1px solid var(--line2); background: var(--paper-solid); font: 600 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--slate); transition: transform .06s, background .15s; }
.goalbtn:active { transform: translateY(1px); }
.goalbtn svg { width: 18px; height: 18px; }
.goalbtn.on { background: rgba(230, 201, 138, .25); border-color: var(--gold-d); color: var(--ink); }

/* ---------- Player bits used in dialogs ---------- */
.pl-lv { width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font: 500 22px/1 var(--title); }
.res-points { font: 400 40px/1.1 var(--title); letter-spacing: 0; color: var(--ink); margin: 4px 0 10px; }
.res-best { font: 600 17px/1.2 var(--font); color: var(--amber-ink); margin-bottom: 10px; }
.res-badge { display: flex; align-items: center; gap: 8px; font: 600 16px/1.2 var(--font); color: var(--ink); margin-bottom: 8px; }
.res-badge svg { width: 24px; height: 24px; }
.res-badge .rb-img { width: 40px; height: 40px; object-fit: contain; padding: 6px; border-radius: 12px; background: var(--navy); }
.res-level { display: flex; justify-content: space-between; font: 600 15px/1.2 var(--font); margin-top: 8px; }
.dialog .xp-bar { margin-bottom: 22px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }
.small { font-size: 13px; margin-top: 6px; }

/* ---------- Sign in ---------- */
.signin { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.signin-card { width: min(440px, 100%); padding: 34px; display: flex; flex-direction: column; gap: 16px; }
.signin-card h2 { margin: 0 0 4px; font: 400 34px/1.1 var(--title); letter-spacing: 0; }
.signin-card label { display: flex; flex-direction: column; gap: 8px; font: 600 14px/1 var(--font); color: var(--slate); }
.signin-card input { height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font: 600 18px/1 var(--font); -webkit-user-select: text; user-select: text; }
.signin-card input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 28, 68, .10); }
.signin-card .btn { height: 54px; margin-top: 4px; font-size: 17px; }
.signin-err { color: var(--red); font: 600 15px/1.3 var(--font); }

/* ---------- Pairing ---------- */
.pair { display: flex; flex-direction: column; gap: 16px; align-items: center; width: 100%; color: #fff; }
.pair-t { font: 400 28px/1.1 var(--title); letter-spacing: 0; text-align: center; }
.pair-dots { display: flex; gap: 8px; }
.pd { width: 46px; height: 58px; border-radius: 14px; background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .30); display: flex; align-items: center; justify-content: center; font: 500 28px/1 var(--title); color: #fff; }
.pd.on { background: #fff; color: var(--navy); }
.pair-card .signin-err { color: var(--gold); }
.keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.key { height: 60px; border-radius: 16px; border: 0; background: #fff; color: var(--ink); font: 500 26px/1 var(--title); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); transition: transform .06s, box-shadow .06s; }
.key:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, .35); }
.key[data-k="del"] { font-size: 15px; font-family: var(--font); font-weight: 600; background: #D9DEF0; }

/* ---------- Dialogs and toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(14, 21, 64, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease; }
.dialog { width: min(480px, 100%); max-height: 100%; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 30px; box-shadow: 0 30px 60px -20px rgba(14, 21, 64, .6); animation: pop .22s cubic-bezier(.3, 1.3, .5, 1); }
.dialog h2 { margin: 0 0 12px; font: 400 32px/1.1 var(--title); letter-spacing: 0; }
.dialog p { margin: 0 0 20px; font: 500 17px/1.45 var(--font); color: var(--slate); }
.dialog ol { margin: 0 0 24px; padding-left: 24px; font: 500 17px/1.5 var(--font); color: var(--ink); }
.dialog ol li { margin-bottom: 8px; }
.dialog .btn-row .btn { flex: 1; height: 54px; font-size: 17px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(28px + var(--sab)); transform: translateX(-50%); background: var(--navy); color: #fff; font: 600 15px/1.2 var(--font); padding: 15px 22px; border-radius: 16px; box-shadow: 0 12px 28px -12px rgba(14, 21, 64, .7); animation: toastin .2s ease; pointer-events: none; max-width: 90vw; text-align: center; }
body.shell .toast { bottom: calc(28px + var(--sab)); }
@media (orientation: portrait) { body.shell .toast { bottom: calc(var(--tabbar) + 20px + var(--sab)); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

.sent { text-align: center; }
.sent-pic { position: relative; display: flex; justify-content: center; align-items: center; height: 190px; margin-bottom: 8px; }
.sent .rings { position: absolute; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 201, 138, .5) 0%, rgba(230, 201, 138, .18) 60%, rgba(230, 201, 138, 0) 100%); animation: glow 1.6s ease-in-out infinite alternate; }
@keyframes glow { to { transform: scale(1.12); } }
.sent-img { position: relative; width: 150px; height: 150px; object-fit: contain; animation: bounce .7s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 14px 14px rgba(14, 21, 64, .25)); }
@keyframes bounce { from { transform: scale(.3) translateY(30px); opacity: 0; } }
.sent h2 { margin-bottom: 6px; }
.cost-line { display: flex; align-items: center; justify-content: center; gap: 6px; }
.cost-line b { font: 500 30px/1 var(--title); color: var(--ink); }
.cel-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font: 600 17px/1.2 var(--font); }
.cel-row span { color: var(--green); font-weight: 600; }
.dialog .cel-row:last-of-type { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  .rw-img, .sent .rings, .page-in { animation: none; }
  .tab img, .gcard, .btn { transition: none; }
  .wr-host *, .wr-host *::before, .wr-host *::after, .wr-spark { animation: none !important; transition: none !important; }
}

/* Home verse: centred in its card */
.home-mid .verse { justify-content: center; }
.home-mid .verse .v-text { font-size: 30px; line-height: 1.3; }

.side .btn { height: 46px; }
.side { gap: 10px; }
.side .card { padding: 14px 16px; }

/* Rank emblem in the hero: left of the name, gold level badge on its corner */
.lvl.xl.rk { background: var(--glass-fill); box-shadow: inset 0 0 0 1px var(--glass-line); position: relative; overflow: visible; }
.lvl.xl.rk .rank-img { width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.lvl.xl.rk b { position: absolute; right: -8px; bottom: -8px; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 12px; background: var(--gold); color: #2A2000; font: 500 19px/34px var(--title); text-align: center; }
.stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat > div { min-width: 0; }
.stat b { white-space: nowrap; }
.stats.four .stat b { font-size: 24px; }

/* ---------- Writing tab (22 Nov 2026): read, then play ---------- */
.wr-intro { display: flex; align-items: center; gap: 18px; padding: 18px 22px; }
.wr-intro-txt { flex: 1; min-width: 0; }
.wr-view { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(14, 21, 64, .06); flex: none; align-self: flex-start; }
.wr-vbtn { width: 40px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--slate); background: transparent; border: 0; cursor: pointer; }
.wr-vbtn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(14, 21, 64, .12); }
.wr-num { position: absolute; left: 12px; top: 12px; z-index: 1; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; background: #fff; color: var(--ink); font: 700 16px/34px var(--title); text-align: center; box-shadow: 0 1px 3px rgba(14, 21, 64, .18); }
.wr-card.fin .wr-pic img { filter: saturate(.55); opacity: .75; }
.wr-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, .35); z-index: 1; }
.wr-bar i { display: block; height: 100%; background: #E6C98A; }
.wr-grid.list { grid-template-columns: 1fr; gap: 10px; }
.wr-grid.list .wr-card { flex-direction: row; align-items: center; }
.wr-grid.list .wr-pic { flex: none; width: 168px; aspect-ratio: 16 / 9; }
.wr-grid.list .wr-pic::after { display: none; }
.wr-grid.list .wr-num { left: 8px; top: 8px; min-width: 28px; height: 28px; font-size: 14px; line-height: 28px; border-radius: 8px; }
.wr-grid.list .wr-body { flex: 1; min-width: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "title subjects"; align-items: center; column-gap: 16px; row-gap: 6px; padding: 10px 16px; }
.wr-grid.list .wr-title { grid-area: title; font-size: 18px; padding-right: 12px; }
.wr-grid.list .wr-meta { flex-direction: column; gap: 2px; }
.wr-grid.list .wr-meta span { height: auto; padding: 0; background: none; font: 500 13px/1.4 var(--font); color: var(--slate); white-space: nowrap; }
.wr-grid.list .wr-tag { justify-self: start; }
.wr-grid.list .wr-sub { display: none; }
.wr-grid.list .wr-subjects { grid-area: subjects; margin: 0; }
.wr-grid.list .wr-subjects span { height: auto; min-height: 26px; line-height: 1.3; padding: 5px 10px; white-space: normal; }
.wr-grid.list .wr-meta { grid-area: meta; margin: 0; }
.wr-grid.list .wr-tag { grid-area: tag; margin: 0; white-space: nowrap; }
@media (max-width: 1100px) { .wr-grid.list .wr-body { grid-template-columns: 1fr; grid-template-areas: "title" "subjects"; } }
@media (max-width: 640px) { .wr-intro { flex-wrap: wrap; } .wr-grid.list .wr-pic { width: 112px; } .wr-grid.list .wr-subjects { display: none; } .wr-grid.list .wr-title { font-size: 17px; } .wr-grid.list .wr-body { padding: 8px 12px; } }
.wr-intro p { margin-top: 4px; font-size: 15px; }
.wr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.wr-card { padding: 0; overflow: hidden; text-align: left; display: flex; flex-direction: column; cursor: pointer; transition: transform .12s ease; }
.wr-card:active { transform: scale(.985); }
.wr-pic { display: block; aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.wr-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wr-pic::after { content: ""; position: absolute; inset: auto 0 0 0; height: 50%; background: linear-gradient(180deg, transparent, rgba(14, 21, 64, .5)); }
.wr-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.wr-title { font: 500 24px/1.1 var(--title); color: var(--ink); }
.wr-sub { font: 500 14px/1.35 var(--font); color: var(--slate); }
.wr-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wr-meta span { height: 26px; padding: 0 10px; border-radius: 9px; background: rgba(14, 21, 64, .06); font: 600 12px/26px var(--font); color: var(--ink); }
.wr-tag { align-self: flex-start; margin-top: 4px; font: 600 13px/1 var(--font); color: var(--ink); background: rgba(230, 201, 138, .3); padding: 7px 10px; border-radius: 9px; }
.wr-tag.got { background: var(--navy); color: #fff; }
.wr-shell { display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 0 auto; width: 100%; }
.wr-progress { display: flex; align-items: center; gap: 14px; padding: 2px 0 4px; flex-wrap: wrap; }
@media (max-width: 760px) { .wr-progress .wr-steps { flex: 1 1 100%; margin: 0; } }
.wr-dots, .wr-steps { height: 40px; padding: 0 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.wr-back { height: 40px; padding: 0 14px 0 10px; gap: 4px; }
.wr-back svg { width: 18px; height: 18px; }
.wr-dots, .wr-steps { flex: 0 1 auto; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wr-dot { width: 12px; height: 12px; border-radius: 50%; border: 0; background: rgba(14, 21, 64, .14); padding: 0; }
.wr-dot.done { background: var(--navy); }
.wr-dot.half { background: linear-gradient(90deg, var(--navy) 50%, rgba(14, 21, 64, .14) 50%); }
.wr-dot.on { background: var(--gold-d); box-shadow: 0 0 0 4px rgba(230, 201, 138, .3); }
.wr-dot.play { width: 14px; height: 14px; border-radius: 4px; }
.wr-step { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(14, 21, 64, .07); font: 500 15px/1 var(--title); color: var(--slate); }
.wr-step.done { background: var(--navy); color: #fff; }
.wr-step.on { background: var(--gold); color: #2A2000; }
.wr-count { font: 600 14px/1 var(--font); color: var(--slate); white-space: nowrap; }
.wr-read { padding: 28px 34px 30px; font-size: 19px; line-height: 1.55; }
.wr-read p { margin: 0 0 14px; max-width: 70ch; }
.wr-read p:last-of-type { margin-bottom: 0; }
.wr-h { font: 400 32px/1.1 var(--title); margin: 0 0 16px; }
.wr-word { background: rgba(14, 21, 64, .04); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 16px 0 20px; max-width: 70ch; }
.wr-word-w { font: 500 18px/1.2 var(--title); }
.wr-word-w::before { content: "Words to keep: "; color: var(--gold-d); }
.wr-word-d { font-size: 16px; margin-top: 4px; }
.wr-word-e { font-size: 15px; color: var(--slate); margin-top: 4px; }
.wr-keep { background: linear-gradient(160deg, #1B2560, #121A47); color: #fff; border-radius: 16px; padding: 16px 20px; margin: 20px 0; max-width: 70ch; font-size: 17px; }
.wr-keep b { color: var(--gold); font-weight: 600; }
.wr-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 22px; font-size: 15px; }
.wr-table > div { background: rgba(14, 21, 64, .04); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.wr-table b { display: block; font: 500 19px/1.2 var(--title); margin-bottom: 4px; }
.wr-fig { margin: 0 0 22px; }
.wr-fig img { width: 100%; border-radius: 18px; display: block; box-shadow: 0 24px 50px -28px rgba(14, 21, 64, .6); }
.wr-fig figcaption { font-size: 14px; color: var(--slate); margin-top: 8px; }
.wr-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.wr-play { padding: 24px 28px 22px; }
.wr-play-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.wr-play-head .wr-h { margin: 0; font-size: 28px; }
.wr-xp { font: 600 14px/1 var(--font); color: var(--gold-d); white-space: nowrap; }
.wr-q-n { font-size: 14px; margin-bottom: 6px; }
.wr-q { font: 500 23px/1.3 var(--title); margin-bottom: 16px; max-width: 60ch; }
.wr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wr-opts.two { max-width: 420px; }
.wr-opt { min-height: 58px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--paper-solid); font: 600 17px/1.25 var(--font); color: var(--ink); text-align: left; transition: transform .06s, background .15s; }
.wr-opt:active { transform: scale(.985); }
.wr-opt.sel { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.wr-opt.right { background: var(--navy); border-color: var(--navy); color: #fff; }
.wr-opt.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.wr-opt[disabled] { opacity: .9; }
.wr-match { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px 18px; }
.wr-col { display: flex; flex-direction: column; gap: 8px; }
.wr-chip { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--paper-solid); font: 600 16px/1.25 var(--font); color: var(--ink); text-align: left; transition: background .15s, transform .06s; }
.wr-chip:active { transform: scale(.98); }
.wr-chip.sel { background: var(--navy); border-color: var(--navy); color: #fff; }
.wr-chip.done { background: rgba(14, 21, 64, .06); border-color: transparent; color: var(--slate); }
.wr-chip.wrong { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.wr-pool, .wr-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wr-order { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: o; }
.wr-order li { counter-increment: o; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 8px 14px; border-radius: 12px; background: var(--navy); color: #fff; font: 600 16px/1.25 var(--font); }
.wr-order li::before { content: counter(o) "."; font: 500 17px/1 var(--title); color: var(--gold); min-width: 22px; }
.wr-order li span { flex: 1; }
.wr-order li.empty { background: rgba(14, 21, 64, .05); color: var(--slate); border: 1px dashed var(--line2); }
.wr-order li.empty::before { content: none; }
.wr-x { width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 6px; }
.wr-x svg { width: 100%; height: 100%; }
.wr-buckets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wr-bucket { min-height: 120px; padding: 12px; border-radius: 16px; border: 1px solid var(--line2); background: rgba(14, 21, 64, .03); text-align: left; display: flex; flex-direction: column; gap: 6px; align-items: stretch; font: 500 14px/1.3 var(--font); color: var(--ink); }
.wr-bucket b { font: 500 18px/1.2 var(--title); margin-bottom: 4px; }
.wr-bucket.open { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(20, 28, 68, .15); }
.wr-bitem { background: var(--navy); color: #fff; border-radius: 9px; padding: 7px 9px; }
.wr-bitem.wrong { background: var(--red); }
.wr-gaptext { font-size: 20px; line-height: 2; max-width: 70ch; }
.wr-gap { display: inline-block; min-width: 110px; height: 40px; padding: 0 12px; margin: 0 2px; border-radius: 10px; border: 2px dashed var(--line2); background: #fff; font: 600 17px/36px var(--font); color: var(--ink); vertical-align: middle; }
.wr-gap.sel { border-color: var(--navy); border-style: solid; }
.wr-gap.filled { border-style: solid; border-color: var(--navy); background: var(--navy); color: #fff; }
.wr-gap.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.wr-label { display: block; margin-top: 16px; font: 600 15px/1.3 var(--font); color: var(--slate); }
.wr-text { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font: 500 17px/1.5 var(--font); -webkit-user-select: text; user-select: text; resize: vertical; }
.wr-text:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 28, 68, .10); }
.wr-fb { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--red-bg); color: var(--red); font: 600 16px/1.35 var(--font); }
.wr-fb.ok { background: rgba(230, 201, 138, .28); color: var(--ink); }
.wr-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.wr-actions .btn.wait { opacity: .9; }
.wr-tries { font-size: 14px; }
.wr-result .hi { font-size: 40px; }
.wr-res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 18px; }
.wr-res-grid .stat b { font-size: 22px; }
@media (orientation: portrait), (max-width: 980px) {
  .wr-read { padding: 22px 20px 24px; font-size: 18px; }
  .wr-opts, .wr-match, .wr-table, .wr-buckets, .wr-res-grid { grid-template-columns: 1fr; }
  .wr-play { padding: 20px 18px; }
}
/* Writing player: story on the left, mission on the right (his rule 22 Nov) */
.wr-shell.wide { max-width: 1120px; }
.wr-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wr-story { padding: 0; max-height: calc(100dvh - var(--top) - var(--sat) - 120px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wr-story-in { padding: 20px 24px 24px; font-size: 16px; line-height: 1.55; }
.wr-story-in p { margin: 0 0 10px; }
.wr-story-h { font: 500 19px/1.2 var(--title); margin: 14px 0 8px; color: var(--ink); position: sticky; top: 0; background: rgba(255, 255, 255, .92); padding: 6px 0; }
.wr-story-h:first-child { margin-top: 0; }
.wr-story .wr-word { margin: 10px 0 14px; padding: 10px 14px; }
.wr-story .wr-word-w { font-size: 16px; }
.wr-story .wr-word-d, .wr-story .wr-word-e { font-size: 14px; }
.wr-split .wr-play { position: sticky; top: 0; }
.wr-split .wr-opts { grid-template-columns: 1fr; }
.wr-split .wr-match { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.wr-split .wr-buckets { grid-template-columns: 1fr; }
.wr-split .wr-bucket { min-height: 64px; }
.wr-order li.miss { background: var(--red); }
@media (orientation: portrait), (max-width: 980px) {
  .wr-split { grid-template-columns: 1fr; }
  .wr-split .wr-play { position: static; order: -1; }
  .wr-story { max-height: 60dvh; }
}

.wr-subjects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.wr-subjects span { height: 26px; padding: 0 10px; border-radius: 9px; background: var(--navy); color: #fff; font: 600 12px/26px var(--font); }
.wr-subjects.top { margin: 0 0 10px; }
.wr-focus { font-size: 15px; color: var(--slate); margin: 0 0 18px; }
/* Writing missions: guess first, you are Meta (22 Nov) */
.wr-opts.one { grid-template-columns: 1fr; }
.wr-reveal { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(160deg, #1B2560, #121A47); color: #fff; font: 500 16px/1.4 var(--font); }
.wr-model { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(14, 21, 64, .05); font: 500 15px/1.5 var(--font); }
.wr-model b { font-weight: 600; }
.wr-keepline { margin: 0 0 14px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(160deg, #1B2560, #121A47); color: #fff; font: 400 20px/1.35 var(--title); }
.wr-keepline::before { content: "Keep one thing: "; color: var(--gold); font: 600 13px/1 var(--font); display: block; margin-bottom: 6px; }
/* Proper writing with a keyboard (22 Nov) */
.wr-text.big { min-height: 260px; font: 500 18px/1.6 var(--font); padding: 16px 18px; }
.wr-words { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font: 600 14px/1 var(--font); color: var(--slate); }
.wr-wc.ok { color: var(--gold-d); }
/* Speaking: read it aloud (22 Nov) */
.wr-saylist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.wr-say { padding: 12px 14px; border-radius: 12px; background: rgba(14, 21, 64, .04); font: 500 18px/1.5 var(--font); color: var(--slate); }
.wr-say.on { background: rgba(230, 201, 138, .22); color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold-d); }
.wr-say.ok { color: var(--ink); background: rgba(14, 21, 64, .06); }
.wr-say.miss { color: var(--ink); }
.w-ok { color: var(--ink); }
.w-miss { color: var(--red); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.wr-sayact { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wr-mic { display: inline-flex; align-items: center; gap: 10px; font: 600 15px/1 var(--font); color: var(--ink); }
.wr-dot-live { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: live 1s ease-in-out infinite alternate; }
@keyframes live { to { transform: scale(.6); opacity: .5; } }
.wr-typerow { display: flex; gap: 10px; align-items: center; }
.wr-input { flex: 1; height: 54px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font: 500 22px/1 var(--title); -webkit-user-select: text; user-select: text; }
.wr-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 28, 68, .10); }
.wr-text.big { min-height: 340px; }
.wr-text.mid { min-height: 120px; font: 500 17px/1.55 var(--font); }
@media (min-height: 900px) { .wr-text.big { min-height: 440px; } }
.wr-listen { float: right; margin: -4px 0 8px 12px; height: 40px; }
.wr-listen.on { background: var(--navy); color: #fff; }
.wr-hear { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; flex-wrap: wrap; }

.games-pay { font: 500 14px/1.4 var(--font); color: var(--slate); padding: 2px 4px 10px; }

/* ---------- Writing: six new exercise kinds and the animation layer (23 Nov 2026) ---------- */
@keyframes wr-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes wr-slidel { from { opacity: 0; transform: translateX(-24px); } }
@keyframes wr-slider { from { opacity: 0; transform: translateX(36px); } }
@keyframes wr-pulse { 50% { transform: scale(1.06); } }
@keyframes wr-kb { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes wr-grow { from { transform: scaleX(0); } }
@keyframes wr-pop { 0% { opacity: 0; transform: scale(.5); } 60% { opacity: 1; transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes wr-ringin { from { opacity: 0; transform: scale(.3); } }
@keyframes wr-ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.3); } }
@keyframes wr-hintpulse { 50% { transform: scale(1.04); opacity: .75; } }
@keyframes wr-ringrun { to { stroke-dashoffset: 163.36; } }
@keyframes wr-lift { from { transform: translateY(0); } }
.wr-spark { position: fixed; z-index: 90; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); pointer-events: none; transform: translate(-50%, -50%); }
.wr-spark.w { background: #fff; box-shadow: 0 0 0 1px rgba(14, 21, 64, .18); }
/* reader */
.wr-fig-in { display: block; overflow: hidden; border-radius: 18px; box-shadow: 0 24px 50px -28px rgba(14, 21, 64, .6); }
.wr-fig-in img { border-radius: 0; box-shadow: none; will-change: transform; }
.wr-host.fx .wr-read .wr-fig-in img { animation: wr-kb 12s ease-out both; }
.wr-host.fx .wr-read p:nth-of-type(-n+8) { animation: wr-rise .4s ease both; }
.wr-host.fx .wr-read p:nth-of-type(1) { animation-delay: .04s; }
.wr-host.fx .wr-read p:nth-of-type(2) { animation-delay: .09s; }
.wr-host.fx .wr-read p:nth-of-type(3) { animation-delay: .14s; }
.wr-host.fx .wr-read p:nth-of-type(4) { animation-delay: .19s; }
.wr-host.fx .wr-read p:nth-of-type(5) { animation-delay: .24s; }
.wr-host.fx .wr-read p:nth-of-type(6) { animation-delay: .29s; }
.wr-host.fx .wr-read p:nth-of-type(7) { animation-delay: .34s; }
.wr-host.fx .wr-read p:nth-of-type(8) { animation-delay: .39s; }
.wr-host.fx .wr-read .wr-word { animation: wr-slidel .4s .15s ease both; }
.wr-host.fx .wr-nav .btn.primary { animation: wr-pulse .8s 1.4s ease 1 both; }
/* story list: the thin line grows on first paint */
.wr-host.fx .wr-bar i { transform-origin: left center; animation: wr-grow .8s .15s cubic-bezier(.3, .7, .3, 1) both; }
/* missions */
.wr-host.fx .wr-play .wr-q, .wr-host.fx .wr-play .wr-q-n { animation: wr-rise .3s ease both; }
.wr-host.fx .wr-step.done { animation: wr-pop .35s ease both; }
.wr-host.fx .wr-step.done:nth-child(2) { animation-delay: .05s; }
.wr-host.fx .wr-step.done:nth-child(3) { animation-delay: .1s; }
.wr-host.fx .wr-step.done:nth-child(4) { animation-delay: .15s; }
.wr-host.fx .wr-step.done:nth-child(5) { animation-delay: .2s; }
.wr-host.fx .wr-step.done:nth-child(6) { animation-delay: .25s; }
.wr-host.fx .wr-step.done:nth-child(n+7) { animation-delay: .3s; }
.wr-host.fx .wr-res-grid .stat { animation: wr-rise .4s ease both; }
.wr-host.fx .wr-res-grid .stat:nth-child(1) { animation-delay: .1s; }
.wr-host.fx .wr-res-grid .stat:nth-child(2) { animation-delay: .17s; }
.wr-host.fx .wr-res-grid .stat:nth-child(3) { animation-delay: .24s; }
.wr-host.fx .wr-res-grid .stat:nth-child(4) { animation-delay: .31s; }
.wr-host.fx .wr-res-grid .stat:nth-child(5) { animation-delay: .38s; }
.wr-host.fx .wr-res-grid .stat:nth-child(6) { animation-delay: .45s; }
.wr-host.fx .wr-res-grid .stat:nth-child(n+7) { animation-delay: .5s; }
/* Find it */
.wr-hs { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.wr-hs.locked { cursor: default; }
.wr-hs img { display: block; width: 100%; height: auto; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.wr-ring { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--gold-d), 0 0 0 7px rgba(14, 21, 64, .25); pointer-events: none; animation: wr-ringin .45s cubic-bezier(.2, .8, .3, 1) both; }
.wr-ring.ok::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid #fff; animation: wr-ripple .7s ease-out both; }
.wr-ring.miss { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-color: #fff; box-shadow: 0 0 0 2px rgba(14, 21, 64, .45); }
.wr-hint { position: absolute; border-radius: 14px; border: 3px solid #fff; background: rgba(230, 201, 138, .3); box-shadow: 0 0 0 3px var(--gold-d), 0 0 0 6px rgba(14, 21, 64, .3); pointer-events: none; animation: wr-hintpulse 1s ease-in-out 4 both; }
/* Build the word */
.wr-slots, .wr-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-slots { margin: 4px 0 20px; flex-wrap: nowrap; }
.wr-slot { position: relative; z-index: 2; flex: 1 1 0; min-width: 0; max-width: 48px; height: 58px; border-radius: 12px; border: 2px dashed var(--line2); background: #fff; display: grid; place-items: center; font: 500 28px/1 var(--title); color: #fff; }
.wr-slot.on { border: 2px solid var(--navy); background: var(--navy); }
.wr-slot.show { border: 2px solid var(--gold-d); background: rgba(230, 201, 138, .3); color: var(--ink); }
.wr-tile { width: 52px; height: 58px; border-radius: 12px; border: 1px solid var(--line2); background: var(--paper-solid); font: 500 28px/1 var(--title); color: var(--ink); transition: transform .06s; }
.wr-tile:active { transform: scale(.94); }
.wr-tile.used { opacity: .2; }
.wr-tile.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red); opacity: 1; }
/* Quick fire */
.wr-quick { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.wr-qcard { flex: 1; min-width: 0; min-height: 110px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line2); background: #fff; display: flex; align-items: center; font: 500 23px/1.3 var(--title); }
.wr-host.fx .wr-qcard { animation: wr-slider .28s ease both; }
.wr-timer { flex: none; width: 68px; height: 68px; }
.wr-timer svg { display: block; width: 68px; height: 68px; transform: rotate(-90deg); }
.wr-timer circle { fill: none; stroke-width: 6; }
.wr-timer .bg { stroke: rgba(14, 21, 64, .1); }
.wr-timer .fg { stroke: var(--gold-d); stroke-linecap: round; stroke-dasharray: 163.36; stroke-dashoffset: 0; animation-name: wr-ringrun; animation-timing-function: linear; animation-fill-mode: both; }
.wr-timer.stop .fg { animation-play-state: paused; }
.wr-qbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wr-qbtns .wr-opt { min-height: 78px; text-align: center; font: 500 26px/1 var(--title); }
/* Say it back */
.wr-chat { display: flex; flex-direction: column; gap: 8px; }
.wr-who { font: 600 13px/1 var(--font); color: var(--slate); margin: 2px 0 -2px 6px; }
.wr-bub { align-self: flex-start; max-width: 88%; padding: 12px 16px; border-radius: 16px 16px 16px 5px; background: #fff; border: 1px solid var(--line2); color: var(--ink); font: 500 17px/1.4 var(--font); }
.wr-bub.me { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: var(--navy); border-color: var(--navy); color: #fff; }
.wr-bub.me.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.wr-bub.best { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: rgba(230, 201, 138, .3); border-color: var(--gold-d); }
.wr-bub.old { opacity: .55; }
.wr-replies { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: flex-end; }
.wr-reply { max-width: 92%; min-height: 48px; padding: 10px 16px; border-radius: 16px 16px 5px 16px; border: 1px solid var(--navy); background: #fff; color: var(--ink); font: 600 16px/1.3 var(--font); text-align: left; transition: transform .06s, background .15s; }
.wr-reply:active { transform: scale(.98); background: rgba(14, 21, 64, .05); }
.wr-whyline { font: 500 13px/1.4 var(--font); color: var(--slate); margin: 2px 6px 0; }
.wr-host.fx .wr-bub.cur { animation: wr-rise .35s ease both; }
.wr-host.fx .wr-replies { animation: wr-rise .35s .4s ease both; }
/* Pictures in order */
.wr-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.wr-pslot { position: relative; min-height: 118px; border-radius: 12px; border: 2px dashed var(--line2); background: rgba(14, 21, 64, .03); }
.wr-pslot.on { border: 0; background: none; }
.wr-pslot.miss .wr-ptile { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.wr-pnum { position: absolute; left: 6px; top: 6px; z-index: 2; min-width: 24px; height: 24px; border-radius: 8px; background: var(--navy); color: #fff; font: 500 14px/24px var(--title); text-align: center; }
.wr-ptile { display: flex; flex-direction: column; width: 100%; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line2); background: #fff; text-align: left; transition: transform .06s; }
button.wr-ptile:active { transform: scale(.97); }
.wr-ptile img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; -webkit-user-drag: none; }
.wr-pcap { display: block; padding: 6px 8px 7px; font: 600 12px/1.25 var(--font); color: var(--ink); }
/* Odd one out */
.wr-oddg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wr-odd-c { min-height: 84px; padding: 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--paper-solid); display: flex; align-items: center; justify-content: center; text-align: center; font: 600 17px/1.3 var(--font); color: var(--ink); transition: transform .06s; }
.wr-odd-c:active { transform: scale(.985); }
.wr-odd-c[disabled] { opacity: 1; }
.wr-odd-c.glow { background: var(--navy); border-color: var(--navy); color: #fff; transform: translateY(-4px); box-shadow: 0 0 0 3px rgba(230, 201, 138, .8), 0 16px 26px -14px rgba(14, 21, 64, .6); animation: wr-lift .3s ease both; }
.wr-odd-c.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); }
@media (max-width: 520px) {
  .wr-oddg { grid-template-columns: 1fr; }
  .wr-slot { height: 50px; font-size: 24px; }
  .wr-slots, .wr-tiles { gap: 6px; }
  .wr-tile { width: 44px; height: 50px; font-size: 24px; }
  .wr-qcard { font-size: 20px; min-height: 96px; }
  .wr-timer, .wr-timer svg { width: 56px; height: 56px; }
  .wr-pgrid { grid-template-columns: 1fr 1fr; }
}
/* the subject chips above chapter 1 carry the class "top" and were picking up the fixed top band; keep them in the flow */
body .wr-subjects.top, body.shell .wr-subjects.top { position: static; z-index: auto; height: auto; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; margin: 0 0 10px; }
@media (max-width: 520px) { .wr-progress .wr-count { display: none; } .wr-progress { gap: 10px; } .wr-steps, .wr-dots { flex: 1 1 auto; padding: 0 10px; gap: 6px; } .wr-step { width: 28px; height: 28px; } }

/* ---------- Books (23 Nov 2026) ---------- */
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bk-card { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; min-height: 190px; padding: 18px 18px 16px; background: var(--navy); color: #fff; border: 1px solid rgba(255, 255, 255, .10); cursor: pointer; transition: transform .12s ease; }
.bk-card:active { transform: scale(.985); }
.bk-card.now { box-shadow: 0 0 0 2px var(--gold), 0 18px 40px -22px rgba(0, 0, 0, .7); }
.bk-card.fin { opacity: .72; }
.bk-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gold); color: var(--navy); font: 500 22px/1 var(--title); flex: none; }
.bk-num.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 34px; }
.bk-title { font: 500 19px/1.2 var(--title); letter-spacing: -.01em; margin-top: auto; }
.bk-line { display: block; width: 100%; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bk-line i { display: block; height: 100%; background: var(--gold); }
.bk-pages { font: 500 13px/1 var(--font); color: var(--on-navy); }
.bk-shell { display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 0 auto; width: 100%; }
.bk-hero .hero-top { align-items: center; }
.bk-form { display: flex; flex-direction: column; gap: 14px; }
.bk-label { display: flex; flex-direction: column; gap: 8px; font: 600 15px/1.2 var(--font); color: var(--ink); }
.bk-input { height: 52px; width: 160px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper-solid); padding: 0 16px; font: 500 24px/1 var(--title); color: var(--ink); }
.bk-log { display: flex; flex-direction: column; gap: 0; padding: 4px 18px; }
.bk-entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bk-entry:last-child { border-bottom: 0; }
.bk-entry-top { display: flex; justify-content: space-between; gap: 12px; font: 500 15px/1.2 var(--font); color: var(--slate); }
.bk-entry-top b { font: 500 18px/1.2 var(--title); color: var(--ink); }
.bk-entry p { margin: 6px 0 0; font: 400 15px/1.45 var(--font); color: var(--ink); }
@media (max-width: 520px) { .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bk-card { min-height: 160px; padding: 14px; } .bk-title { font-size: 16px; } }
.bk-hero .hi { font-size: clamp(22px, 4.2vw, 34px); line-height: 1.15; overflow-wrap: anywhere; }
.bk-hero .hero-txt { min-width: 0; }

/* ---------- Books reader (23 Nov 2026) ---------- */
.bk-card .bk-file { font: 500 12px/1 var(--font); color: var(--gold); }
.bk-read { padding: 0; overflow: hidden; }
.bk-read-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper-solid); z-index: 2; }
.bk-read-top .bk-where { margin-left: auto; font: 600 14px/1 var(--font); color: var(--slate); white-space: nowrap; }
.bk-text { padding: 22px clamp(18px, 5vw, 56px) 32px; font: 400 var(--bk-size, 19px)/1.62 Georgia, 'Times New Roman', serif; color: var(--ink); max-width: 760px; margin: 0 auto; }
.bk-text h1, .bk-text h2, .bk-text h3 { font: 500 1.3em/1.2 var(--title); margin: 1.2em 0 .5em; }
.bk-text p { margin: 0 0 .9em; }
.bk-text img, .bk-text svg { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.bk-text a { color: inherit; text-decoration: none; pointer-events: none; }
.bk-read-nav { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.bk-size { display: inline-flex; gap: 6px; }
.bk-size .btn { height: 36px; padding: 0 12px; min-width: 40px; }
.bk-drop { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bk-drop input { display: none; }

.bk-card.has-cover { padding-top: 0; }
.bk-cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px 12px 0 0; margin: 0 -18px 6px; width: calc(100% + 36px); max-width: none; display: block; }
.bk-card.has-cover .bk-num { position: absolute; top: 10px; left: 10px; }
.bk-cover.xl { width: 96px; aspect-ratio: 2 / 3; border-radius: 12px; margin: 0; flex: none; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7); }
@media (max-width: 520px) { .bk-cover { margin: 0 -14px 6px; width: calc(100% + 28px); } }
/* reader in landscape (23 Nov 2026): one calm column, a book's measure, room at the sides */
.bk-text { hyphens: auto; -webkit-hyphens: auto; text-rendering: optimizeLegibility; }
.bk-text p { text-align: left; }
@media (orientation: landscape) and (min-width: 900px) {
  .bk-shell:has(.bk-read) { max-width: 1040px; }
  .bk-read .bk-text { max-width: 700px; padding: 36px 24px 48px; font-size: var(--bk-size, 20px); line-height: 1.66; }
  .bk-read-top { padding: 12px 28px; }
  .bk-read-nav { padding: 14px 28px 18px; max-width: 760px; margin: 0 auto; width: 100%; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .bk-read .bk-text { padding-top: 22px; }
}
.bk-read .bk-text, .bk-read .bk-text p, .bk-read .bk-text li, .bk-read .bk-text blockquote { font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif; }
.bk-read .bk-text h1, .bk-read .bk-text h2, .bk-read .bk-text h3 { font-family: var(--title); }

/* Test mode: every exercise one tap away */
.wr-test { margin-top: 24px; padding: 24px; display: grid; gap: 20px; }
.wr-test-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wr-test-p b { font: 600 17px/1.3 var(--font); color: var(--ink); }
.wr-test-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wr-test-b { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 14px/1 var(--font); cursor: pointer; }
.wr-test-b i { font-style: normal; color: var(--slate); font-size: 12px; }
.wr-test-b.done { border-color: var(--navy); }
.test-chip { background: var(--navy); color: #fff; border-color: var(--navy); text-decoration: none; padding: 0 14px; }

/* Hard words: marked once, tap or hover shows the meaning */
.wr-hw { all: unset; cursor: pointer; color: inherit; font-weight: 600; border-bottom: 2px dotted var(--gold-d); background: rgba(230, 201, 138, .22); border-radius: 4px 4px 0 0; padding: 0 2px 1px; }
.wr-hw:hover, .wr-hw:focus-visible { background: rgba(230, 201, 138, .25); border-radius: 4px; }
.wr-hw-tip { position: fixed; z-index: 60; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 16px; display: grid; gap: 4px; font: 400 16px/1.4 var(--font); box-shadow: 0 16px 32px -16px rgba(14, 21, 64, .5); }
.wr-hw-tip b { font: 600 17px/1.2 var(--font); color: #E6C98A; }

.wr-sayrow { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }

/* Learn card: the skill is taught before the question (his rule 23 Nov 2026) */
.wr-learn { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 0 0 16px; font: 500 17px/1.45 var(--font); color: var(--ink); }

/* SkillTeam way: goal with the first question, takeaway when the chapter is done */
.wr-goal { font: 500 16px/1.45 var(--font); color: var(--slate); margin: 0 0 12px; }
.wr-goal b { color: var(--ink); font-weight: 700; margin-right: 4px; }
.wr-takeaway { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 16px 0 0; }
.wr-takeaway h3 { margin: 0; padding: 10px 18px; background: var(--navy); color: #fff; font: 600 15px/1.2 var(--font); }
.wr-takeaway p, .wr-takeaway ol { margin: 12px 18px; font: 400 17px/1.45 var(--font); color: var(--ink); }
.wr-takeaway ol { padding-left: 20px; }
.wr-tk-key { font-weight: 600 !important; }
.wr-tk-c { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.wr-tk-c span { background: #fff; padding: 12px 18px; font: 400 16px/1.4 var(--font); color: var(--ink); }
.wr-tk-c span:first-child { color: var(--slate); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
@media (max-width: 600px) { .wr-tk-c { grid-template-columns: 1fr; } }

/* Test mode bar: Show answer and Skip */
.wr-testbar { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.wr-testbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.wr-testans { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font: 400 15px/1.45 var(--font); color: var(--ink); }
