/* ============================================================================
   Fact Dragons — styles.  Prefix: fd-
   Night-sky base (the games suite's shared tokens) with one accent per realm.
   Every animation is gated: prefers-reduced-motion AND the in-game setting
   (body.fd-still) both switch them off.
   ========================================================================== */
:root {
  --bg-0: #0b1020; --bg-1: #131a31; --card: #1a2238; --card-2: #212c47; --line: #2d3a5c;
  --ink: #eef2ff; --muted: #9aa6c7; --primary: #38bdf8; --primary-ink: #06283b;
  --go: #34d399; --bad: #fb7185; --gold: #ffd166;
  --A: #7ddc6a; --A2: #ffd166;      /* Sunleaf Meadow */
  --S: #7fdcff; --S2: #b8a4ff;      /* Frostpeak */
  --M: #ff8a3d; --M2: #ff5a4e;      /* Emberforge */
  --D: #3ee0c8; --D2: #9b7bff;      /* Crystal Deep */
  --c0: #2a3350; --c1: #f59e42; --c2: #4f8cff; --c3: #ffd166; --c4: #ffe9a8;
  --font: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--ink); min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, #2a2458 0%, var(--bg-0) 60%) fixed, var(--bg-0);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.fd-muted { color: var(--muted); }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- nav */
