/* Pixelify Sans draws 5 like S and 8 like B. Digits (and only digits) come from VT323, a pixel font with
   unmistakable numerals; unicode-range makes the browser use it just for 0-9. */
@font-face {
  font-family: "Pixel Digits";
  src: url(https://fonts.gstatic.com/s/vt323/v18/pxiKyp0ihIEF2isfFJXUdVNF.woff2) format("woff2");
  unicode-range: U+0030-0039;
  size-adjust: 128%;
  font-display: swap;
}

:root {
  --pixel: "Pixel Digits", "Pixelify Sans", ui-monospace, Menlo, monospace;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --ink: #0b0806;
  --text: #efe6d2;
  --muted: #a99b7f;
  --gold: #d4a94c;
  --gold-hi: #f3d27a;
  --gold-lo: #7a5a22;
  --yellow: #ffd100;
  --parch: #e8d6a8;
  --parch-ink: #36240f;
  --parch-muted: #6e5634;
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #2f8cff; --q-epic: #b65cff; --q-legendary: #ff8000;
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath fill='%230a0705' d='M1 0h10v1H1zM0 1h1v10H0zM11 1h1v10h-1zM1 11h10v1H1z'/%3E%3Cpath fill='%23f0cf7a' d='M1 1h10v1H1zM1 1h1v10H1z'/%3E%3Cpath fill='%23876524' d='M1 10h10v1H1zM10 1h1v10h-1z'/%3E%3Cpath fill='%23140e08' d='M2 2h8v1H2zM2 2h1v8H2zM9 2h1v8H9zM2 9h8v1H2z'/%3E%3Cpath fill='%235a4320' d='M3 3h6v1H3zM3 3h1v6H3zM8 3h1v6H8zM3 8h6v1H3z'/%3E%3C/svg%3E");
  --frame-thin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%230a0705' d='M1 0h4v1H1zM0 1h1v4H0zM5 1h1v4H5zM1 5h4v1H1z'/%3E%3Cpath fill='%23c9a04a' d='M1 1h4v1H1zM1 1h1v4H1z'/%3E%3Cpath fill='%23735419' d='M1 4h4v1H1zM4 1h1v4H4z'/%3E%3C/svg%3E");
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: #07060f; color: var(--text);
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-hi); }
.aside { font-size: 14px; color: var(--muted); margin: 12px 2px 0; }
.pin.home { cursor: help; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }
.px { font-family: var(--pixel); letter-spacing: .02em; }

#scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  image-rendering: pixelated; z-index: 0;
}
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0,0,0,.55) 100%); }
#app { position: relative; z-index: 2; min-height: 100%; }

