*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --night-0: #07081a;
  --night-1: #0b0d1c;
  --night-2: #12152b;
  --stone-1: #191d36;
  --stone-2: #222745;
  --stone-3: #2f355c;
  --stone-4: #434a7a;
  --rim: rgba(232, 176, 75, 0.16);
  --rim-strong: rgba(232, 176, 75, 0.38);
  --line: rgba(255, 255, 255, 0.07);

  --gold: #e8b04b;
  --gold-bright: #f6cf7a;
  --gold-deep: #a8731f;
  --parch: #f5ead0;
  --parch-2: #eadbb4;
  --parch-3: #d9c393;
  --ink: #2b1e10;
  --ink-soft: #5d4831;
  --crimson: #b3263e;
  --crimson-bright: #e0485f;
  --ember: #f07b2c;
  --emerald: #3fa877;
  --sapphire: #4d7fe0;
  --violet: #8b6fd6;

  --text: #efe8d6;
  --muted: #aaa3bd;
  --dim: #6f6988;

  --f-display: "Cinzel", "Times New Roman", serif;
  --f-deco: "Cinzel Decorative", "Cinzel", serif;
  --f-body: "Alegreya Sans", "Segoe UI", sans-serif;
  --f-read: "Alegreya", Georgia, serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  --f-script: "Pinyon Script", cursive;

  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --top: 72px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

html { scroll-behavior: smooth; }
body {
  overflow-x: clip;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--night-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-bright); }
button, input { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; top: -60px; left: 12px; z-index: 5000; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }

