/* Ported from Ventures/DEFI_MAGIC_GAME/vision/FIRST_TOUCH_PROTOTYPE.html —
   palette, fonts, glass-panel treatment, and every component's look lifted
   near-verbatim from the vision prototype; selectors adapted to match this
   app's DOM (built by src/app.ts + src/render/*.ts) rather than the
   prototype's static markup. See that file for the design source of truth. */

:root {
  color-scheme: dark;
  --void: #04060a; --obsidian: #0a0f14; --glass: #0e141bcc; --line: #1d2833;
  --parch: #e8dcc0; --dim: #8fa0ad; --gold: #d4a94e; --ember: #ff6b35;
  --cube: #3dff8f; --veil: #7fd4c1;
  --vein: #6b7fd4; --sylv: #3fae6a; --nigh: #d4502a; --aure: #d4b04e; --grim: #95705a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--void);
  color: var(--parch);
  font-family: "Crimson Text", Georgia, serif;
  overflow-x: hidden;
  line-height: 1.5;
}
h1, h2, h3, .cz { font-family: "Cinzel", serif; }
.mono { font-family: "JetBrains Mono", monospace; }
a { color: var(--gold); }

/* ————— THE APPROACH (intro) ————— */
#approach {
  position: fixed; inset: 0; z-index: 50;
  background:
    radial-gradient(120% 70% at 50% 110%, #0c2a1e 0%, transparent 55%),
    radial-gradient(90% 50% at 50% -10%, #101c26 0%, transparent 60%), var(--void);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 1.6s ease, visibility 1.6s;
  cursor: pointer;
}
#approach.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.veilCurtain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.aurora {
  position: absolute; left: -20%; width: 140%; height: 42%; filter: blur(48px); opacity: .5;
  background: linear-gradient(100deg, transparent, #1d5a44, #123a4a, #1d5a44, transparent);
  animation: breathe 9s ease-in-out infinite;
}
.aurora.a1 { top: 6%; } .aurora.a2 { top: 38%; animation-delay: -4s; opacity: .32; }
@keyframes breathe { 0%, 100% { transform: translateX(-4%) scaleY(1); } 50% { transform: translateX(4%) scaleY(1.25); } }
.fracture {
  position: absolute; top: 0; left: 50%; width: 2px; height: 100%;
  background: linear-gradient(var(--cube), transparent 70%);
  box-shadow: 0 0 24px 2px #3dff8f66; opacity: .65; animation: flicker 4s infinite;
}
@keyframes flicker { 0%, 92%, 100% { opacity: .65; } 94% { opacity: .25; } 96% { opacity: .8; } }
.ember {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise { 0% { transform: translateY(105vh); opacity: 0; } 12% { opacity: .8; } 88% { opacity: .5; } 100% { transform: translateY(-6vh); opacity: 0; } }
#approach h1 {
  font-size: clamp(28px, 4.6vw, 58px); font-weight: 600; letter-spacing: .14em; text-align: center;
  text-shadow: 0 0 34px #3dff8f33;
}
#approach .sub { margin-top: 18px; font-style: italic; color: var(--dim); font-size: clamp(15px, 1.6vw, 20px); text-align: center; max-width: 640px; padding: 0 20px; }
.lines span { display: block; opacity: 0; animation: lineIn 1.4s forwards; }
.lines span:nth-child(2) { animation-delay: 1.2s; }
.lines span:nth-child(3) { animation-delay: 2.6s; }
@keyframes lineIn { to { opacity: 1; } }
#descend {
  margin-top: 56px; background: none; border: 1px solid #3a4b3f; color: var(--parch);
  font-family: "Cinzel", serif; letter-spacing: .28em; font-size: 13px; padding: 14px 34px; cursor: pointer;
  transition: .4s; position: relative; overflow: hidden;
}
#descend:hover { border-color: var(--cube); box-shadow: 0 0 30px #3dff8f2e; color: #dfffe9; }
.hint { margin-top: 16px; color: #5a6b76; font-size: 12px; letter-spacing: .2em; font-family: "Cinzel", serif; }

/* ————— APP SHELL ————— */
header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 26px;
  padding: 14px 26px; background: linear-gradient(#060a0ef2, #060a0ecc); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.sigil { display: flex; align-items: center; gap: 12px; }
.sigil .cube {
  width: 22px; height: 22px; border: 1.5px solid var(--cube); box-shadow: 0 0 12px #3dff8f55, inset 0 0 8px #3dff8f33;
  transform: rotate(45deg); animation: cubePulse 5s infinite;
}
@keyframes cubePulse { 0%, 100% { box-shadow: 0 0 12px #3dff8f55, inset 0 0 8px #3dff8f33; } 50% { box-shadow: 0 0 22px #3dff8f88, inset 0 0 14px #3dff8f55; } }
.sigil b { font-family: "Cinzel", serif; letter-spacing: .22em; font-size: 15px; color: var(--parch); }
nav { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; }
nav button {
  background: none; border: none; color: var(--dim); font-family: "Cinzel", serif; font-size: 13px;
  letter-spacing: .18em; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; transition: .3s;
}
nav button.on { color: var(--gold); border-bottom-color: var(--gold); }
nav button:hover { color: var(--parch); }
#markBtn {
  margin-left: auto; background: linear-gradient(120deg, #15321f, #0e2418); border: 1px solid #2c5a3c;
  color: #bfe8c8; font-family: "Cinzel", serif; font-size: 12px; letter-spacing: .2em; padding: 10px 20px; cursor: pointer; transition: .3s;
}
#markBtn:hover { box-shadow: 0 0 22px #3dff8f33; border-color: var(--cube); }

main { max-width: 1500px; margin: 0 auto; padding: 22px; }
.view { display: none; }
.view.on { display: block; animation: fadeUp .7s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ————— REALM (map) ————— */
#realmWrap { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
#mapCard {
  position: relative;
  background: radial-gradient(80% 90% at 30% 20%, #0d1720 0%, #070c11 55%, #05080c 100%);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-height: 640px;
}
#mapTitle { position: absolute; top: 16px; left: 20px; z-index: 5; }
#mapTitle h2 { font-size: 19px; letter-spacing: .2em; color: var(--parch); font-weight: 600; }
#mapTitle p { color: var(--dim); font-style: italic; font-size: 14px; }
#warTicker { position: absolute; top: 16px; right: 20px; z-index: 5; text-align: right; }
.tick { font-family: "JetBrains Mono", monospace; font-size: 11px; color: #c98d6b; letter-spacing: .06em; }
.tick b { color: var(--ember); }
svg text { user-select: none; }
#lodBadge {
  position: absolute; left: 20px; bottom: 62px; z-index: 6; font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: .12em; color: var(--dim); background: var(--glass); border: 1px solid var(--line);
  border-radius: 3px; padding: 4px 8px;
}
.hexmap-wrap { position: relative; width: 100%; height: 640px; cursor: grab; touch-action: none; }
.hexmap-wrap.dragging { cursor: grabbing; }
.hexmap { width: 100%; height: 100%; display: block; }
.hexcell { cursor: pointer; }
.hexcell:focus { outline: 2px solid var(--gold); }
.battle-pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .35; } }
#epochBar {
  position: absolute; left: 20px; right: 20px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 14px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px; backdrop-filter: blur(6px);
}
#epochBar label { font-family: "Cinzel", serif; font-size: 11px; letter-spacing: .22em; color: var(--gold); white-space: nowrap; }
#epoch { flex: 1; accent-color: #d4a94e; }
#epochRead { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--dim); white-space: nowrap; }

/* side panel (dossier) */
#dossier {
  background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 20px; backdrop-filter: blur(8px);
  min-height: 640px; display: flex; flex-direction: column;
}
#dossier .empty { color: #5a6b76; font-style: italic; margin: auto; text-align: center; line-height: 1.9; }
.dosHead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.dosHead h3 { font-size: 17px; letter-spacing: .14em; }
.dosHead .coord { font-family: "JetBrains Mono", monospace; color: var(--dim); font-size: 12px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #16202a; font-size: 15px; }
.kv b { color: var(--gold); font-weight: 600; }
details { margin-top: 14px; border: 1px solid var(--line); border-radius: 4px; background: #0a1118; }
summary { cursor: pointer; padding: 11px 14px; font-family: "Cinzel", serif; font-size: 12px; letter-spacing: .18em; color: var(--veil); }
details .inner { padding: 4px 16px 14px; font-size: 14px; color: var(--dim); line-height: 1.75; }
details .inner .mono { color: var(--parch); font-size: 12.5px; display: block; margin: 8px 0; line-height: 2; }
.siege { margin-top: 14px; border: 1px solid #4a2c1d; background: #160d08; border-radius: 4px; padding: 14px; }
.siege h4 { font-family: "Cinzel", serif; color: var(--ember); font-size: 12px; letter-spacing: .22em; margin-bottom: 10px; }
.barRow { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13.5px; }
.bar { flex: 1; height: 8px; background: #0d1420; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }
.voteGauge { margin-top: 10px; display: flex; justify-content: space-between; font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--dim); }

/* ————— LEDGER (aggregator) ————— */
.ledgerHead { display: flex; align-items: baseline; gap: 18px; margin: 6px 2px 16px; flex-wrap: wrap; }
.ledgerHead h2 { font-size: 21px; letter-spacing: .18em; }
.ledgerHead p { color: var(--dim); font-style: italic; }
table { width: 100%; border-collapse: collapse; background: var(--glass); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
thead th {
  font-family: "Cinzel", serif; font-size: 10.5px; letter-spacing: .2em; color: #8fa0ad; text-align: right;
  padding: 13px 14px; border-bottom: 1px solid var(--line); background: #0a1016;
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td { padding: 13px 14px; text-align: right; font-size: 15px; border-bottom: 1px solid #101822; }
tbody tr { transition: .25s; }
tbody tr[data-kingdom]:hover { background: #101a24; cursor: pointer; }
.kban { display: flex; align-items: center; gap: 12px; text-align: left; }
.kban .dot { width: 13px; height: 13px; transform: rotate(45deg); box-shadow: 0 0 10px currentColor; }
.kban .nm { font-family: "Cinzel", serif; letter-spacing: .1em; font-size: 14px; }
.kban .rl { display: block; color: #71838f; font-size: 12px; font-style: italic; font-family: "Crimson Text", serif; letter-spacing: 0; }
.up { color: #5fe39a; } .dn { color: #ff8a5e; }
td .mono { font-size: 12.5px; }
.war { color: var(--ember); font-family: "Cinzel", serif; font-size: 10.5px; letter-spacing: .18em; animation: warPulse 2.2s infinite; }
.peace { color: #5a6b76; font-family: "Cinzel", serif; font-size: 10.5px; letter-spacing: .18em; }
@keyframes warPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pairsCard { margin-top: 22px; background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.pairsCard h3 { font-size: 13px; letter-spacing: .22em; color: var(--veil); margin-bottom: 6px; }
.pairsCard p { color: var(--dim); font-style: italic; font-size: 14px; margin-bottom: 14px; }
.grid5 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 560px; }
.g5 {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 3px;
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: #0a1016; font-weight: 600;
}
.g5.hd { background: none; color: var(--dim); font-family: "Cinzel", serif; font-size: 10px; letter-spacing: .08em; }

/* ————— COURT (kingdom page) ————— */
.courtPicker { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.courtPicker button {
  background: var(--glass); border: 1px solid var(--line); color: var(--dim); font-family: "Cinzel", serif;
  font-size: 11px; letter-spacing: .14em; padding: 8px 16px; cursor: pointer; border-radius: 3px; transition: .3s;
}
.courtPicker button.on { color: var(--parch); border-color: var(--accent, var(--gold)); box-shadow: 0 0 14px color-mix(in srgb, var(--accent, var(--gold)) 35%, transparent); }
#courtWrap { display: grid; grid-template-columns: 390px 1fr; gap: 18px; }
.portrait {
  background: radial-gradient(70% 55% at 50% 34%, color-mix(in srgb, var(--accent, var(--vein)) 33%, transparent) 0%, transparent 70%), var(--glass);
  border: 1px solid var(--line); border-radius: 6px; padding: 26px; text-align: center; position: relative; overflow: hidden;
}
.runeRing {
  width: 170px; height: 170px; margin: 8px auto 14px; border-radius: 50%; position: relative;
  border: 1px solid color-mix(in srgb, var(--accent, var(--vein)) 60%, #0a1016); box-shadow: 0 0 40px color-mix(in srgb, var(--accent, var(--vein)) 20%, transparent), inset 0 0 30px color-mix(in srgb, var(--accent, var(--vein)) 13%, transparent);
  display: flex; align-items: center; justify-content: center; animation: slowspin 40s linear infinite;
}
@keyframes slowspin { to { transform: rotate(360deg); } }
.runeRing span { position: absolute; font-family: "Cinzel", serif; color: var(--accent, #9db0ff); font-size: 13px; opacity: .85; }
.archSil {
  width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #c9d6ff 0%, var(--accent, var(--vein)) 30%, #16204a 75%);
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent, var(--vein)) 55%, transparent); animation: cubePulse 6s infinite;
}
.portrait h2 { font-size: 20px; letter-spacing: .16em; }
.portrait .ttl { color: var(--dim); font-style: italic; margin-top: 4px; }
.doctrine { margin-top: 18px; text-align: left; }
.doctrine h4, .vaults h4, .cause h4 { font-family: "Cinzel", serif; font-size: 11px; letter-spacing: .24em; color: var(--veil); margin-bottom: 10px; }
.axis { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--dim); margin: 6px 0; }
.axis .tr { flex: 1; height: 4px; background: #111a26; border-radius: 2px; position: relative; }
.axis .tr i { position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--vein)); box-shadow: 0 0 8px var(--accent, var(--vein)); }
.cause { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; text-align: left; }
.cause .big { font-size: 26px; color: var(--gold); font-family: "Cinzel", serif; }
.courtRight { display: flex; flex-direction: column; gap: 18px; }
.vaults { background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.vaultGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.vault { background: #0a1118; border: 1px solid #182430; border-radius: 4px; padding: 12px 8px; text-align: center; transition: .3s; }
.vault:hover { border-color: var(--gold); box-shadow: 0 0 18px #d4a94e22; }
.vault .ic { font-size: 17px; }
.vault .nm { font-family: "Cinzel", serif; font-size: 9px; letter-spacing: .12em; color: var(--dim); margin: 6px 0 4px; }
.vault .amt { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--parch); }
.feed { background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 20px; flex: 1; }
.feed h4 { font-family: "Cinzel", serif; font-size: 11px; letter-spacing: .24em; color: var(--veil); margin-bottom: 14px; }
.feed-filter { margin-bottom: 12px; }
.feed-filter select { background: #0a1118; color: var(--parch); border: 1px solid var(--line); padding: 6px 10px; border-radius: 3px; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.post { border-left: 2px solid color-mix(in srgb, var(--accent, var(--vein)) 70%, #0a1016); padding: 2px 0 2px 16px; margin-bottom: 18px; }
.post .meta { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: #5a6b76; margin-bottom: 6px; }
.post p { font-size: 15.5px; line-height: 1.75; color: #d5ccb8; }
.post.live { border-left-color: var(--cube); }
.post.live .meta b { color: var(--cube); }
.covenant { display: flex; gap: 2px; margin-top: 8px; border-radius: 3px; overflow: hidden; height: 26px; font-family: "Cinzel", serif; font-size: 10px; letter-spacing: .1em; }
.covenant div { display: flex; align-items: center; justify-content: center; color: #0a1016; }

/* ————— YOUR HOARD ————— */
#hoardWrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hcard { background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.hcard h4 { font-family: "Cinzel", serif; font-size: 11px; letter-spacing: .24em; color: var(--veil); margin-bottom: 12px; }
.hoardHero { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 26px; flex-wrap: wrap; }
.hoardHero .big { font-family: "Cinzel", serif; font-size: 42px; color: var(--gold); text-shadow: 0 0 30px #d4a94e33; }
.hoardHero .sub3 { color: var(--dim); font-style: italic; }
.hrow { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #16202a; font-size: 15px; cursor: pointer; transition: .25s; }
.hrow:hover { background: #101a2455; }
.hrow .l { display: flex; align-items: center; gap: 10px; }
.hrow .dot { width: 11px; height: 11px; transform: rotate(45deg); }
.hrow .mono { font-size: 12.5px; }
.attr { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13.5px; }
.attr span:first-child { width: 150px; color: var(--dim); }
.attr .bar { flex: 1; height: 9px; background: #0d1420; border-radius: 4px; overflow: hidden; }
.attr .mono { width: 76px; text-align: right; }
.qm {
  grid-column: 1 / -1; background: radial-gradient(70% 120% at 20% 0%, #1a1408 0%, #0c0f14 55%), var(--glass);
  border: 1px solid #4a3c1d; border-radius: 6px; padding: 24px; position: relative;
}
.qm h3 { font-size: 16px; letter-spacing: .2em; color: var(--gold); }
.qm .prem {
  position: absolute; top: 16px; right: 20px; font-family: "Cinzel", serif; font-size: 10px; letter-spacing: .26em;
  color: #0a0f14; background: linear-gradient(120deg, #d4a94e, #f0d290); padding: 5px 12px; border-radius: 2px;
}
.ambRow { display: flex; align-items: center; gap: 16px; margin: 18px 0 6px; flex-wrap: wrap; }
.ambRow label { font-family: "Cinzel", serif; font-size: 11px; letter-spacing: .22em; color: var(--veil); }
#ambition { flex: 1; min-width: 220px; accent-color: #d4a94e; }
#ambRead { font-family: "Cinzel", serif; color: var(--gold); font-size: 17px; min-width: 190px; }
#counselBtn {
  background: linear-gradient(120deg, #2a2210, #1a1408); border: 1px solid #d4a94e; color: #f0d290;
  font-family: "Cinzel", serif; font-size: 12px; letter-spacing: .2em; padding: 11px 24px; cursor: pointer; transition: .3s;
}
#counselBtn:hover { box-shadow: 0 0 26px #d4a94e44; }
.plan { margin-top: 16px; display: none; }
.plan.shown { display: block; }
.plan .pl { border-left: 2px solid #d4a94e66; padding: 2px 0 2px 16px; margin-bottom: 14px; }
.plan .pl .tag { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: #d4a94e; letter-spacing: .08em; }
.plan .pl p { font-size: 15px; line-height: 1.7; color: #d5ccb8; }
.plaque { margin-top: 14px; border: 1px solid #2a3542; background: #0a1016; border-radius: 4px; padding: 12px 16px; font-size: 12.5px; color: #71838f; font-style: italic; line-height: 1.7; }

footer { max-width: 1500px; margin: 10px auto 40px; padding: 0 26px; color: #43535e; font-style: italic; font-size: 13px; text-align: center; }

/* ————— THE MARK (modal) ————— */
#veilModal { position: fixed; inset: 0; z-index: 60; background: #04060af0; display: none; align-items: center; justify-content: center; }
#veilModal.on { display: flex; }
.circle {
  background: radial-gradient(70% 70% at 50% 40%, #0d1a13 0%, #070b0e 70%); border: 1px solid #21402d; border-radius: 8px;
  padding: 38px 44px; max-width: 520px; text-align: center; position: relative;
}
.circle h2 { letter-spacing: .2em; font-size: 19px; color: #cfe9d4; }
.circle .sub2 { color: var(--dim); font-style: italic; margin: 8px 0 20px; }
#runeRing2 { width: 220px; height: 220px; margin: 0 auto 20px; position: relative; }
.rune {
  position: absolute; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  font-family: "Cinzel", serif; font-size: 16px; color: #274034; border: 1px solid #1e3328; border-radius: 50%; transition: .6s; background: #081009;
}
.rune.lit { color: var(--cube); border-color: var(--cube); box-shadow: 0 0 18px #3dff8f66; text-shadow: 0 0 12px #3dff8f; }
.choiceRow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.choiceRow button {
  background: #0a1310; border: 1px solid #22382c; color: #bfd4c2; font-family: "Cinzel", serif;
  font-size: 11px; letter-spacing: .14em; padding: 9px 14px; cursor: pointer; transition: .3s;
}
.choiceRow button:hover, .choiceRow button.sel { border-color: var(--cube); color: #dfffe9; box-shadow: 0 0 14px #3dff8f33; }
.circle .note { font-size: 12.5px; color: #5a6b76; line-height: 1.7; margin-top: 12px; }
.circle .close { position: absolute; top: 10px; right: 16px; background: none; border: none; color: #5a6b76; font-size: 20px; cursor: pointer; }
#markDone { display: none; }
#markDone.shown { display: block; }
#markSteps.hidden { display: none; }
#markDone .mark { font-family: "Cinzel", serif; font-size: 15px; color: var(--cube); letter-spacing: .18em; margin: 12px 0 4px; text-shadow: 0 0 16px #3dff8f66; }

/* ————— INTERVENE + CLARA ————— */
#intBtn {
  position: fixed; right: 26px; bottom: 26px; z-index: 30; background: linear-gradient(120deg, #2a1a08, #1a1006);
  border: 1px solid #ffb35e; color: #ffd9a8; font-family: "Cinzel", serif; font-size: 12px; letter-spacing: .22em;
  padding: 13px 22px; cursor: pointer; box-shadow: 0 0 24px #ffb35e33;
}
#intPanel {
  position: fixed; right: 26px; bottom: 84px; z-index: 30; width: 330px; display: none;
  background: #0b0f14f4; border: 1px solid #3a2c18; border-radius: 6px; padding: 18px; backdrop-filter: blur(8px);
}
#intPanel.on { display: block; }
#intPanel h3 { font-size: 13px; letter-spacing: .22em; color: #ffd9a8; margin-bottom: 4px; }
#intPanel > p, .intDesc { color: #8fa0ad; font-style: italic; font-size: 13px; margin-bottom: 12px; }
.act { border: 1px solid #241c10; border-radius: 4px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: .3s; background: #0d0f12; }
.act:hover { border-color: #ffb35e; box-shadow: 0 0 16px #ffb35e22; }
.act b { font-size: 12px; letter-spacing: .14em; color: #a8ffd0; }
.act .price { float: right; color: #ffd9a8; font-family: "JetBrains Mono", monospace; }
.act p { font-size: 13.5px; color: #b8aa90; margin: 4px 0 0; }
#actToast { display: none; margin-top: 10px; border: 1px solid #2c5a3c; background: #0d1a13; border-radius: 4px; padding: 10px; font-size: 12.5px; color: #a8ffd0; font-style: italic; }
#actToast.shown { display: block; }
#clara { position: fixed; left: 26px; bottom: 26px; z-index: 30; display: flex; align-items: center; gap: 12px; cursor: pointer; }
#claraFace {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid #2c5a3c; position: relative; flex-shrink: 0;
  background: radial-gradient(circle at 50% 30%, #1a2a20 0%, #0a120d 70%); box-shadow: 0 0 20px #3dff8f2a; animation: cubePulse 7s infinite;
}
#claraFace::before, #claraFace::after { content: ""; position: absolute; top: 21px; width: 7px; height: 7px; border-radius: 50%; }
#claraFace::before { left: 13px; background: #7dffb8; box-shadow: 0 0 8px #7dffb8; }
#claraFace::after { right: 13px; background: #1d7a4d; box-shadow: 0 0 6px #1d7a4d; }
#claraBubble { display: none; max-width: 300px; background: #0b120ef4; border: 1px solid #21402d; border-radius: 6px; padding: 14px 16px; font-size: 14.5px; font-style: italic; color: #cfe9d4; line-height: 1.7; }
#claraBubble.shown { display: block; }
#claraBubble .attrib { color: #5a6b76; font-size: 12px; }

/* charts / detail helpers reused across views */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: .5rem 0; }
.detail-list dt { color: var(--dim); }
.detail-list dd { margin: 0; }
.muted { color: var(--dim); font-size: .92em; }

@media (max-width: 1000px) {
  #realmWrap, #courtWrap, #hoardWrap { grid-template-columns: 1fr; }
}

/* ————— DEMO-ONLY: live clock bar, cast-act state, quest panel ————— */
.demoTag {
  font-size: 10px; letter-spacing: .18em; color: var(--void); background: var(--cube);
  padding: 2px 6px; border-radius: 3px; margin-left: 8px; vertical-align: middle;
}
.clockBar { display: flex; align-items: center; gap: 14px; margin-left: 18px; }
.epochLabel { color: var(--veil); font-size: 12px; letter-spacing: .12em; }
.speedGroup { display: flex; gap: 4px; }
.speedGroup button {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-family: "JetBrains Mono", monospace; font-size: 11px; padding: 3px 8px;
  border-radius: 3px; cursor: pointer;
}
.speedGroup button.on { color: var(--cube); border-color: var(--cube); }
.act.cast { opacity: .45; cursor: default; }
.act.cast:hover { border-color: #241c10; box-shadow: none; }
.questPanel { margin-top: 18px; }
.questPanel h3 { font-size: 13px; letter-spacing: .22em; color: var(--gold); margin-bottom: 8px; }
.questPanel .act { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: default; }
.questPanel .act p { margin: 0; flex: 1; }
.questPanel .act button {
  background: var(--gold); color: var(--void); border: none; border-radius: 3px;
  padding: 6px 10px; font-family: "JetBrains Mono", monospace; font-size: 11px; cursor: pointer;
}
.questPanel .act button:disabled { background: var(--line); color: var(--dim); cursor: default; }