/* ---------- Frames ---------- */
.frame {
  border: 8px solid transparent; border-image: var(--frame) 4 / 8px stretch;
  background: linear-gradient(180deg, #1d1711 0%, #130e0a 100%) padding-box;
}
.frame-thin {
  border: 6px solid transparent; border-image: var(--frame-thin) 2 / 6px stretch;
}
.parchment {
  background-color: var(--parch); color: var(--parch-ink);
  background-image: var(--noise), radial-gradient(ellipse at 50% 40%, rgba(255,250,230,.55), rgba(150,110,50,.28) 100%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--pixel); font-size: 15px; color: var(--yellow); text-decoration: none;
  padding: 7px 18px; cursor: pointer; text-shadow: 1px 1px 0 #000;
  border: 6px solid transparent; border-image: var(--frame-thin) 2 / 6px stretch;
  background: linear-gradient(180deg, #9c231b 0%, #6a140f 55%, #4d0d0a 100%) padding-box;
  transition: filter .12s;
}
.btn:hover { filter: brightness(1.25); }
.btn:active { transform: translateY(1px); }
.btn.alt { background: linear-gradient(180deg, #3a3326 0%, #221d15 100%) padding-box; color: var(--text); }
.btn.big { font-size: 22px; padding: 10px 40px; }

/* ---------- Character select ---------- */
.select { min-height: 100vh; display: grid; grid-template-rows: auto 1fr var(--ground, 20vh); padding: 18px 24px 0; animation: fade .5s ease; }
.sel-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.realm { font-family: var(--pixel); font-size: 14px; color: var(--muted); }
.realm b { color: var(--gold-hi); font-weight: 500; }
.skip { font-family: var(--pixel); font-size: 14px; color: var(--text); text-decoration: none; opacity: .85; padding: 6px 10px; }
.skip:hover { opacity: 1; color: var(--yellow); }
.sel-stage { display: grid; grid-template-columns: 1fr minmax(260px, 320px); align-items: end; gap: 24px; min-height: 0; margin-bottom: -8px; }
.sel-list { align-self: center; }
.sel-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sel-nameplate { text-align: center; margin-bottom: 18px; }
.sel-nameplate h1 { font-family: var(--pixel); font-weight: 600; font-size: clamp(30px, 4.4vw, 52px); color: var(--yellow); margin: 0; line-height: 1; text-shadow: 0 2px 0 #000, 0 0 24px rgba(255,190,60,.25); }
.sel-nameplate .cls { font-family: var(--pixel); font-size: 17px; color: var(--text); margin-top: 8px; }
.sel-nameplate .guild { font-family: var(--pixel); font-size: 15px; color: #7ee07a; margin-top: 2px; }
.altar { position: relative; display: flex; align-items: flex-end; gap: clamp(20px, 5vw, 60px); }
.hero-wrap { outline-offset: 6px; }
.hero-big { width: 160px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); animation: breathe 2.4s steps(2) infinite; }
.torch { width: 80px; position: relative; margin-bottom: 0; }
.torch .f2 { display: none; }
.torch .glow { position: absolute; left: 50%; top: -10px; width: 160px; height: 160px; transform: translate(-50%, -30%); pointer-events: none;
  background: radial-gradient(circle, rgba(255,180,70,.28), transparent 65%); animation: flick 1.6s ease-in-out infinite; }
.torch .sprite { animation: none; }
.torch.anim .f1 { animation: frameA .5s steps(1) infinite; }
.torch.anim .f2 { display: block; position: absolute; inset: 0; animation: frameB .5s steps(1) infinite; }
.pedestal { width: 300px; height: 30px; margin-top: -2px; position: relative;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(0,0,0,.45) 38px 40px) 0 10px / 100% 20px no-repeat,
    linear-gradient(180deg, #8d86a0 0 4px, #615a76 4px 10px, #4a445c 10px 20px, #37324a 20px 26px, #1d1a28 26px);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px, 100% 100%, 0 100%, 0 10px, 10px 10px); }
.pedestal::after { content: ""; position: absolute; left: -20px; right: -20px; top: 30px; height: 10px; }
.sel-list { padding: 16px; max-height: 100%; overflow: auto; }
.sel-list h2 { font-family: var(--pixel); font-weight: 500; font-size: 15px; color: var(--muted); margin: 0 0 10px; text-transform: uppercase; letter-spacing: .08em; text-align: center; }
.char-entry { display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 6px; border: 2px solid transparent; background: transparent; cursor: pointer; text-decoration: none; color: var(--text); }
.char-entry .n { font-family: var(--pixel); font-size: 17px; color: var(--yellow); display: block; }
.char-entry .d { font-size: 14px; color: var(--muted); display: block; line-height: 1.35; }
.char-entry.sel { background: linear-gradient(90deg, rgba(255,209,0,.14), rgba(255,209,0,.03)); border-color: rgba(255,209,0,.55); }
.char-entry.alt .n { color: #b7ad98; }
.char-entry:hover { background: rgba(255,255,255,.05); }
.char-entry.sel:hover { background: linear-gradient(90deg, rgba(255,209,0,.2), rgba(255,209,0,.05)); }
.sel-list .note { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; font-style: italic; }
.sel-bottom { text-align: center; display: grid; gap: 10px; justify-items: center; align-content: center; padding: 18px 0 12px; }
.sel-bottom .tagline { margin: 0 auto; max-width: 640px; font-size: 19px; color: var(--text); text-shadow: 0 1px 2px #000, 0 0 12px rgba(0,0,0,.8); }
.sel-ctas { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.sel-contact { margin: 0; font-size: 15px; color: var(--muted); }
.sel-contact a { color: var(--text); text-decoration-color: rgba(243,210,122,.5); text-underline-offset: 3px; }
.sel-contact a:hover { color: var(--yellow); }
.skip { border-bottom: 1px solid rgba(243,210,122,.5); }

/* ---------- World HUD ---------- */
.world { position: relative; min-height: 100vh; animation: fade .35s ease; }
.unitframe { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 0; z-index: 5; text-decoration: none; color: inherit; }
.uf-portrait { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3b3a5a, #15132a); border: 3px solid var(--gold); box-shadow: 0 0 0 2px #0a0705, 0 4px 10px rgba(0,0,0,.6); display: grid; place-items: center; overflow: hidden; position: relative; z-index: 2; }
.uf-portrait svg { width: 58px; margin-top: 14px; }
.uf-level { position: absolute; bottom: 0; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #1a120a; border: 2px solid var(--gold); display: grid; place-items: center; font-family: var(--pixel); font-size: 13px; color: var(--yellow); z-index: 3; }
.uf-body { margin-left: -14px; padding: 6px 12px 8px 22px; min-width: 210px; }
.uf-name { font-family: var(--pixel); font-size: 16px; color: var(--yellow); line-height: 1.1; }
.bar { height: 12px; margin-top: 5px; position: relative; background: #0b0a08; box-shadow: inset 0 0 0 1px #000; overflow: hidden; }
.bar > i { position: absolute; inset: 1px; background: linear-gradient(180deg, #3fcf4a, #1f8a2a); }
.bar.mana > i { background: linear-gradient(180deg, #4a7fff, #2546b8); }
.bar .short { display: none; }
.bar span { position: relative; z-index: 1; display: block; font-family: var(--pixel); font-size: 13px; line-height: 17px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; white-space: nowrap; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }

.minimap { position: absolute; top: 12px; right: 16px; width: 132px; text-align: center; z-index: 5; }
.mm-zone { font-family: var(--pixel); font-size: 13px; color: var(--yellow); text-shadow: 1px 1px 0 #000; margin-bottom: 4px; }
.mm-ring { width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; padding: 5px; background: conic-gradient(from 20deg, #8a6a2a, #f0cf7a, #8a6a2a, #4a3612, #8a6a2a); box-shadow: 0 0 0 2px #0a0705, 0 6px 14px rgba(0,0,0,.6); position: relative; }
.mm-ring canvas { width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated; display: block; box-shadow: inset 0 0 0 2px #000; }
.mm-ring .you { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -60%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid var(--yellow); filter: drop-shadow(1px 1px 0 #000); }
.mm-clock { position: absolute; bottom: -4px; right: -4px; font-family: var(--pixel); font-size: 12px; background: #120d09; border: 2px solid var(--gold-lo); padding: 1px 6px; color: var(--text); }

.panel-host { position: relative; padding: 108px 16px 150px; display: flex; justify-content: center; align-items: flex-start; z-index: 4; }
.panel { width: min(1180px, 100%); display: flex; flex-direction: column; animation: pop .16s ease-out; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 10px 8px; border-bottom: 2px solid #3a2a14; background: linear-gradient(180deg, #2a2016, #18120c); }
.panel-icon { width: 38px; height: 38px; padding: 5px; background: #0d0a07; box-shadow: inset 0 0 0 2px var(--gold-lo); flex: none; }
.panel-head h2:focus { outline: none; }
.panel-head h2 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: 22px; color: var(--yellow); line-height: 1.1; text-shadow: 1px 1px 0 #000; }
.panel-head h2 small { display: block; font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--muted); text-shadow: none; }
.panel-head .spacer { flex: 1; }
.close { width: 30px; height: 30px; display: grid; place-items: center; text-decoration: none; font-family: var(--pixel); font-size: 18px; color: #ffd8c8; background: linear-gradient(180deg, #a3261d, #5d100c); box-shadow: 0 0 0 2px #0a0705, inset 0 0 0 1px #e8885c; flex: none; }
.close:hover { filter: brightness(1.25); }
.panel-body { padding: 24px;
}
.panel { position: relative; }
@keyframes nudge { 50% { transform: translateY(2px); } }

/* ---------- Action bar ---------- */
.actionbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; padding: 8px 10px; z-index: 6;
  border: 8px solid transparent; border-image: var(--frame) 4 / 8px stretch; background: linear-gradient(180deg, #241c13, #110c08) padding-box; }
.ab-btn { position: relative; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text); padding: 2px 0; }
.ab-icon { width: 48px; height: 48px; padding: 7px; background: radial-gradient(circle at 40% 30%, #3b3324, #120e09); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #5a4320; transition: box-shadow .1s, transform .1s; }
.ab-btn:hover .ab-icon { box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--gold-hi), 0 0 12px rgba(255,209,0,.35); }
.ab-btn.on .ab-icon { box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--yellow), 0 0 14px rgba(255,209,0,.45); }
.ab-btn:active .ab-icon { transform: translateY(1px); }
.ab-key { position: absolute; top: 3px; right: 14px; font-family: var(--pixel); font-size: 12px; color: #e8e8e8; text-shadow: 1px 1px 0 #000; }
.ab-label { font-family: var(--pixel); font-size: 13px; line-height: 1; color: var(--text); white-space: nowrap; }
.ab-btn.on .ab-label { color: var(--yellow); }

/* ---------- Chat ---------- */
.chat { position: fixed; left: 16px; bottom: 16px; width: 360px; z-index: 5; font-size: 14px; background: rgba(8,6,4,.78) padding-box; }
.chat-log { height: auto; max-height: 92px; overflow: auto; padding: 4px 6px; line-height: 1.4; scrollbar-width: none; }
.chat-log p { margin: 0 0 2px; text-shadow: 1px 1px 0 #000; }
.chat-log .sys { color: var(--yellow); }
.chat-log .guild { color: #40ff40; }
.chat-log .whisper { color: #ff80ff; }
.chat-log .say { color: #fff; }
.chat-log .emote { color: #ff9a3c; }
.chat-log .loot { color: #1eff00; }
.chat-log a { color: #7fc8ff; }
.chat form { display: flex; margin-top: 4px; }
.chat input { flex: 1; background: rgba(0,0,0,.65); border: 1px solid #4a3a1e; color: var(--text); font: 14px var(--serif); padding: 5px 8px; }
.chat input::placeholder { color: #8d8270; }

/* idle hero in world */
.idle { position: fixed; left: 50%; bottom: calc(var(--ground, 20vh) - 40px); transform: translateX(-50%); text-align: center; z-index: 3; }
.idle .hero-big { width: 128px; margin: 0 auto; }
.idle .plate { display: inline-block; font-family: var(--pixel); color: var(--yellow); text-shadow: 1px 1px 0 #000; margin-bottom: 8px; padding: 3px 10px; background: rgba(8,6,4,.6); border-radius: 2px; }
.idle .plate small { display: block; color: #7ee07a; font-size: 13px; }
.idle p { display: inline-block; padding: 2px 8px; background: rgba(8,6,4,.55); margin: 10px 0 0; font-family: var(--pixel); font-size: 14px; color: var(--text); text-shadow: 1px 1px 0 #000; }

/* ---------- Tooltip ---------- */
#tooltip { position: fixed; z-index: 100; max-width: 340px; pointer-events: none; padding: 10px 12px; font-size: 15px; line-height: 1.4;
  background: linear-gradient(180deg, rgba(14,16,38,.97), rgba(6,7,20,.97)); border: 1px solid #000; box-shadow: inset 0 0 0 1px #8a8fae, 0 6px 18px rgba(0,0,0,.6); border-radius: 3px; color: #fff; }
#tooltip[hidden] { display: none; }
.tt-title { font-family: var(--pixel); font-size: 17px; font-weight: 500; line-height: 1.2; margin-bottom: 2px; }
.tt-row { display: flex; justify-content: space-between; gap: 16px; color: #fff; }
.tt-row span:last-child { color: #fff; }
.tt-sub { color: #fff; }
.tt-grey { color: #a8a8a8; }
.tt-green { color: #1eff00; margin-top: 4px; }
.tt-yellow { color: var(--yellow); margin-top: 4px; }
.tt-sub { margin-top: 4px; }
.tt-src { color: #a8a8a8; margin-top: 6px; font-size: 13.5px; }
.tt-flavor { color: var(--yellow); font-style: italic; margin-top: 6px; }
.tt-hint { color: #7fc8ff; margin-top: 6px; font-size: 13px; }
.q-poor { color: var(--q-poor); } .q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); }
.q-rare { color: var(--q-rare); } .q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }

/* ---------- Character panel ---------- */
.char { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.doll { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start; }
.slots { display: grid; gap: 6px; }
.slot { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: help; text-align: left; min-width: 0; }
.slots.right .slot { flex-direction: row-reverse; text-align: right; }
.tile { display: grid; place-items: center; flex: none; }
.tile svg { width: 72%; }
.slot-icon { width: 42px; height: 42px;
  background: radial-gradient(circle at 35% 30%, #4a4a5e, #16161f); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px currentColor; }
.slot-icon svg { width: 30px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.6)); }
.slot-meta { min-width: 0; line-height: 1.15; }
.slot-meta b { display: block; font-family: var(--pixel); font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-meta small { font-size: 12px; color: var(--muted); }
.slot:hover .slot-icon, .slot:focus-visible .slot-icon { filter: brightness(1.3); }
.doll-center { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.doll-portrait { width: 170px; height: 220px; display: grid; place-items: end center; padding-bottom: 14px; background: radial-gradient(ellipse at 50% 65%, #2c2e4c, #0e0d18 70%); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #3a3354; }
.doll-portrait svg { width: 120px; }
.doll-name { font-family: var(--pixel); font-size: 18px; color: var(--yellow); margin-top: 10px; text-align: center; line-height: 1.1; }
.doll-cls { font-size: 14px; color: var(--text); text-align: center; }
.doll-guild { font-family: var(--pixel); font-size: 13px; color: #7ee07a; }
.weapons { display: flex; gap: 10px; margin-top: 12px; }
.weapons .slot { flex-direction: column; text-align: center; gap: 4px; }
.weapons .slot-meta b { font-size: 12.5px; }

.about h3 { font-family: var(--pixel); font-weight: 500; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.stat { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed #3a2c18; cursor: help; background: none; border-top: 0; border-left: 0; border-right: 0; text-align: left; }
.stat .k { font-size: 15px; color: var(--text); }
.stat .k small { display: block; font-family: var(--pixel); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.stat .v { font-family: var(--pixel); font-size: 17px; color: #1eff00; white-space: nowrap; }

.about .lede { font-size: 23px; line-height: 1.3; color: #fff; margin: 0 0 12px; }
.about p { margin: 0 0 12px; color: #e3d9c3; }
.doing { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.doing li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; }
.doing li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; background: var(--yellow); box-shadow: 2px 2px 0 #7a5a10; }
.doing b { font-family: var(--pixel); font-weight: 500; color: var(--yellow); font-size: 15.5px; display: block; }
.doing span { color: #d8cdb5; font-size: 15.5px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Spellbook ---------- */
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; box-shadow: 0 0 0 2px #2a1a0a, 0 0 0 6px #5a2a1a, 0 0 0 8px #1a0c06; }
.book .page { padding: 20px 24px; }
.book .page + .page { border-left: 2px solid rgba(80,50,20,.35); box-shadow: inset 12px 0 18px -12px rgba(80,50,20,.45); }
.book-title { font-family: var(--pixel); font-weight: 600; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--parch-muted); margin: 0 0 14px; }
.spell:focus-visible { outline-offset: 0; }
.spell { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(80,50,20,.22); }
.spell:last-child { border-bottom: 0; }
.spell-icon { width: 52px; height: 52px; display: grid; place-items: center; box-shadow: 0 0 0 2px #1a0c06, inset 0 0 0 2px rgba(255,255,255,.25); }
.spell-icon svg { width: 36px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5)); }
.school-arcane { background: radial-gradient(circle at 35% 30%, #c38bff, #4a1c8a); }
.school-holy { background: radial-gradient(circle at 35% 30%, #fff1a0, #b07a12); }
.school-fire { background: radial-gradient(circle at 35% 30%, #ffb35a, #a2280e); }
.school-nature { background: radial-gradient(circle at 35% 30%, #a6ef70, #2c6a1c); }
.school-frost { background: radial-gradient(circle at 35% 30%, #a8e4ff, #1f5c9c); }
.spell h3 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: 17px; color: var(--parch-ink); line-height: 1.15; }
.spell .txt { margin: 0; font-size: 15.5px; color: #4a3519; }

/* ---------- Talents ---------- */
.spec-sum { font-family: var(--pixel); font-size: 15px; color: var(--muted); margin: 0 0 14px; text-align: center; }
.spec-sum b { color: var(--yellow); font-weight: 500; }
.trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tree { padding: 12px 10px 16px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 3px #3a2a14; }
.tree::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, var(--tc), transparent 70%); opacity: .22; pointer-events: none; }
.tree-art { position: absolute; left: 50%; bottom: -10%; width: 70%; transform: translateX(-50%); opacity: .045; pointer-events: none; filter: grayscale(.3); }
.tree h3 { position: relative; margin: 0 0 2px; text-align: center; font-family: var(--pixel); font-weight: 600; font-size: 17px; color: var(--yellow); }
.tree .pts { position: relative; text-align: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.tgrid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; justify-items: center; align-items: start; }
.tcell { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.tname { font-size: 12.5px; line-height: 1.15; color: #d8cdb5; text-align: center; max-width: 92px; }
.tnode { position: relative; width: 48px; height: 48px; display: grid; place-items: center; cursor: help; border: 0; padding: 0;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tc) 75%, white), color-mix(in srgb, var(--tc) 40%, black)); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #1eff00; }
.tnode.max { box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--yellow); }
.tnode svg { width: 30px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.6)); }
.tnode.cap { width: 56px; height: 56px; border-radius: 50%; }
.tnode .rk { position: absolute; right: -10px; bottom: -8px; font-size: 12px; font-weight: 400; background: #0a0705; color: #1eff00; padding: 0 3px; box-shadow: 0 0 0 1px #3a3a3a; text-shadow: none; }
.tnode.max .rk { color: var(--yellow); }
.tnode:hover, .tnode:focus-visible { filter: brightness(1.25); }
.tline { position: absolute; width: 4px; background: #1eff00; opacity: .55; transform: translateX(-50%); box-shadow: 0 0 0 1px #000; }
.talent-detail { margin-top: 14px; min-height: 52px; padding: 10px 14px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px #3a2a14; font-size: 15.5px; color: #d8cdb5; }
.talent-detail b { font-family: var(--pixel); font-weight: 500; color: var(--yellow); }

/* ---------- Two-pane (quests, tomes) ---------- */
.twopane { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; min-height: 0; }
.qlist { display: flex; flex-direction: column; gap: 2px; }
.qgroup { font-family: var(--pixel); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 4px; }
.qitem { display: block; text-decoration: none; color: var(--text); padding: 8px 10px; border: 2px solid transparent; }
.qitem:hover { background: rgba(255,255,255,.05); }
.qitem.sel { background: linear-gradient(90deg, rgba(255,209,0,.14), rgba(255,209,0,.03)); border-color: rgba(255,209,0,.5); }
.qitem .t { font-family: var(--pixel); font-size: 15.5px; color: var(--yellow); display: block; line-height: 1.2; }
.qitem .m { font-size: 13.5px; color: var(--muted); }
.qitem.locked { opacity: .55; cursor: default; }
.qitem.locked .t { color: #9d9d9d; }
.qdetail { padding: 22px 26px; box-shadow: inset 0 0 0 2px rgba(80,50,20,.4); min-width: 0; }
.qdetail h3 { font-family: var(--pixel); font-weight: 600; font-size: 25px; margin: 0; color: var(--parch-ink); line-height: 1.15; }
.qmeta { font-size: 14.5px; color: var(--parch-muted); margin: 4px 0 14px; }
.qmeta .st { color: #1d6f12; font-weight: 700; }
.qdetail .pitch { font-size: 19px; font-weight: 700; margin: 0 0 10px; line-height: 1.35; }
.qdetail p { margin: 0 0 12px; }
.qdetail h4 { font-family: var(--pixel); font-weight: 600; font-size: 16px; color: #6a2a10; margin: 18px 0 6px; }
.objectives { list-style: none; padding: 0; margin: 0; }
.objectives li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin: 4px 0; }
.objectives li::before { content: ""; width: 12px; height: 12px; margin-top: 6px; border: 2px solid var(--parch-ink); background: rgba(255,255,255,.35); }
.rewards { display: flex; flex-wrap: wrap; gap: 8px; }
.reward { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: rgba(40,25,10,.88); color: var(--q-rare); font-family: var(--pixel); font-size: 14px; box-shadow: 0 0 0 1px #000; }
.reward .tile { width: 24px; height: 24px; background: radial-gradient(circle at 35% 30%, #4a4a5e, #16161f); box-shadow: inset 0 0 0 1px var(--q-rare); }
.reward .tile svg { width: 18px; }
.repo { margin-top: 18px; font-size: 14.5px; color: var(--parch-muted); font-style: italic; }

/* ---------- Map ---------- */
.mapwrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.map { position: relative; aspect-ratio: 160 / 96; box-shadow: 0 0 0 2px #2a1a0a, 0 0 0 5px #6b4a1e, 0 0 0 7px #120a04; }
.map canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.map-title { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); font-family: var(--pixel); font-weight: 600; font-size: clamp(13px, 1.6vw, 18px); color: #4a2e12; background: rgba(232,214,168,.85); padding: 2px 12px; box-shadow: 0 0 0 2px #5c3d1e; white-space: nowrap; }
.compass { position: absolute; right: 3%; bottom: 5%; width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--pixel); font-size: 12px; color: #4a2e12; }
.compass::before { content: ""; position: absolute; inset: 6px; border: 2px solid #5c3d1e; border-radius: 50%; }
.compass::after { content: ""; position: absolute; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 18px solid #9a2a1e; top: 2px; }
.compass span { position: relative; margin-top: 24px; }
.pin { position: absolute; transform: translate(-50%, -100%); background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.pin .flag { width: 18px; height: 22px; position: relative; }
.pin .flag::before { content: ""; position: absolute; left: 2px; top: 0; width: 3px; height: 22px; background: #2a1a0a; }
.pin .flag::after { content: ""; position: absolute; left: 5px; top: 1px; width: 12px; height: 9px; background: #9a2a1e; box-shadow: inset 0 0 0 1px #2a1a0a; }
.pin.current .flag::after { background: var(--yellow); animation: wave 1s steps(2) infinite; }
.pin.home .flag::after { background: #2f6fd0; }
.pin .lbl { margin-top: 2px; font-family: var(--pixel); font-size: clamp(10px, 1.05vw, 13px); color: #2a1a0a; background: rgba(240,226,186,.92); padding: 0 5px; box-shadow: 0 0 0 1px #5c3d1e; white-space: nowrap; line-height: 1.5; }
.pin .lbl small { color: #7a5a32; margin-left: 4px; }
.pin.sel .lbl { background: #2a1a0a; color: var(--yellow); }
.pin.sel .lbl small { color: #e8d6a8; }
.pin:hover .lbl { filter: brightness(1.08); }
.zone { padding: 18px 20px; }
.zone .lv { font-family: var(--pixel); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.zone h3 { font-family: var(--pixel); font-weight: 600; font-size: 24px; color: var(--yellow); margin: 2px 0 0; line-height: 1.1; }
.zone .org { font-size: 17px; color: #fff; margin: 4px 0 2px; }
.zone .org small { display: block; color: var(--muted); font-size: 14px; }
.role { margin: 10px 0 0; padding: 8px 10px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px #3a2a14; }
.role b { font-family: var(--pixel); font-weight: 500; font-size: 15px; color: var(--q-rare); display: block; filter: brightness(1.25); }
.role span { font-size: 14px; color: var(--muted); }
.zone h4 { font-family: var(--pixel); font-weight: 500; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 14px 0 6px; }
.done { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.done li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; font-size: 15px; color: #e3d9c3; line-height: 1.4; }
.done li::before { content: "✓"; font-family: var(--pixel); color: var(--yellow); }
.loot li::before { content: "◆"; color: var(--q-epic); font-size: 12px; margin-top: 3px; }
.loot li { color: var(--q-epic); filter: brightness(1.2); }
.zone-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.zone-nav .btn { font-size: 13px; padding: 4px 12px; }
.zone-nav .btn[aria-disabled="true"] { opacity: .35; cursor: default; filter: none; }

/* ---------- Tomes ---------- */
.shelf { display: flex; flex-direction: column; gap: 10px; }
.tome-card { display: grid; grid-template-columns: 34px 1fr; gap: 12px; text-decoration: none; color: var(--text); padding: 8px; border: 2px solid transparent; }
.tome-card:hover { background: rgba(255,255,255,.05); }
.tome-card.sel { border-color: rgba(255,209,0,.5); background: rgba(255,209,0,.06); }
.spine { width: 34px; height: 92px; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px rgba(255,255,255,.12); position: relative; }
.spine::before, .spine::after { content: ""; position: absolute; left: 4px; right: 4px; height: 3px; background: var(--gold); }
.spine::before { top: 12px; } .spine::after { bottom: 12px; }
.tome-card .t { font-family: var(--pixel); font-size: 16px; color: var(--yellow); line-height: 1.2; display: block; }
.tome-card .s { font-size: 13.5px; color: var(--muted); display: block; margin-top: 2px; }
.reader { padding: 28px clamp(20px, 4vw, 48px); min-width: 0; }
.reader .eyebrow { font-family: var(--pixel); font-size: 13px; color: var(--parch-muted); text-transform: uppercase; letter-spacing: .1em; }
.reader h3 { font-family: var(--pixel); font-weight: 600; font-size: clamp(24px, 3vw, 32px); margin: 4px 0 18px; line-height: 1.1; }
.prose { max-width: 66ch; font-size: 18px; line-height: 1.6; }
.prose p { margin: 0 0 14px; }
.prose > p:first-child::first-letter { float: left; font-family: var(--pixel); font-weight: 700; font-size: 3.2em; line-height: .85; margin: 4px 8px 0 0; color: #7a2b2b; }
.prose h4 { font-family: var(--pixel); font-weight: 600; font-size: 19px; margin: 24px 0 8px; color: #6a2a10; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }

/* ---------- Armory / résumé ---------- */
.armory { max-width: 860px; margin: 0 auto; padding: 30px clamp(20px, 4vw, 44px); box-shadow: inset 0 0 0 2px rgba(80,50,20,.4); }
.cv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; border-bottom: 2px solid rgba(80,50,20,.4); padding-bottom: 14px; }
.cv-head h1, .cv-head h3 { font-family: var(--pixel); font-weight: 600; font-size: 32px; margin: 0; line-height: 1; }
.cv-head .ttl { font-size: 18px; margin-top: 6px; }
.cv-contact { font-size: 15px; color: var(--parch-muted); margin-top: 4px; }
.cv-contact a { color: #6a2a10; }
.cv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.armory h4 { font-family: var(--pixel); font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: #6a2a10; margin: 22px 0 8px; }
.armory p { margin: 0 0 8px; }
.cv-co { margin: 14px 0 0; }
.cv-co .co { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 18px; }
.cv-co .co span { font-weight: 400; font-size: 15px; color: var(--parch-muted); }
.cv-co .co-note { font-style: italic; font-size: 15px; color: var(--parch-muted); }
.cv-role { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-style: italic; font-size: 16px; }
.cv-role span { font-style: normal; font-size: 15px; color: var(--parch-muted); }
.armory ul { margin: 4px 0 0; padding-left: 20px; font-size: 16px; }
.armory li { margin: 3px 0; }
.cv-skills { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; font-size: 16px; }
.cv-skills b { font-weight: 700; }

/* ---------- Loot toast ---------- */
.toast { position: fixed; left: 50%; top: 22%; transform: translate(-50%, 0); z-index: 50; display: flex; gap: 12px; align-items: center; padding: 10px 18px 10px 10px; pointer-events: none; opacity: 0;
  background: rgba(8,8,20,.92); box-shadow: inset 0 0 0 1px #8a8fae, 0 8px 24px rgba(0,0,0,.6); border-radius: 3px; }
.toast.show { animation: loot 3.2s ease forwards; }
.toast-icon { width: 40px; height: 40px; padding: 4px; background: radial-gradient(circle at 35% 30%, #4a4a5e, #16161f); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px var(--q-epic); }
.toast small { display: block; font-size: 13px; color: #fff; }
.toast b { font-family: var(--pixel); font-weight: 500; font-size: 17px; }
@keyframes loot { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.96); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1.03); } 14% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- Animations ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes flick { 0%,100% { opacity: .85; } 45% { opacity: 1; } 70% { opacity: .7; } }
@keyframes frameA { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes frameB { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes wave { 0% { transform: skewY(0); } 50% { transform: skewY(-8deg); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 25% { transform: translateY(-12px); } 50% { transform: translateY(0); } 75% { transform: translateY(-6px); } }
.dance { animation: bounce .5s steps(4) 4 !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
.world.has-panel .chat { display: none; }
@media (max-width: 980px) {
  .char { grid-template-columns: 1fr; }
  .char > .about { order: -1; }
  .mapwrap { grid-template-columns: 1fr; }
  .trees { grid-template-columns: 1fr; }
  .twopane { grid-template-columns: 1fr; }
  .book { grid-template-columns: 1fr; }
  .book .page + .page { border-left: 0; border-top: 2px solid rgba(80,50,20,.35); box-shadow: none; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .chat { display: none; }
  .hero-big { width: 128px; }
  .pedestal { width: 240px; }
  .sel-stage { padding-bottom: 0; }
  .select { padding: 14px 16px 16px; overflow: auto; grid-template-rows: auto 1fr auto; }
  .sel-stage { margin-bottom: 0; }
  .sel-nameplate { margin-bottom: 10px; }
  .sel-bottom { padding: 14px 0 0; gap: 8px; }
  .sel-bottom .tagline { font-size: 17px; }
  .btn.big { font-size: 19px; padding: 8px 28px; }
  .sel-stage { grid-template-columns: 1fr; }
  .sel-list { display: none; }
  .torch { display: none; }
  .uf-portrait { width: 52px; height: 52px; }
  .uf-portrait svg { width: 42px; margin-top: 10px; }
  .uf-body { min-width: 0; width: calc(100vw - 150px); padding-left: 18px; }
  .uf-level { width: 20px; height: 20px; font-size: 11px; }
  .uf-body { min-width: 150px; }
  .minimap { width: 64px; right: 10px; top: 54px; }
  .unitframe { top: 54px; left: 10px; }
  .mm-zone { display: none; }
  .mm-ring { width: 60px; height: 60px; padding: 3px; }
  .mm-clock { font-size: 10px; right: -6px; }
  .panel-host { padding: 130px 8px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .panel-body { padding: 14px; }
  .panel-head h2 { font-size: 18px; }
  .actionbar { left: 8px; right: 8px; transform: none; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; gap: 0; padding: 4px; overflow-x: auto; }
  .ab-btn { width: auto; flex: 1 1 0; min-width: 0; }
  .ab-icon { width: 38px; height: 38px; padding: 6px; }
  .ab-label { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .ab-key { display: none; }
  .ab-label { font-size: 10.5px; }
  .doll { grid-template-columns: 1fr 1fr; }
  .doll-center { grid-column: 1 / -1; order: -1; }
  .slots.right .slot { flex-direction: row; text-align: left; }
  .stats { grid-template-columns: 1fr; }
  .about .lede { font-size: 20px; }
  .cv-skills { grid-template-columns: 1fr; }
}
@media (max-height: 820px) and (min-width: 981px) {
  .tgrid { gap: 4px 4px; }
  .tcell { gap: 7px; }
  .tnode { width: 40px; height: 40px; } .tnode svg { width: 26px; }
  .tnode.cap { width: 46px; height: 46px; }
  .tree h3 { font-size: 16px; } .tree .pts { margin-bottom: 8px; }
  .spec-sum { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .pin:not(.sel) .lbl { display: none; }
  .map-title { font-size: 11px; top: 2%; }
}
@media (max-width: 420px) {
  .ab-label { display: none; }
}

/* ---------- Mode toggle ---------- */
.mode-toggle { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; padding: 3px; gap: 2px;
  background: rgba(10,8,6,.82); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--gold-lo); border-radius: 3px; }
.mode-toggle a { font-family: var(--pixel); font-size: 13px; color: var(--muted); text-decoration: none; padding: 5px 12px; border-radius: 2px; }
.mode-toggle a:hover { color: var(--text); }
.mode-toggle a.on { background: linear-gradient(180deg, #3a2e1c, #251c11); color: var(--yellow); box-shadow: inset 0 0 0 1px var(--gold); }
.mode-personal .sel-top { padding-top: 36px; }
@media (min-width: 761px) { .mode-personal .sel-top { padding-top: 0; } }

/* ---------- Skills panel ---------- */
.skillwrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.skilltabs { display: flex; flex-direction: column; gap: 4px; }
.skilltabs a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; color: var(--text); font-family: var(--pixel); font-size: 15px; border: 2px solid transparent; }
.skilltabs a:hover { background: rgba(255,255,255,.05); }
.skilltabs a.on { color: var(--yellow); border-color: rgba(255,209,0,.5); background: linear-gradient(90deg, rgba(255,209,0,.14), rgba(255,209,0,.03)); }
.st-icon { width: 32px; height: 32px; padding: 5px; flex: none; background: radial-gradient(circle at 35% 30%, #4a4a5e, #16161f); box-shadow: 0 0 0 2px #000, inset 0 0 0 1px #5a4320; }
.skilllist { padding: 22px 26px; box-shadow: inset 0 0 0 2px rgba(80,50,20,.4); }
.skilllist h3 { font-family: var(--pixel); font-weight: 600; font-size: 22px; margin: 0 0 10px; }
.skilllist dl { margin: 0; }
.skillrow { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(80,50,20,.22); }
.skillrow:last-child { border-bottom: 0; }
.skillrow dt { font-weight: 700; }
.skillrow dd { margin: 0; color: #4a3519; }

/* ---------- Professional mode ---------- */
.mode-pro { background: #100c09; }
.mode-pro #scene { position: absolute; top: 0; left: 0; width: 100%; height: auto; }
.mode-pro .vignette { display: none; }
.pro-hero { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 18px;
  background: linear-gradient(180deg, transparent 55%, rgba(16,12,9,.65) 85%, #100c09); }
.pro-hero-inner { width: min(880px, 100%); display: flex; align-items: center; gap: 18px; }
.pro-portrait { width: 84px; height: 84px; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3b3a5a, #15132a); border: 3px solid var(--gold); box-shadow: 0 0 0 2px #0a0705; display: grid; place-items: center; overflow: hidden; }
.pro-portrait svg { width: 66px; margin-top: 16px; }
.pro-hero h1 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: clamp(30px, 4vw, 44px); color: var(--yellow); line-height: 1; text-shadow: 0 2px 0 #000; }
.pro-title { margin: 6px 0 0; font-size: 17px; color: var(--text); text-shadow: 0 1px 2px #000; }
.pro { width: min(880px, 100%); margin: 0 auto; padding: 8px 16px 64px; }
.pro-lede { font-size: 22px; line-height: 1.4; color: #fff; margin: 10px 0 16px; }
.pro-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pro-sec { margin-top: 44px; }
.pro-sec h2 { font-family: var(--pixel); font-weight: 500; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #3a2a14; }
.pro-sec p { color: #e3d9c3; margin: 0 0 12px; }
.pro-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pro-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pro-card { padding: 16px 18px; background: #18120d; box-shadow: inset 0 0 0 1px #3a2a14; }
.pro-card h3, .pro-principle h3, .pro-skill h3, .tl-head h3 { font-family: var(--pixel); font-weight: 500; font-size: 17px; color: var(--yellow); margin: 0 0 6px; }
.pro-card p { font-size: 16px; margin: 0 0 8px; }
.pro-tags { font-size: 14px !important; color: #c4b89c !important; }
.pro-status { font-family: var(--pixel); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.pro-principle { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.pro-principle p { font-size: 16px; margin: 0; }
.pi { width: 40px; height: 40px; padding: 7px; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px rgba(255,255,255,.2); }
.pro-timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid #3a2a14; }
.pro-timeline > li { position: relative; margin-bottom: 26px; }
.pro-timeline > li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 10px; height: 10px; background: var(--gold); box-shadow: 0 0 0 2px #100c09, 0 0 0 3px var(--gold-lo); }
.pro-timeline > li:first-child::before { background: var(--yellow); }
.tl-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.tl-head h3 { margin: 0; font-size: 19px; }
.tl-head span { font-size: 15px; color: #c4b89c; }
.tl-roles { font-size: 16px; color: #fff; margin: 2px 0 6px; }
.tl-roles span { color: #c4b89c; font-size: 15px; }
.pro-timeline ul { margin: 0; padding-left: 18px; color: #d8cdb5; font-size: 16px; }
.pro-timeline ul li { margin: 3px 0; }
.pro-skill { padding: 14px 16px; background: #18120d; box-shadow: inset 0 0 0 1px #3a2a14; }
.pro-skill ul { margin: 0; padding-left: 18px; font-size: 15.5px; color: #d8cdb5; }
.pro-skill li { margin: 4px 0; }
.pro-skill b { color: #fff; font-weight: 500; }
.pro-note { font-size: 15px !important; color: #c4b89c !important; }
.pro-foot { margin-top: 52px; padding-top: 18px; border-top: 1px solid #3a2a14; }
.pro-foot a, .pro-sec a { color: var(--gold-hi); }
@media (max-width: 760px) {
  .pro-grid2, .pro-grid3 { grid-template-columns: 1fr; }
  .pro-lede { font-size: 19px; }
  .skillwrap { grid-template-columns: 1fr; }
  .skilltabs { flex-direction: row; flex-wrap: wrap; }
  .skilltabs a { font-size: 13px; padding: 6px 8px; }
  .skillrow { grid-template-columns: 1fr; gap: 2px; }
}

/* soil band behind the fixed action bar so scrolled content fades out under it */
.world::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: 5; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(13,11,8,.85) 55%, #0d0b08); }
.world:not(.has-panel)::after { display: none; }
@media (max-width: 760px) {
  .mode-toggle { top: calc(8px + env(safe-area-inset-top, 0px)); }
  .mode-toggle a { font-size: 12px; padding: 4px 10px; }
  .pro-hero { background: linear-gradient(180deg, transparent 20%, rgba(16,12,9,.82) 60%, #100c09); }
  .pro-portrait { width: 64px; height: 64px; } .pro-portrait svg { width: 50px; margin-top: 12px; }
  .world::after { height: 90px; }
}

/* Desktop: render the game UI at ~80% so panels, HUD and text fit a laptop screen at 100% browser zoom.
   The scene canvas stays full-size; only the UI layers scale. */
@media (min-width: 1100px) {
  .mode-personal .panel-host,
  .mode-personal .unitframe,
  .mode-personal .minimap,
  .mode-personal .actionbar,
  .mode-personal .chat,
  .mode-personal .toast,
  .mode-personal .mode-toggle,
  .mode-personal .sel-top,
  .mode-personal .sel-stage,
  .mode-personal .sel-bottom { zoom: 0.82; }
}

/* ---------- Eval charts (Forever Planner quest) ---------- */
.evals h5 { font-family: var(--pixel); font-weight: 600; font-size: 15px; color: #6a2a10; margin: 16px 0 6px; }
.echart { display: grid; gap: 6px; }
.erow { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: center; }
.elabel { font-family: var(--pixel); font-size: 14px; line-height: 1.15; }
.elabel small { display: block; font-family: var(--serif); font-size: 12.5px; color: var(--parch-muted); }
.ebars { display: grid; gap: 3px; }
.ebar-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.ebar { position: relative; display: block; height: 16px; background: rgba(60,40,15,.15); box-shadow: inset 0 0 0 1px rgba(60,40,15,.35); }
.ebar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.25); }
.ev { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--parch-ink); font-variant-numeric: tabular-nums; }
.s-overlap { --c: #c99a2e; } .s-faithful { --c: #5f8f3a; } .s-cost { --c: #9a4a2a; }
.s-model0 { --c: #2f6fb0; } .s-model1 { --c: #8a3fb8; } .s-model2 { --c: #c99a2e; }
.elegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: 15px; }
.elegend i { display: inline-block; width: 12px; height: 12px; background: var(--c); margin-right: 5px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.ex { margin: 6px 0; padding: 8px 12px; background: rgba(255,250,235,.45); box-shadow: inset 0 0 0 1px rgba(80,50,20,.35); }
.ex.best { border-left: 4px solid #5f8f3a; } .ex.worst { border-left: 4px solid #9a4a2a; }
.ex summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ex-title { font-family: var(--pixel); font-size: 14px; }
.ex-scores { font-size: 14px; color: var(--parch-muted); }
.ex-prompt { font-style: italic; margin: 8px 0 4px; }
.ex-answer { white-space: pre-wrap; font-size: 15px; max-height: 320px; overflow: auto; padding: 8px 10px; background: rgba(255,255,255,.4); margin: 6px 0; }
.ex-judge { white-space: pre-wrap; font-size: 14px; color: var(--parch-muted); }
@media (max-width: 760px) { .erow { grid-template-columns: 1fr; gap: 2px; } }
.parchment .aside { color: var(--parch-muted); }