.sky {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #1f2450 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 15%, rgba(232, 176, 75, 0.08), transparent 70%),
    linear-gradient(180deg, #0d1030 0%, #0b0d1c 45%, #07081a 100%);
}
.stars { position: absolute; inset: 0; background-repeat: repeat; }
.stars.s1 {
  background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 80px, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 200px 150px, #f6e7bd 50%, transparent 51%),
    radial-gradient(1px 1px at 280px 40px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 330px 200px, #fff 50%, transparent 51%);
  background-size: 360px 260px;
  opacity: 0.55;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.stars.s2 {
  background-image:
    radial-gradient(1.6px 1.6px at 60px 120px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 180px 20px, #cfd8ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 260px 230px, #fff 50%, transparent 51%);
  background-size: 300px 300px;
  opacity: 0.35;
  animation: twinkle 9s ease-in-out infinite alternate-reverse;
}
@keyframes twinkle { to { opacity: 0.15; } }
#emberCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

.topbar {
  position: sticky; top: 0; z-index: 1000; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 max(18px, 3.5vw);
  background: linear-gradient(180deg, rgba(11, 13, 28, 0.96), rgba(11, 13, 28, 0.84));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rim);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 6px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(232, 176, 75, 0.25), transparent);
  filter: blur(4px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-crest { width: 42px; height: 42px; filter: drop-shadow(0 0 10px rgba(232, 176, 75, 0.35)); transition: transform 0.5s var(--spring); }
.brand:hover .brand-crest { transform: rotate(-8deg) scale(1.08); }
.brand-words { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: 1.5px; color: var(--gold-bright); }
.brand-tag { font-size: 12px; color: var(--muted); letter-spacing: 0.3px; }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px;
  padding: 8px 14px; border-radius: 10px; transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.active { color: var(--gold-bright); }
.nav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg);
  background: var(--gold); box-shadow: 0 0 10px var(--gold);
}

.hud { display: flex; align-items: center; gap: 10px; }
.purse {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  padding: 5px 14px 5px 6px; border-radius: 999px;
  background: linear-gradient(180deg, var(--stone-2), var(--stone-1));
  border: 1px solid var(--rim-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.3s var(--spring), box-shadow 0.3s;
}
.purse.bump { transform: scale(1.1); box-shadow: 0 0 24px rgba(232, 176, 75, 0.55); }
.purse-text { display: flex; flex-direction: column; line-height: 1.05; }
.purse-text strong { font-family: var(--f-display); font-size: 17px; color: var(--gold-bright); }
.purse-text small { font-size: 11px; color: var(--muted); letter-spacing: 0.4px; }
.coin {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff1c2 0 12%, #f6cf7a 30%, #d79a2c 70%, #9b6616 100%);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 0 10px rgba(232, 176, 75, 0.4);
}
.coin::after { content: "N"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 14px; color: #8a5a12; }
.coin.big { width: 54px; height: 54px; }
.coin.big::after { font-size: 24px; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; border-radius: 12px;
  background: var(--stone-1); border: 1px solid var(--line); color: var(--muted); transition: all 0.2s;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--gold-bright); border-color: var(--rim-strong); }
.settings { position: relative; }
.settings-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 300px; padding: 8px;
  background: var(--stone-1); border: 1px solid var(--rim-strong); border-radius: 14px; box-shadow: var(--shadow);
  animation: pop 0.2s var(--ease);
}
.settings-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: 15px; color: var(--text); }
.settings-menu button:hover { background: rgba(255, 255, 255, 0.05); }
.settings-menu .danger { color: var(--crimson-bright); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }

main { flex: 1; outline: none; position: relative; z-index: 1; }
.wrap { width: min(1200px, 92%); margin: 0 auto; }
.view { display: none; padding: 44px 0 80px; }
.view.active { display: block; animation: viewIn 0.5s var(--ease); }
@keyframes viewIn { from { opacity: 0; } }
.section { margin-top: 90px; }
.section-head { margin-bottom: 34px; max-width: 760px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.15; color: var(--parch); margin: 6px 0 10px; }
.section-head p { color: var(--muted); font-size: 18px; }
.center { text-align: center; }
.eyebrow { font-family: var(--f-display); font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.eyebrow.ember { color: var(--ember); }
.panel {
  position: relative; border-radius: var(--r); padding: 26px;
  background: linear-gradient(180deg, rgba(34, 39, 69, 0.92), rgba(25, 29, 54, 0.94));
  border: 1px solid var(--rim);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold); opacity: 0.55; pointer-events: none;
}
.panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.meter { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); box-shadow: 0 0 12px rgba(232, 176, 75, 0.6); transition: width 0.8s var(--ease); }
.hud-label { display: block; font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: 1px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.25s var(--spring), box-shadow 0.25s, filter 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  color: #2a1a05;
  background: linear-gradient(180deg, #f9dc92 0%, #e8b04b 48%, #c48a2b 100%);
  border-color: #fbe3a6;
  box-shadow: 0 6px 0 #7d5212, 0 10px 24px rgba(232, 176, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-gold:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-gold:active { transform: translateY(4px); box-shadow: 0 2px 0 #7d5212, 0 6px 14px rgba(232, 176, 75, 0.3); }
.btn-ember { color: #fff; background: linear-gradient(180deg, #ff9a4d, #e2552a 55%, #a8321b); border-color: #ffb07a; box-shadow: 0 6px 0 #6d1f10, 0 10px 30px rgba(240, 123, 44, 0.45); }
.btn-ember:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost { color: var(--parch); background: rgba(255, 255, 255, 0.04); border-color: var(--rim-strong); }
.btn-ghost:hover { background: rgba(232, 176, 75, 0.1); transform: translateY(-2px); }
.btn-lg { font-size: 16px; padding: 15px 28px; }
.btn-sm { font-size: 13px; padding: 8px 14px; }
.btn-block { width: 100%; }
.btn.is-locked { opacity: 0.5; pointer-events: none; filter: grayscale(0.7); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; min-height: calc(100vh - var(--top) - 120px); }
.hero-title { font-family: var(--f-display); font-weight: 900; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.06; color: var(--parch); margin: 14px 0 22px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.hero-title span { background: linear-gradient(90deg, var(--gold-bright), var(--ember)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 19px; color: var(--muted); max-width: 580px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-facts li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rim); background: rgba(25, 29, 54, 0.7); color: var(--muted); font-size: 15px; }
.hero-facts strong { color: var(--gold-bright); font-family: var(--f-display); margin-right: 4px; }
.hero-scene { position: relative; }
.hero-scene::before { content: ""; position: absolute; inset: 10% 5% 0; background: radial-gradient(ellipse at 50% 60%, rgba(232, 176, 75, 0.18), transparent 65%); filter: blur(20px); }
.castle-scene { position: relative; width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6)); }
.flag { transform-box: fill-box; transform-origin: left center; animation: wave 2.2s ease-in-out infinite; }
.flag.f2 { animation-delay: -0.6s; } .flag.f3 { animation-delay: -1.2s; }
@keyframes wave { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(6deg) scaleX(0.92); } }
.win { fill: #f6cf7a; animation: flicker 3s infinite; }
.win.w2 { animation-delay: -1.1s; fill: #f0a94b; } .win.w3 { animation-delay: -2s; }
@keyframes flicker { 0%, 100% { opacity: 0.95; } 40% { opacity: 0.7; } 60% { opacity: 1; } 75% { opacity: 0.8; } }
.flame { fill: #ffb347; transform-box: fill-box; transform-origin: bottom; animation: flame 0.35s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px #ff8a2c); }
.torch.t2 .flame { animation-delay: -0.17s; }
@keyframes flame { from { transform: scaleY(1) scaleX(1); } to { transform: scaleY(1.25) scaleX(0.85); } }
.drawbridge { transform-box: fill-box; transform-origin: bottom center; transition: transform 1.3s cubic-bezier(0.6, 0, 0.3, 1.2); }
.castle-scene.open .drawbridge { transform: scaleY(-0.62); }
.portcullis { transition: transform 1.2s 0.9s var(--ease); }
.castle-scene.open .portcullis { transform: translateY(-70px); }
.ripples { animation: ripple 4s ease-in-out infinite alternate; }
@keyframes ripple { to { transform: translateX(14px); } }

.journey-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.journey-card {
  position: relative; padding: 22px 20px 20px; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(180deg, var(--stone-2), var(--stone-1));
  border: 1px solid var(--line); border-top: 3px solid var(--c);
  transition: transform 0.35s var(--spring), border-color 0.3s, box-shadow 0.3s;
}
.journey-card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--c); }
.journey-card .jc-num { font-family: var(--f-display); font-size: 44px; font-weight: 900; line-height: 1; color: var(--c); opacity: 0.9; }
.journey-card h3 { font-family: var(--f-display); font-size: 18px; margin: 10px 0 6px; color: var(--parch); }
.journey-card p { font-size: 15px; color: var(--muted); }
.journey-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--c); opacity: 0.08; }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 40px; }
.how-card { padding: 26px; border-radius: var(--r); background: rgba(25, 29, 54, 0.75); border: 1px solid var(--rim); }
.how-card h3 { font-family: var(--f-display); font-size: 20px; margin: 14px 0 8px; color: var(--parch); }
.how-card p { color: var(--muted); font-size: 16px; }
.how-ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: rgba(232, 176, 75, 0.12); border: 1px solid var(--rim-strong); }
.how-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--gold-bright); stroke-width: 1.8; stroke-linejoin: round; }
.how-ico.coin-ico { background: radial-gradient(circle at 35% 30%, #fff1c2 0 10%, #f6cf7a 30%, #d79a2c 70%, #9b6616); border: 0; border-radius: 50%; }

.map-head { display: block; }
.map-progress { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; padding: 20px 24px; }
.map-progress > .mp-row:nth-child(1) { order: 1; }
.map-progress > .mp-row:nth-child(3) { order: 2; }
.map-progress > .mp-row:nth-child(3) { border-left: 1px solid var(--line); padding-left: 28px; }
.map-progress > .meter { order: 3; grid-column: 1 / -1; }
.map-progress > #wingProgress { order: 4; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 720px) { .map-progress { grid-template-columns: 1fr; } .map-progress > #wingProgress { grid-template-columns: 1fr; } }
.map-progress { margin-bottom: 34px; display: grid; gap: 12px; }
.mp-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 15px; }
.mp-row strong { font-family: var(--f-display); color: var(--parch); font-size: 18px; }
.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.map-frame {
  position: relative; border-radius: 22px; padding: 10px;
  background: linear-gradient(180deg, #2a2f52, #161a32);
  border: 1px solid var(--rim-strong);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.map-svg svg { width: 100%; height: auto; border-radius: 14px; }
.map-svg .node { cursor: pointer; }
.map-svg .node .hit { fill: transparent; }
.map-svg .node .ring { fill: none; stroke: var(--gold); stroke-width: 3; opacity: 0; }
.map-svg .node.current .ring { opacity: 1; animation: nodePulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nodePulse { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
.map-svg .node .disc { transition: transform 0.3s var(--spring); transform-box: fill-box; transform-origin: center; }
.map-svg .node:hover .disc, .map-svg .node.selected .disc { transform: scale(1.12); }
.map-svg .node.selected .sel { opacity: 1; }
.map-svg .node .sel { opacity: 0; fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 6 5; transition: opacity 0.2s; }
.map-svg .node-label { font-family: var(--f-display); font-weight: 700; font-size: 17px; fill: var(--parch); paint-order: stroke; stroke: #0b0d1c; stroke-width: 5px; stroke-linejoin: round; }
.map-svg .node.locked .node-label { fill: #8d88a6; }
.map-svg .path-base { fill: none; stroke: rgba(246, 207, 122, 0.25); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; }
.map-svg .path-lit { fill: none; stroke: var(--gold-bright); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px #e8b04b); stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: drawPath 2.2s var(--ease) forwards; }
@keyframes drawPath { to { stroke-dashoffset: 0; } }
.map-svg .m-flag { transform-box: fill-box; transform-origin: left center; animation: wave 2.4s ease-in-out infinite; }
.map-svg .m-win { animation: flicker 3s infinite; }
.map-svg .cloud { animation: drift 60s linear infinite; }
.map-svg .cloud.c2 { animation-duration: 90s; animation-delay: -30s; }
@keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(1200px); } }

.room-panel { position: sticky; top: calc(var(--top) + 20px); text-align: left; }
.room-medal {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px;
  font-family: var(--f-display); font-weight: 900; font-size: 26px; color: #1b1205;
  background: radial-gradient(circle at 35% 30%, #fff3cf, var(--c, var(--gold)) 55%, #4a320d 130%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.3), 0 0 0 6px var(--c, var(--gold)), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.room-panel h3 { font-family: var(--f-display); font-size: 26px; color: var(--parch); margin: 4px 0 10px; line-height: 1.2; }
.rp-sub { font-weight: 700; color: var(--gold-bright); font-size: 16px; margin: -4px 0 10px; }
.rp-blurb { color: var(--muted); margin-bottom: 18px; font-size: 16px; }
.rp-steps { list-style: none; display: grid; gap: 8px; margin-bottom: 20px; }
.rp-steps li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.rp-steps .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--stone-4); flex-shrink: 0; display: grid; place-items: center; }
.rp-steps li.done .tick { border-color: var(--emerald); background: var(--emerald); }
.rp-steps li.done .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.rp-hint { font-size: 14px; color: var(--dim); margin-top: 12px; text-align: center; }
.sheet-close { display: none; }

.log-title { font-family: var(--f-display); font-size: 22px; color: var(--parch); margin: 44px 0 16px; }
.quest-log { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.log-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; background: rgba(25, 29, 54, 0.85); border: 1px solid var(--line);
  transition: transform 0.25s var(--spring), border-color 0.2s;
}
.log-item:hover { transform: translateY(-3px); border-color: var(--c); }
.log-item.locked { opacity: 0.55; }
.log-medal { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 15px; color: #1b1205; background: radial-gradient(circle at 35% 30%, #fff3cf, var(--c) 60%, #3a280a 140%); }
.log-item.locked .log-medal { background: var(--stone-3); color: var(--muted); }
.log-body { flex: 1; min-width: 0; }
.log-body strong { display: block; font-family: var(--f-display); font-size: 15px; color: var(--parch); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-body small { color: var(--muted); font-size: 13px; }
.log-body .meter { height: 5px; margin-top: 6px; }

#view-chamber { padding-top: 0; }
.chamber-banner {
  position: relative; padding: 30px 0 34px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, #e8b04b) 26%, #151832) 0%, rgba(11, 13, 28, 0) 100%);
  border-bottom: 1px solid var(--rim);
}
.chamber-banner::before {
  content: ""; position: absolute; inset: 0; opacity: 0.12; pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px), linear-gradient(0deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 64px 32px; mask-image: linear-gradient(180deg, #000, transparent);
}
.chamber-banner-inner { position: relative; display: grid; grid-template-columns: auto auto 1fr 260px; gap: 22px; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 10px; text-decoration: none; color: var(--gold-bright); font-weight: 700; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--rim-strong); transition: transform 0.2s; }
.back-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.back-link:hover { transform: translateX(-3px); }
.ch-medal { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 24px; color: #1b1205; background: radial-gradient(circle at 35% 30%, #fff3cf, var(--c) 55%, #3a280a 140%); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--c), 0 0 40px color-mix(in srgb, var(--c) 50%, transparent); }
.ch-titles h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 3.4vw, 40px); color: var(--parch); line-height: 1.1; margin-top: 4px; }
.ch-progress { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }

.chamber-wrap { max-width: 920px; padding-top: 26px; }
.ch-tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 24px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); overflow-x: auto; position: sticky; top: calc(var(--top) + 10px); z-index: 50; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ch-tab { flex: 1; min-width: 120px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; background: none; border: 1px solid transparent; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; transition: all 0.2s; }
.ch-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.ch-tab.active { color: #1b1205; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); box-shadow: 0 4px 14px rgba(232, 176, 75, 0.3); }
.ch-tab .tdot { width: 9px; height: 9px; border-radius: 50%; background: var(--stone-4); flex-shrink: 0; }
.ch-tab.done .tdot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.ch-tab.active .tdot { background: #1b1205; }
.ch-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.parchment {
  position: relative; color: var(--ink); border-radius: 6px; padding: 46px clamp(22px, 5vw, 60px) 50px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.55), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(170, 125, 60, 0.18), transparent 55%),
    linear-gradient(180deg, var(--parch), var(--parch-2));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(150, 100, 40, 0.25);
  animation: unroll 0.7s var(--ease) both;
  transform-origin: top center;
}
.parchment::before, .parchment::after {
  content: ""; position: absolute; left: -14px; right: -14px; height: 26px; border-radius: 14px;
  background: linear-gradient(180deg, #8a5a2b, #5b3a19 60%, #3b250f); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}
.parchment::before { top: -13px; }
.parchment::after { bottom: -13px; }
@keyframes unroll { from { clip-path: inset(0 0 100% 0); opacity: 0.4; } to { clip-path: inset(0 0 -40px 0); opacity: 1; } }
.scroll-kicker { font-family: var(--f-display); font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--crimson); text-transform: uppercase; }
.scroll-title { font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin: 6px 0 20px; color: #2a1708; }
.scroll-body { font-family: var(--f-read); font-size: 19px; line-height: 1.72; }
.scroll-body p { margin-bottom: 16px; }
.scroll-body .lede { font-size: 21px; color: #3d2a14; display: flow-root; }
.scroll-body .lede::first-letter { font-family: var(--f-deco); float: left; font-size: 64px; line-height: 0.85; padding: 6px 10px 0 0; color: var(--crimson); }
.scroll-body h3 { font-family: var(--f-display); font-size: 21px; margin: 26px 0 10px; color: #3a1d0b; }
.scroll-body h4 { font-family: var(--f-display); font-size: 16px; margin-bottom: 6px; color: #3a1d0b; }
.scroll-body strong { color: #1d1206; }
.scroll-body em { color: #5a3a1a; }
.rune-list { padding-left: 26px; margin-bottom: 16px; }
.rune-list li { margin-bottom: 9px; padding-left: 6px; }
.rune-list li::marker { color: var(--crimson); font-family: var(--f-display); font-weight: 700; }
ul.rune-list { list-style: none; padding-left: 4px; }
ul.rune-list li { position: relative; padding-left: 28px; }
ul.rune-list li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 9px; height: 9px; transform: rotate(45deg); background: var(--crimson); }
.callout { margin: 22px 0; padding: 16px 20px; border-radius: 10px; background: rgba(77, 127, 224, 0.1); border: 1px solid rgba(77, 127, 224, 0.35); border-left: 5px solid var(--sapphire); font-family: var(--f-body); font-size: 17px; }
.callout b { display: block; font-family: var(--f-display); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #2b4f9e; margin-bottom: 4px; }
.callout.warn { background: rgba(179, 38, 62, 0.08); border-color: rgba(179, 38, 62, 0.35); border-left-color: var(--crimson); }
.callout.warn b { color: var(--crimson); }
.formula { margin: 18px 0; padding: 16px 20px; border-radius: 10px; background: #2a1d10; color: var(--gold-bright); font-family: var(--f-mono); font-size: 16px; text-align: center; box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); overflow-x: auto; }
.example { margin: 14px 0; padding: 14px 18px; border-radius: 10px; background: rgba(255, 255, 255, 0.5); border: 1px dashed rgba(93, 72, 49, 0.45); font-family: var(--f-body); font-size: 17px; }
.example b { color: #3a1d0b; }
.ok { color: #1f7a4d; font-weight: 800; }
.no { color: var(--crimson); font-weight: 800; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; font-family: var(--f-body); }
.trio > div { padding: 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(93, 72, 49, 0.2); }
.trio p { font-size: 16px; line-height: 1.5; margin: 0; }
.ledger { width: 100%; border-collapse: collapse; margin: 18px 0; font-family: var(--f-body); font-size: 16px; }
.ledger th { text-align: left; font-family: var(--f-display); font-size: 13px; letter-spacing: 1px; color: #fff; background: #5b3a19; padding: 10px 12px; }
.ledger td { padding: 10px 12px; border-bottom: 1px solid rgba(93, 72, 49, 0.25); vertical-align: top; }
.ledger tr:nth-child(even) td { background: rgba(255, 255, 255, 0.35); }
.tier { display: inline-block; padding: 2px 10px; border-radius: 6px; font-weight: 800; font-size: 14px; color: #fff; }
.tier.t1 { background: #8e1b2f; } .tier.t2 { background: #c45a1c; } .tier.t3 { background: #a77c12; } .tier.t4 { background: #2f7d55; }
.quest-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; font-family: var(--f-body); }
.quest-grid.four { grid-template-columns: repeat(4, 1fr); }
.quest-grid > div { padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(93, 72, 49, 0.25); text-align: center; }
.quest-grid b { display: block; font-family: var(--f-deco); font-size: 30px; color: var(--crimson); line-height: 1.1; }
.quest-grid span { font-size: 15px; line-height: 1.4; display: block; }
.vows { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; font-family: var(--f-body); }
.vows > div { padding: 14px 12px; border-radius: 12px; text-align: center; background: linear-gradient(180deg, #7a1c2e, #561322); color: var(--parch); }
.vows b { font-family: var(--f-display); color: var(--gold-bright); font-size: 18px; }
.vows h4 { color: #fff; margin: 4px 0; }
.vows p { font-size: 14px; line-height: 1.4; margin: 0; color: #f0dcc0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 18px; font-family: var(--f-body); }
.two-col > div { padding: 16px; border-radius: 12px; }
.two-col .good { background: rgba(63, 168, 119, 0.15); border: 1px solid rgba(63, 168, 119, 0.5); }
.two-col .bad { background: rgba(179, 38, 62, 0.1); border: 1px solid rgba(179, 38, 62, 0.4); }
.two-col p { font-size: 16px; margin: 0; }

.fig { margin: 24px 0; padding: 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(93, 72, 49, 0.25); }
.fig svg { width: 100%; height: auto; }
.fig figcaption { font-family: var(--f-body); font-size: 15px; font-style: italic; color: var(--ink-soft); text-align: center; margin-top: 10px; }
.f-h { font-family: var(--f-display); font-size: 13px; font-weight: 700; letter-spacing: 1.5px; fill: #7a1c2e; text-anchor: start; }
.fig svg text { font-family: var(--f-body); }
.f-box { fill: #fffaf0; stroke: #5b3a19; stroke-width: 2; }
.f-box.f-gold { fill: #f6d78f; } .f-box.f-crimson { fill: #f0b8c0; stroke: #8e1b2f; }
.f-t { font-size: 16px; font-weight: 700; fill: #2b1e10; text-anchor: middle; }
.f-big { font-size: 26px; }
.f-small { font-size: 13px; fill: #5d4831; text-anchor: middle; }
.f-op { font-size: 26px; font-weight: 700; fill: #5d4831; text-anchor: middle; }
.f-note { font-size: 15px; font-style: italic; fill: #b3263e; font-weight: 700; }
.f-arrow, .f-wire { stroke: #5b3a19; stroke-width: 2.5; fill: none; }
.f-arrowhead { fill: #5b3a19; }
.f-w { font-size: 14px; font-weight: 700; fill: #a8731f; }
.f-node { fill: #fffaf0; stroke: #5b3a19; stroke-width: 2.5; }
.f-node.f-gold { fill: #f6d78f; } .f-node.f-crimson { fill: #e0485f; stroke: #7a1c2e; }
.f-step { stroke: #2f7d55; stroke-width: 3; fill: none; }
.f-curve { fill: none; stroke: #5b3a19; stroke-width: 3; }
.f-dot { fill: #e8b04b; stroke: #5b3a19; stroke-width: 2; }
.f-dot.f-goal { fill: #3fa877; }
.f-steps { stroke: #b3263e; stroke-width: 2; stroke-dasharray: 4 4; fill: none; }
.f-land { fill: #ecd9a8; stroke: #8a5a2b; stroke-width: 2; }
.f-region { stroke-width: 2; stroke-dasharray: 5 4; }
.f-region.r1 { fill: rgba(217, 101, 59, 0.18); stroke: #b4502b; }
.f-region.r2 { fill: rgba(63, 168, 119, 0.18); stroke: #2f7d55; }
.f-region.r3 { fill: rgba(139, 111, 214, 0.18); stroke: #6a52b2; }
.f-region + .f-h, .fig svg .f-h { text-anchor: middle; }
.fig svg text.f-h[x="20"] { text-anchor: start; }
.f-beam { fill: none; stroke: #e8b04b; stroke-linecap: round; opacity: 0.85; }
.f-axis { stroke: #5b3a19; stroke-width: 2; }
.f-bar.b1 { fill: #4d7fe0; } .f-bar.b2 { fill: #b3263e; }
.f-dash { stroke: #a8731f; stroke-width: 2; stroke-dasharray: 6 5; }

.scroll-seal { display: flex; align-items: center; gap: 14px; margin-top: 30px; padding-top: 22px; border-top: 2px dashed rgba(93, 72, 49, 0.3); font-family: var(--f-body); font-size: 16px; color: var(--ink-soft); }
.wax { width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #e0485f, #8e1b2f 70%); color: var(--gold-bright); font-family: var(--f-display); font-weight: 900; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); animation: stamp 0.6s var(--spring) both; }
@keyframes stamp { from { transform: scale(2.4) rotate(-30deg); opacity: 0; } }

.widget { margin: 22px 0; padding: 22px; border-radius: 14px; background: #1c2038; color: var(--text); font-family: var(--f-body); box-shadow: inset 0 0 0 1px rgba(232, 176, 75, 0.3), 0 14px 30px rgba(0, 0, 0, 0.3); }
.widget h4 { font-family: var(--f-display); color: var(--gold-bright); font-size: 15px; letter-spacing: 1px; margin-bottom: 12px; }
.oracle-sentence { font-family: var(--f-read); font-size: 21px; margin-bottom: 14px; color: var(--parch); }
.oracle-sentence .blank { display: inline-block; min-width: 90px; padding: 0 10px; border-bottom: 2px dashed var(--gold); color: var(--gold-bright); text-align: center; transition: all 0.3s; }
.oracle-sentence .blank.filled { animation: popIn 0.5s var(--spring); }
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } }
.oracle-bars { display: grid; gap: 7px; margin: 14px 0; }
.ob-row { display: grid; grid-template-columns: 80px 1fr 56px; gap: 10px; align-items: center; font-size: 15px; }
.ob-track { height: 16px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.ob-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--violet), var(--gold-bright)); transition: width 0.45s var(--ease); }
.ob-row .pct { font-family: var(--f-mono); font-size: 13px; color: var(--muted); text-align: right; }
.slider-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.slider-row input[type="range"] { flex: 1; min-width: 160px; }
input[type="range"] { accent-color: var(--gold); height: 28px; cursor: pointer; }
.qb-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qb-toggle { cursor: pointer; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--rim-strong); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-weight: 700; transition: all 0.2s var(--spring); }
.qb-toggle b { font-family: var(--f-deco); color: var(--gold); margin-right: 4px; }
.qb-toggle.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #1b1205; transform: translateY(-2px); }
.qb-toggle.on b { color: var(--crimson); }
.qb-prompt { padding: 14px 16px; border-radius: 10px; background: #0f1226; border: 1px solid var(--line); font-family: var(--f-mono); font-size: 14px; line-height: 1.65; color: var(--parch); min-height: 70px; }
.qb-prompt .piece { animation: popIn 0.4s var(--spring); }
.qb-prompt .piece.q { color: #f6cf7a; } .qb-prompt .piece.u { color: #8fb3ff; } .qb-prompt .piece.e { color: #b9a6ff; } .qb-prompt .piece.s { color: #7fd8a8; } .qb-prompt .piece.t { color: #ff9a8a; }
.qb-meter { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; color: var(--muted); }
.qb-pips { display: flex; gap: 5px; }
.qb-pips span { width: 26px; height: 10px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); transition: background 0.3s; }
.qb-pips span.on { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

.trial { padding: 30px; border-radius: var(--r); background: linear-gradient(180deg, var(--stone-2), var(--stone-1)); border: 1px solid var(--rim-strong); box-shadow: var(--shadow); animation: viewIn 0.4s var(--ease); }
.trial-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.trial-badge { width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: rgba(240, 123, 44, 0.15); border: 1px solid rgba(240, 123, 44, 0.45); }
.trial-badge svg { width: 26px; height: 26px; fill: none; stroke: var(--ember); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trial-head h2 { font-family: var(--f-display); font-size: 26px; color: var(--parch); line-height: 1.2; }
.trial-head p { color: var(--muted); font-size: 16px; margin-top: 4px; }
.trial-done-banner { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px 18px; border-radius: 12px; background: rgba(63, 168, 119, 0.15); border: 1px solid rgba(63, 168, 119, 0.5); color: #9fe6c1; font-weight: 700; animation: popIn 0.5s var(--spring); }
.trial-done-banner svg { width: 26px; height: 26px; fill: none; stroke: #9fe6c1; stroke-width: 2.6; }
.trial-status { font-size: 15px; color: var(--muted); margin-top: 14px; }

.sort-list { display: grid; gap: 12px; }
.sort-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); transition: all 0.35s var(--ease); }
.sort-item p { font-size: 17px; }
.sort-item .why { grid-column: 1 / -1; font-size: 15px; color: var(--muted); margin-top: -4px; animation: viewIn 0.3s; }
.sort-btns { display: flex; gap: 8px; }
.sort-btn { cursor: pointer; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--rim-strong); background: var(--stone-1); font-weight: 700; font-size: 14px; color: var(--parch); transition: all 0.2s var(--spring); }
.sort-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); }
.sort-btn:disabled { cursor: default; opacity: 0.5; }
.sort-item.right { border-color: rgba(63, 168, 119, 0.6); background: rgba(63, 168, 119, 0.1); }
.sort-item.right .why { color: #9fe6c1; }
.sort-item.right .sort-btn.picked { opacity: 1; background: var(--emerald); color: #fff; border-color: var(--emerald); }
.sort-item.wrong { border-color: rgba(224, 72, 95, 0.6); animation: shake 0.4s; }
.sort-item.wrong .why { color: #ffb3bf; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.forge { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; }
.forge-controls { padding: 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.f-slider { margin-bottom: 14px; }
.f-slider label { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.f-slider label strong { font-family: var(--f-mono); color: var(--gold-bright); }
.f-slider input { width: 100%; }
.visitors { display: grid; gap: 10px; margin-top: 14px; }
.visitor { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; cursor: pointer; text-align: left; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); transition: all 0.25s var(--ease); width: 100%; }
.visitor:hover { border-color: var(--rim-strong); }
.visitor.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.visitor .v-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--stone-3); font-family: var(--f-display); font-weight: 900; color: var(--gold-bright); }
.visitor strong { display: block; font-size: 15px; color: var(--parch); }
.visitor small { font-size: 13px; color: var(--muted); }
.visitor .v-state { font-size: 13px; font-weight: 800; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.v-state.good { background: rgba(63, 168, 119, 0.2); color: #9fe6c1; }
.v-state.bad { background: rgba(224, 72, 95, 0.2); color: #ffb3bf; }
.gate-view { border-radius: 14px; overflow: hidden; background: #0d1028; border: 1px solid var(--line); }
.gate-view svg { width: 100%; height: auto; }
.gate-bridge { transform-box: fill-box; transform-origin: bottom center; transition: transform 0.9s cubic-bezier(0.6, 0, 0.3, 1.25); }
.gate-view.open .gate-bridge { transform: scaleY(-0.55); }
.gate-calc { padding: 14px 16px; font-family: var(--f-mono); font-size: 14px; color: var(--parch); border-top: 1px solid var(--line); }
.gate-calc .res { font-weight: 700; }

.trial-canvas { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--rim-strong); background: #0d1028; touch-action: none; }
.trial-canvas.map { aspect-ratio: 600 / 400; cursor: grab; }
.trial-canvas.range { aspect-ratio: 640 / 300; }
.trial-hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.stat span { display: block; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); font-family: var(--f-display); font-weight: 700; }
.stat strong { font-family: var(--f-mono); font-size: 18px; color: var(--parch); }
.range-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.range-controls .slider-row { flex: 1; }
.lr-tag { font-weight: 800; padding: 3px 10px; border-radius: 7px; font-size: 14px; }
.spark { width: 100%; height: 46px; display: block; }

.council-table { position: relative; padding: 70px 10px 18px; border-radius: 16px; background: radial-gradient(ellipse at 50% 100%, rgba(201, 129, 58, 0.18), transparent 70%), rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.council-tokens { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tok { cursor: pointer; padding: 10px 14px; border-radius: 10px; font-family: var(--f-read); font-size: 19px; background: var(--parch); color: var(--ink); border: 2px solid transparent; transition: transform 0.25s var(--spring), box-shadow 0.25s; }
.tok:hover:not(.focus) { transform: translateY(-4px); }
.tok.focus { background: var(--crimson); color: #fff; cursor: default; box-shadow: 0 0 20px rgba(224, 72, 95, 0.6); }
.tok.wrong { animation: shake 0.4s; border-color: var(--crimson-bright); }
.tok.right { border-color: var(--gold); box-shadow: 0 0 22px rgba(246, 207, 122, 0.8); }
.tok small { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); }
.council-beams { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.council-beams path { fill: none; stroke: var(--gold-bright); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(246, 207, 122, 0.8)); stroke-dasharray: 600; stroke-dashoffset: 600; animation: drawPath 1s var(--ease) forwards; }
.council-q { text-align: center; font-size: 18px; margin: 18px 0 6px; color: var(--parch); }
.council-hint { text-align: center; font-size: 15px; color: var(--muted); min-height: 24px; }
.puzzle-pips { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.puzzle-pips span { width: 34px; height: 8px; border-radius: 4px; background: var(--stone-3); }
.puzzle-pips span.done { background: var(--emerald); } .puzzle-pips span.now { background: var(--gold); }

.seal-scrolls { display: grid; gap: 18px; }
.mini-scroll { position: relative; padding: 22px 24px; border-radius: 10px; color: var(--ink); background: linear-gradient(180deg, var(--parch), var(--parch-2)); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.mini-scroll h4 { font-family: var(--f-display); color: #7a1c2e; font-size: 14px; letter-spacing: 1.5px; margin-bottom: 8px; }
.mini-scroll p { font-family: var(--f-read); font-size: 18px; line-height: 1.7; }
.sent { cursor: pointer; border-radius: 4px; padding: 1px 2px; transition: background 0.2s; }
.sent:hover { background: rgba(232, 176, 75, 0.35); }
.sent.cleared { background: rgba(63, 168, 119, 0.18); cursor: default; }
.sent.forged { background: rgba(179, 38, 62, 0.2); text-decoration: line-through; text-decoration-color: var(--crimson); cursor: default; }
.mini-scroll.solved::after { content: "FORGED"; position: absolute; right: 18px; top: 14px; font-family: var(--f-display); font-weight: 900; letter-spacing: 3px; color: var(--crimson); border: 3px solid var(--crimson); padding: 2px 10px; border-radius: 6px; transform: rotate(8deg); opacity: 0.85; animation: stamp 0.5s var(--spring); }
.seal-note { margin-top: 10px; font-family: var(--f-body); font-size: 15px; padding: 10px 12px; border-radius: 8px; animation: viewIn 0.3s; }
.seal-note.good { background: rgba(179, 38, 62, 0.1); color: #7a1c2e; }
.seal-note.meh { background: rgba(63, 168, 119, 0.14); color: #1f5e3e; }

.court { display: grid; gap: 18px; }
.features { display: flex; flex-wrap: wrap; gap: 10px; }
.feature { cursor: pointer; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--rim-strong); font-weight: 700; color: var(--parch); transition: all 0.25s var(--spring); }
.feature small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.feature:hover:not(:disabled) { transform: translateY(-2px); }
.feature.flagged { background: rgba(179, 38, 62, 0.25); border-color: var(--crimson-bright); text-decoration: line-through; }
.feature.legit { animation: shake 0.4s; border-color: var(--emerald); }
.feature:disabled { cursor: default; }
.villages { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.village { padding: 16px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.village h4 { font-family: var(--f-display); color: var(--parch); display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 10px; }
.village h4 span { font-family: var(--f-mono); color: var(--gold-bright); }
.squires { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.squire { aspect-ratio: 1; border-radius: 6px 6px 50% 50%; background: var(--stone-3); transition: all 0.4s var(--spring); }
.squire.sel { background: var(--c); box-shadow: 0 0 10px var(--c); transform: translateY(-3px); }
.impact { padding: 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.impact-bar { position: relative; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, 0.06); overflow: visible; margin: 10px 0 8px; }
.impact-fill { height: 100%; border-radius: 11px; transition: width 0.6s var(--ease), background 0.4s; }
.impact-line { position: absolute; top: -6px; bottom: -6px; left: 80%; width: 3px; background: var(--gold-bright); border-radius: 2px; }
.impact-line::after { content: "80%"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--gold-bright); font-weight: 800; }
.verdict { font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.verdict.pass { color: #9fe6c1; } .verdict.fail { color: #ffb3bf; }

.quiz { padding: 30px; border-radius: var(--r); background: linear-gradient(180deg, var(--stone-2), var(--stone-1)); border: 1px solid var(--rim-strong); box-shadow: var(--shadow); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.quiz-pips { display: flex; gap: 8px; }
.quiz-pips span { width: 40px; height: 10px; border-radius: 5px; background: var(--stone-3); transition: background 0.3s; }
.quiz-pips span.now { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.quiz-pips span.right { background: var(--emerald); } .quiz-pips span.wrong { background: var(--crimson); }
.quiz-q { font-family: var(--f-display); font-size: clamp(20px, 2.4vw, 25px); color: var(--parch); line-height: 1.35; margin-bottom: 20px; }
.choices { display: grid; gap: 12px; }
.choice { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; cursor: pointer; padding: 15px 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); font-size: 17px; color: var(--text); transition: transform 0.25s var(--spring), border-color 0.2s, background 0.2s; }
.choice:hover:not(:disabled) { transform: translateX(6px); border-color: var(--gold); }
.choice .letter { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; background: var(--stone-3); color: var(--gold-bright); }
.choice:disabled { cursor: default; }
.choice.dim { opacity: 0.45; }
.choice.right { border-color: var(--emerald); background: rgba(63, 168, 119, 0.15); }
.choice.right .letter { background: var(--emerald); color: #fff; }
.choice.wrong { border-color: var(--crimson-bright); background: rgba(179, 38, 62, 0.15); animation: shake 0.4s; }
.choice.wrong .letter { background: var(--crimson); color: #fff; }
.feedback { margin-top: 16px; padding: 14px 18px; border-radius: 12px; font-size: 16px; animation: viewIn 0.3s; }
.feedback.good { background: rgba(63, 168, 119, 0.15); border: 1px solid rgba(63, 168, 119, 0.45); color: #c6f2da; }
.feedback.bad { background: rgba(179, 38, 62, 0.14); border: 1px solid rgba(224, 72, 95, 0.45); color: #ffd1d8; }
.feedback b { font-family: var(--f-display); }
.quiz-foot { display: flex; justify-content: flex-end; margin-top: 18px; }
.result { text-align: center; padding: 20px 0 6px; }
.result-stars { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.result-stars svg { width: 46px; height: 46px; fill: var(--stone-3); }
.result-stars svg.on { fill: var(--gold-bright); filter: drop-shadow(0 0 10px rgba(246, 207, 122, 0.7)); animation: starIn 0.6s var(--spring) both; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.result h2 { font-family: var(--f-display); font-size: 30px; color: var(--parch); margin-bottom: 8px; }
.result p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }

.conquer { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(7, 8, 26, 0.8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: viewIn 0.3s; padding: 20px; }
.conquer-card { text-align: center; max-width: 480px; padding: 40px 30px 34px; border-radius: 22px; background: linear-gradient(180deg, #2a2f52, #161a32); border: 2px solid var(--gold); box-shadow: 0 0 80px rgba(232, 176, 75, 0.35); animation: rise 0.6s var(--spring); }
@keyframes rise { from { transform: translateY(40px) scale(0.9); opacity: 0; } }
.conquer-crest { width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 40px; color: #1b1205; background: radial-gradient(circle at 35% 30%, #fff3cf, var(--c) 55%, #3a280a 140%); box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35), 0 0 0 9px var(--c), 0 0 60px var(--c); animation: stamp 0.8s 0.2s var(--spring) both; }
.conquer-card h2 { font-family: var(--f-display); font-size: 32px; color: var(--gold-bright); }
.conquer-card p { color: var(--muted); margin: 8px 0 22px; }

.dragon-gate { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: center; border-color: rgba(240, 123, 44, 0.4); }
.dg-art svg { width: 100%; height: auto; filter: drop-shadow(0 0 30px rgba(179, 38, 62, 0.6)); animation: hover 4s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-10px); } }
.dg-text h3 { font-family: var(--f-display); font-size: 28px; color: var(--parch); margin-bottom: 8px; }
.dg-text p { color: var(--muted); margin-bottom: 14px; }
.dg-rules { list-style: none; display: grid; gap: 8px; margin-bottom: 18px; }
.dg-rules li { padding-left: 26px; position: relative; color: var(--text); font-size: 16px; }
.dg-rules li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 10px; height: 10px; transform: rotate(45deg); background: var(--ember); }
.toggle { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; cursor: pointer; color: var(--muted); }
.toggle input { width: 20px; height: 20px; accent-color: var(--gold); }

.battle { border-color: rgba(240, 123, 44, 0.4); padding: 22px; }
.battle-hud { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.hud-side.right { text-align: right; flex: 1; max-width: 420px; }
.shields { display: flex; gap: 8px; }
.shield-ico { width: 34px; height: 38px; transition: all 0.4s var(--spring); }
.shield-ico path { fill: var(--sapphire); stroke: #cfdcff; stroke-width: 2; }
.shield-ico.broken { opacity: 0.25; transform: scale(0.8) rotate(-12deg); filter: grayscale(1); }
.hpbar { height: 18px; border-radius: 9px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(224, 72, 95, 0.5); overflow: hidden; }
.hpbar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #7a1c2e, var(--crimson-bright), var(--ember)); box-shadow: 0 0 14px rgba(224, 72, 95, 0.7); transition: width 0.6s var(--ease); }
.arena { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid rgba(240, 123, 44, 0.35); }
#battleCanvas { display: block; width: 100%; aspect-ratio: 900 / 420; background: #0b0d1c; }
.attack-banner { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); max-width: 86%; text-align: center; padding: 10px 20px; border-radius: 12px; background: rgba(11, 13, 28, 0.85); border: 1px solid rgba(240, 123, 44, 0.5); }
.attack-banner span { display: block; font-family: var(--f-display); font-weight: 900; font-size: 18px; color: var(--ember); letter-spacing: 1px; }
.attack-banner small { display: block; font-size: 14px; color: var(--text); }
.attack-banner.flash { animation: bannerIn 0.5s var(--spring); }
@keyframes bannerIn { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }
.timer-ring { position: absolute; right: 14px; bottom: 14px; width: 60px; height: 60px; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-bg { fill: rgba(11, 13, 28, 0.8); stroke: rgba(255, 255, 255, 0.1); stroke-width: 4; }
.tr-fg { fill: none; stroke: var(--gold-bright); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 106.8; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 18px; }
.timer-ring.low .tr-fg { stroke: var(--crimson-bright); }
.streak { position: absolute; left: 14px; bottom: 14px; padding: 6px 14px; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--gold-bright)); color: #1b1205; font-family: var(--f-display); font-weight: 900; animation: popIn 0.4s var(--spring); }
.spell-q { font-family: var(--f-display); font-size: 21px; color: var(--parch); margin: 18px 0 12px; line-height: 1.35; }
.spells { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spell { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px; font-size: 16px; color: var(--text); background: linear-gradient(180deg, rgba(77, 127, 224, 0.12), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(77, 127, 224, 0.4); transition: transform 0.25s var(--spring), box-shadow 0.25s; }
.spell:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 0 22px rgba(77, 127, 224, 0.45); }
.spell .rune { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: rgba(77, 127, 224, 0.25); font-family: var(--f-deco); color: #cfdcff; font-size: 18px; }
.spell:disabled { cursor: default; }
.spell.right { border-color: var(--emerald); background: rgba(63, 168, 119, 0.2); }
.spell.wrong { border-color: var(--crimson-bright); background: rgba(179, 38, 62, 0.2); animation: shake 0.4s; }
.battle-log { margin-top: 14px; min-height: 26px; text-align: center; font-size: 16px; color: var(--muted); }
.battle-log.good { color: #9fe6c1; } .battle-log.bad { color: #ffb3bf; }
.battle-end { text-align: center; padding: 44px 26px; }
.be-icon { width: 120px; height: 120px; margin: 0 auto 18px; animation: stamp 0.8s var(--spring) both; }
.be-icon svg { width: 100%; height: 100%; }
.battle-end h3 { font-family: var(--f-deco); font-size: clamp(30px, 4vw, 44px); color: var(--gold-bright); margin-bottom: 10px; }
.battle-end p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: 18px; }
.arena.shake { animation: shake 0.4s; }

.lex-tools { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 14px; background: var(--stone-1); border: 1px solid var(--rim-strong); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2; }
.search input { flex: 1; background: none; border: 0; padding: 13px 0; font-size: 17px; outline: none; }
.lex-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.lf-btn { cursor: pointer; padding: 8px 12px; border-radius: 10px; background: var(--stone-1); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
.lf-btn.on { background: var(--gold); color: #1b1205; border-color: var(--gold); }
.lex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lex-card { cursor: pointer; text-align: left; width: 100%; padding: 18px; border-radius: 14px; background: linear-gradient(180deg, var(--stone-2), var(--stone-1)); border: 1px solid var(--line); border-left: 4px solid var(--c); transition: transform 0.25s var(--spring), border-color 0.2s; color: var(--text); }
.lex-card:hover { transform: translateY(-3px); }
.lex-card strong { display: block; font-family: var(--f-display); font-size: 17px; color: var(--parch); }
.lex-card small { font-size: 13px; color: var(--muted); }
.lex-card p { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--text); display: none; }
.lex-card.open p { display: block; animation: viewIn 0.3s; }
.lex-card.open { background: linear-gradient(180deg, rgba(232, 176, 75, 0.12), var(--stone-1)); }
.lex-card.open { border-color: var(--rim-strong); }
.lex-empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 30px; }

.honors-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.rank-card { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.rank-card h3 { font-family: var(--f-display); font-size: 28px; color: var(--gold-bright); }
.rank-card p { color: var(--muted); margin-bottom: 10px; }
.rank-seal { width: 92px; height: 92px; }
.rank-gold { text-align: center; display: grid; justify-items: center; gap: 4px; }
.rank-gold strong { font-family: var(--f-display); font-size: 26px; color: var(--gold-bright); }
.rank-gold small { color: var(--muted); }
.crest-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.crest { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 13px; background: var(--stone-1); border: 2px dashed var(--stone-4); color: var(--dim); }
.crest.won { border: 0; color: #1b1205; background: radial-gradient(circle at 35% 30%, #fff3cf, var(--c) 55%, #3a280a 140%); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.sub-title { font-family: var(--f-display); font-size: 24px; color: var(--parch); margin: 40px 0 16px; }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ach { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; background: rgba(25, 29, 54, 0.8); border: 1px solid var(--line); }
.ach-ico { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--stone-3); }
.ach-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--dim); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.ach strong { display: block; font-family: var(--f-display); font-size: 15px; color: var(--muted); }
.ach small { font-size: 14px; color: var(--dim); line-height: 1.35; display: block; }
.ach.won { border-color: var(--rim-strong); background: linear-gradient(180deg, rgba(232, 176, 75, 0.12), rgba(25, 29, 54, 0.85)); }
.ach.won .ach-ico { background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); box-shadow: 0 0 16px rgba(232, 176, 75, 0.5); }
.ach.won .ach-ico svg { stroke: #2a1a05; }
.ach.won strong { color: var(--gold-bright); }
.ach.won small { color: var(--muted); }

.cert-controls { margin-bottom: 20px; }
.cert-controls label { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 1px; color: var(--muted); }
.cert-row { display: flex; gap: 12px; margin: 10px 0 8px; flex-wrap: wrap; }
.cert-row input { flex: 1; min-width: 220px; padding: 13px 16px; border-radius: 12px; background: var(--night-1); border: 1px solid var(--rim-strong); font-size: 18px; }
.cert-note { font-size: 15px; color: var(--muted); }
.cert-stage { position: relative; }
.cert-stage.locked .certificate { filter: blur(3px) grayscale(0.5); opacity: 0.6; }
.cert-lock { display: none; position: absolute; inset: 0; place-items: center; align-content: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 20px; color: var(--parch); text-align: center; padding: 20px; }
.cert-lock svg { width: 54px; height: 54px; fill: none; stroke: var(--gold-bright); stroke-width: 1.8; margin: 0 auto; }
.cert-stage.locked .cert-lock { display: grid; }

.certificate { aspect-ratio: 11 / 8.5; width: 100%; padding: 2.2%; color: var(--ink); border-radius: 4px; background: radial-gradient(ellipse at 50% 40%, #fffaf0, var(--parch) 60%, var(--parch-3)); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); container-type: inline-size; }
.cert-border { position: relative; height: 100%; border: 0.6cqw double #8a5a2b; border-width: 0.9cqw; outline: 0.2cqw solid #a8731f; outline-offset: -1.8cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3cqw 7cqw; }
.cert-corner { position: absolute; width: 6cqw; height: 6cqw; border: 0.35cqw solid #a8731f; }
.cert-corner.tl { top: 2.4cqw; left: 2.4cqw; border-right: 0; border-bottom: 0; }
.cert-corner.tr { top: 2.4cqw; right: 2.4cqw; border-left: 0; border-bottom: 0; }
.cert-corner.bl { bottom: 2.4cqw; left: 2.4cqw; border-right: 0; border-top: 0; }
.cert-corner.br { bottom: 2.4cqw; right: 2.4cqw; border-left: 0; border-top: 0; }
.cert-kicker { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.5cqw; font-size: 1.4cqw; color: #7a1c2e; text-transform: uppercase; }
.cert-title { font-family: var(--f-deco); font-size: 4.6cqw; color: #3a1d0b; line-height: 1.1; margin: 1.2cqw 0 1.6cqw; }
.cert-small { font-family: var(--f-read); font-style: italic; font-size: 1.8cqw; color: var(--ink-soft); }
.cert-name { font-family: var(--f-script); font-size: 6.4cqw; line-height: 1.2; color: #2b1e10; border-bottom: 0.15cqw solid #a8731f; padding: 0 4cqw; margin: 0.6cqw 0 1.4cqw; min-width: 50%; }
.cert-body { font-family: var(--f-read); font-size: 1.7cqw; line-height: 1.55; max-width: 72cqw; color: #3d2a14; }
.cert-stats { display: flex; gap: 6cqw; margin: 2cqw 0 1.2cqw; }
.cert-stats span { display: block; font-family: var(--f-display); font-size: 1.1cqw; letter-spacing: 0.3cqw; color: #7a1c2e; text-transform: uppercase; }
.cert-stats strong { font-family: var(--f-display); font-size: 2.2cqw; color: #2b1e10; }
.cert-foot { display: flex; align-items: flex-end; justify-content: space-between; width: 100%; gap: 3cqw; margin-top: 1cqw; }
.cert-sign { flex: 1; display: grid; justify-items: center; }
.cert-sign .sig { font-family: var(--f-script); font-size: 2.8cqw; color: #2b1e10; }
.cert-sign .line { width: 80%; height: 0.15cqw; background: #5b3a19; margin: 0.3cqw 0; }
.cert-sign small { font-family: var(--f-display); font-size: 1.1cqw; letter-spacing: 0.2cqw; color: #5b3a19; text-transform: uppercase; }
.cert-seal { width: 11cqw; height: 11cqw; filter: drop-shadow(0 0.4cqw 0.6cqw rgba(0, 0, 0, 0.35)); }

.refs-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 22px; align-items: start; }
.ref-h { font-family: var(--f-display); font-size: 19px; color: var(--gold-bright); margin: 6px 0 14px; }
.ref-h ~ .ref-h { margin-top: 28px; }
.doc-links { display: grid; gap: 10px; }
.doc-link { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; text-decoration: none; color: inherit; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); transition: transform 0.2s, border-color 0.2s; }
.doc-link:hover { transform: translateX(4px); border-color: var(--rim-strong); }
.doc-ico { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--crimson); color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.doc-link strong { display: block; color: var(--parch); }
.doc-link small { color: var(--muted); }
.ref-plain { list-style: none; display: grid; gap: 10px; font-size: 16px; }
.ref-plain li { padding-left: 14px; border-left: 2px solid var(--rim-strong); color: var(--text); }
.ref-p { font-size: 16px; color: var(--text); }
.ref-apa { padding-left: 24px; display: grid; gap: 12px; font-size: 15.5px; }
.ref-apa li { padding-left: 6px; line-height: 1.55; }
.ref-apa li::marker { color: var(--dim); }
.ref-apa a { color: #9cb8ff; word-break: break-word; text-decoration: none; }
.ref-apa a:hover { text-decoration: underline; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 4000; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; width: min(360px, calc(100vw - 40px)); padding: 14px 16px; border-radius: 14px; background: #1b1f3a; border: 1px solid var(--rim-strong); box-shadow: var(--shadow); animation: toastIn 0.5s var(--spring); }
.toast.out { animation: toastOut 0.35s ease forwards; }
@keyframes toastIn { from { transform: translateX(60px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(60px); opacity: 0; } }
.toast-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); }
.toast-ico svg { width: 22px; height: 22px; fill: none; stroke: #2a1a05; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.toast.t-bad .toast-ico { background: linear-gradient(180deg, #e0485f, #7a1c2e); }
.toast.t-bad .toast-ico svg { stroke: #fff; }
.toast strong { display: block; font-family: var(--f-display); color: var(--parch); }
.toast p { font-size: 14px; color: var(--muted); }
.fly-coin { position: fixed; z-index: 4500; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff1c2 0 15%, #f6cf7a 35%, #c48a2b 80%); box-shadow: 0 0 8px rgba(246, 207, 122, 0.8); }
.gold-pop { position: fixed; z-index: 4500; pointer-events: none; font-family: var(--f-display); font-weight: 900; font-size: 20px; color: var(--gold-bright); text-shadow: 0 0 10px rgba(232, 176, 75, 0.8), 0 2px 0 #3a280a; animation: goldPop 1.2s var(--ease) forwards; }
@keyframes goldPop { from { transform: translateY(0) scale(0.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-10px) scale(1.15); } to { transform: translateY(-50px) scale(1); opacity: 0; } }
.confetti { position: fixed; z-index: 3500; pointer-events: none; width: 9px; height: 14px; border-radius: 2px; }

.footer { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px max(18px, 3.5vw); border-top: 1px solid var(--rim); background: rgba(7, 8, 26, 0.9); font-size: 14px; color: var(--dim); }
.footer strong { color: var(--muted); font-family: var(--f-display); }
.footer a { text-decoration: none; font-weight: 700; }
.tabbar { display: none; }

.tldr { margin: 0 0 26px; padding: 16px 20px; border-radius: 12px; font-family: var(--f-body); font-size: 18px; line-height: 1.55; color: #3a2610;
  background: linear-gradient(180deg, rgba(246, 207, 122, 0.45), rgba(232, 176, 75, 0.22)); border: 1px solid rgba(168, 115, 31, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.tldr b { display: block; font-family: var(--f-display); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #7a4a0d; margin-bottom: 4px; }
.callout.real { background: rgba(63, 168, 119, 0.1); border-color: rgba(63, 168, 119, 0.45); border-left-color: #2f7d55; }
.callout.real b { color: #1f5e3e; }
.callout .mf { margin: 4px 0 0; font-size: 17px; line-height: 1.5; }
.callout .mf span { font-family: var(--f-display); font-weight: 700; color: var(--crimson); margin-right: 4px; }
.callout .mf + .mf span { color: #1f7a4d; }
details.check { margin: 28px 0 4px; border-radius: 12px; font-family: var(--f-body); background: rgba(77, 127, 224, 0.08); border: 1px solid rgba(77, 127, 224, 0.4); overflow: hidden; }
details.check summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 17px; font-weight: 700; color: #1f3a78; transition: background 0.2s; }
details.check summary::-webkit-details-marker { display: none; }
details.check summary:hover { background: rgba(77, 127, 224, 0.1); }
.ck-ico { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #2b4f9e; color: #fff; font-family: var(--f-display); font-weight: 900; }
.ck-q { flex: 1; }
.ck-tap { flex-shrink: 0; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #fff; background: #2b4f9e; padding: 4px 10px; border-radius: 999px; }
details.check[open] .ck-tap { background: #2f7d55; }
.ck-tap::after { content: "Reveal"; }
details.check[open] .ck-tap::after { content: "✓ Answer"; }
details.check[open] .ck-ico { background: #2f7d55; }
details.check .ans { padding: 2px 18px 16px 60px; font-size: 17px; line-height: 1.6; color: #2b1e10; animation: viewIn 0.3s; }
.timeline { list-style: none; margin: 14px 0 20px; padding-left: 0; position: relative; font-family: var(--f-body); }
.timeline::before { content: ""; position: absolute; left: 52px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(180deg, #a8731f, #7a1c2e); border-radius: 2px; }
.timeline li { display: grid; grid-template-columns: 44px 1fr; gap: 26px; align-items: start; padding: 6px 0; position: relative; }
.timeline li::after { content: ""; position: absolute; left: 47px; top: 13px; width: 13px; height: 13px; border-radius: 50%; background: var(--parch); border: 3px solid #7a1c2e; }
.timeline b { font-family: var(--f-display); font-weight: 900; color: #7a1c2e; font-size: 16px; padding-top: 2px; }
.timeline span { font-size: 17px; line-height: 1.5; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 22px; }
.pcard { padding: 16px 18px; border-radius: 12px; background: #2a1d10; color: var(--parch); font-family: var(--f-mono); font-size: 14px; line-height: 1.6; box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4); }
.pcard span { display: block; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: 1.5px; color: var(--gold-bright); text-transform: uppercase; margin-bottom: 6px; }
.lights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 20px; font-family: var(--f-body); }
.lights > div { padding: 16px; border-radius: 12px; border-top: 6px solid; background: rgba(255, 255, 255, 0.5); }
.lights h4 { margin-bottom: 6px; }
.lights p { font-size: 16px; line-height: 1.5; margin: 0; }
.lights .lg { border-color: #2f7d55; } .lights .lg h4 { color: #1f5e3e; }
.lights .ly { border-color: #d19a1c; } .lights .ly h4 { color: #8a5a0a; }
.lights .lr { border-color: #b3263e; } .lights .lr h4 { color: #8e1b2f; }
.table-wrap { overflow-x: auto; margin: 18px 0; }
.table-wrap .ledger { margin: 0; min-width: 520px; }
.widget-note { font-size: 15px; color: var(--muted); margin: 0 0 12px !important; line-height: 1.5; }
.widget .trial-hud .stat strong { font-size: 15px; }

.journey-grid .wing-block { grid-column: span 2; list-style: none; padding: 20px; border-radius: 20px; background: rgba(25, 29, 54, 0.55); border: 1px solid var(--line); border-top: 3px solid var(--wc); }
.journey-grid .wing-foundations { grid-column: 1 / -1; }
.wing-head { margin-bottom: 16px; }
.wing-num { font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--wc); }
.wing-head h3 { font-family: var(--f-display); font-size: 24px; color: var(--parch); margin: 2px 0 4px; }
.wing-head p { color: var(--muted); font-size: 16px; }
.wing-cards { list-style: none; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 14px; }
.wing-progress { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.wp-row .mp-row { font-size: 14px; }
.wp-row .mp-row strong { font-size: 15px; }
.wp-meter { height: 6px; margin-top: 4px; }
.wp-meter span { background: var(--wc); box-shadow: 0 0 10px var(--wc); }

@media (max-width: 1100px) {
  .nav a { padding: 8px 10px; font-size: 14px; }
  .brand-tag { display: none; }
  .journey-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-grid { grid-template-columns: repeat(3, 1fr); }
  .lex-grid { grid-template-columns: repeat(2, 1fr); }
  .quest-log { grid-template-columns: repeat(2, 1fr); }
  .journey-grid .wing-block { grid-column: 1 / -1; }
  .wing-foundations .wing-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --top: 64px; }
  body { font-size: 16px; }
  .nav { display: none; }
  .hero, .map-head, .map-layout, .forge, .refs-layout, .honors-top, .dragon-gate, .how-grid { grid-template-columns: 1fr; }
  .hero { min-height: 0; gap: 20px; }
  .hero-scene { order: -1; max-width: 520px; margin: 0 auto; width: 100%; }
  .chamber-banner-inner { grid-template-columns: auto 1fr; }
  .chamber-banner-inner .back-link { grid-column: 1 / -1; justify-self: start; }
  .ch-progress { grid-column: 1 / -1; }
  .trio, .two-col, .villages, .pgrid, .lights { grid-template-columns: 1fr; }
  .quest-grid, .vows { grid-template-columns: repeat(2, 1fr); }
  .quest-grid.four { grid-template-columns: repeat(2, 1fr); }
  .spells { grid-template-columns: 1fr; }
  .dg-art { max-width: 200px; margin: 0 auto; }
  .rank-card { grid-template-columns: auto 1fr; }
  .rank-gold { grid-column: 1 / -1; grid-template-columns: auto auto auto; justify-content: start; align-items: center; gap: 10px; }
  .view { padding-bottom: 110px; }
  .footer { padding-bottom: 92px; }
  .toasts { bottom: 88px; right: 12px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    background: rgba(11, 13, 28, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--rim); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  .tabbar a.active { color: var(--gold-bright); background: rgba(232, 176, 75, 0.12); }
  .room-panel {
    position: fixed; left: 10px; right: 10px; bottom: 76px; top: auto; z-index: 1050; max-height: 72vh; overflow-y: auto;
    transform: translateY(calc(100% + 120px)); transition: transform 0.45s var(--ease);
    background: linear-gradient(180deg, #2a2f52, #191d36); box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.7);
  }
  .room-panel.open { transform: none; }
  .sheet-close { display: grid; place-items: center; position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font-size: 22px; cursor: pointer; color: var(--muted); }
  .map-svg .node-label { font-size: 24px; stroke-width: 7px; }
}
@media (max-width: 600px) {
  .wrap { width: 94%; }
  .brand-name { font-size: 16px; }
  .brand-crest { width: 36px; height: 36px; }
  .purse-text small { display: none; }
  .journey-grid, .quest-log, .ach-grid, .lex-grid, .wing-cards, .wing-foundations .wing-cards { grid-template-columns: 1fr; }
  .journey-grid .wing-block { padding: 14px; }
  details.check .ans { padding-left: 18px; }
  .ck-tap { display: none; }
  .timeline::before { left: 46px; } .timeline li::after { left: 41px; } .timeline li { grid-template-columns: 38px 1fr; gap: 24px; }
  .crest-row { grid-template-columns: repeat(5, 1fr); }
  .trial, .quiz { padding: 20px; }
  .parchment { padding: 36px 18px 40px; }
  .scroll-body { font-size: 17.5px; }
  .scroll-body .lede { font-size: 19px; }
  .sort-item { grid-template-columns: 1fr; }
  .ch-tab { min-width: 0; padding: 10px 10px; font-size: 13px; }
  .ch-tab .tlabel-long { display: none; }
  .vows { grid-template-columns: 1fr; }
  .arena { overflow: visible; border: 0; }
  #battleCanvas { border-radius: 14px; border: 1px solid rgba(240, 123, 44, 0.35); }
  .attack-banner, .attack-banner.flash { position: static; transform: none; max-width: none; margin-top: 10px; animation: popIn 0.4s var(--spring); }
  .attack-banner span { font-size: 15px; }
  .attack-banner small { font-size: 13px; }
  .timer-ring { top: 8px; right: 8px; bottom: auto; }
  .streak { top: 8px; left: 8px; bottom: auto; font-size: 12px; padding: 4px 10px; }
  .timer-ring { width: 46px; height: 46px; }
  .ledger { font-size: 14px; }
  .squires { gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.lab-top { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: end; }
.lab-progress { margin-bottom: 34px; display: grid; gap: 10px; }
.lab-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.lab-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, var(--stone-2), var(--stone-1)); border: 1px solid var(--line); border-left: 4px solid var(--wc); color: var(--text);
  transition: transform 0.25s var(--spring), border-color 0.2s, box-shadow 0.2s; }
.lab-card:hover { transform: translateY(-3px); border-color: var(--rim-strong); }
.lab-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 26px rgba(232, 176, 75, 0.2); background: linear-gradient(180deg, #2c3260, var(--stone-2)); }
.lab-card-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: rgba(232, 176, 75, 0.12); border: 1px solid var(--rim-strong); }
.lab-card-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-bright); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.lab-card-txt { flex: 1; min-width: 0; }
.lab-card-txt small { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.3px; }
.lab-card-txt strong { display: block; font-family: var(--f-display); font-size: 15px; color: var(--parch); line-height: 1.25; }
.lab-card-check { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--stone-4); }
.lab-card.done .lab-card-check { border: 0; background: var(--emerald); }
.lab-card-check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; }

.lab-panel { border-top: 3px solid var(--wc); animation: viewIn 0.4s var(--ease); scroll-margin-top: calc(var(--top) + 12px); }
.lab-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.lab-head-ico { width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); box-shadow: 0 0 20px rgba(232, 176, 75, 0.35); }
.lab-head-ico svg { width: 28px; height: 28px; fill: none; stroke: #2a1a05; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lab-head h3 { font-family: var(--f-display); font-size: 28px; color: var(--parch); line-height: 1.15; margin: 2px 0 4px; }
.lab-head p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.lab-goal { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; background: rgba(232, 176, 75, 0.08); border: 1px dashed var(--rim-strong); font-size: 16px; transition: all 0.4s var(--ease); }
.lab-goal b { color: var(--gold-bright); }
.lab-goal-ico { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(232, 176, 75, 0.15); }
.lab-goal-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-bright); stroke-width: 2.2; }
.lab-goal.met { background: rgba(63, 168, 119, 0.14); border: 1px solid rgba(63, 168, 119, 0.55); animation: popIn 0.5s var(--spring); }
.lab-goal.met b { color: #9fe6c1; }
.lab-goal.met .lab-goal-ico { background: var(--emerald); }
.lab-goal.met .lab-goal-ico svg { stroke: #fff; }

.lab-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; align-items: start; }
.lab-cv { width: 100%; display: block; aspect-ratio: 600 / 420; border-radius: 14px; border: 1px solid var(--rim-strong); background: #0d1028; touch-action: none; cursor: crosshair; }
#labPanel canvas.lab-cv[aria-label*="Curve"], #labPanel canvas.lab-cv[aria-label*="distributions"] { aspect-ratio: 600 / 400; }
.lab-cap { font-size: 14px; color: var(--muted); margin-top: 8px; min-height: 22px; }
.lab-side { display: grid; gap: 14px; }
.lab-ctl { display: grid; gap: 6px; }
.lab-lbl { display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.lab-lbl b { color: var(--gold-bright); font-family: var(--f-mono); letter-spacing: 0; text-transform: none; font-size: 14px; }
.lab-ctl input[type="range"] { width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.seg-b { flex: 1; cursor: pointer; padding: 8px 10px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; transition: all 0.2s; }
.seg-b:hover { color: var(--text); }
.seg-b.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #1b1205; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3 .stat { padding: 10px 12px; }
.stats3 .stat span { font-size: 10.5px; letter-spacing: 1px; }
.stats3 .stat strong { font-size: 16px; }
.eq { padding: 10px 12px; border-radius: 10px; background: #0f1226; border: 1px solid var(--line); font-family: var(--f-mono); font-size: 13px; color: var(--parch); }
.eq b { color: var(--gold-bright); }
.lab-chart { display: grid; gap: 6px; }
.lab-chart .lab-lbl { justify-content: flex-start; flex-wrap: wrap; gap: 0 6px; }
.lab-mini { width: 100%; aspect-ratio: 300 / 100; border-radius: 10px; border: 1px solid var(--line); display: block; }
.lab-meter { display: grid; gap: 8px; }
.meter.big { height: 14px; border-radius: 8px; }
.meter.big span { border-radius: 8px; }
.lab-verdict { font-size: 15px; font-weight: 700; color: var(--parch); min-height: 22px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { cursor: pointer; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--rim-strong); background: rgba(0, 0, 0, 0.25); color: var(--parch); font-weight: 700; font-size: 14px; transition: all 0.2s var(--spring); }
.chip:hover { transform: translateY(-2px); }
.chip.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #1b1205; border-color: var(--gold); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.tog { cursor: pointer; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--muted); font-weight: 700; font-size: 14px; text-align: left; transition: all 0.2s; }
.tog::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--stone-4); vertical-align: 1px; transition: all 0.2s; }
.tog.on { color: var(--parch); border-color: var(--gold); }
.tog.on::before { background: var(--gold-bright); box-shadow: 0 0 8px var(--gold); }
.net-out { padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); display: grid; gap: 8px; }
.net-out strong { font-family: var(--f-display); font-size: 28px; color: var(--parch); }
.net-svg { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--rim-strong); }
.nn-col { font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: 2px; fill: var(--muted); text-anchor: middle; }
.nn-lbl { font-family: var(--f-body); font-weight: 700; font-size: 14px; fill: var(--parch); text-anchor: middle; }
.nn-lbl[text-anchor="end"] { text-anchor: end; }
.net-node { cursor: pointer; }
.net-node:focus { outline: none; }
.net-node:focus .nn-bg, .net-node:hover .nn-bg { stroke: #fff; }
.nn-bg { fill: #1b1f3a; stroke: var(--gold); stroke-width: 2.5; transition: stroke 0.2s; }
.nn-fill { fill: var(--gold-bright); transition: opacity 0.4s var(--ease); pointer-events: none; }
.nn-val { font-family: var(--f-mono); font-size: 12px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: #0b0d1c; stroke-width: 3px; }
.net-edge { fill: none; stroke-linecap: round; stroke-dasharray: 7 9; animation: netFlow 1.5s linear infinite; transition: stroke-width 0.3s, opacity 0.3s; }
@keyframes netFlow { to { stroke-dashoffset: -32; } }
.key-gold { color: var(--gold-bright); font-weight: 700; }
.key-blue { color: #8fb3ff; font-weight: 700; }
.ratio-bar { position: relative; height: 18px; border-radius: 9px; background: rgba(255, 255, 255, 0.06); }
.ratio-fill { height: 100%; border-radius: 9px; transition: width 0.4s var(--ease), background 0.3s; }
.ratio-line { position: absolute; top: -5px; bottom: -5px; left: 80%; width: 3px; border-radius: 2px; background: var(--gold-bright); }
.ratio-line::after { content: "0.80"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--gold-bright); }
.lab-notes { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; margin-top: 22px; }
.lab-try, .lab-explain { padding: 18px 20px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.lab-notes h4 { font-family: var(--f-display); font-size: 16px; color: var(--gold-bright); letter-spacing: 1px; margin-bottom: 10px; }
.lab-try ol { padding-left: 22px; display: grid; gap: 8px; font-size: 16px; }
.lab-try li::marker { color: var(--gold); font-weight: 800; }
.lab-try b { color: var(--parch); }
.lab-explain p { font-size: 16px; color: var(--text); margin-bottom: 10px; line-height: 1.6; }
.lab-explain strong { color: var(--parch); }
.lab-link { display: inline-block; margin-top: 4px; font-weight: 800; text-decoration: none; }
.lab-link:hover { text-decoration: underline; }
.lab-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.lab-nav .btn:disabled { visibility: hidden; }

@media (max-width: 1100px) {
  .lab-picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .lab-top, .lab-grid, .lab-notes { grid-template-columns: 1fr; }
  .lab-progress { margin-bottom: 20px; }
}
@media (max-width: 600px) {
  .lab-picker { grid-template-columns: 1fr; }
  .lab-head { gap: 12px; }
  .lab-head-ico { width: 44px; height: 44px; }
  .lab-head h3 { font-size: 23px; }
  .stats3 .stat strong { font-size: 14px; }
  .lab-nav .btn { flex: 1; white-space: normal; }
  .nn-lbl { font-size: 18px; }
  .nn-val { font-size: 15px; }
  .nn-col { font-size: 15px; letter-spacing: 1px; }
}

.widget [hidden] { display: none !important; }

.spot-answer { font-family: var(--f-read); font-size: 19px; line-height: 1.75; color: var(--parch); padding: 18px 20px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.spot-s { display: inline; cursor: pointer; border-radius: 5px; padding: 2px 3px; transition: background 0.2s, box-shadow 0.2s; }
.spot-s:hover { background: rgba(232, 176, 75, 0.18); }
.spot-s:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.spot-s.picked { background: rgba(232, 176, 75, 0.3); box-shadow: inset 0 -2px 0 var(--gold-bright); }
.spot-s.reveal { cursor: default; }
.spot-s.reveal.is-forged { background: rgba(224, 72, 95, 0.28); text-decoration: underline wavy #e0485f; text-underline-offset: 4px; }
.spot-s.reveal.is-true { background: rgba(63, 168, 119, 0.14); }
.spot-report { margin-top: 18px; animation: viewIn 0.4s var(--ease); }
.spot-report h4 { margin-bottom: 6px; }
.spot-summary { font-size: 16px; font-weight: 700; color: var(--parch); padding: 12px 14px; border-radius: 10px; background: rgba(224, 72, 95, 0.14); border: 1px solid rgba(224, 72, 95, 0.4); margin-bottom: 12px; }
.spot-summary.good { background: rgba(63, 168, 119, 0.16); border-color: rgba(63, 168, 119, 0.5); }
.spot-rows { list-style: none; display: grid; gap: 10px; }
.spot-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; padding: 11px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); border-left: 4px solid var(--c, #8d88a6); font-size: 15px; line-height: 1.55; color: var(--text); }
.spot-row b { font-family: var(--f-display); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.spot-row em { font-style: normal; font-weight: 800; color: var(--parch); }
.spot-row.ok { --c: #3fa877; } .spot-row.ok b { color: #6ee0a6; }
.spot-row.clear { --c: #3fa877; } .spot-row.clear b { color: #9fd9b8; }
.spot-row.miss { --c: #e8b04b; } .spot-row.miss b { color: var(--gold-bright); }
.spot-row.false { --c: #e0485f; } .spot-row.false b { color: #ff9a8a; }
@media (max-width: 600px) { .spot-row { grid-template-columns: 1fr; gap: 4px; } .spot-answer { font-size: 17px; } }

.cs-chat { display: grid; gap: 12px; margin-bottom: 16px; }
.cs-bubble { position: relative; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.6; max-width: 92%; }
.cs-bubble.you { justify-self: end; background: linear-gradient(180deg, #2c3a6e, #1d2750); color: var(--parch); border-bottom-right-radius: 4px; }
.cs-bubble.bot { justify-self: start; background: var(--parch); color: var(--ink); border-bottom-left-radius: 4px; }
.cs-who { display: block; font-family: var(--f-display); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 4px; opacity: 0.75; }
.cs-reply p { margin: 0 0 8px; }
.cs-reply p:last-child { margin-bottom: 0; }
.cs-list { padding-left: 20px; margin: 0; }
.cs-list li { margin-bottom: 6px; }
.cs-reply.swap { animation: viewIn 0.45s var(--ease); }
.cs-typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.cs-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); animation: csDot 1s infinite ease-in-out; }
.cs-typing i:nth-child(2) { animation-delay: 0.15s; }
.cs-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes csDot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }

.companions { padding: 56px 0 8px; }
.comp-intro { text-align: center; margin-bottom: 18px; }
.comp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.comp-card { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; padding: 20px; border-radius: 18px; background: linear-gradient(160deg, rgba(31, 36, 64, 0.95), rgba(14, 17, 36, 0.95)); border: 1px solid var(--rim-strong); border-top: 3px solid var(--cc); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.comp-art { width: 150px; height: 190px; border-radius: 14px; background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.12), transparent 70%), rgba(0, 0, 0, 0.25); display: grid; place-items: end center; overflow: hidden; }
.comp-svg { width: 100%; height: 100%; animation: compFloat 4s ease-in-out infinite; }
.comp-name { font-family: var(--f-display); font-size: 20px; color: var(--parch); }
.comp-name span { font-family: var(--f-read); font-style: italic; font-size: 16px; color: var(--cc); }
.comp-greet { font-size: 14px; color: var(--muted); margin: 4px 0 10px; min-height: 2.6em; }
.comp-bubble { position: relative; margin: 0 0 12px; padding: 14px 16px; border-radius: 14px; background: var(--parch); color: var(--ink); font-family: var(--f-read); font-size: 18px; line-height: 1.5; min-height: 5.2em; }
.comp-bubble::before { content: ""; position: absolute; left: 22px; top: -9px; width: 16px; height: 16px; background: var(--parch); transform: rotate(45deg); }
.comp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.comp-card.bounce { animation: compBounce 0.5s var(--spring); }
@keyframes compFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes compBounce { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
@media (max-width: 760px) {
  .comp-grid { grid-template-columns: 1fr; }
  .comp-card { grid-template-columns: 110px 1fr; gap: 14px; padding: 16px; }
  .comp-art { width: 110px; height: 140px; }
  .comp-bubble { font-size: 16px; min-height: 0; }
}
@media (max-width: 420px) { .comp-card { grid-template-columns: 1fr; justify-items: center; text-align: center; } .comp-bubble::before { left: 50%; margin-left: -8px; } }

.wing-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 0 36px; }
.wb-intro { grid-column: 1 / -1; text-align: center; }
.wb-card { padding: 22px; border-radius: 18px; background: rgba(25, 29, 54, 0.75); border: 1px solid var(--rim-strong); border-top: 4px solid var(--wc); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25); }
.wb-num { font-family: var(--f-display); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--wc); }
.wb-card h3 { font-family: var(--f-display); font-size: 24px; color: var(--parch); margin: 6px 0 4px; }
.wb-req { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.wb-card ul { list-style: none; display: grid; gap: 7px; font-size: 15px; color: var(--text); }
.wb-card li b { display: inline-block; min-width: 2.2em; color: var(--wc); font-family: var(--f-display); }
.wing-legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 22px; }
.wl-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--wc); background: rgba(0, 0, 0, 0.25); color: var(--parch); font-size: 14px; }
.wl-chip b { color: var(--wc); font-family: var(--f-display); letter-spacing: 1px; margin-right: 6px; }
@media (max-width: 820px) { .wing-band { grid-template-columns: 1fr; } }

.sigil-count { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--rim-strong); color: var(--parch); font-size: 14px; white-space: nowrap; }
.sigil-count.bump { animation: popIn 0.45s var(--spring); }
.sigil-gem { width: 11px; height: 11px; transform: rotate(45deg); background: linear-gradient(135deg, #f6cf7a, #e8b04b); box-shadow: 0 0 8px rgba(232, 176, 75, 0.7); }
.sigil-text strong { font-family: var(--f-display); color: var(--gold-bright); margin-right: 2px; }
.sigil-text small { margin-left: 5px; color: var(--muted); font-size: 12px; }
.sigil-host { position: relative; }
.sigil { position: absolute; z-index: 6; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 243, 207, 0.85); background: radial-gradient(circle, rgba(232, 176, 75, 0.6), rgba(232, 176, 75, 0.15) 70%); display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 18px rgba(232, 176, 75, 0.75); animation: sigilRing 2.4s ease-out infinite; transition: transform 0.3s; }
.sigil span { display: block; width: 16px; height: 16px; transform: rotate(45deg); background: linear-gradient(135deg, #fff8e0, #f6cf7a 50%, #e8b04b); border-radius: 3px; box-shadow: 0 0 12px #f6cf7a; animation: sigilPulse 2.4s ease-in-out infinite; }
@keyframes sigilRing { 0% { box-shadow: 0 0 0 0 rgba(232, 176, 75, 0.7), 0 0 18px rgba(232, 176, 75, 0.75); } 100% { box-shadow: 0 0 0 18px rgba(232, 176, 75, 0), 0 0 18px rgba(232, 176, 75, 0.75); } }
.sigil:hover, .sigil:focus-visible { opacity: 1; transform: scale(1.25); outline: none; }
@keyframes sigilPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@media (max-width: 600px) {
  .sigil-count small { display: none; }
  .sigil-count { padding: 5px 9px; gap: 6px; }
  .hud { gap: 6px; }
  .hud .icon-btn { width: 38px; height: 38px; }
}

@media print {
  @page { size: letter landscape; margin: 0.3in; }
  html, body { background: #fff !important; height: auto; min-height: 0; display: block; }
  body > *:not(main) { display: none !important; }
  main .view:not(#view-honors) { display: none !important; }
  #view-honors { display: block !important; padding: 0 !important; animation: none !important; }
  #view-honors .wrap { width: auto; }
  #view-honors .wrap > *:not(.cert-stage) { display: none !important; }
  .cert-lock { display: none !important; }
  .certificate { width: 9.9in; margin: 0 auto; box-shadow: none; filter: none !important; opacity: 1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
}
@media (max-width: 600px) {
  #lexGrid { gap: 10px; }
  .lex-card { padding: 13px 15px; }
  .lex-card strong { font-size: 16px; }
  .lex-card small { font-size: 12px; }
  .lex-card p { margin-top: 6px; font-size: 15px; line-height: 1.5; }
}