.fd-nav { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: rgba(8, 12, 26, .85);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(6px); }
.fd-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.fd-brand span { font-family: "Sora", var(--font); font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.fd-spacer { flex: 1; }
.fd-who { color: var(--muted); font-size: 14px; }
.fd-navbtn { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.fd-navbtn:hover { border-color: var(--primary); }

.fd-wrap { max-width: 1180px; margin: 0 auto; padding: 16px 14px 60px; }
.fd-screen { display: none; }
.fd-wrap[data-screen="loading"] [data-for="loading"],
.fd-wrap[data-screen="home"] [data-for="home"],
.fd-wrap[data-screen="session"] [data-for="session"],
.fd-wrap[data-screen="summary"] [data-for="summary"],
.fd-wrap[data-screen="dragons"] [data-for="dragons"],
.fd-wrap[data-screen="grids"] [data-for="grids"],
.fd-wrap[data-screen="lair"] [data-for="lair"],
.fd-wrap[data-screen="race"] [data-for="race"],
.fd-wrap[data-screen="duel"] [data-for="duel"],
.fd-wrap[data-screen="robo"] [data-for="robo"],
.fd-wrap[data-screen="board"] [data-for="board"],
.fd-wrap[data-screen="teacher"] [data-for="teacher"] { display: block; }

.fd-loading { text-align: center; padding: 120px 0; color: var(--muted); font-size: 20px; }
.fd-egg-spin { width: 70px; height: 90px; margin: 0 auto 14px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: linear-gradient(160deg, #ffd166, #f59e42); box-shadow: 0 0 40px rgba(255, 209, 102, .4);
  animation: fdWobble 1s ease-in-out infinite; }
@keyframes fdWobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* --------------------------------------------------------------- home */
.fd-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; min-height: 360px;
  border-radius: 24px; overflow: hidden; position: relative; padding: 26px;
  background: linear-gradient(90deg, rgba(11, 16, 32, .55), rgba(11, 16, 32, .15) 55%, rgba(11, 16, 32, .6)),
              url("art/scenes/hero.jpg") center / cover no-repeat;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.fd-hero h1 { font-size: clamp(38px, 6vw, 64px); margin: 0; line-height: 1; font-weight: 700;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 30px rgba(155, 123, 255, .5); }
.fd-ver { font-size: 14px; font-weight: 500; color: var(--muted); vertical-align: middle; text-shadow: none; }
.fd-tag { font-size: 19px; max-width: 26ch; margin: 12px 0 0; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.fd-guest { background: rgba(8, 12, 26, .75); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  max-width: 44ch; font-size: 15px; margin-top: 16px; }
.fd-guest a { color: var(--gold); }
.fd-today { align-self: end; background: rgba(12, 17, 36, .82); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px; padding: 16px; backdrop-filter: blur(4px); }
.fd-stats { display: flex; gap: 8px; }
.fd-stat { flex: 1; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center;
  background: var(--card); border-radius: 14px; padding: 6px 8px; column-gap: 6px; }
.fd-stat img { grid-row: span 2; width: 34px; height: 34px; object-fit: contain; }
.fd-stat b { font-size: 22px; line-height: 1; }
.fd-stat span { font-size: 12px; color: var(--muted); }
.fd-week { display: flex; gap: 6px; justify-content: center; margin: 12px 0 6px; }
.fd-week i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: 12px; color: var(--muted); background: var(--card-2); border: 2px solid var(--line); }
.fd-week i.lit { background: radial-gradient(circle, #ffe08a, #f59e42); color: #3b2200; border-color: #ffd166;
  box-shadow: 0 0 14px rgba(255, 170, 60, .6); }
.fd-week i.today { outline: 2px dashed var(--primary); outline-offset: 2px; }
.fd-week small { align-self: center; color: var(--muted); font-size: 12px; margin-left: 4px; }
.fd-track { display: flex; gap: 8px; margin: 10px 0; }
.fd-trackbtn { flex: 1; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 14px;
  padding: 8px; font-size: 22px; font-weight: 600; line-height: 1.1; }
.fd-trackbtn small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.fd-trackbtn.is-on { border-color: var(--gold); background: linear-gradient(180deg, #2e2a52, var(--card)); }
.fd-train { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 18px; padding: 10px 14px;
  background: linear-gradient(180deg, #ffd166, #f59e42); color: #3b2200; text-align: left;
  box-shadow: 0 6px 0 #b8691a, 0 12px 30px rgba(245, 158, 66, .35); transition: transform .08s; }
.fd-train:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8691a; }
.fd-train b { display: block; font-size: 26px; font-weight: 700; }
.fd-train small { font-size: 14px; opacity: .8; }
.fd-train-dragon { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.fd-beacon { margin: 8px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

.fd-classgoal { margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.fd-bar { height: 12px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.fd-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--D), var(--gold)); border-radius: 999px; transition: width .6s; }

/* home: minutes today / this week / all time, with the weekly goal (v1.53) */
.fd-mins { margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.fd-minstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.fd-minstats span { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fd-minstats small { color: var(--muted); font-size: 13px; }
.fd-minstats b { font-size: 22px; line-height: 1.15; }
.fd-minstats b em { font-style: normal; font-size: 14px; color: var(--muted); font-weight: 600; }
.fd-mins > small { display: block; margin-top: 6px; color: var(--muted); text-align: center; }
@media (max-width: 520px) { .fd-minstats b { font-size: 18px; } }

/* home: this week's top 5 */
.fd-hometop { margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px 14px; }
.fd-hthead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.fd-hthead h3 { margin: 0; font-size: 19px; }
.fd-htme { color: var(--muted); font-size: 15px; }
.fd-htme b { color: var(--gold); font-size: 17px; }
.fd-htseg button { padding: 4px 12px; font-size: 14px; }
.fd-htgo { margin-left: auto; padding: 5px 14px; font-size: 15px; }
.fd-htnote { margin: 4px 0 0; font-size: 15px; }
.fd-htlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 10px; }
.fd-htlist li { position: relative; min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 8px; align-items: center;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 8px;
  animation: fdRowIn .35s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.fd-htlist li.me { border: 2px solid var(--gold); background: linear-gradient(135deg, rgba(255, 209, 102, .16), var(--card-2) 70%); }
.fd-htlist .av { grid-column: 1; grid-row: 1 / span 2; width: 46px; height: 46px; object-fit: contain; }
.fd-htlist .nm { grid-column: 2; grid-row: 1; align-self: end; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-htlist .nm em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--gold); color: #3b2200; border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.fd-htlist .st { grid-column: 2; grid-row: 2; align-self: start; font-size: 16px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.fd-htlist .rk { position: absolute; top: -9px; left: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.fd-htlist .rk img { position: absolute; top: -14px; left: 50%; width: 18px; transform: translateX(-50%) rotate(-8deg); }

.fd-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.fd-tab { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 17px; font-weight: 500; }
.fd-tab img { width: 34px; height: 34px; object-fit: contain; }
.fd-tab:hover { border-color: var(--gold); }

.fd-realms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.fd-realm { position: relative; border-radius: 20px; overflow: hidden; min-height: 190px; padding: 14px;
  background: center / cover no-repeat; border: 2px solid rgba(255, 255, 255, .06); display: flex; flex-direction: column; }
.fd-realm::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 26, .1), rgba(8, 12, 26, .85)); }
.fd-realm > * { position: relative; }
.fd-realm h3 { margin: 0; font-size: 22px; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.fd-realm .fd-op { font-size: 13px; color: #e6ebff; opacity: .9; }
.fd-realm .fd-eggs { display: flex; gap: 2px; flex-wrap: wrap; margin-top: auto; }
.fd-realm .fd-eggs img { width: 42px; height: 42px; object-fit: contain; }
.fd-realm .fd-eggs img.locked { filter: brightness(0) opacity(.35); }
.fd-realm .fd-rprog { font-size: 14px; margin-top: 6px; }
.fd-realm img.fd-rguard { position: absolute; right: 10px; top: 8px; width: 126px; height: 126px; object-fit: contain; z-index: 1;
  filter: drop-shadow(0 0 12px rgba(255, 220, 120, .95)) drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); animation: fdGuard 2.4s ease-in-out infinite; }   /* an awake guardian on its tile: 3× an egg (v1.67) */
.fd-realm.guarded h3, .fd-realm.guarded .fd-op { max-width: calc(100% - 130px); }
.fd-realm[data-r="A"] { border-color: rgba(125, 220, 106, .35); }
.fd-realm[data-r="S"] { border-color: rgba(127, 220, 255, .35); }
.fd-realm[data-r="M"] { border-color: rgba(255, 138, 61, .35); }
.fd-realm[data-r="D"] { border-color: rgba(62, 224, 200, .35); }
.fd-realm.moon { grid-column: 1 / -1; min-height: 150px; border-color: rgba(201, 181, 255, .45); background-position: center 38%; cursor: pointer; }
.fd-realm.moon h3 { color: #e9ddff; }
.fd-realm.moon .fd-eggs img { width: 46px; height: 46px; }
.fd-realm.moon .fd-eggs img.locked { filter: brightness(0) opacity(.6) drop-shadow(0 0 2px rgba(220, 205, 255, .9)); }   /* silhouettes read on the night map */
.fd-realm.moon:hover, .fd-realm.moon:focus-visible { border-color: rgba(201, 181, 255, .9); outline: none; }
.fd-realm.moon:focus-visible { box-shadow: 0 0 0 3px rgba(201, 181, 255, .5); }

.fd-ccss { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; }
.fd-ccss summary { cursor: pointer; font-weight: 600; }
.fd-ccss p { font-size: 14px; line-height: 1.5; }

/* ------------------------------------------------------------ session */
.fd-hud { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fd-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 16px; }
.fd-pill img { width: 24px; height: 24px; object-fit: contain; }
.fd-quit { font-weight: 600; }
.fd-flight { flex: 1; }
.fd-flight-track { position: relative; height: 12px; background: var(--card-2); border-radius: 999px; }
.fd-flight-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #6d5bd0, var(--gold)); transition: width .4s; }
.fd-flight-track img { position: absolute; top: 50%; left: 0; width: 38px; height: 38px; object-fit: contain;
  transform: translate(-50%, -50%); transition: left .4s; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }

.fd-stage { display: grid; grid-template-columns: 200px 1fr 300px; gap: 18px; align-items: center; }
.fd-companion { text-align: center; position: relative; }
.fd-companion img { width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.fd-companion img.hop { animation: fdHop .38s ease-out; }
.fd-companion img.tilt { animation: fdTilt .38s ease-out; }
@keyframes fdHop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-22px) scale(1.06); } 100% { transform: none; } }
@keyframes fdTilt { 0%, 100% { transform: none; } 30% { transform: rotate(-7deg); } 60% { transform: rotate(5deg); } }
.fd-combo { position: absolute; top: 0; right: 4px; font-weight: 700; font-size: 22px; color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }

.fd-card { position: relative; background: linear-gradient(180deg, #232d4d, var(--card)); border: 2px solid var(--line);
  border-radius: 26px; padding: 26px 20px 30px; text-align: center; min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; transition: border-color .2s, box-shadow .2s; }
.fd-card.good { border-color: var(--go); box-shadow: 0 0 0 4px rgba(52, 211, 153, .25), 0 0 40px rgba(52, 211, 153, .25); }
.fd-card.oops { border-color: #f59e42; }
.fd-badge { min-height: 28px; font-size: 15px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.fd-badge.new { color: #3b2200; background: var(--gold); border-radius: 999px; padding: 3px 12px; }
.fd-badge.warm { color: var(--primary); }
.fd-prob { font-size: clamp(56px, 9vw, 104px); font-weight: 700; line-height: 1.05; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.fd-prob .eq { color: var(--muted); }
.fd-prob .shown { color: var(--gold); }
.fd-prob .count { color: var(--gold); }   /* the 3 · 2 · 1 before a race (v1.93) */
.fd-answer { margin-top: 14px; min-width: 190px; min-height: 84px; border-radius: 18px; background: var(--bg-0);
  border: 3px solid var(--line); font-size: 56px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; padding: 0 16px; }
.fd-card.good .fd-answer { border-color: var(--go); color: var(--go); }
.fd-caret { width: 3px; height: 50px; background: var(--primary); margin-left: 3px; animation: fdBlink 1s steps(1) infinite; }
@keyframes fdBlink { 50% { opacity: 0; } }
.fd-rawinput { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.fd-repair { margin-top: 14px; background: rgba(245, 158, 66, .12); border: 1px dashed #f59e42; border-radius: 14px;
  padding: 10px 14px; font-size: 20px; max-width: 520px; }
.fd-repair b { color: var(--gold); font-size: 30px; display: block; }
.fd-toast { position: absolute; left: 50%; top: -18px; transform: translate(-50%, 0); background: var(--gold); color: #3b2200;
  border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 18px; opacity: 0; pointer-events: none;
  white-space: nowrap; transition: opacity .2s, transform .2s; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.fd-toast.show { opacity: 1; transform: translate(-50%, -10px); }
.fd-gemfly { position: fixed; width: 34px; height: 34px; pointer-events: none; z-index: 60; transition: transform .45s ease-in, opacity .45s; }
.fd-spark { position: fixed; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 60; }

.fd-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fd-pad button { height: 72px; border-radius: 18px; border: 0; background: var(--card-2); color: var(--ink); font-size: 32px;
  font-weight: 600; box-shadow: 0 5px 0 #151c32; transition: transform .06s; touch-action: manipulation; }
.fd-pad button:active, .fd-pad button.press { transform: translateY(3px); box-shadow: 0 2px 0 #151c32; }
.fd-pad .fd-key-go { background: var(--go); color: #03281b; box-shadow: 0 5px 0 #1e8a63; }
.fd-pad .fd-key-back { font-size: 26px; }

/* ----------------------------------------------------- strategy card */
.fd-strategy { text-align: center; }
.fd-strategy .fd-sdragon { width: 120px; height: 120px; object-fit: contain; }
.fd-strategy h3 { margin: 6px 0; font-size: 26px; }
.fd-strategy p { font-size: 19px; line-height: 1.45; margin: 6px auto; max-width: 46ch; }
.fd-strategy .fd-worked { font-size: 30px; font-weight: 700; color: var(--gold); margin: 10px 0; }
.fd-vis { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.fd-tf { display: grid; grid-template-columns: repeat(5, 22px); gap: 4px; padding: 6px; border-radius: 10px; background: #0e1428; border: 1px solid var(--line); }
.fd-tf i, .fd-arr i { width: 22px; height: 22px; border-radius: 50%; background: #243052; display: block; }
.fd-arr { display: grid; gap: 4px; padding: 8px; border-radius: 10px; background: #0e1428; border: 1px solid var(--line); }
.fd-arr i { width: 16px; height: 16px; }
i.k1 { background: var(--gold); } i.k2 { background: #6fb8ff; } i.kx { background: #243052; opacity: .45; outline: 2px solid #f59e42; }
.fd-visop { font-size: 26px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------ summary */
.fd-summary { text-align: center; }
.fd-summary h2 { font-size: 40px; margin: 6px 0 14px; }
.fd-celebrate { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.fd-cele { background: var(--card); border: 2px solid var(--gold); border-radius: 22px; padding: 14px; width: 220px;
  box-shadow: 0 0 30px rgba(255, 209, 102, .25); }
.fd-cele .fd-evo { position: relative; height: 170px; }
.fd-cele .fd-evo img { position: absolute; inset: 0; margin: auto; max-height: 170px; object-fit: contain; }
.fd-cele .fd-evo img.from { animation: fdOut 1.6s ease-in forwards; }
.fd-cele .fd-evo img.to { opacity: 0; animation: fdIn 1.6s ease-out .8s forwards; }
@keyframes fdOut { 0% { opacity: 1; transform: none; } 50% { transform: rotate(-10deg) scale(1.05); } 70% { transform: rotate(10deg) scale(1.1); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes fdIn { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: none; } }
.fd-cele h4 { margin: 8px 0 2px; font-size: 20px; }
.fd-cele small { color: var(--muted); }
.fd-cele.lv small b { color: var(--gold); }
.fd-celebrate.many { gap: 10px; }
.fd-celebrate.many .fd-cele { width: 132px; padding: 8px; border-radius: 16px; }
.fd-celebrate.many .fd-evo { height: 96px; }
.fd-celebrate.many .fd-evo img { max-height: 96px; max-width: 110px; }
.fd-celebrate.many h4 { font-size: 16px; }
.fd-celebrate.many small { font-size: 11px; display: block; line-height: 1.25; }
.fd-sumgrid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.fd-sumgrid div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; min-width: 130px; }
.fd-sumgrid b { display: block; font-size: 30px; }
.fd-sumgrid span { color: var(--muted); font-size: 14px; }
.fd-debrief { max-width: 640px; margin: 0 auto; text-align: left; }
.fd-debrief h3 { font-size: 18px; margin: 8px 0; }
.fd-debrief li { font-size: 17px; margin: 4px 0; list-style: none; }
.fd-debrief .tried { color: var(--bad); text-decoration: line-through; margin-left: 8px; }
.fd-debrief .how { color: var(--muted); font-size: 14px; display: block; }
.fd-next { margin: 14px auto; max-width: 640px; color: var(--muted); }
.fd-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.fd-primary { background: linear-gradient(180deg, #ffd166, #f59e42); color: #3b2200; border: 0; border-radius: 14px;
  padding: 12px 22px; font-size: 20px; font-weight: 700; box-shadow: 0 5px 0 #b8691a; }
.fd-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); border-radius: 14px; padding: 10px 20px; font-size: 18px; }

/* ------------------------------------------------------------ dragons */
.fd-screenhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fd-screenhead h2 { margin: 0; font-size: 30px; }
.fd-back { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; }
.fd-drealm { margin: 14px 0 22px; }
.fd-drealm h3 { margin: 0 0 8px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.fd-drealm h3 small { font-size: 14px; color: var(--muted); font-weight: 400; }
.fd-dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fd-dcard { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px; text-align: center; color: var(--ink); }
.fd-dcard img { width: 110px; height: 110px; object-fit: contain; }
.fd-dcard.locked img { filter: brightness(0) opacity(.35); }
.fd-dcard.legend { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 209, 102, .35); }
.fd-dcard.legend img { filter: drop-shadow(0 0 10px rgba(255, 220, 120, .9)); }
.fd-dcard b { display: block; font-size: 17px; }
.fd-dcard small { color: var(--muted); font-size: 13px; }
.fd-dmeter { height: 7px; background: var(--card-2); border-radius: 999px; margin-top: 6px; overflow: hidden; display: flex; }
.fd-dmeter i { display: block; height: 100%; }
.fd-guardian { display: flex; gap: 14px; align-items: center; background: linear-gradient(90deg, rgba(255, 209, 102, .12), transparent);
  border: 1px dashed var(--line); border-radius: 18px; padding: 10px 14px; margin-top: 10px; }
.fd-guardian img { width: 90px; height: 90px; object-fit: contain; }
.fd-guardian.asleep img { filter: brightness(0) opacity(.3); }

/* -------------------------------------------------------------- grids */
.fd-seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.fd-seg button { border: 0; background: transparent; color: var(--ink); padding: 8px 16px; border-radius: 999px; font-size: 18px; font-weight: 600; }
.fd-seg button.is-active { background: var(--gold); color: #3b2200; }
.fd-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.fd-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.fd-legend .c0 { background: var(--c0); } .fd-legend .c1 { background: var(--c1); } .fd-legend .c2 { background: var(--c2); }
.fd-legend .c3 { background: var(--c3); } .fd-legend .c4 { background: var(--c4); box-shadow: 0 0 6px var(--gold); }
.fd-gridwrap { overflow-x: auto; padding-bottom: 6px; }
.fd-factgrid { display: grid; gap: 3px; width: max-content; }
.fd-factgrid .h { font-size: 13px; color: var(--muted); display: grid; place-items: center; font-weight: 600; }
.fd-factgrid button { width: 42px; height: 34px; border: 0; border-radius: 6px; font-size: 12px; color: #0b1020; font-weight: 600; padding: 0; }
.fd-factgrid button.s0 { background: var(--c0); color: #7d88aa; }
.fd-factgrid button.s1 { background: var(--c1); }
.fd-factgrid button.s2 { background: var(--c2); color: #fff; }
.fd-factgrid button.s3 { background: var(--c3); }
.fd-factgrid button.s4 { background: var(--c4); box-shadow: inset 0 0 0 2px var(--gold); }
.fd-factgrid button.na { visibility: hidden; }

/* --------------------------------------------------------------- lair */
/* isolation: the lair's depth z-indexes (up to ~1010, the Put away button 5000) stack INSIDE
   the scene only. Without it they competed with the whole page and drew over the dragon
   card (modal, z 80) and the sticky nav (z 40). */
.fd-lairscene { position: relative; isolation: isolate; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden;
  background: url("art/scenes/lair.jpg") center / cover no-repeat; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.fd-lairscene img { position: absolute; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); transform: translate(-50%, -100%); }
.fd-lairscene img.item, .fd-lairscene img.dragon { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none;
  -webkit-touch-callout: none; transition: transform .12s, filter .12s; }
.fd-lairscene img.item:focus, .fd-lairscene img.dragon:focus { outline: none; }
.fd-lairscene img.item:focus-visible, .fd-lairscene img.dragon:focus-visible { outline: 3px dashed var(--gold); outline-offset: 3px; border-radius: 10px; }
.fd-lairscene img.dragging { cursor: grabbing; transform: translate(-50%, -100%) scale(1.06);
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .55)) brightness(1.08); }
.fd-lairscene img.fresh { animation: fdFresh 1.4s ease-out; }
.fd-lairscene img.dragon.guardian { filter: drop-shadow(0 0 10px rgba(255, 220, 120, .8)); }   /* a guardian in the lair (v1.57) */
.fd-lairscene img.flip { transform: translate(-50%, -100%) scaleX(-1); }                    /* mirrored to face into the room (v1.41, dragons v1.44) */
.fd-lairscene img.flip.dragging { transform: translate(-50%, -100%) scaleX(-1) scale(1.06); }
@keyframes fdFresh { 0% { transform: translate(-50%, -100%) scale(.6); filter: drop-shadow(0 0 0 rgba(255, 209, 102, 0)); }
  35% { transform: translate(-50%, -100%) scale(1.12); filter: drop-shadow(0 0 18px rgba(255, 209, 102, .95)); }
  100% { transform: translate(-50%, -100%); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); } }
.fd-lairhint { font-size: 14px; margin: 8px 2px 0; }
.fd-lairscene img.item.sel { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.fd-putaway { position: absolute; z-index: 5000; transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap;
  border: 0; border-radius: 999px; padding: 6px 14px; background: var(--gold); color: #3b2200; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.fd-putaway.below { transform: translate(-50%, 8px); }
.fd-putaway::before { content: "📦 "; }
.fd-store { margin: 14px 0 4px; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 10px 14px 12px; }
.fd-store h3 { margin: 0 0 8px; font-size: 18px; }
.fd-store h3 small { font-size: 13px; font-weight: 400; }
.fd-storelist { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-stored { display: grid; grid-template-columns: 48px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px 6px 6px; }
.fd-stored img { grid-row: 1 / span 2; width: 48px; height: 48px; object-fit: contain; }
.fd-stored b { grid-column: 2; grid-row: 1; font-size: 15px; }
.fd-stored b small { color: var(--muted); font-size: 13px; font-weight: 600; }
.fd-stored button { grid-column: 2; grid-row: 2; justify-self: start; border: 0; border-radius: 10px; padding: 4px 12px;
  background: var(--gold); color: #3b2200; font-weight: 700; font-size: 14px; }
.fd-stored button:disabled { background: var(--card); color: var(--muted); cursor: default; }
/* the shelves under the lair fold up on phones (a <details>, rendered only below 760px) */
.fd-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 10px; }
.fd-fold > summary::-webkit-details-marker { display: none; }
.fd-fold > summary h3 { margin: 0; flex: 1; }
.fd-fold > summary::after { content: "▾"; font-size: 22px; line-height: 1; color: var(--gold); transition: transform .2s; }
.fd-fold[open] > summary::after { transform: rotate(180deg); }
.fd-fold[open] > summary { margin-bottom: 10px; }
.fd-fold > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.fd-foldn { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--gold); color: #3b2200;
  font-size: 14px; text-align: center; vertical-align: 2px; }
.fd-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fd-item { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px; text-align: center; color: var(--ink); }
.fd-shoptitle { margin-top: 18px; }
.fd-shopsec { margin: 4px 0 14px; }
.fd-shopsec > h3, .fd-shopsec summary h3 { font-size: 17px; margin: 10px 0 8px; }
.fd-shopsec h3 small { font-size: 13px; font-weight: 400; }
.fd-daytag { position: absolute; top: 8px; left: 8px; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700;
  background: var(--card-2); color: var(--muted); }
.fd-item.today { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 102, .28); }
.fd-item.today .fd-daytag { background: var(--gold); color: #3b2200; }
.fd-item.offday > img { filter: grayscale(.7) opacity(.55); }
.fd-item.grand { background: linear-gradient(180deg, #2a2450, var(--card)); }
.fd-item .need { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.fd-item img { width: 80px; height: 80px; object-fit: contain; }
.fd-item b { display: block; }
.fd-item .price { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.fd-item .price img { width: 20px; height: 20px; }
.fd-item.has { border-color: var(--go); }
.fd-item .count { display: block; color: var(--go); font-size: 13px; font-weight: 600; }
.fd-item button { display: block; margin: 6px auto 0; border: 0; border-radius: 10px; padding: 6px 12px; background: var(--gold); color: #3b2200; font-weight: 700; font-size: 15px; }
.fd-item button:disabled { background: var(--card-2); color: var(--muted); cursor: default; }

/* --------------------------------------------------------------- race */
.fd-racepick { display: flex; gap: 12px; flex-wrap: wrap; }
.fd-racepick button { flex: 1 1 200px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; color: var(--ink);
  padding: 12px; font-size: 20px; text-align: left; }
.fd-racepick button:disabled { opacity: .45; cursor: default; }
.fd-racepick small { display: block; color: var(--muted); font-size: 14px; }
.fd-racebars { display: grid; gap: 6px; margin-bottom: 10px; }
.fd-racebars .ghost i { background: linear-gradient(90deg, #4b5579, #7a86ad); }
.fd-racetime { text-align: center; font-size: 30px; font-weight: 700; color: var(--gold); }
.fd-racecard { min-height: 200px; margin-bottom: 14px; }
.fd-race .fd-pad { max-width: 420px; margin: 0 auto; }

/* --------------------------------------------------------- leaderboard */
.fd-board select { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-family: inherit; font-size: 15px; }
.fd-board #bTabs { margin-bottom: 14px; }
.fd-bme { display: flex; gap: 16px; align-items: center; max-width: 640px; margin: 0 0 18px; padding: 14px 18px;
  border: 2px solid rgba(255, 209, 102, .45); border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 209, 102, .14), rgba(155, 123, 255, .10) 60%, var(--card)); }
.fd-bme-av { flex: none; width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.fd-bme-main { flex: 1; min-width: 0; }
.fd-bme-rank { font-size: 40px; font-weight: 700; line-height: 1; color: var(--gold); }
.fd-bme-rank small { font-size: 18px; font-weight: 500; color: var(--muted); }
.fd-bme-stars { font-size: 16px; margin: 6px 0 0; }
.fd-btrack { position: relative; height: 12px; margin: 22px 18px 4px; border-radius: 999px; background: var(--card-2); }
.fd-btrack-zone { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 209, 102, .3), var(--gold)); }
.fd-btrack-you { position: absolute; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-1); border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, .5);
  transition: left .6s ease-out; }
.fd-btrack-you img { width: 30px; height: 30px; object-fit: contain; }
.fd-btrack-ends { display: flex; justify-content: space-between; margin: 0 4px; font-size: 12px; color: var(--muted); }
.fd-bnudge { margin: 8px 0 0; font-size: 16px; }
.fd-bme .fd-primary { margin-top: 10px; }
.fd-bhead { font-size: 20px; margin: 6px 0 10px; }
.fd-bown { background: rgba(255, 209, 102, .1); border: 1px solid rgba(255, 209, 102, .45); border-radius: 12px; padding: 8px 12px; font-size: 15px; }   /* a teacher-only board (v1.20) */
/* The teacher's complete board (v1.13): a table, everyone, real names. */
.fd-bscope { margin-left: 10px; }
.fd-lbfull { max-width: 720px; }
.fd-lbfull th.on, .fd-lbfull td.on { color: var(--gold); font-weight: 700; }
.fd-lbfull td.rk { font-weight: 700; width: 46px; white-space: nowrap; }
.fd-lbfull td.rk img { width: 18px; vertical-align: -3px; margin-right: 3px; }
.fd-lbfull td.rk small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.fd-lbfull .av { width: 34px; height: 34px; object-fit: contain; }
.fd-lbfull td.nm { font-weight: 600; }
.fd-lbfull tr.p1 td.rk { color: var(--gold); }
.fd-lbfull tr.zero td { color: var(--muted); }
.fd-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 640px; }
.fd-lb li { display: grid; grid-template-columns: 52px 48px 1fr auto; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 6px 8px;
  animation: fdRowIn .35s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fdRowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fd-lb .rk { position: relative; justify-self: center; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-2); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-lb .rk img { position: absolute; top: -17px; left: 50%; width: 26px; transform: translateX(-50%) rotate(-8deg); }
.fd-lb .p1 .rk, .fd-htlist .p1 .rk { background: radial-gradient(circle at 35% 30%, #fff1b8, #ffd166 55%, #d99a1e); color: #3b2200; }
.fd-lb .p2 .rk, .fd-htlist .p2 .rk { background: radial-gradient(circle at 35% 30%, #ffffff, #c9d3ea 55%, #8d98b5); color: #1b2238; }
.fd-lb .p3 .rk, .fd-htlist .p3 .rk { background: radial-gradient(circle at 35% 30%, #ffd9b8, #e0935a 55%, #a45a26); color: #2b1300; }
.fd-lb .av { width: 44px; height: 44px; object-fit: contain; }
.fd-lb .nm { min-width: 0; font-size: 19px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-lb .nm em { font-style: normal; font-size: 12px; font-weight: 700; background: var(--gold); color: #3b2200;
  border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.fd-lb .st { font-size: 20px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.fd-lb li.me { border: 2px solid var(--gold); background: linear-gradient(90deg, rgba(255, 209, 102, .16), var(--card) 70%); }
.fd-lb li.gap { display: block; padding: 0; background: none; border: 0; text-align: center; color: var(--muted);
  font-size: 22px; line-height: 1; letter-spacing: 6px; }
.fd-bfoot { font-size: 14px; max-width: 640px; }
.fd-bempty { max-width: 640px; text-align: center; padding: 30px 10px; }
.fd-bempty img { width: 90px; height: 90px; object-fit: contain; }
.fd-bempty .fd-primary { display: inline-block; text-decoration: none; margin-top: 6px; }
.fd-bhow { max-width: 640px; }

/* ------------------------------------------------------------ teacher */
.fd-teacher select { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-family: inherit; font-size: 15px; }
.fd-tcards { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 16px; }
.fd-tcards div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; min-width: 150px; }
.fd-tcards b { font-size: 26px; display: block; }
.fd-tcards span { color: var(--muted); font-size: 13px; }
.fd-ttable { width: 100%; border-collapse: collapse; font-size: 14px; }
.fd-ttable th, .fd-ttable td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fd-ttable th { color: var(--muted); font-weight: 600; position: sticky; top: 56px; background: var(--bg-0); }
.fd-ttable tr.click { cursor: pointer; }
.fd-ttable tr.click:hover td { background: rgba(255, 255, 255, .03); }
/* Weekly progress grade (v1.12) - the teacher's benchmarks and the scores they yield. */
.fd-weekly { margin: 6px 0 22px; }
.fd-weekly h3 small { font-weight: 500; font-size: 14px; margin-left: 8px; }
.fd-weekly-ctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 8px; font-size: 14px; }
.fd-weekly-ctl label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.fd-weekly-ctl input, .fd-weekly-ctl select { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 14px; }
.fd-weekly-ctl button { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.fd-weekly-ctl button:hover { border-color: var(--primary); }
.fd-weekly-note { font-size: 13px; margin: 0 0 10px; }
.fd-weekly-table td { font-variant-numeric: tabular-nums; }
.fd-bm-ok   { background: rgba(52, 211, 153, .18); }
.fd-bm-part { background: rgba(255, 209, 102, .16); }
.fd-bm-no   { background: rgba(251, 113, 133, .16); }
.fd-bm-score b { font-size: 16px; }
@media print {
  body.fd-print-weekly > *:not(#fdMain), body.fd-print-weekly #fdMain > .fd-screen:not([data-for="teacher"]),
  body.fd-print-weekly .fd-screenhead, body.fd-print-weekly #tBody > *:not(#tWeekly), body.fd-print-weekly .fd-noprint { display: none !important; }
  body.fd-print-weekly, body.fd-print-weekly #fdMain, body.fd-print-weekly .fd-teacher { background: #fff !important; color: #000 !important; }
  body.fd-print-weekly .fd-weekly .fd-muted { color: #444 !important; }
  body.fd-print-weekly .fd-tcards div { border-color: #bbb; background: #fff; }
  body.fd-print-weekly .fd-ttable { font-size: 12px; color: #000; }
  body.fd-print-weekly .fd-ttable th { position: static; background: #fff; color: #000; border-bottom: 1px solid #000; }
  body.fd-print-weekly .fd-ttable td { border-bottom: 1px solid #ccc; }
  body.fd-print-weekly .fd-bm-ok   { background: #d1fae5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.fd-print-weekly .fd-bm-part { background: #fef3c7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.fd-print-weekly .fd-bm-no   { background: #fee2e2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.fd-chip { display: inline-block; background: rgba(245, 158, 66, .15); border: 1px solid rgba(245, 158, 66, .5); border-radius: 8px; padding: 1px 6px; margin: 1px; font-size: 12px; }
.fd-heat button.h0 { background: #1c2440; color: #56618a; }
.fd-heat button.h1 { background: #3b2f2a; color: #ffd9b3; }
.fd-heat button.h2 { background: #6b3a1f; color: #ffe0c2; }
.fd-heat button.h3 { background: #a4451c; color: #fff; }
.fd-heat button.h4 { background: #e0521f; color: #fff; }
.fd-tabletwrap { overflow-x: auto; }
/* Inside the wrapper the WRAPPER is the scroll container, so a sticky header's
   top: 56px (meant to clear the page nav) pushed the header row 56px down INTO the
   table, under the first row (seen on the teacher's leaderboard, 2026-09-29). The
   wrapper never scrolls vertically, so a 0 offset simply leaves the header in place. */
.fd-tabletwrap .fd-ttable th { top: 0; }
.fd-lbfull td.pd { color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------- modals */
.fd-modal { position: fixed; inset: 0; z-index: 80; background: rgba(4, 7, 18, .72); display: grid; place-items: center; padding: 16px; }
.fd-modalbox { position: relative; background: var(--bg-1); border: 1px solid var(--line); border-radius: 24px; padding: 22px;
  width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.fd-modalbox h2 { margin: 0 0 10px; font-size: 26px; padding-right: 36px; }
.fd-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 18px; }
.fd-modalbox p, .fd-modalbox li { font-size: 17px; line-height: 1.5; }
.fd-setrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fd-setrow small { display: block; color: var(--muted); font-size: 13px; }
.fd-factlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fd-factlist span { border-radius: 8px; padding: 3px 8px; font-size: 15px; font-weight: 600; color: #0b1020; }
.fd-factlist .s0 { background: var(--c0); color: #8f9abc; } .fd-factlist .s1 { background: var(--c1); }
.fd-factlist .s2 { background: var(--c2); color: #fff; } .fd-factlist .s3 { background: var(--c3); } .fd-factlist .s4 { background: var(--c4); }

/* ------------------------------------------------------------ dragon duel (v1.16) */
.fd-dhow { padding-left: 18px; margin: 8px 0; }
.fd-dhow li { margin: 4px 0; }
.fd-dlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }
.fd-dmate { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px 8px 8px; }
.fd-dmate img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.fd-dmate b { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
.fd-dmate .fd-primary { padding: 8px 14px; font-size: 16px; }
.fd-dmate .fd-primary:disabled { opacity: .45; cursor: default; }
.fd-dinvite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(255, 209, 102, .12); border: 2px solid var(--gold);
  border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; }
.fd-dinvite.out { background: var(--card); border-color: var(--line); }
.fd-dinvite img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.fd-dinvite div { flex: 1 1 160px; min-width: 0; }
.fd-dinvite b { display: block; font-size: 19px; }
.fd-dinvite small { color: var(--muted); font-size: 14px; }
.fd-dscore { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fd-dside { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; }
.fd-dside.them { justify-content: flex-end; }
.fd-dside img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.fd-dside span { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fd-dside b { font-size: 34px; color: var(--gold); min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; flex: none; }
.fd-dvs { color: var(--muted); font-weight: 700; flex: none; }
.fd-ddots { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin: 4px 0 10px; }
.fd-ddots i { width: 14px; height: 14px; border-radius: 50%; background: var(--card-2); border: 2px solid var(--line); }
.fd-ddots i.them { border-radius: 4px; }
.fd-ddots i.ok { background: var(--go); border-color: var(--go); }
.fd-ddots i.ok.bn { background: var(--gold); border-color: var(--gold); }
.fd-ddots i.no, .fd-ddots i.miss { background: var(--bad); border-color: var(--bad); }
.fd-ddots i.now { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56, 189, 248, .3); }
.fd-dclock { margin-bottom: 10px; }
.fd-dclock i { transition: none; width: 0; background: linear-gradient(90deg, var(--primary), var(--go)); }
.fd-dclock.low i { background: linear-gradient(90deg, #f59e42, var(--bad)); }
.fd-dcard { min-height: 240px; margin-bottom: 14px; }
.fd-dcard.mine { border-color: var(--primary); }
.fd-dcard.theirs .fd-badge { color: var(--ink); font-size: 18px; }
.fd-dthink { width: 110px; height: 110px; object-fit: contain; animation: fdDthink 1.6s ease-in-out infinite; }
@keyframes fdDthink { 50% { transform: translateY(-8px) rotate(-3deg); } }
.fd-dflash { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 6px 14px; border-radius: 999px;
  font-size: 18px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-dflash.show { opacity: 1; }
.fd-dflash.ok { background: rgba(52, 211, 153, .18); color: var(--go); }
.fd-dflash.no { background: rgba(251, 113, 133, .16); color: var(--bad); }
.fd-duel .fd-pad { max-width: 420px; margin: 0 auto; }
.fd-duel .fd-pad.off { opacity: .35; pointer-events: none; }
.fd-dsum { text-align: center; }
.fd-drecord { display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 15px; }   /* v1.28 */
.fd-dsum .fd-drecord { margin-top: 4px; }

/* ------------------------------------------------------------ 🎃 limited-edition event (v1.31) */
.fd-event { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 14px; padding: 10px 14px; text-align: left; color: var(--ink);
  background: linear-gradient(90deg, rgba(255, 138, 61, .22), rgba(155, 123, 255, .18)); border: 2px solid rgba(255, 138, 61, .55); border-radius: 18px; cursor: pointer; }
.fd-event img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.fd-event b { display: block; font-size: 18px; }
.fd-event small { display: block; color: var(--muted); font-size: 14px; }
.fd-event .fd-hwline { color: var(--gold); font-weight: 600; margin-top: 2px; }
.fd-ltd h3 { color: #ffb36b; }
.fd-dcard.ltd { border-color: rgba(255, 138, 61, .7); background: linear-gradient(180deg, rgba(255, 138, 61, .18), var(--card)); }
.fd-hwlist { text-align: left; list-style: none; padding: 0; margin: 10px auto; max-width: 460px; }
.fd-hwlist li { padding: 8px 10px; margin: 6px 0; border-radius: 12px; background: var(--card-2); }
.fd-hwlist li.ok { background: rgba(52, 211, 153, .16); }
.fd-hwsec h3 { color: #ffb36b; }
.fd-item.ev { border-color: rgba(255, 138, 61, .7); }
/* Moonhollow treasures — earned with the milestone dragons (v1.48) */
.fd-mssec h3 { color: #c9b5ff; }
.fd-item.ms { border-color: rgba(201, 181, 255, .6); background: linear-gradient(180deg, #262046, var(--card)); }
.fd-item.ms .fd-daytag { background: #4b3d8f; color: #efe9ff; }
.fd-item.ms.has .fd-daytag { background: #c9b5ff; color: #241a4d; }
.fd-item.ms.locked > img { filter: brightness(0) opacity(.5) drop-shadow(0 0 3px rgba(0, 0, 0, .8)); }
.fd-item.ms .need { line-height: 1.3; }

/* ------------------------------------------------------------ dragon maps (v1.37) */
.fd-mapbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.fd-mapbar .fd-ghost { padding: 8px 16px; font-size: 16px; }
.fd-mapbar span { font-size: 14px; }
.fd-map { position: relative; aspect-ratio: 1 / 1; max-width: 640px; margin: 0 auto; border-radius: 22px; overflow: hidden; border: 2px solid var(--line);
  background-image: url("art/scenes/world.jpg"); background-size: 200% 200%; background-repeat: no-repeat; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.fd-map.world { background-size: 100% 100%; background-position: 0 0; max-width: 960px; }
.fd-pin { position: absolute; width: 13%; transform: translate(-50%, -62%); background: transparent; border: 0; padding: 0; color: #fff;
  text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.fd-pin img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)); transition: transform .15s; }
.fd-pin:hover img, .fd-pin:focus-visible img { transform: translateY(-4px) scale(1.08); }
.fd-pin:focus { outline: none; }
.fd-pin:focus-visible img { outline: 3px dashed var(--gold); outline-offset: 2px; border-radius: 12px; }
.fd-pin b { font-size: clamp(9px, 1.7vw, 14px); font-weight: 700; line-height: 1.1; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, .9); white-space: nowrap; }
.fd-pin .fd-dmeter { width: 80%; height: 5px; margin-top: 2px; background: rgba(0, 0, 0, .45); }
.fd-lv { font-style: normal; font-weight: 800; font-size: .78em; color: #1b2340; background: var(--gold); border-radius: 999px; padding: 0 5px; margin-left: 3px; text-shadow: none; white-space: nowrap; }   /* the level badge (v1.79) */
.fd-lvbox { margin: 8px auto 6px; max-width: 46ch; text-align: center; }
.fd-lvbox b { display: block; font-size: 18px; margin-bottom: 4px; color: var(--gold); }
.fd-lvbox .fd-bar { height: 10px; margin: 0 0 5px; }
.fd-lvbox small { display: block; line-height: 1.35; }
.fd-pin.locked img, .fd-pin.asleep img { filter: brightness(0) opacity(.55) drop-shadow(0 0 4px rgba(0, 0, 0, .8)); }
.fd-pin.locked b { color: #cbd2ea; opacity: .85; }
.fd-pin.egg img { filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)) brightness(.92); }
.fd-pin.legend img { filter: drop-shadow(0 0 10px rgba(255, 220, 120, .95)); }
.fd-pin.guardian { width: 34%; z-index: 1; }                                        /* 2× (v1.69, Tan); behind the dragons it now overlaps (v1.70) */
.fd-pin[data-cid], .fd-pin.special { z-index: 2; }
.fd-pin.guardian.awake img { filter: drop-shadow(0 0 14px rgba(255, 220, 120, 1)); animation: fdGuard 2.4s ease-in-out infinite; }
@keyframes fdGuard { 50% { transform: translateY(-5px); } }
.fd-map.world .fd-pin { width: 6.5%; }
.fd-map.world .fd-pin.guardian { width: 17%; }
.fd-maplabel { position: absolute; background: rgba(8, 12, 26, .62); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 6px 10px; pointer-events: none; }
.fd-maplabel b { display: block; font-size: clamp(12px, 2vw, 20px); text-shadow: 0 2px 6px #000; }
.fd-maplabel small { color: #e6ebff; font-size: clamp(9px, 1.3vw, 13px); }
.fd-mapnote { font-size: 14px; margin: 8px 2px 0; }
/* Moonhollow — special dragons (v1.46) */
.fd-special h3 { color: #c9b5ff; }
.fd-map.special { background-size: 100% 100%; background-position: 0 0; border-color: rgba(201, 181, 255, .5); }
.fd-map.special .fd-pin { width: 11.5%; }
.fd-mapcorner { position: absolute; left: 0; bottom: 0; width: 55%; height: auto; pointer-events: none; }
.fd-pin.special small { display: block; font-size: clamp(8px, 1.4vw, 12px); color: #ffe9a8; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, .9); white-space: nowrap; line-height: 1.1; }
.fd-pin.special.locked img { filter: brightness(0) opacity(.6) drop-shadow(0 0 4px rgba(0, 0, 0, .8)); }
.fd-pin.special.locked b { color: #d9d0ff; }
.fd-pin.special.owned img { filter: drop-shadow(0 0 10px rgba(201, 181, 255, .9)); }
@media (max-width: 520px) { .fd-pin.special b, .fd-pin.special small { display: none; } }
.fd-sdragon.shadow { filter: brightness(0) opacity(.45); }
@media (max-width: 520px) { .fd-pin b { display: none; } .fd-pin .fd-dmeter { display: none; } .fd-pin { width: 15%; } .fd-pin.guardian { width: 40%; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .fd-stage { grid-template-columns: 1fr; }
  .fd-companion { display: none; }
  .fd-pad { max-width: 420px; margin: 0 auto; width: 100%; }
  .fd-card { min-height: 230px; }
  .fd-htlist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fd-hero { grid-template-columns: 1fr; padding: 18px; }
  .fd-realms { grid-template-columns: 1fr; }
  .fd-realm.moon { min-height: 170px; }                                   /* phones: one column, Moonhollow last, full width */
  .fd-realm.moon .fd-eggs img { width: 38px; height: 38px; }
  .fd-classgoal { grid-template-columns: 1fr; }
  .fd-htlist { grid-template-columns: 1fr; gap: 8px; }                  /* phones: one row per keeper, names readable */
  .fd-htlist li { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 6px 14px 6px 10px; }
  .fd-htlist .av { grid-row: 1; width: 40px; height: 40px; }
  .fd-htlist .nm { grid-row: 1; align-self: center; font-size: 17px; }
  .fd-htlist .st { grid-column: 3; grid-row: 1; align-self: center; font-size: 17px; }
  .fd-who { display: none; }
  .fd-pad button { height: 60px; }
  .fd-answer { font-size: 46px; min-height: 70px; }
  .fd-dside img { width: 38px; height: 38px; }
  .fd-dside b { font-size: 28px; }
  .fd-dside span { font-size: 15px; }
  .fd-ddots { gap: 4px; }
  .fd-ddots i { width: 11px; height: 11px; }                          /* all 20 turns on one row */
  .fd-dcard { min-height: 200px; }
}
@media (max-width: 420px) {
  .fd-nav { gap: 6px; padding: 6px 10px; }
  .fd-brand img { height: 36px; }
  .fd-brand span { font-size: 15px; }
  .fd-navbtn { padding: 6px 10px; font-size: 13px; }
  .fd-seg { display: flex; flex-wrap: wrap; max-width: 100%; border-radius: 18px; }
  .fd-seg button { padding: 6px 10px; font-size: 15px; }
  .fd-stat span { display: none; }
  .fd-factgrid button { width: 34px; height: 30px; font-size: 10px; }
  .fd-bme { padding: 12px; gap: 10px; }
  .fd-bme-av { width: 60px; height: 60px; }
  .fd-bme-rank { font-size: 32px; }
  .fd-lb li { grid-template-columns: 40px 36px 1fr auto; gap: 8px; padding: 6px 10px 6px 6px; }
  .fd-lb .av { width: 34px; height: 34px; }
  .fd-lb .nm { font-size: 17px; }
}

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fd-cele .fd-evo img.from { display: none; }
  .fd-cele .fd-evo img.to { opacity: 1; }
}
body.fd-still *, body.fd-still *::before, body.fd-still *::after { animation: none !important; transition: none !important; }
body.fd-still .fd-cele .fd-evo img.from { display: none; }
body.fd-still .fd-cele .fd-evo img.to { opacity: 1; }

/* ================================================================ ROBO DRAGON (v1.59) */
.fd-rhp { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 8px; font-weight: 800; font-size: 18px; }
.fd-rhpbar { height: 30px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(8, 12, 26, .9); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 14px rgba(34, 211, 238, .35); }   /* big and bright (v1.67, Tan) */
.fd-rhpbar i { background: linear-gradient(180deg, #67e8f9, #06b6d4 55%, #0e7490); transition: width .5s; box-shadow: 0 0 10px rgba(34, 211, 238, .8); }
.fd-rhpbar.low i { background: linear-gradient(180deg, #fde68a, #f59e42 55%, #c2410c); box-shadow: 0 0 10px rgba(245, 158, 66, .8); }
.fd-rhpbar.last i { background: linear-gradient(180deg, #fecaca, var(--bad) 55%, #9f1239); box-shadow: 0 0 12px rgba(251, 113, 133, .9); }
.fd-rhp b { font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: right; font-size: 24px; color: #a5f3fc; text-shadow: 0 1px 3px #000; }
@media (max-width: 520px) { .fd-realm img.fd-rguard { width: 96px; height: 96px; } .fd-realm.guarded h3, .fd-realm.guarded .fd-op { max-width: calc(100% - 100px); } .fd-rhp { font-size: 15px; gap: 8px; } .fd-rhp b { font-size: 20px; min-width: 4.5em; } .fd-rhpbar { height: 24px; } }
.fd-rscene { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; border: 2px solid rgba(34, 211, 238, .35);
  background: url(art/scenes/arena.jpg) center 60% / cover no-repeat; isolation: isolate; }
.fd-rscene.shake { animation: fdShake .5s; }
@keyframes fdShake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 3px); } 80% { transform: translate(4px, -2px); } }
.fd-rboss { position: absolute; left: 50%; top: 56%; width: 30%; transform: translate(-50%, -50%); z-index: 5; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); transition: transform .2s; }
.fd-rboss.charge { animation: fdCharge .6s ease-in-out infinite alternate; filter: drop-shadow(0 0 18px rgba(34, 211, 238, .9)); }
@keyframes fdCharge { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.06); } }
.fd-rboss.hit { animation: fdHit .5s; }
@keyframes fdHit { 0% { transform: translate(-50%, -50%) rotate(0); } 25% { transform: translate(-48%, -52%) rotate(-5deg); } 75% { transform: translate(-52%, -49%) rotate(4deg); } 100% { transform: translate(-50%, -50%); } }
.fd-rwave { position: absolute; left: 50%; top: 56%; width: 10%; aspect-ratio: 1 / 1; border-radius: 50%; border: 6px solid rgba(34, 211, 238, .9); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; z-index: 4; }
.fd-rwave.go { animation: fdWave 1s ease-out; }
@keyframes fdWave { 0% { opacity: 1; width: 10%; } 100% { opacity: 0; width: 130%; } }
.fd-rclock { position: absolute; left: 50%; top: 7%; transform: translateX(-50%); background: rgba(8, 12, 26, .72); border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; padding: 4px 14px; text-align: center; z-index: 6; }
.fd-rclock b { display: block; font-size: clamp(22px, 5vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.fd-rclock small { color: #e6ebff; font-size: clamp(9px, 1.6vw, 13px); }
.fd-rclock.low b { color: #fbbf24; }
.fd-rclock.last b { color: var(--bad); }
.fd-rkeeper { position: absolute; width: 11%; transform: translate(-50%, -100%); text-align: center; color: #fff; z-index: 3; }
.fd-rkeeper img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .6)); }
.fd-rkeeper b { display: block; font-size: clamp(8px, 1.5vw, 13px); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, .9); }
.fd-rkeeper small { display: block; font-size: clamp(8px, 1.5vw, 13px); color: #ff8aa0; letter-spacing: 1px; text-shadow: 0 1px 2px #000; }
.fd-rkeeper.me b { color: var(--gold); }
.fd-rkeeper.out img { filter: grayscale(1) brightness(.5) drop-shadow(0 4px 5px rgba(0, 0, 0, .6)); }
.fd-rkeeper i { position: absolute; right: -2px; top: 0; width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 14px; line-height: 22px; font-weight: 800; display: none; }
.fd-rkeeper i.ok { display: block; background: var(--go); color: #06281a; }
.fd-rkeeper i.no { display: block; background: var(--bad); color: #fff; }
.fd-rlog { margin: 10px 0 8px; min-height: 22px; text-align: center; font-weight: 600; }
.fd-rlog .hit { color: #22d3ee; } .fd-rlog .miss { color: var(--bad); } .fd-rlog small { display: block; color: var(--muted); font-weight: 400; }
.fd-rcard.waiting { opacity: .9; }
/* ONE SCREEN (v1.66, Tan: "students have to scroll down to see the question"): the arena on the
   left, the question + keypad on the right; on a phone the arena is short enough for the card
   and a compact keypad to sit under it without scrolling. */
.fd-rgrid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 14px; align-items: start; }
.fd-rgrid[hidden] { display: none; }
.fd-rleft { min-width: 0; }
.fd-rright { min-width: 0; position: sticky; top: 8px; }
.fd-rright .fd-rcard { margin-bottom: 10px; }
.fd-rright .fd-rcard .fd-prob { font-size: clamp(34px, 5vw, 56px); }
.fd-rscene { max-height: calc(100vh - 230px); min-height: 260px; }
.fd-robo .fd-pad { max-width: 420px; margin: 0 auto; }
.fd-robo .fd-pad button { height: 54px; font-size: 24px; }
@media (max-width: 760px) {
  .fd-rgrid { grid-template-columns: 1fr; gap: 8px; }
  .fd-rright { position: static; }
  .fd-rscene { aspect-ratio: 16 / 10; max-height: 36vh; min-height: 180px; }
  .fd-rhp { margin-bottom: 4px; }
  .fd-rlog { margin: 4px 0; min-height: 0; font-size: 14px; }
  .fd-rright .fd-rcard { min-height: 0; padding: 8px 10px; margin-bottom: 6px; }
  .fd-rright .fd-rcard .fd-prob { font-size: 34px; }
  .fd-rright .fd-rcard .fd-answer { min-height: 40px; font-size: 26px; }
  .fd-robo .fd-pad { gap: 6px; }
  .fd-robo .fd-pad button { height: 42px; font-size: 20px; }
  .fd-robo .fd-row { margin-top: 4px; }
}
.fd-robo .fd-pad.off { opacity: .35; pointer-events: none; }
.fd-rhow li { margin: 4px 0; }
.fd-rsum img { width: 220px; max-width: 70%; }
@media (max-width: 520px) { .fd-rkeeper { width: 14%; } .fd-rboss { width: 36%; } }

/* ================================================================ two-player DRAGON RACE (v1.74) */
.fd-dmate { flex-wrap: wrap; }                                   /* two buttons (⚔ Duel · 🏁 Race) wrap under the name (v1.75) */
.fd-dmate .fd-primary { flex: 1 1 42%; white-space: nowrap; }
.fd-rrinvite { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fd-rrinvite small { flex: 1 1 260px; }
.fd-rrtrack { border-radius: 18px; overflow: hidden; border: 2px solid var(--line); background: linear-gradient(180deg, #2b3a2e, #1d2a20); padding: 6px 0; margin-bottom: 8px; }
.fd-rrlane { position: relative; height: 88px; margin: 4px 8px; border-radius: 12px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 40px, rgba(255, 255, 255, 0) 40px 80px), linear-gradient(180deg, #5b4a35, #4a3a28); }
.fd-rrlane::after { content: ""; position: absolute; right: 6%; top: 6px; bottom: 6px; width: 6px; border-radius: 3px;
  background: repeating-linear-gradient(180deg, #fff 0 8px, #111 8px 16px); }
.fd-rrlane img { position: absolute; left: 4%; bottom: 4px; width: 84px; height: 84px; object-fit: contain; transform: translateX(-30%) scaleX(-1);
  transition: left .35s ease-out; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)); }
.fd-rrlane.me img { filter: drop-shadow(0 0 10px rgba(255, 220, 120, .9)); }
.fd-rrlane b { position: absolute; left: 10px; top: 6px; font-size: 14px; color: #fff; text-shadow: 0 1px 3px #000; background: rgba(0, 0, 0, .35); padding: 1px 8px; border-radius: 999px; }
.fd-rrlane.me b { color: var(--gold); }
.fd-rrlane .fd-rrflag { position: absolute; right: 1.5%; top: 4px; font-style: normal; font-size: 26px; }
.fd-rrlane img.hop { animation: fdRrHop .3s; }
@keyframes fdRrHop { 0% { bottom: 4px; } 50% { bottom: 18px; } 100% { bottom: 4px; } }
.fd-rrhud { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 8px; font-weight: 700; }
.fd-rrhud b { font-variant-numeric: tabular-nums; font-size: 22px; min-width: 2em; text-align: right; }
.fd-rrhud .fd-dclock { margin: 0; }
@media (max-width: 520px) { .fd-rrlane { height: 64px; } .fd-rrlane img { width: 60px; height: 60px; } }

/* ================================================================ ZENITH, the Guardian of Guardians (v1.76) */
.fd-train.fd-ult { margin-bottom: 10px; background: linear-gradient(135deg, #fff3c4, #ffd166 45%, #f3e8ff); border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 0 22px rgba(255, 209, 102, .55); }
.fd-train.fd-ult[hidden] { display: none; }
.fd-train.fd-ult small { display: block; }
.fd-ultpanel h3 { color: #ffe9a8; }
.fd-ultcard { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; color: var(--ink); background: linear-gradient(135deg, #2a2450, var(--card)); border: 2px solid rgba(255, 209, 102, .55); border-radius: 20px; padding: 12px 16px; margin-bottom: 8px; }
.fd-ultcard img { width: 120px; height: 120px; object-fit: contain; flex: none; filter: drop-shadow(0 0 14px rgba(255, 220, 120, .9)); }
.fd-ultcard img.shadow { filter: brightness(0) opacity(.45); }
.fd-ultcard div { flex: 1; min-width: 0; }
.fd-ultcard b { font-size: 22px; }
.fd-ultcard p { margin: 4px 0 6px; }
.fd-ultcard .fd-bar { margin-bottom: 6px; }
.fd-ultpanel.locked .fd-ultcard { opacity: .8; }
@media (max-width: 520px) { .fd-ultcard { gap: 10px; } .fd-ultcard img { width: 84px; height: 84px; } .fd-ultcard b { font-size: 18px; } }
