:root { --k: 1; --vw: calc(1vw / var(--k)); --vh: calc(1vh / var(--k)); } /* vw/vh under the UI zoom (src/ui/scale.js) */
:root {
  --bg: #07060a;
  --line: rgba(200, 160, 100, 0.22);
  --line2: rgba(214, 170, 104, 0.5);
  --gold: #e3b866;
  --gold2: #ffe0a0;
  --bronze: #8a6236;
  --text: #efe6d6;
  --muted: #a89c88;
  --red: #e0453a;
  /* One family (Hahmlet). Weights: body text 400, labels and subheads 500-700, headlines 600-700. */
  --font: 'Hahmlet', 'AppleMyungjo', serif;
  --display: 'Hahmlet', 'AppleMyungjo', serif;
  --latin: 'Hahmlet', serif;
  /* Spacing scale: every gap, padding and margin in the UI comes from these steps. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --stone: repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 5px), linear-gradient(180deg, rgba(28, 21, 18, .95), rgba(11, 9, 11, .97));
  --gild: linear-gradient(180deg, #fff4d8 0%, #f0c779 45%, #a8672a 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 400; overflow: hidden; user-select: none; -webkit-user-select: none; }
/* Line breaking: Korean wraps between words (never mid-word), long unbroken strings still wrap,
   headings balance their lines and paragraphs avoid a lone last word. */
html { word-break: keep-all; overflow-wrap: break-word; line-break: strict; }
h1, h2, h3, h4, h5, .nick-q, .cc-name, .a-title, .a-sub, .bi-name, .pp-body h3 { text-wrap: balance; }
p, li, .note, .tagline, .cc-text, .cc-hint, .story, .tip span, .itip { text-wrap: pretty; }
body::after { content: ''; position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6) 100%); }
canvas#game { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; }
/* No visible scrollbars anywhere (menus, chat, loot); wheel and touch scrolling still work. */
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
kbd { font-family: var(--latin); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 1px; border: 1px solid var(--line2); background: linear-gradient(180deg, #2a1f16, #0e0a08); color: var(--gold2); box-shadow: inset 0 1px 0 rgba(255,220,160,.15), 0 1px 2px #000; }
input, select { font-family: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: rgba(0,0,0,.5); border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 11px 14px; outline: none; box-shadow: inset 0 2px 10px rgba(0,0,0,.7); transition: border-color .2s, background .2s; }
input:focus, select:focus { border-bottom-color: var(--gold); background: linear-gradient(0deg, rgba(227,184,102,.08), rgba(0,0,0,.55) 60%); }
select option { background: #120e0c; }

/* ---------- frames ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 5; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(20,10,6,.55), rgba(3,2,4,.85)); }
.panel, .mcard, .inventory, .shop, .tip, .itip { background: linear-gradient(180deg, rgba(22,17,15,.94), rgba(9,8,9,.96)); box-shadow: 0 30px 80px rgba(0,0,0,.75); }
.panel { width: min(560px, 100%); padding: var(--s6); animation: rise .35s ease-out both; }
.panel.center { text-align: center; width: min(380px, 100%); }
.panel h2, .mcard h3, .inv-head h3 { font-family: var(--display); font-weight: 600; letter-spacing: .06em; }
.panel h2 { margin: 0 0 var(--s4); font-size: 34px; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 2px #000); }
.note { color: var(--muted); font-size: 14px; line-height: 1.75; }
.row { display: flex; gap: var(--s3); justify-content: center; margin-top: var(--s5); flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s4); }

/* ---------- buttons: bevelled plates with pointed ends ---------- */
.btn { --k: 12px; --bd: rgba(255,225,170,.14); --fill: linear-gradient(180deg, #2e241b, #140f0d); position: relative; isolation: isolate; appearance: none; border: 0; background: none; color: var(--text); font: 500 15px/1.2 var(--font); letter-spacing: .04em; padding: 13px 28px; cursor: pointer; transition: transform .1s, filter .2s, color .2s; }
.btn::before, .btn::after { content: ''; position: absolute; z-index: -1; clip-path: polygon(var(--k) 0, calc(100% - var(--k)) 0, 100% 50%, calc(100% - var(--k)) 100%, var(--k) 100%, 0 50%); }
.btn::before { inset: 0; background: var(--bd); }
.btn::after { inset: 1px; background: var(--fill); box-shadow: inset 0 1px 0 rgba(255,230,180,.12); }
.btn:hover { --bd: rgba(255,225,170,.4); color: #fff3dc; filter: drop-shadow(0 0 10px rgba(227,184,102,.3)); }
.btn:active { transform: translateY(1px); }
.btn small { color: var(--muted); font-weight: 400; margin-left: var(--s2); font-size: 12px; }
.btn.primary { --bd: linear-gradient(180deg, #d8773e, #7a2410); --fill: linear-gradient(180deg, #9c3618 0%, #5c170c 55%, #360c07 100%); color: #ffecc8; text-shadow: 0 0 12px rgba(255,150,60,.7), 0 1px 0 #000; filter: drop-shadow(0 0 14px rgba(200,90,30,.35)); }
.btn.primary:hover { filter: drop-shadow(0 0 22px rgba(255,130,50,.6)) brightness(1.12); }
.btn.big { --k: 18px; font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: .3em; padding: 15px 20px 15px calc(20px + .3em); }
.btn.ghost { --bd: rgba(255,225,170,.08); --fill: linear-gradient(180deg, rgba(20,15,12,.8), rgba(8,6,6,.8)); font-weight: 500; color: #d8ccb6; }
.btn.small { --k: 8px; padding: 8px 18px; font-size: 13px; }
.link-btn { padding: 4px 0; background: none; border: 0; cursor: pointer; font: 500 13px var(--font); letter-spacing: .08em; color: var(--muted); transition: color .2s; }
.link-btn:hover { color: var(--gold2); }
.link { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; font-family: inherit; font-size: 12px; }

/* ---------- logo ---------- */
.logo { display: flex; flex-direction: column; line-height: 1; }
.logo-en { font-family: var(--display); font-weight: 600; font-size: clamp(56px, calc(5.6 * var(--vw)), 80px); letter-spacing: .08em; margin-right: -.08em; white-space: nowrap; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255,130,50,.45)) drop-shadow(0 4px 3px #000); padding: var(--s1) 0; }
.logo-ko { font-family: var(--display); font-weight: 500; font-size: clamp(14px, calc(1.4 * var(--vw)), 17px); letter-spacing: .9em; margin-right: -.9em; color: var(--gold); margin-top: var(--s3); padding-left: .2em; text-shadow: 0 0 12px rgba(227,184,102,.4); }
.logo::after { content: ''; height: 1px; margin-top: var(--s4); background: linear-gradient(90deg, var(--gold), rgba(227,184,102,.25) 60%, transparent); }

/* loading */
.loading { flex-direction: column; gap: var(--s6); background: radial-gradient(ellipse at center, #1f140e, #050407 70%); }
.loading .logo { align-items: center; text-align: center; }
.loading .logo::after { width: 100%; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.lbar { position: relative; width: min(380px, calc(70 * var(--vw))); height: 3px; background: rgba(255,255,255,.08); }
.lbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a3a12, #e3a050, #ffe0a0); box-shadow: 0 0 14px #e3a050; transition: width .2s; }
.lt { color: var(--muted); font-size: 14px; letter-spacing: .12em; }

/* ---------- menu ---------- */
.menu { justify-content: flex-start; align-items: stretch; padding: 0; background: linear-gradient(90deg, rgba(5,4,8,.94) 0%, rgba(5,4,8,.8) 34%, rgba(5,4,8,0) 60%); }
.tagline { color: #cdbfa8; font-size: 15px; line-height: 1.85; margin: 0; }
.hero { display: contents; }
.classes { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); }
.cls { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s3) var(--s1); border: 0; background: rgba(0,0,0,.28); color: var(--text); cursor: pointer; transition: background .2s, transform .15s; }
.cls svg { width: 34px; height: 34px; padding: 5px; color: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 60%, transparent)); }
.cls b { font-size: 15px; font-weight: 700; }
.cls em { font-style: normal; font-family: var(--latin); font-size: 11px; font-weight: 700; color: var(--muted); }
.cls:hover { background: rgba(255,240,210,.06); transform: translateY(-2px); }
.cls.on { background: linear-gradient(0deg, color-mix(in srgb, var(--c) 30%, transparent), transparent 90%); box-shadow: inset 0 -2px 0 var(--c); }
.cls.on::after { content: ''; position: absolute; bottom: -6px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: var(--c); box-shadow: 0 0 10px var(--c); }
.ci-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.ci-name { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: text; }
.ci-name input { flex: 0 1 auto; field-sizing: content; min-width: 2ch; max-width: 100%; padding: 2px 0 4px; font-family: var(--display); font-weight: 600; font-size: 26px; color: #fff0d6; background: none; border: 0; border-bottom: 1px dashed transparent; box-shadow: none; transition: border-color .2s; }
.ci-name:hover input { border-bottom-color: var(--line2); }
.ci-name input:focus { background: none; border-bottom: 1px solid var(--gold); }
.ci-name svg { flex: none; width: 16px; height: 16px; color: var(--muted); transition: color .2s; }
.ci-name:hover svg, .ci-name:focus-within svg { color: var(--gold2); }
.ci-head span { flex: none; }
.ci-head span { font-size: 13px; color: var(--gold); }
.ci-head span b { font-family: var(--latin); font-size: 16px; font-weight: 700; color: var(--gold2); margin-left: 2px; }
/* job level (big numeral) beside the job XP bar, under the class tabs */
.joblv { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s4); }
.jl-num { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.jl-num small { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.jl-num b { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255,150,60,.45)) drop-shadow(0 2px 2px #000); }
.ci-spec { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s4); font-size: 13px; color: var(--text); }
.ci-spec b { font-size: 15px; font-weight: 700; }
.ci-spec span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { flex: none; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border: 1px solid currentColor; }
.role.tank { color: #8fc4ff; } .role.dps { color: #ff9a7a; } .role.heal { color: #7dffb0; }
.ci-skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.cis { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s2); font-size: 12px; font-weight: 400; color: #cdbfa8; text-align: center; }
.cis svg { width: 40px; height: 40px; padding: 8px; color: var(--gold2); background: radial-gradient(circle at 50% 40%, rgba(255,220,160,.1), rgba(0,0,0,.35) 70%); }
.cis kbd { position: absolute; top: -4px; left: calc(50% - 30px); font-size: 10px; padding: 1px 5px; }
.xpline { margin: 0; }
.xpl { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s2); font-size: 12px; }
.xpl span { font-weight: 700; letter-spacing: .04em; color: var(--gold); }
.xpl b { font-family: var(--latin), var(--font); font-weight: 700; color: #d8ccb6; }
.xpbar { height: 5px; background: rgba(255,255,255,.08); }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #a8702a, var(--gold2)); box-shadow: 0 0 8px rgba(227,184,102,.6); }
.actions { display: flex; flex-direction: column; gap: var(--s3); }
/* chapter picker: a centred title block, the numeral between diamond chevrons */
.diff-pick { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s2) 0 var(--s4); text-align: center; }
.diff-pick::before { content: ''; position: absolute; left: 50%; top: 42%; z-index: -1; width: 300px; height: 170px; transform: translate(-50%, -50%); pointer-events: none; background: radial-gradient(ellipse, rgba(255,130,50,.2), transparent 70%); }
.diff-pick .dl { display: flex; align-items: center; gap: var(--s3); font-size: 12px; font-weight: 700; letter-spacing: .5em; color: var(--gold); }
.diff-pick .dl::before, .diff-pick .dl::after { content: ''; width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.diff-pick .dl::after { margin-left: -.5em; background: linear-gradient(270deg, transparent, var(--gold)); }
.dp-main { display: flex; align-items: center; gap: var(--s5); }
.dp-main b { min-width: 104px; font-family: var(--display); font-weight: 700; font-size: 68px; line-height: 1.05; letter-spacing: .04em; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,130,50,.55)) drop-shadow(0 3px 3px #000); }
.diff-pick .dch { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: .14em; margin-right: -.14em; color: #fff0d6; text-shadow: 0 0 16px rgba(255,150,70,.45), 0 2px 3px #000; }
.diff-pick em { font-style: normal; font-size: 12px; line-height: 1.7; color: var(--muted); }
.tier-pick { display: flex; gap: var(--s1); margin-top: var(--s1); }
.tier { min-width: 64px; padding: 5px var(--s3); font: 500 13px var(--font); letter-spacing: .06em; color: var(--muted); background: rgba(0,0,0,.35); border: 1px solid rgba(255,226,160,.18); cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.tier:hover:not(:disabled) { color: #fff0d6; border-color: rgba(255,226,160,.5); }
.tier.on { color: #fff0d6; border-color: var(--gold); background: rgba(227,184,102,.14); }
.tier.t1.on { color: #ffd0a0; border-color: #e8894a; background: rgba(232,137,74,.16); }
.tier.t2.on { color: #f0d0ff; border-color: #b57ae0; background: rgba(181,122,224,.18); }
.tier:disabled { opacity: .35; cursor: default; }
.diff-tag em { font-style: normal; color: #ffb87a; }
.diff-tag em.t2 { color: #d8a8ff; }
.dstep { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: var(--gold2); background: rgba(0,0,0,.35); border: 1px solid rgba(255,226,160,.4); transform: rotate(45deg); transition: background .2s, border-color .2s, box-shadow .2s; }
.dstep svg { width: 18px; height: 18px; transform: rotate(-45deg); }
.dstep:hover:not(:disabled) { background: rgba(227,184,102,.18); border-color: var(--gold2); box-shadow: 0 0 16px rgba(227,184,102,.4); }
.dstep:disabled { opacity: .22; cursor: default; }
.dstep-gap { width: 36px; }
.join { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); }
.join input { font-family: var(--latin), var(--font); text-transform: uppercase; letter-spacing: .4em; text-align: center; font-weight: 700; }
.sub { display: flex; justify-content: center; gap: var(--s5); margin-top: var(--s2); }
/* camp home: title top left with the camp scene under it; the right panel centres the hero and,
   set apart below it by extra space, the chapter and entry buttons; links and credits bottom left */
.menu.home { justify-content: flex-end; background: radial-gradient(ellipse 60% 55% at 0% 0%, rgba(5,4,8,.85), transparent 70%), linear-gradient(270deg, rgba(5,4,8,.95) 0%, rgba(5,4,8,.82) 30%, rgba(5,4,8,0) 52%); }
.menu-title { position: absolute; top: var(--s6); left: var(--s7); width: min(460px, calc(42 * var(--vw))); display: flex; flex-direction: column; gap: var(--s4); animation: rise .8s ease-out both; }
.menu-right { width: min(520px, 100%); height: 100%; padding: var(--s5) var(--s7) var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s5); overflow-y: auto; animation: rise .8s .1s ease-out both; }
.mr-inner { margin: auto 0; display: flex; flex-direction: column; gap: var(--s5); }
.menu-right .actions { margin-top: var(--s6); }
.menu-right .diff-pick { gap: var(--s1); padding: 0 0 var(--s2); }
.menu-right .dp-main b { font-size: 56px; min-width: 88px; }
.menu-right .diff-pick .dch { font-size: 22px; }
.menu-right .btn.big { padding-top: 13px; padding-bottom: 13px; }
.menu-right .pick { gap: var(--s2); }
.menu-right .kit { padding-top: var(--s3); }
.menu-right .ci-spec { margin-bottom: var(--s3); }
.menu-right .jl-num b { font-size: 36px; }
.menu-foot { position: absolute; left: var(--s7); bottom: var(--s4); display: flex; align-items: center; gap: var(--s5); }
.menu-foot .sub { margin: 0; }
.menu-foot .credits { position: static; }
.credits { position: fixed; bottom: var(--s3); right: var(--s4); font-size: 11px; color: #6e665c; }

/* hero block: labelled actions under the selected hero */
/* class pick: the prompt, then the class tabs */
.pick { display: flex; flex-direction: column; gap: var(--s3); }
.pick-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .2em; color: var(--gold); }
.hero-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s2); }
.hero-actions button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s2); row-gap: 2px; align-items: center; padding: var(--s3); text-align: left; cursor: pointer; color: var(--text); background: rgba(255,240,210,.05); border: 0; font-family: var(--font); transition: background .2s; }
.hero-actions button:hover { background: rgba(227,184,102,.16); }
.hero-actions svg { grid-row: span 2; width: 22px; height: 22px; color: var(--gold2); }
.hero-actions b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.hero-actions span { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* the skill tree is the button to notice first */
.hero-actions button.main { background: linear-gradient(180deg, rgba(227,184,102,.22), rgba(227,184,102,.08)); box-shadow: inset 0 0 0 1px rgba(255,214,140,.5), 0 0 18px rgba(227,184,102,.18); }
.hero-actions button.main:hover { background: linear-gradient(180deg, rgba(227,184,102,.32), rgba(227,184,102,.12)); }
.hero-actions button.main b { font-size: 15px; color: #fff0d6; }
.hero-actions button.main span { color: #d8c49c; }
.hero-actions button.main svg { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(227,184,102,.6)); }
/* current spec and its four skills: a faint light card with a fading edge */
.kit { padding: var(--s4) var(--s4) var(--s3); background: linear-gradient(180deg, rgba(255,250,240,.06), rgba(255,250,240,.02)); border: 1px solid; border-image: linear-gradient(180deg, rgba(255,236,200,.3), rgba(255,236,200,.04)) 1; }
.ci-spec b { font-size: 15px; font-weight: 700; }
.ci-spec span { font-size: 12px; color: var(--muted); }

/* ---------- lobby ---------- */
.codebox { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s3) 0; margin: var(--s2) 0 var(--s3); background: none; box-shadow: none; }
.codebox span { font-size: 12px; font-weight: 700; letter-spacing: .3em; color: var(--gold); }
.codebox b { font-family: var(--latin); font-weight: 700; font-size: 48px; letter-spacing: .3em; padding-left: .3em; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255,160,70,.5)); }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.roster li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: linear-gradient(90deg, rgba(255,240,210,.06), transparent); }
.roster li.empty { color: #5f574e; background: none; }
.roster .ri svg { width: 24px; height: 24px; color: var(--c); filter: drop-shadow(0 0 5px var(--c)); }
.roster em { font-style: normal; font-size: 12px; color: var(--muted); }
.tag { margin-left: auto; font-size: 11px; font-weight: 700; color: #1d1206; background: var(--gold); padding: 2px var(--s2); }
.tag.me { margin-left: var(--s1); }
.spinner { width: 30px; height: 30px; border: 2px solid var(--gold); box-shadow: 0 0 16px rgba(227,184,102,.5), inset 0 0 10px rgba(227,184,102,.4); animation: spin 1.6s linear infinite; margin: 10px auto 18px; }

/* first launch: carve a name on the gravestone */
.nick { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s2); }
.nick-who { margin: 0 0 -8px; font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: .08em; color: #d8c49c; }
.nick-q { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; color: #fff0d6; text-shadow: 0 0 18px rgba(255,150,70,.35), 0 2px 3px #000; }
.nick input { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: .08em; text-align: center; padding: 14px; background: linear-gradient(180deg, rgba(40,36,34,.9), rgba(16,14,14,.95)); border-bottom: 2px solid var(--gold); box-shadow: inset 0 3px 14px rgba(0,0,0,.8); }
.nick input.bad { border-bottom-color: #ff6a50; }
.nick-err { margin: -4px 0 0; min-height: 16px; font-size: 12px; color: #ff8a7a; }
.nick .note { margin: 0; }
.lobby-nick { display: flex; align-items: center; gap: var(--s3); }
.lobby-nick span { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--gold); }
.lobby-nick input { flex: 1; min-width: 0; font-size: 15px; padding: 8px 12px; }

/* lobby: party column docked left, the world stays clickable on the right */
.wl-code { display: flex; align-items: baseline; gap: var(--s3); margin: 0; }
.wl-code span { font-size: 11px; font-weight: 700; letter-spacing: .25em; color: var(--gold); }
.wl-code b { font-family: var(--latin); font-size: 22px; font-weight: 700; letter-spacing: .2em; color: #fff0d6; }
.wl-code .link-btn { margin-left: auto; }
.tabs { display: flex; gap: var(--s5); }
.tabs button { padding: var(--s2) 0; background: none; border: 0; cursor: pointer; font: 500 20px var(--display); color: var(--muted); transition: color .2s, text-shadow .2s; }
.tabs button:hover { color: #e8dcc8; }
.tabs button.on { color: #fff0d6; text-shadow: 0 0 14px rgba(255,170,90,.45); box-shadow: inset 0 -2px 0 var(--gold); }
.tab-party, .tab-char { display: flex; flex-direction: column; gap: var(--s5); }
.tab-party.hidden, .tab-char.hidden { display: none; }
.screen.lobby { justify-content: flex-end; align-items: stretch; padding: 0; pointer-events: none; background: radial-gradient(ellipse 50% 40% at 0% 0%, rgba(5,4,8,.8), transparent 70%), linear-gradient(270deg, rgba(5,4,8,.95) 0%, rgba(5,4,8,.82) 30%, rgba(5,4,8,0) 50%); }
.lobby-panel { pointer-events: auto; width: min(520px, 100%); padding: var(--s6) var(--s7) var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s4); overflow-y: auto; animation: rise .5s ease-out both; }
.lobby-title { pointer-events: auto; gap: var(--s3); }
.lobby-title h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 38px; letter-spacing: .06em; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 2px #000); }
.lobby .codebox b { font-size: 32px; padding-left: 0; }
.lobby .note { margin: 0; font-size: 13px; line-height: 1.7; }
.lobby-warn { margin: var(--s2) 0 0; text-align: center; font-size: 13px; color: #e8a25f; }
.lobby .row { margin-top: 0; justify-content: stretch; }
.lobby .row .btn { flex: 1; }
.chat-slot { flex: none; height: 200px; display: flex; }
/* lobby, like the camp: world name and tabs on top, chat at the bottom, the open tab centred between */
.lobby-panel .tab-party, .lobby-panel .tab-char { margin: auto 0; }
.lobby-hint { position: fixed; left: var(--s7); bottom: var(--s4); margin: 0; font-size: 13px; color: #cdbfa8; text-shadow: 0 1px 3px #000; }
.lobby-hint kbd { margin-right: var(--s1); }

/* chat */
.chat { display: flex; flex-direction: column; font-size: 13px; }
.chat-log { display: flex; flex-direction: column; gap: var(--s1); overflow-y: auto; padding: var(--s3) var(--s4); }
.cl { line-height: 1.6; color: #eadfcb; text-shadow: 0 1px 2px #000, 0 0 2px #000; overflow-wrap: anywhere; }
.cl b { color: var(--c); font-weight: 700; margin-right: var(--s2); }
.cl.sys { color: var(--gold); font-size: 12px; }
.cl.sys::before { content: '◆ '; font-size: 9px; vertical-align: 1px; }
.chat-form { display: flex; }
.chat-in { flex: 1; min-width: 0; font-size: 14px; padding: var(--s2) var(--s3); }
.chat.lobby { flex: 1; background: rgba(0,0,0,.35); }
.chat.lobby .chat-log { flex: 1; min-height: 0; }
.chat.play { position: fixed; left: 16px; bottom: 16px; width: min(380px, calc(40 * var(--vw))); z-index: 4; pointer-events: none; }
.chat.play .chat-log { max-height: 200px; overflow: hidden; padding: 6px 10px; }
.chat.play .cl { animation: chatfade .6s 10s forwards; }
.chat.play .chat-form { opacity: 0; }
.chat.play.open { pointer-events: auto; background: linear-gradient(90deg, rgba(8,6,6,.88), rgba(8,6,6,.35)); border-left: 2px solid var(--line2); }
.chat.play.open .chat-log { overflow-y: auto; }
.chat.play.open .cl { animation: none; }
.chat.play.open .chat-form { opacity: 1; }
@keyframes chatfade { to { opacity: 0; } }
@media (max-width: 1320px) { .chat.play { bottom: 150px; } }

/* speech bubbles and lobby name tags */
.overhead { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.bubble { position: absolute; left: 0; top: 0; max-width: 240px; padding: var(--s2) var(--s3); font-size: 13px; line-height: 1.5; color: #f3e8d4; text-align: center; overflow-wrap: anywhere; background: rgba(12,9,8,.92); border: 1px solid var(--line2); box-shadow: 0 6px 16px rgba(0,0,0,.6); will-change: transform; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg); background: rgb(12,9,8); border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.tagname { position: absolute; left: 0; top: 0; font-size: 13px; font-weight: 700; color: #f0e6d4; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 3px #000; will-change: transform; }
.tagname::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 2px; transform: rotate(45deg); background: var(--c); box-shadow: 0 0 6px var(--c); }
.tagname.me { color: var(--gold2); }

/* ---------- results ---------- */
.results h2 { font-size: 42px; text-align: center; }
.results h2.lose { background: linear-gradient(180deg, #ffd0c0, #d0402a 55%, #6a1208); -webkit-background-clip: text; background-clip: text; }
.results .note { text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: var(--s5) 0; }
.stats div { padding: var(--s4) var(--s3); background: rgba(0,0,0,.3); text-align: center; }
.stats b { display: block; font-family: var(--latin), var(--font); font-weight: 700; font-size: 24px; color: #fff0d6; }
.stats span { font-size: 12px; color: var(--muted); }
.results h4 { margin: var(--s5) 0 var(--s3); font-size: 13px; letter-spacing: .25em; color: var(--gold); }
.discard-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s3); font-size: 13px; color: var(--muted); }
.loot-list { max-height: calc(34 * var(--vh)); overflow-y: auto; display: grid; gap: var(--s1); }
.li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-left: 3px solid var(--rc); background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 18%, transparent), rgba(0,0,0,.3)); }
.li b { color: var(--rc); font-size: 14px; font-weight: 700; text-shadow: 0 0 10px color-mix(in srgb, var(--rc) 50%, transparent); }
.li em { font-style: normal; font-size: 12px; color: var(--muted); }

/* ---------- portal transition: the next chapter's key visual ---------- */
.portal-screen { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: #000; animation: psIn .5s ease-out both; }
.portal-screen.out { animation: psOut .6s ease-in both; }
.ps-art { position: absolute; inset: 0; background-size: cover; background-position: center; animation: kenburns calc(var(--dur) + 1s) linear both; }
.ps-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.5) 35%, transparent 60%), radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.6)); }
.ps-info { position: relative; width: min(760px, 100%); padding: 0 var(--s7) calc(var(--s7) + var(--s4)); }
.ps-info.end { margin: auto; text-align: center; padding-bottom: 0; }
.ps-num { font-size: 13px; font-weight: 700; letter-spacing: .6em; color: var(--gold); }
.ps-info h2 { margin: var(--s3) 0 var(--s4); font-family: var(--display); font-weight: 600; font-size: 64px; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 4px #000); }
.ps-info p { margin: 0 0 var(--s3); max-width: 560px; font-size: 16px; line-height: 1.8; color: #e8dcc8; text-shadow: 0 2px 6px #000; }
.ps-info.end p { margin: 0 auto 12px; }
.ps-info em { font-style: normal; font-size: 12px; color: var(--muted); }
.ps-bar { width: 240px; height: 2px; margin-top: 22px; background: rgba(255,255,255,.12); }
.ps-info.end .ps-bar { margin: 22px auto 0; }
.ps-bar i { display: block; height: 100%; background: var(--gold2); box-shadow: 0 0 8px var(--gold); animation: psBar var(--dur) linear both; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
@keyframes psBar { from { width: 0; } to { width: 100%; } }
@keyframes psIn { from { opacity: 0; } }
@keyframes psOut { to { opacity: 0; } }

/* ---------- look editor: docked left, the hero stays visible on the right ---------- */
.modal.side { justify-content: flex-start; background: linear-gradient(90deg, rgba(4,3,6,.8), rgba(4,3,6,0) 45%); pointer-events: none; }
.modal.side .mcard { pointer-events: auto; width: min(460px, 100%); max-height: calc(calc(100 * var(--vh)) - 36px); overflow-y: auto; }
.lrow { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: var(--s3); margin: var(--s5) 0; }
.lrow > span { font-size: 13px; font-weight: 700; color: var(--gold); }
.sw { display: flex; flex-wrap: wrap; gap: var(--s2); }
.swatch { position: relative; width: 30px; height: 30px; padding: 0; cursor: pointer; background: var(--s); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.swatch i { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.swatch:hover i, .swatch.on i { opacity: 1; }
.swatch.dflt { background: repeating-linear-gradient(45deg, var(--s) 0 5px, rgba(0,0,0,.4) 5px 8px); }
.swatch:hover { border-color: var(--gold2); }
.swatch.on { border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(227,184,102,.5); }
.chip { padding: var(--s2) var(--s4); cursor: pointer; font: 500 13px var(--font); color: var(--text); background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.chip.on { border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 10px rgba(227,184,102,.3); }
.note.small { font-size: 12px; margin-top: var(--s5); }

/* ---------- worlds ---------- */
.mcard.worlds { width: min(600px, 100%); }
.wlist { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s4) 0 var(--s5); max-height: calc(44 * var(--vh)); overflow-y: auto; }
.witem { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: linear-gradient(90deg, rgba(255,240,210,.07), rgba(0,0,0,.2)); }
.wi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.wi b { font-size: 16px; font-weight: 700; color: #fff0d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi em { font-style: normal; font-size: 12px; color: var(--muted); }
.wi em i { font-style: normal; font-family: var(--latin); font-weight: 700; letter-spacing: .15em; color: var(--gold2); }
.btn.danger { --bd: #ff6a50; color: #ffb0a0; }
.wnew { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s2); padding-top: var(--s5); border-top: 1px solid var(--line); }
.wnew input { min-width: 0; font-size: 14px; }
.mcard.pw { width: min(380px, 100%); }
.mcard.pw input { width: 100%; margin-top: var(--s3); }
.center-note { text-align: center; margin: var(--s3) 0 0; }
.wc { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 46px; padding: 5px 0 4px; cursor: pointer; color: var(--text); background: rgba(0,0,0,.45); border: 1px solid var(--line); transition: border-color .15s; }
.wc svg { width: 20px; height: 20px; color: var(--c); }
.wc span { font-family: var(--latin); font-size: 10px; font-weight: 700; color: var(--muted); }
.wc:hover { border-color: color-mix(in srgb, var(--c) 70%, transparent); }
.wc.on { border-color: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 35%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 20%, transparent); }
@media (max-width: 600px) { .wnew { grid-template-columns: 1fr; } }

/* ---------- skill tree ---------- */
.mcard.tree { width: min(860px, 100%); max-height: calc(calc(100 * var(--vh)) - 36px); overflow-y: auto; }
.tree-root { position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s3); margin: var(--s1) auto var(--s6); }
.tree-root > svg { width: 44px; height: 44px; padding: 9px; color: var(--c); background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 50%, transparent)); }
.tree-root b { display: block; font-family: var(--display); font-weight: 600; font-size: 22px; color: #fff0d6; }
.tree-root em { font-style: normal; font-size: 12px; color: var(--muted); }
.tree-branches { position: relative; display: grid; gap: var(--s5); padding-top: var(--s4); }
.tree-branches.n1 { grid-template-columns: minmax(0, 420px); justify-content: center; }
.tree-branches.n2 { grid-template-columns: 1fr 1fr; }
.branch { position: relative; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); cursor: pointer; background: rgba(0,0,0,.3); opacity: .6; transition: opacity .2s, background .2s; }
.branch:hover { opacity: .9; }
.branch.on { opacity: 1; background: linear-gradient(180deg, rgba(227,184,102,.14), rgba(0,0,0,.3) 60%); box-shadow: 0 -2px 0 var(--gold) inset; }
.br-head { display: flex; align-items: center; gap: var(--s3); }
.br-head b { font-family: var(--display); font-weight: 600; font-size: 24px; color: #fff0d6; }
.branch p { margin: 0; font-size: 13px; line-height: 1.75; color: #cdbfa8; }
.br-passive { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); background: rgba(227,184,102,.07); }
.br-passive svg { flex: none; width: 22px; height: 22px; color: var(--gold2); filter: drop-shadow(0 0 5px rgba(227,184,102,.6)); }
.br-passive b { display: block; font-size: 13px; color: var(--gold2); margin-bottom: var(--s1); }
.br-passive span { font-size: 12px; line-height: 1.65; color: #d6cab6; }
.br-passive .hk { display: block; margin-top: var(--s1); color: var(--muted); }
.br-skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.node { display: flex; flex-direction: column; align-items: center; gap: var(--s2); font-size: 12px; font-weight: 400; text-align: center; color: #e3d6c0; }
.node svg { width: 42px; height: 42px; padding: 9px; color: var(--gold2); background: radial-gradient(circle at 50% 40%, rgba(255,220,160,.1), rgba(0,0,0,.35) 70%); }
.node.shared svg { color: #cdbfa8; }
.node i, .tag-shared { font-style: normal; font-size: 10px; font-weight: 700; padding: 0 5px; color: #cdbfa8; border: 1px dashed #8a7d6a; }
.node kbd { font-size: 10px; }
.growth { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.growth b { margin-right: var(--s2); font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--gold); }
.growth span { padding: 3px var(--s3); font-size: 12px; color: var(--muted); border: 1px dashed rgba(255,226,160,.2); }
.growth span.on { color: #fff0d6; border-style: solid; border-color: var(--gold); background: rgba(227,184,102,.1); }
.br-pick { display: flex; justify-content: center; min-height: 34px; align-items: center; }
.picked { font-size: 13px; font-weight: 700; letter-spacing: .2em; color: var(--gold2); }
.picked::before, .picked::after { content: '◆'; font-size: 8px; margin: 0 8px; vertical-align: 2px; color: var(--gold); }
@media (max-width: 700px) { .tree-branches.n2 { grid-template-columns: 1fr; } .tree-branches.n2::before, .branch::before { display: none; } }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20,10,6,.6), rgba(3,2,4,.88)); padding: var(--s5); }
.mcard { width: min(560px, 100%); padding: var(--s6); animation: rise .25s ease-out both; }
.mcard h3 { margin: 0 0 var(--s5); font-size: 28px; color: #fff0d6; }
.mbody { font-size: 14px; color: #d6cab6; line-height: 1.75; }
.mbody ul { padding-left: var(--s5); }
.mbody li + li { margin-top: var(--s1); }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s5); font-size: 13px; }
.howto kbd { margin-right: var(--s2); }
.tips { font-size: 13px; color: var(--muted); }
.tips li::marker { content: '◆  '; color: var(--gold); font-size: 9px; }
.settings { display: flex; flex-direction: column; gap: var(--s4); }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); font-size: 14px; }
.settings input[type=range] { width: 55%; accent-color: var(--gold); padding: 0; border: none; background: none; box-shadow: none; }
.settings input[type=checkbox] { accent-color: #9c3618; width: 16px; height: 16px; box-shadow: none; }
.settings select { font-size: 14px; max-width: 60%; }
.settings .ck { justify-content: flex-start; }
.toast { position: fixed; top: 22px; left: 50%; transform: translate(-50%, -20px); opacity: 0; transition: all .25s; background: radial-gradient(ellipse at center, rgba(14,10,9,.95), rgba(14,10,9,.6) 70%, transparent); padding: 12px 60px; font-size: 15px; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#hud > * { position: absolute; }
#hud.inv-only > *:not(.inventory) { display: none; }
/* Gear opened from the camp menu: above the menu screen, which is dimmed behind it. */
#hud.inv-only { z-index: 20; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(20,10,6,.55), rgba(3,2,4,.85)); }
.h-top { top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: min(640px, calc(80 * var(--vw))); }
.room-title { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: .14em; color: #e8d6b4; text-shadow: 0 0 14px rgba(255,170,80,.3), 0 2px 6px #000; white-space: nowrap; }
.room-title:not(:empty)::before, .room-title:not(:empty)::after { content: ''; display: inline-block; vertical-align: middle; width: 40px; height: 1px; margin: 0 12px; background: linear-gradient(90deg, transparent, var(--gold)); }
.room-title:not(:empty)::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.boss { width: 100%; animation: rise .5s ease-out both; }
.boss-name { display: flex; justify-content: center; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.boss-name .bn { font-family: var(--display); font-weight: 600; font-size: 28px; color: #ffe0c8; letter-spacing: .06em; text-shadow: 0 0 16px rgba(255,80,40,.7), 0 2px 4px #000; }
.boss-name .bt { font-size: 13px; font-weight: 500; letter-spacing: .1em; color: #c9927a; }
.boss.enraged .bt { color: #ff5a3a; font-weight: 700; text-shadow: 0 0 10px rgba(255,60,30,.7); }

/* Framed gauges: metal rim, glass sheen and 10% ticks painted by the text layer, diamond end caps. */
.boss-bar, .hpbar, .jbar { position: relative; background: rgba(8,4,5,.9); border: 1px solid #7a5530; box-shadow: 0 0 0 2px rgba(8,6,5,.95), 0 0 0 3px rgba(200,150,80,.35), 0 8px 22px rgba(0,0,0,.7); }
.boss-bar::before, .boss-bar::after, .hpbar::before, .hpbar::after { content: ''; position: absolute; top: 50%; width: 11px; height: 11px; z-index: 3; background: linear-gradient(135deg, #ffe6a8, #8a5a26); border: 1px solid #1a120a; box-shadow: 0 0 8px rgba(227,184,102,.5); }
.boss-bar::before, .hpbar::before { left: -9px; transform: translateY(-50%) rotate(45deg); }
.boss-bar::after, .hpbar::after { right: -9px; transform: translateY(-50%) rotate(45deg); }
.boss-bar { height: 20px; }
.boss-bar i, .hpbar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .12s; }
.boss-bar .lag { background: #f2e2c0; width: 100%; transition: width .6s ease-in; }
.boss-bar .hp { background: linear-gradient(180deg, #ff6a4a, #b82418 45%, #5a0a08); width: 100%; box-shadow: 0 0 12px rgba(255,60,30,.5); }
.boss-bar b, .hpbar b { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; font-family: var(--latin); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-shadow: 0 1px 2px #000, 0 0 4px #000;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 45%, rgba(0,0,0,.3)), repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,.5) calc(10% - 1px) 10%); }
.judge { margin: 14px auto 0; width: 70%; text-align: center; }
.jl { font-family: var(--display); font-weight: 600; font-size: 17px; color: #bfe6ff; text-shadow: 0 0 12px #3aa0ff; margin-bottom: 6px; }
.jt { font-family: var(--latin); font-weight: 700; color: #fff; margin-left: 6px; }
.jbar { height: 10px; border-color: #3a6a9a; box-shadow: 0 0 0 2px rgba(5,8,12,.95), 0 0 0 3px rgba(120,200,255,.35); }
.jbar i { display: block; height: 100%; background: linear-gradient(180deg, #bfe8ff, #3aa0ff 50%, #1a4a8a); box-shadow: 0 0 12px #3aa0ff; transition: width .1s; }

.party { top: var(--s4); left: var(--s4); display: flex; flex-direction: column; gap: var(--s2); width: 240px; }
.pf { display: flex; gap: var(--s4); align-items: center; padding: var(--s2) var(--s3) var(--s2) var(--s4); background: linear-gradient(90deg, rgba(14,10,9,.88), rgba(14,10,9,.4)); border-left: 2px solid var(--line); }
.pf.me { border-left-color: var(--gold); }
.pf.down { opacity: .6; border-left-color: rgba(255,80,60,.7); filter: grayscale(.6); }
.pic { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; transform: rotate(45deg); background: radial-gradient(circle, #2a1f18, #0a0808); border: 1px solid var(--c); box-shadow: 0 0 0 2px rgba(0,0,0,.8), 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.pic svg { width: 19px; height: 19px; color: var(--c); transform: rotate(-45deg); }
.pinfo { flex: 1; min-width: 0; }
.pn { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.pn em { display: block; font-style: normal; font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 1px; }
.pbar { position: relative; height: 7px; background: rgba(0,0,0,.75); border: 1px solid rgba(200,150,80,.3); margin-top: 5px; }
.pbar i { position: absolute; left: 0; top: 0; bottom: 0; }
.pbar .hp { background: linear-gradient(180deg, #9ff2b8, #2f9a55 60%, #1a5a30); }
.pbar .sh { background: rgba(255,230,160,.8); height: 2px; }
.rv { font-size: 11px; color: #ff9a8a; margin-top: 3px; }
.diff-tag { top: 198px; right: 18px; width: 170px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; color: #d8c7a8; text-shadow: 0 1px 3px #000; }
.diff-tag b { font-family: var(--latin); font-size: 15px; color: #ffb87a; }
.story { margin: var(--s4) 0 var(--s2); padding: var(--s4) var(--s5); font-size: 14px; line-height: 1.85; color: #e8dcc8; background: rgba(0,0,0,.35); border-left: 2px solid var(--gold); }
.unlock { margin: var(--s3) 0 0; text-align: center; font-size: 14px; font-weight: 700; letter-spacing: .15em; color: var(--gold2); text-shadow: 0 0 12px rgba(255,190,90,.6); }
.minimap { top: 18px; right: 18px; width: 170px; height: 170px; border-radius: 50%; box-shadow: 0 0 0 2px #140e0a, 0 0 0 3px rgba(214,170,104,.6), 0 0 0 7px rgba(16,11,8,.9), 0 0 0 8px rgba(214,170,104,.3), 0 10px 26px rgba(0,0,0,.8); }

.bottom { bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hpbar { height: 20px; }
/* your status, bottom centre: big class symbol (class and spec under it), then name / Lv / feathers,
   the HP bar and the job EXP bar, each labelled before its numbers */
.status { display: grid; grid-template-columns: 96px auto; align-items: center; gap: var(--s4); padding: var(--s2) var(--s4) 0; text-shadow: 0 1px 3px #000, 0 0 3px #000; }
.st-sym { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.sym { width: 62px; height: 62px; margin: var(--s2) 0 var(--s3); display: flex; align-items: center; justify-content: center; transform: rotate(45deg); background: radial-gradient(circle, color-mix(in srgb, var(--c) 32%, #1a1418), #0a0808 75%); border: 1px solid var(--c); box-shadow: 0 0 0 3px rgba(0,0,0,.85), 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent), 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
.sym svg { width: 36px; height: 36px; color: #fff3dc; transform: rotate(-45deg); filter: drop-shadow(0 0 6px var(--c)); }
.status.down .sym { filter: grayscale(1); opacity: .6; }
.st-cls { font-family: var(--display); font-size: 14px; font-weight: 600; color: #fff0d6; }
.st-spec { font-style: normal; font-size: 11px; color: #cdbfa8; white-space: nowrap; }
.st-bars { width: 440px; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.st-bars .skills { margin-top: var(--s1); justify-content: center; }
.st-head { display: flex; align-items: baseline; gap: var(--s3); }
.st-name { min-width: 0; font-family: var(--display); font-size: 18px; font-weight: 600; color: #fff0d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-lv { flex: none; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--gold); }
.st-lv b { font-size: 18px; color: var(--gold2); }
.st-feather { flex: none; margin-left: auto; display: flex; align-items: center; gap: var(--s1); pointer-events: auto; cursor: help; color: #bfe6ff; }
.st-feather svg { width: 16px; height: 16px; filter: drop-shadow(0 0 4px #3aa0ff); }
.st-feather b { font-family: var(--latin); font-size: 14px; font-weight: 700; }
.st-feather.none { color: var(--muted); } .st-feather.none svg { filter: none; }
.hpbar, .xp { isolation: isolate; }
.hpbar b, .xp b { line-height: 1; }
.hpbar b > *, .xp b > * { line-height: 1; display: block; }
.hpbar b em, .xp b em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--gold2); margin-right: var(--s2); }
.xp { position: relative; height: 14px; background: rgba(8,6,5,.9); border: 1px solid rgba(200,150,80,.45); box-shadow: 0 0 0 2px rgba(8,6,5,.9); }
.xp i { display: block; height: 100%; background: linear-gradient(180deg, #ffe7a8, #c8902e 55%, #7a4e18); box-shadow: 0 0 8px rgba(227,184,102,.5); }
.xp b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--latin); font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.hpbar .sh { background: rgba(255, 224, 150, .8); }
.hpbar .hp { background: linear-gradient(180deg, #ff6a50, #b82418 45%, #5a0a08); }
.hpbar.low .hp { animation: pulse .6s infinite alternate; }
.skills { position: relative; display: flex; gap: 8px; pointer-events: auto; padding: 10px 18px 14px; background: linear-gradient(180deg, rgba(20,15,12,.85), rgba(6,5,5,.92)); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.4); }
.slot { position: relative; width: 58px; height: 58px; border-radius: 1px; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 28%, #1a1418), #0a080a); border: 1px solid #6a4e30; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.9), inset 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent), inset 0 0 16px rgba(0,0,0,.85), 0 3px 8px rgba(0,0,0,.6); }
.slot > svg { width: 32px; height: 32px; color: #fff3dc; filter: drop-shadow(0 0 5px var(--c)); }
.slot.ult { width: 64px; height: 64px; border-color: #ffd98a; outline: 1px solid rgba(255,217,138,.45); outline-offset: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.9), inset 0 0 18px rgba(0,0,0,.8), 0 0 18px rgba(255,200,100,.3); }
.slot.util { width: 46px; height: 46px; align-self: flex-end; }
.slot.util > svg { width: 24px; height: 24px; }
.slot .cd { position: absolute; inset: 0; }
.slot .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--latin); font-size: 18px; font-weight: 700; text-shadow: 0 0 4px #000, 0 2px 3px #000; }
.slot kbd { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; padding: 1px 5px; }
.slot .charges { position: absolute; top: 2px; right: 5px; font-family: var(--latin); font-size: 13px; font-weight: 700; color: #9ff2b8; text-shadow: 0 1px 3px #000; }
.slot.empty > svg { opacity: .3; }
.slot.pop { animation: pop .35s ease-out; }
.slot.deny { animation: deny .3s; }
.slot .tip { display: none; z-index: 20; position: absolute; bottom: 76px; left: 50%; transform: translateX(-50%); width: 240px; padding: var(--s3) var(--s4); font-size: 12px; line-height: 1.65; }
.slot:hover .tip { display: block; }
.tip b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--gold2); margin-bottom: var(--s1); }
.tip span { color: #d6cab6; }
.tip em { display: block; font-style: normal; color: var(--muted); margin-top: var(--s2); }

.announce { top: 22%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity .35s; width: calc(90 * var(--vw)); }
.announce.show { opacity: 1; animation: ann .5s ease-out; }
.a-title { font-family: var(--display); font-weight: 600; font-size: 44px; letter-spacing: .06em; text-shadow: 0 0 26px currentColor, 0 3px 6px #000; }
.announce.big .a-title { font-size: 62px; }
.a-sub { display: inline-block; margin-top: 10px; padding: 6px 60px; font-size: 16px; font-weight: 500; letter-spacing: .08em; color: #e3d6c0; text-shadow: 0 2px 6px #000; background: linear-gradient(90deg, transparent, rgba(0,0,0,.55) 25%, rgba(0,0,0,.55) 75%, transparent); }
.a-sub:empty { display: none; }
.chapter-card { top: 34%; left: 50%; transform: translateX(-50%); width: min(620px, calc(90 * var(--vw))); text-align: center; opacity: 0; transition: opacity 1s; padding: 22px 30px; background: radial-gradient(ellipse at center, rgba(0,0,0,.65), transparent 72%); }
.chapter-card.show { opacity: 1; }
.cc-num { font-size: 14px; font-weight: 700; letter-spacing: .6em; color: var(--gold); }
.cc-name { font-family: var(--display); font-weight: 600; font-size: 58px; margin-top: 6px; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(255,130,50,.45)) drop-shadow(0 3px 3px #000); }
.cc-hint { margin: 10px auto 0; max-width: 520px; font-size: 13px; line-height: 1.6; color: var(--gold2); text-shadow: 0 2px 6px #000; }
.cc-hint:empty { display: none; }
.cine-bars { inset: 0; pointer-events: none; }
.cine-bars i { position: absolute; left: 0; right: 0; height: calc(11 * var(--vh)); background: #000; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.cine-bars i:first-child { top: 0; transform: translateY(-100%); }
.cine-bars i:last-child { bottom: 0; transform: translateY(100%); }
#hud.cine .cine-bars i { transform: none; }
#hud > * { transition: opacity .4s; }
#hud.cine > *:not(.cine-bars):not(.boss-intro):not(.chapter-card):not(.dmg-layer):not(.dialogue):not(.scene-hit):not(.talk-wait) { opacity: 0; pointer-events: none; }
/* portal panel: slides in from the left while the host stands in the portal */
.portal-panel { top: 50%; left: 0; z-index: 4; width: min(400px, calc(92 * var(--vw))); max-height: calc(calc(100 * var(--vh)) - 32px); overflow-y: auto; pointer-events: auto; background: linear-gradient(90deg, rgba(10,8,12,.97), rgba(14,10,18,.93)); border-right: 1px solid rgba(190,140,255,.35); box-shadow: 18px 0 50px rgba(0,0,0,.6), inset -1px 0 18px rgba(150,90,255,.12); transform: translate(-105%, -50%); transition: transform .42s cubic-bezier(.2,.8,.2,1); }
.portal-panel.in { transform: translate(0, -50%); }
.pp-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.pp-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,8,12,.97), transparent 55%); }
.pp-body { position: relative; margin-top: -36px; padding: 0 var(--s6) var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.pp-body.end { margin-top: 0; padding-top: var(--s6); }
.pp-num { font-size: 12px; font-weight: 700; letter-spacing: .5em; color: #cdb2ff; }
.pp-body h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 34px; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 3px #000); }
.pp-body p { margin: 0; font-size: 14px; line-height: 1.75; color: #e0d4c0; }
.pp-body em { font-style: normal; font-size: 12px; color: var(--muted); }
.pp-party { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pp-party:empty { display: none; }
.pp-party li { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); font-size: 13px; background: rgba(255,240,210,.05); }
.pp-party li i { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.pp-party li.ok i { color: #7dffb0; }
.pp-go { margin-top: var(--s2); width: 100%; }
.pp-go:disabled { filter: saturate(.4) brightness(.8); cursor: default; }
.pp-note { text-align: center; font-size: 11px; color: var(--muted); }
.use-prompt { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(14,10,8,.78); border: 1px solid rgba(255,210,122,.45); color: #f1e4c8; font-size: 13px; pointer-events: none; white-space: nowrap; z-index: 3; }
.use-prompt kbd { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffd27a; color: #20140a; font: 700 12px/1 var(--body, sans-serif); }
.use-prompt.hidden { display: none; }
/* Third-person aim: a small dot in the middle, a diamond over the locked-on foe, a hint to take the mouse. */
.reticle { position: absolute; left: 50%; top: 42%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,240,210,.85); box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); pointer-events: none; z-index: 2; }
.lockmark { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 2; will-change: transform; }
.lockmark::before { content: ''; position: absolute; inset: 3px; border: 2px solid #ffe2a0; transform: rotate(45deg); box-shadow: 0 0 6px rgba(255,200,110,.8), inset 0 0 4px rgba(255,200,110,.6); }
.lockmark::after { content: ''; position: absolute; left: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #fff3d0; }
.look-hint { position: absolute; left: 50%; top: calc(var(--s4) + 44px); transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(14,10,8,.72); border: 1px solid rgba(255,210,122,.35); color: #f1e4c8; font-size: 13px; pointer-events: none; white-space: nowrap; z-index: 2; }
.reticle.hidden, .lockmark.hidden, .look-hint.hidden { display: none; }
.cc-text { margin: 12px auto 0; max-width: 520px; font-size: 15px; line-height: 1.8; color: #e3d6c0; text-shadow: 0 2px 6px #000; }
.boss-intro { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.65) 50%, transparent 70%); transition: opacity .6s; }
.boss-intro.show { opacity: 1; }
.bi-title { font-size: 15px; font-weight: 500; letter-spacing: .6em; color: #d6a78a; }
.bi-name { font-family: var(--display); font-weight: 600; font-size: 84px; color: #ffe0c8; text-shadow: 0 0 34px rgba(255,70,30,.85), 0 4px 10px #000; margin-top: 8px; }
.boss-intro.show .bi-name { animation: slam .6s cubic-bezier(.2,1.5,.4,1) both; }

/* downed: countdown ring to the automatic feather, feather count, use / cancel, how feathers work */
.death { top: 50%; left: 50%; transform: translate(-50%, -54%); width: min(480px, calc(92 * var(--vw))); display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s6) var(--s5); text-align: center; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(6,4,8,.88), rgba(6,4,8,.55) 55%, transparent 75%); }
.dt-title { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; color: #ffd9c8; text-shadow: 0 0 24px rgba(255,60,40,.6), 0 3px 6px #000; }
.dt-ring { position: relative; width: 108px; height: 108px; margin: var(--s2) 0; }
.dt-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dt-ring circle { fill: none; stroke-width: 4; }
.dt-ring .bg { stroke: rgba(255,255,255,.1); }
.dt-ring .fg { stroke: #bfe6ff; stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 276.46; filter: drop-shadow(0 0 6px #6ab8ff); }
.dt-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #bfe6ff; }
.dt-in svg { width: 30px; height: 30px; filter: drop-shadow(0 0 6px #3aa0ff); }
.dt-in b { font-family: var(--latin); font-size: 20px; font-weight: 700; color: #fff; }
.death.empty .dt-in { color: var(--muted); } .death.empty .dt-in svg { filter: none; }
.death.empty .dt-ring .fg { stroke: #7dffb0; filter: drop-shadow(0 0 6px #2f9a55); }
.dt-msg { margin: 0; font-size: 15px; line-height: 1.6; color: #e8dcc8; text-shadow: 0 2px 4px #000; }
.dt-msg b { font-weight: 700; color: #fff0d6; }
.dt-btns { display: flex; gap: var(--s3); }
.dt-btns:empty { display: none; }
.dt-btns .btn:disabled { opacity: .45; cursor: default; }
.dt-watch { display: flex; align-items: center; gap: var(--s3); }
.dt-watch:empty { display: none; }
.dt-watch span { font-size: 13px; color: #d8ccb6; text-shadow: 0 1px 3px #000; }
.dt-watch b { font-weight: 700; color: #fff0d6; }
/* watching a party member: a compact strip at the top instead of the centred panel */
.death.watching { top: 110px; transform: translate(-50%, 0); width: auto; max-width: calc(92 * var(--vw)); padding: var(--s3) var(--s6); gap: var(--s2); background: radial-gradient(ellipse at center, rgba(6,4,8,.82), rgba(6,4,8,.5) 60%, transparent 80%); }
.death.watching .dt-title, .death.watching .dt-ring, .death.watching .dt-help { display: none; }
.dt-help { max-width: 400px; margin: var(--s2) 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); text-shadow: 0 1px 3px #000; }
/* dialogue: portrait, speaker, typed line; sits over the status HUD and never pauses the game */
.dialogue { left: 50%; bottom: 224px; transform: translateX(-50%); width: min(660px, calc(94 * var(--vw))); display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--s4); padding: var(--s3) var(--s5) var(--s3) var(--s4); pointer-events: auto; cursor: pointer; z-index: 6;
  background: linear-gradient(180deg, rgba(14,10,12,.9), rgba(8,6,8,.94)); box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 1px 0 color-mix(in srgb, var(--sc) 35%, transparent); border-left: 2px solid var(--sc); }
.dialogue.in { animation: dlIn .28s ease-out both; }
@keyframes dlIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.dl-portrait { width: 52px; height: 52px; margin: 6px 4px 0; display: flex; align-items: center; justify-content: center; transform: rotate(45deg); background: radial-gradient(circle, color-mix(in srgb, var(--sc) 28%, #1a1418), #0a0808 75%); border: 1px solid var(--sc); box-shadow: 0 0 16px color-mix(in srgb, var(--sc) 35%, transparent); }
.dl-portrait i { display: flex; transform: rotate(-45deg); color: var(--sc); }
.dl-portrait svg { width: 28px; height: 28px; }
.dl-body { min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.dl-name { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--sc); }
.dl-text { margin: 0; min-height: 1.65em; font-size: 16px; line-height: 1.65; color: #f0e6d4; text-shadow: 0 1px 2px #000; }
.dl-goal:empty { display: none; }
.dl-goal { display: inline-flex; align-self: flex-start; align-items: center; gap: var(--s2); margin-top: var(--s1); padding: 3px var(--s3); font-size: 12px; color: #d8ccb6; background: rgba(255,226,160,.08); border: 1px solid rgba(255,226,160,.3); }
.dl-goal span { font-weight: 700; letter-spacing: .12em; color: var(--gold); }
.dl-goal b { font-weight: 600; color: #fff0d6; }
.dialogue.waiting .dl-goal { animation: goalPulse 1.4s ease-in-out infinite; }
@keyframes goalPulse { 50% { border-color: rgba(255,226,160,.7); box-shadow: 0 0 12px rgba(255,200,110,.3); } }
.dl-goal.done { border-color: #7dffb0; }
.dl-goal.done b::after { content: '  완료'; color: #7dffb0; }
.dl-ctrl { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; align-self: stretch; }
.dl-next { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--sc); opacity: 0; margin-top: var(--s1); }
.dialogue.typed:not(.waiting) .dl-next { opacity: .8; animation: dlNext 1s ease-in-out infinite; }
@keyframes dlNext { 50% { transform: translateY(3px); } }
.dl-skip { padding: 2px 0; font: 500 12px var(--font); color: var(--muted); background: none; border: 0; cursor: pointer; }
.dl-skip:hover { color: var(--gold2); }
.dl-skip[hidden] { display: none; }
#hud.cine .dialogue { bottom: calc(calc(11 * var(--vh)) + var(--s4)); }
@media (max-width: 800px) { .dialogue { bottom: 250px; } .dl-portrait { width: 40px; height: 40px; } .dl-portrait svg { width: 22px; height: 22px; } .dl-text { font-size: 14px; } }
.loot-feed { right: var(--s4); bottom: 130px; display: flex; flex-direction: column; gap: var(--s1); align-items: flex-end; }
.loot { font-size: 13px; font-weight: 400; padding: 7px 14px 7px 36px; background: linear-gradient(270deg, rgba(10,8,8,.88), rgba(10,8,8,.6) 70%, transparent); animation: slideIn .3s ease-out; transition: opacity .6s, transform .6s; }
.loot.out { opacity: 0; transform: translateX(20px); }
/* gear-change popups: right of centre, clear of the hero standing in the middle of the screen */
.gain-feed { left: calc(50% + 150px); top: 24%; display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.gain { min-width: 270px; padding: var(--s4) var(--s5); background: linear-gradient(90deg, rgba(10,8,8,.9), rgba(10,8,8,.55)); border-left: 2px solid var(--gold); animation: slideIn .3s ease-out; transition: opacity .6s, transform .6s; }
.gain.out { opacity: 0; transform: translateX(20px); }
.gi { display: flex; align-items: center; gap: var(--s3); margin: var(--s2) 0 var(--s3); }
.gi i { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--rc); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 28%, #120f14), #080608); border: 1px solid color-mix(in srgb, var(--rc) 70%, transparent); }
.gi i svg { width: 28px; height: 28px; }
.gi b { display: block; font-size: 19px; font-weight: 700; color: var(--rc); text-shadow: 0 0 10px color-mix(in srgb, var(--rc) 50%, transparent); }
.gi em { display: block; font-style: normal; font-size: 14px; color: var(--muted); margin-top: 2px; }
.gain h5 { margin: 0 0 var(--s1); font-size: 15px; font-weight: 700; letter-spacing: .1em; color: var(--gold2); }
.gain ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.gain li { display: flex; justify-content: space-between; gap: var(--s5); font-size: 16px; color: #d8ccb6; }
.gain li b { font-family: var(--latin), var(--font); font-weight: 700; }
.gain li.up b { color: #7dffb0; } .gain li.down b { color: #ff8a7a; }
.loot em { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 4px; }
.lr { font-weight: 700; margin-right: 4px; }
.loot .lg svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.loot.r-epic, .loot.r-legendary { box-shadow: inset -2px 0 0 currentColor; }

.dmg-layer, .plates { inset: 0; }
.dmg { position: absolute; left: 0; top: 0; font-family: var(--latin); font-size: 24px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 0 3px 4px rgba(0,0,0,.8); white-space: nowrap; text-align: center; line-height: 1; will-change: transform; }
.dmg small { display: block; font-family: var(--font); font-size: 12px; font-weight: 700; color: #ffb04a; letter-spacing: .05em; margin-bottom: 2px; }
.dmg.crit { font-size: 36px; color: #ffe066; text-shadow: 1px 1px 0 #3a1a00, -1px 1px 0 #3a1a00, 1px -1px 0 #3a1a00, -1px -1px 0 #3a1a00, 0 0 16px rgba(255,140,30,.95); }
.dmg.back span { color: #ffb04a; }
.dmg.crit.back span { color: #ff9a2a; }
.dmg.blocked { color: #9fc8e8; font-family: var(--font); font-size: 17px; }
.dmg.other { font-size: 16px; opacity: .7; }
.dmg.taken { color: #ff5a4a; font-size: 21px; }
.dmg.heal { color: #7dffb0; }
.plate { position: absolute; left: 0; top: 0; text-align: center; will-change: transform; }
.eb, .ab { width: 64px; height: 6px; background: rgba(0,0,0,.8); border: 1px solid rgba(200,150,80,.35); box-shadow: 0 0 0 1px rgba(0,0,0,.7); margin: 0 auto; }
.eb i { display: block; height: 100%; background: linear-gradient(180deg, #ff6a50, #a8201a); }
.ab i { display: block; height: 100%; background: linear-gradient(180deg, #9ff2b8, #2f9a55); }
.plate.elite .eb { width: 96px; height: 8px; border-color: rgba(255,170,90,.7); }
.eb.barrier { box-shadow: 0 0 0 1px #9fd8ff, 0 0 8px rgba(120,200,255,.6); }
.plate.elite .eb i { background: linear-gradient(180deg, #ffc070, #e05a20); }
.en { font-size: 13px; font-weight: 700; color: #ffb07a; text-shadow: 0 1px 3px #000, 0 0 3px #000; margin-bottom: 3px; }
.an { font-size: 12px; font-weight: 700; color: #cfe4ff; text-shadow: 0 1px 3px #000, 0 0 3px #000; margin-bottom: 3px; }

/* HUD corner menu: transparent ghost buttons with pale-gold line icons. */
.h-menu { right: var(--s4); bottom: 22px; display: flex; gap: var(--s3); pointer-events: auto; }
.hbtn { position: relative; width: 58px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 0 4px; cursor: pointer; color: #ffe6a8; background: transparent; border: 1px solid rgba(255, 226, 160, .55); transition: background .2s, border-color .2s, box-shadow .2s; }
.hbtn svg { width: 22px; height: 22px; }
.hbtn span { font-size: 11px; font-weight: 500; line-height: 1; color: #f0dcb0; }
.hbtn:hover { background: rgba(255, 226, 160, .1); border-color: #ffe6a8; box-shadow: 0 0 14px rgba(255, 226, 160, .25); }
.hbtn kbd { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; padding: 1px 5px; color: #ffe6a8; background: rgba(8,6,5,.85); border-color: rgba(255, 226, 160, .45); box-shadow: none; }
@media (max-width: 800px) { .h-menu { bottom: 190px; } .hbtn { width: 46px; height: 46px; } .hbtn span { display: none; } }

/* ---------- inventory ---------- */
.inventory { pointer-events: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(780px, calc(94 * var(--vw))); max-height: calc(calc(100 * var(--vh)) - 32px); overflow-y: auto; padding: var(--s5) var(--s6); animation: rise .25s ease-out both; }
.inv-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.inv-head h3 { margin: 0; font-size: 26px; color: #fff0d6; }
.inv-head h3 em { font-family: var(--font); font-style: normal; color: var(--muted); font-size: 13px; letter-spacing: 0; margin-left: var(--s2); }
.gs { margin-left: auto; font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.gs b { font-family: var(--latin); font-weight: 700; color: var(--gold2); font-size: 22px; margin-left: 4px; text-shadow: 0 0 12px rgba(227,184,102,.5); }
.switch { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; font-weight: 700; color: #d8ccb6; cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: relative; flex: none; width: 34px; height: 18px; border: 1px solid var(--line2); background: rgba(0,0,0,.6); transition: background .2s, border-color .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; transform: rotate(45deg); background: #6e665c; transition: left .2s, background .2s, box-shadow .2s; }
.switch input:checked + i { border-color: var(--gold); background: rgba(227,184,102,.15); }
.switch input:checked + i::after { left: 20px; background: var(--gold2); box-shadow: 0 0 8px var(--gold); }
.switch input:focus-visible + i { outline: 1px solid var(--gold2); outline-offset: 2px; }
.switch + .gs { margin-left: var(--s5); }
.inv-head .x { background: rgba(0,0,0,.5); border: 1px solid var(--line2); color: var(--gold2); width: 30px; height: 30px; cursor: pointer; }
.inv-head .x:hover { border-color: var(--gold); box-shadow: 0 0 10px rgba(227,184,102,.4); }
.inv-body { display: grid; grid-template-columns: 150px 1fr; gap: var(--s5); }
.equip { display: flex; flex-direction: column; gap: var(--s3); }
.eq label { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--gold); display: block; margin-bottom: var(--s1); }
.bag { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; align-content: start; align-self: start; padding: var(--s2); background: rgba(0,0,0,.35); box-shadow: inset 0 0 14px rgba(0,0,0,.8); }
.islot { position: relative; aspect-ratio: 1; border-radius: 1px; border: 1px solid color-mix(in srgb, var(--rc, #444) 65%, transparent); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #333) 24%, #120f14), #080608); box-shadow: inset 0 0 10px rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.eq .islot { width: 60px; }
.islot.empty { flex-direction: column; gap: 2px; border: 1px solid rgba(255,255,255,.05); background: linear-gradient(135deg, rgba(255,255,255,.025), rgba(0,0,0,.2)); cursor: default; font-size: 11px; color: #5a534b; }
.islot.empty svg { width: 42%; height: 42%; color: #4a443e; }
.islot .ig svg { width: 60%; height: 60%; display: block; margin: auto; }
.islot .ig { width: 100%; height: 100%; display: flex; }
.islot .il { position: absolute; bottom: 1px; right: 4px; font-family: var(--latin); font-size: 10px; font-weight: 700; color: #ddd; text-shadow: 0 1px 2px #000; }
.islot:hover { box-shadow: inset 0 0 10px rgba(0,0,0,.6), 0 0 14px color-mix(in srgb, var(--rc) 55%, transparent); }
.itip { display: none; position: absolute; left: calc(100% + 8px); top: 0; z-index: 5; width: 250px; padding: var(--s3) var(--s4); border-top: 2px solid var(--rc); font-size: 12px; line-height: 1.6; text-align: left; pointer-events: none; }
.islot:hover .itip { display: block; }
.bag .islot:nth-child(9n) .itip, .bag .islot:nth-child(9n-1) .itip, .bag .islot:nth-child(9n-2) .itip { left: auto; right: calc(100% + 8px); }
.itip b { font-size: 15px; font-weight: 700; }
.im { color: var(--muted); font-size: 12px; margin: var(--s1) 0 var(--s2); }
.itip ul { margin: 0; padding-left: 16px; color: #e8dcc8; }
.cmp { margin-top: var(--s2); font-weight: 700; }
.cmp.up { color: #7dffb0; }
.cmp.down { color: #ff8a7a; }
.inv-hint { font-size: 12px; color: var(--muted); margin: var(--s4) 0 0; }
.itip li em { font-style: normal; color: var(--muted); }
/* stat sheet: attributes on the left, the stats they produce on the right */
.sheet { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--s5); margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.attrs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-content: start; }
.at { display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 2px; padding: var(--s2) var(--s3); background: rgba(0,0,0,.3); }
.at span { font-size: 12px; font-weight: 700; color: #d8ccb6; }
.at span i { font-style: normal; font-size: 10px; margin-left: 6px; padding: 0 5px; color: #1d1206; background: var(--gold); }
.at b { font-family: var(--latin), var(--font); font-size: 17px; font-weight: 700; color: #fff0d6; }
.at em { grid-column: 1 / -1; font-style: normal; font-size: 11px; color: var(--muted); }
.at.main { background: linear-gradient(90deg, rgba(227,184,102,.18), rgba(0,0,0,.3)); }
.at.main b { color: var(--gold2); text-shadow: 0 0 10px rgba(227,184,102,.5); }
.derived { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); align-content: start; }
.derived div { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s3); background: rgba(0,0,0,.22); }
.derived span { font-size: 12px; color: var(--muted); }
.derived b { font-family: var(--latin), var(--font); font-size: 15px; font-weight: 700; color: #eadfcb; }
@media (max-width: 700px) { .sheet { grid-template-columns: 1fr; } }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.inventory, .shop { animation-name: invrise; }
@keyframes invrise { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes spin { from { transform: rotate(45deg); } to { transform: rotate(405deg); } }
@keyframes pulse { to { filter: brightness(1.6); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.15); box-shadow: 0 0 26px var(--c); } 100% { transform: scale(1); } }
@keyframes deny { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes ann { from { transform: translateX(-50%) scale(1.25); } to { transform: translateX(-50%) scale(1); } }
@keyframes slam { from { transform: scale(2); opacity: 0; letter-spacing: .3em; } to { transform: scale(1); opacity: 1; letter-spacing: .02em; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  .h-top { width: min(640px, calc(calc(100 * var(--vw)) - 460px)); }
  .room-title:not(:empty)::before, .room-title:not(:empty)::after { width: 20px; margin: 0 8px; }
}
@media (max-width: 800px) {
  .h-top { width: calc(86 * var(--vw)); top: 140px; }
  .menu { background: rgba(5,4,8,.8); }
  .menu { flex-direction: column; overflow-y: auto; }
  .screen.lobby { flex-direction: column; justify-content: flex-start; overflow-y: auto; pointer-events: auto; background: rgba(5,4,8,.8); }
  .lobby-panel { width: 100%; overflow: visible; padding: var(--s5); }
  .lobby-hint { display: none; }
  .menu.home { background: rgba(5,4,8,.8); }
  .menu-title { position: static; width: auto; padding: var(--s6) var(--s5) 0; }
  .menu-right { width: 100%; height: auto; overflow: visible; padding: var(--s5); }
  .menu-foot { position: static; flex-direction: column; align-items: flex-start; gap: var(--s3); padding: 0 var(--s5) var(--s6); }
  .hero-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-actions span { display: none; }
  .credits { position: static; padding: 0 var(--s5) var(--s5); }
  .status { width: calc(96 * var(--vw)); grid-template-columns: 64px 1fr; } .st-bars { width: auto; } .sym { width: 40px; height: 40px; } .sym svg { width: 24px; height: 24px; }
  .skills { padding: 8px 10px 12px; gap: 6px; }
  .slot { width: 46px; height: 46px; } .slot.ult { width: 50px; height: 50px; } .slot.util { width: 38px; height: 38px; }
  .party { width: 160px; } .minimap { width: 110px; height: 110px; } .diff-tag { top: 134px; width: 110px; }
  .room-title { font-size: 17px; } .room-title::before, .room-title::after { display: none !important; }
  .bi-name { font-size: 54px; } .announce.big .a-title { font-size: 44px; } .a-title { font-size: 34px; }
}

.fps { position: fixed; left: 50%; top: 4px; transform: translateX(-50%); z-index: 70; font: 700 11px/1 var(--latin); color: #9fe0a0; background: rgba(0,0,0,.6); padding: 4px 8px; pointer-events: none; }

/* ---------- merchant ---------- */
/* Left: the merchant's goods or the anvil. Right: the bag (worn pieces on top), picked pieces outlined,
   with 판매 and 강화 at the bottom right. */
.shop { pointer-events: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1060px, calc(96 * var(--vw))); max-height: calc(calc(100 * var(--vh)) - 32px); overflow-y: auto; padding: var(--s5) var(--s6); animation: invrise .25s ease-out both; z-index: 6; }
.shop.hidden { display: none; }
.shop { background: linear-gradient(180deg, #16110f, #090809); box-shadow: 0 0 0 100vmax rgba(3,2,4,.55), 0 30px 80px rgba(0,0,0,.75); }
.shop.busy { pointer-events: none; }
.shop .inv-head h3 em { font-family: var(--font); font-style: normal; color: var(--muted); font-size: 13px; letter-spacing: 0; margin-left: var(--s2); }
.inv-head .gold, .shop .gold { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.gold b { color: #ffd27a; font-weight: 700; }
.sh-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: var(--s5); align-items: stretch; }
.sh-left, .sh-right { display: flex; flex-direction: column; min-width: 0; padding: var(--s4); background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.shead { margin: 0 0 var(--s3); font-family: var(--display); font-size: 16px; color: #fff0d6; letter-spacing: .05em; }
.shead small { font-family: var(--font); font-size: 11px; color: var(--muted); margin-left: var(--s2); letter-spacing: 0; }
/* goods */
.sh-goods { display: flex; flex-direction: column; gap: var(--s2); }
.sgood { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: var(--s3); padding: var(--s3); background: rgba(255,255,255,.04); border: 1px solid var(--line2); color: var(--text); cursor: pointer; text-align: left; font-family: var(--font); }
.gi-ic { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--gold2); border: 1px solid var(--line2); background: radial-gradient(circle at 50% 40%, rgba(227,184,102,.18), #080608); }
.gi-ic svg { width: 26px; height: 26px; }
.gname { display: flex; flex-direction: column; gap: 2px; font-weight: 600; color: var(--gold2); font-size: 15px; }
.gname small { font-size: 11px; font-weight: 400; color: var(--muted); }
.gown { font-size: 12px; color: #cfc4b0; white-space: nowrap; }
.gprice { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 64px; text-align: right; }
.gprice b { color: #ffd27a; font-size: 15px; }
.sgood:hover:not(.off) { border-color: var(--gold); box-shadow: 0 0 12px rgba(227,184,102,.3); }
.sgood.off .gi-ic, .sgood.off .gname, .sgood.off .gprice { opacity: .5; }
.sgood.off { cursor: default; }
.sgood.deny, .sbtn.deny { animation: deny .25s; }
.sh-msg { min-height: 1.4em; margin: var(--s3) 0 0; font-size: 12px; color: #ff9f8a; }
/* bag */
.sh-worn { display: grid; grid-template-columns: repeat(4, 60px); gap: var(--s3); margin-bottom: var(--s3); }
.sh-worn .islot { width: 60px; }
.sh-bag { grid-template-columns: repeat(9, 1fr); user-select: none; align-self: stretch; }
.sh-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s3); }
.qp { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font: 600 12px var(--font); color: var(--rc, var(--gold2)); background: rgba(0,0,0,.35); border: 1px solid color-mix(in srgb, var(--rc, var(--gold2)) 45%, transparent); cursor: pointer; transition: background .15s, border-color .15s; }
.qp small { font-family: var(--latin); font-size: 11px; font-weight: 400; color: var(--muted); }
.qp:hover { background: color-mix(in srgb, var(--rc, var(--gold2)) 14%, transparent); }
.qp.on { background: color-mix(in srgb, var(--rc, var(--gold2)) 24%, transparent); border-color: var(--rc, var(--gold2)); }
.qp.none { --rc: #b8ada0; }
.sel-box { position: fixed; z-index: 80; pointer-events: none; border: 1px solid var(--gold2); background: rgba(255,210,122,.12); }
.islot .ip { position: absolute; top: 1px; left: 4px; font-family: var(--latin); font-size: 10px; font-weight: 700; color: #ffd27a; text-shadow: 0 1px 2px #000; }
.islot.sel { border-color: var(--gold2); box-shadow: inset 0 0 10px rgba(0,0,0,.6), 0 0 0 1px var(--gold2), 0 0 14px rgba(255,210,122,.55); }
.islot.sel::after { content: '✓'; position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #1a1208; background: var(--gold2); }
.shop.dragging .itip { display: none !important; }
.sh-worn .islot:hover .itip { left: calc(100% + 8px); right: auto; }
.sh-foot { display: flex; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s4); }
.sh-sum { margin-right: auto; font-size: 12px; color: var(--muted); }
.sbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 104px; min-height: 48px; padding: var(--s2) var(--s4); background: rgba(227,184,102,.1); border: 1px solid var(--line2); color: var(--gold2); font: 600 14px var(--font); cursor: pointer; }
.sbtn small { color: var(--muted); font-size: 11px; font-weight: 400; }
.sbtn.sell { background: rgba(255,255,255,.04); color: var(--text); }
.sbtn.on { border-color: var(--gold); background: rgba(227,184,102,.18); }
.sbtn.ghost { background: transparent; }
.sbtn:hover:not(.off) { border-color: var(--gold); box-shadow: 0 0 10px rgba(227,184,102,.35); }
.sbtn.off { opacity: .45; cursor: default; }
/* anvil */
.anvil { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; margin-bottom: var(--s3); background: radial-gradient(ellipse at 50% 70%, rgba(255,150,60,.12), transparent 65%); cursor: default; }
.an-slot { position: relative; z-index: 1; width: 108px; height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); text-align: center; font-size: 11px; line-height: 1.5; color: #6e665c; border: 1px dashed rgba(214,170,104,.35); background: linear-gradient(135deg, rgba(255,255,255,.025), rgba(0,0,0,.25)); }
.an-slot > svg { width: 30px; height: 30px; color: #5a534b; }
.anvil.over .an-slot { border-color: var(--gold2); box-shadow: 0 0 18px rgba(255,210,122,.45); }
.anvil.has { cursor: pointer; }
.anvil.has .an-slot { border: 1px solid color-mix(in srgb, var(--rc) 70%, transparent); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 26%, #120f14), #080608); box-shadow: inset 0 0 14px rgba(0,0,0,.8), 0 0 18px color-mix(in srgb, var(--rc) 30%, transparent); }
.anvil.has .an-slot .ig { display: flex; } .anvil.has .an-slot .ig svg { width: 58px; height: 58px; }
.an-slot .ip { position: absolute; top: 4px; left: 6px; font-size: 13px; font-weight: 700; color: #ffd27a; }
.an-hammer { position: absolute; z-index: 2; left: calc(50% + 20px); top: -6px; width: 86px; height: 86px; opacity: 0; transform-origin: 50% 92%; transform: rotate(50deg); filter: drop-shadow(0 6px 8px #000); pointer-events: none; transition: opacity .15s; }
.an-hammer svg { width: 100%; height: 100%; }
.anvil.forging .an-hammer { opacity: 1; }
.anvil.blow .an-hammer { animation: hammer .36s cubic-bezier(.5,0,.75,0) both; }
.anvil.blow .an-slot { animation: anvilHit .36s both; }
.an-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.an-fx i { position: absolute; left: calc(50% + 30px); top: calc(50% - 40px); width: 5px; height: 5px; background: #ffe2a0; box-shadow: 0 0 6px #ffb347, 0 0 12px #ff8a2a; animation: spark .5s ease-out forwards; }
.an-fx i.b { left: 50%; top: 50%; background: #fff6d8; width: 6px; height: 6px; }
.anvil.ok .an-slot { animation: forgeOk .8s ease-out both; }
.anvil.no .an-slot { animation: forgeNo .5s both; filter: grayscale(.7) brightness(.7); }
.anvil.ok::after { content: ''; position: absolute; inset: 10px; background: radial-gradient(circle, rgba(255,226,150,.55), transparent 60%); animation: psOut .8s ease-out forwards; pointer-events: none; }
@keyframes hammer { 0% { transform: rotate(50deg); } 50% { transform: rotate(-42deg); } 62% { transform: rotate(-34deg); } 100% { transform: rotate(50deg); } }
.anvil.blow { animation: anvilShake .3s; }
@keyframes anvilShake { 0%, 45%, 100% { transform: none; } 55% { transform: translate(2px, 3px); } 70% { transform: translate(-2px, -1px); } }
.anvil.blow::before { content: ''; position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255,200,120,.45), transparent 60%); opacity: 0; animation: anFlash .36s ease-out; pointer-events: none; }
@keyframes anFlash { 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes anvilHit { 0%, 45% { transform: none; } 55% { transform: translateY(3px) scale(.97); filter: brightness(1.8); } 100% { transform: none; } }
@keyframes spark { from { transform: translate(-50%, -50%); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); opacity: 0; } }
@keyframes forgeOk { 0% { transform: scale(1); } 30% { transform: scale(1.14); box-shadow: 0 0 40px rgba(255,220,140,.9); } 100% { transform: scale(1); } }
@keyframes forgeNo { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.fg-note { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); text-align: center; }
.fg-info { display: flex; flex-direction: column; gap: var(--s1); }
.fg-info > b { font-size: 16px; font-weight: 600; }
.fg-info > em { font-style: normal; font-size: 12px; color: var(--gold); }
.fg-info ul { margin: var(--s2) 0; padding-left: 16px; font-size: 13px; color: #e8dcc8; line-height: 1.7; }
.fg-info li i { font-style: normal; color: var(--muted); margin: 0 2px; }
.fg-info li b { color: #9ff2b8; font-weight: 600; }
.fg-info li b.same { color: #cfc4b0; font-weight: 400; }
.fg-chance { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s3); font-size: 12px; color: var(--muted); }
.fg-chance b { color: #fff0d6; font-size: 15px; }
.fg-bar { height: 6px; background: rgba(255,255,255,.08); }
.fg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a8672a, #ffd27a); }
.fg-cost { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s2); font-size: 13px; color: #cfc4b0; }
.fg-cost span { display: inline-flex; align-items: center; gap: var(--s1); }
.fg-cost svg { width: 15px; height: 15px; color: var(--gold2); }
.fg-cost b { color: #ffd27a; }
.fg-cost small { color: var(--muted); font-size: 11px; }
.fg-cost .lack, .fg-cost .lack b { color: #ff9f8a; }
.fg-res { margin: var(--s2) 0 0; font-size: 14px; font-weight: 600; text-align: center; }
.fg-res.ok { color: #ffd27a; } .fg-res.no { color: #b8aca0; }
.fg-btns { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: auto; padding-top: var(--s4); }
.sbtn.forge-go { min-width: 140px; font-size: 16px; background: linear-gradient(180deg, rgba(227,184,102,.28), rgba(140,90,40,.2)); border-color: var(--gold); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 80; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; pointer-events: none; border: 1px solid var(--rc); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 30%, #120f14), #080608); box-shadow: 0 8px 20px rgba(0,0,0,.7), 0 0 14px color-mix(in srgb, var(--rc) 50%, transparent); }
.drag-ghost svg { width: 34px; height: 34px; }
@media (max-width: 820px) {
  .sh-body { grid-template-columns: 1fr; }
  .shop { padding: var(--s4); }
  .sh-bag { grid-template-columns: repeat(6, 1fr); }
  .sh-bag .islot:nth-child(9n) .itip, .sh-bag .islot:nth-child(9n-1) .itip, .sh-bag .islot:nth-child(9n-2) .itip { left: calc(100% + 8px); right: auto; }
  .sh-bag .islot:nth-child(6n) .itip, .sh-bag .islot:nth-child(6n-1) .itip, .sh-bag .islot:nth-child(6n-2) .itip { left: auto; right: calc(100% + 8px); }
  .sgood { grid-template-columns: 40px 1fr auto; } .gown { grid-column: 2; grid-row: 2; }
  .shop .inv-head h3 em { display: none; }
  .sh-foot { position: sticky; bottom: calc(-1 * var(--s4)); z-index: 4; flex-wrap: wrap; margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: var(--s3) var(--s4); background: linear-gradient(180deg, rgba(14,11,10,.92), #0b0909); border-top: 1px solid var(--line); }
  .sh-sum { flex-basis: 100%; }
  .sh-foot .sbtn { flex: 1; }
}

/* ---------- journey map ---------- */
/* The 3D map is drawn on the game canvas; this layer holds the title, the labels and the panel. */
#hud.journeying > *:not(.journey):not(.shop):not(.inventory):not(.h-menu) { opacity: 0; pointer-events: none; }
#hud.journeying .inventory, #hud.journeying .h-menu { z-index: 6; } /* above the map, so gear can be changed while choosing the way */
.journey { inset: 0; z-index: 5; pointer-events: auto; animation: psIn .4s ease-out both; }
.journey.hidden { display: none; }
.journey.point { cursor: pointer; }
.jm-head { position: absolute; top: var(--s5); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; pointer-events: none; }
.jm-head small { font-size: 12px; font-weight: 600; letter-spacing: .32em; color: var(--gold); }
.jm-head h2 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .12em; color: #fff0d6; text-shadow: 0 2px 10px #000; }
.jm-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; pointer-events: none; transition: opacity .2s; text-shadow: 0 1px 2px #000, 0 0 10px #000, 0 0 18px #000; --c: var(--gold); }
.jm-label b { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .04em; color: #f4e8d2; }
.jm-label span { font-size: 12px; color: var(--muted); }
.jm-label i { width: 6px; height: 6px; margin-top: 4px; transform: rotate(45deg); background: var(--c); box-shadow: 0 0 8px var(--c); }
.jm-label.hot b { color: var(--c); }
.jm-label.ch.hot b { color: var(--gold2); }
.jm-label.dim { opacity: .45; }
.jm-label.ch b { font-size: 16px; color: #fff0d6; }
.jm-panel { position: absolute; left: 50%; bottom: var(--s5); transform: translateX(-50%); width: min(620px, calc(calc(100 * var(--vw)) - 32px)); display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: start; padding: var(--s4) var(--s5) var(--s4) var(--s4); background: var(--stone); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.jm-panel .dl-portrait { --sc: var(--c, var(--gold)); }
.jm-body { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.jm-body .kind { font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.jm-body h3 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--c, #fff0d6); }
.jm-body p { margin: 0; font-size: 15px; line-height: 1.6; color: #f0e6d4; }
.jm-body .jm-gain { color: #9fb0ff; font-weight: 600; }
.jm-body ul { margin: var(--s1) 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); }
.jm-body li { padding: 2px var(--s3); font-size: 12px; color: #d8ccb6; background: rgba(255,226,160,.07); border: 1px solid rgba(255,226,160,.22); }
.jm-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); }
.jm-row .hint { font-size: 12px; color: var(--muted); }
.jm-btns { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.jm-go { flex: none; white-space: nowrap; padding: 9px 20px; font: 600 14px var(--font); letter-spacing: .08em; color: #fff0d6; background: linear-gradient(180deg, #8a3a22, #5a1e12); border: 1px solid #d08a4a; cursor: pointer; }
.jm-go.ghost { background: transparent; border-color: var(--line2); color: var(--gold2); }
.jm-panel.quiet { grid-template-columns: 1fr; text-align: center; padding: var(--s3) var(--s5); }
.jm-panel.quiet p { margin: 0; font-size: 14px; color: #d8ccb6; }
@media (max-width: 600px) { .jm-head h2 { font-size: 21px; } .jm-label b { font-size: 13px; } .jm-label span { display: none; } .jm-panel { gap: var(--s3); padding: var(--s3); } .jm-body p { font-size: 14px; } .jm-row .hint { display: none; } .jm-row { justify-content: flex-end; } }

/* Painted item icons (src/ui/art.js) */
img.art { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.islot .ig img.art { width: 80%; height: 80%; margin: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.65)); }
.loot .lg img.art { display: inline-block; width: 22px; height: 22px; margin-right: 6px; vertical-align: -6px; }
.gi i img.art { width: 42px; height: 42px; }
@media (max-width: 800px) { .gain-feed { left: auto; right: var(--s4); top: 16%; } .gain { min-width: 220px; } }
.gi-ic img.art { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.slot > img.pot-art { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.75)); }
.slot.empty > img.pot-art { filter: grayscale(1) brightness(.45); }
.fg-cost img.art { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; }
.anvil.has .an-slot .ig img.art { width: 80px; height: 80px; }
.sh-note { margin: var(--s2) 0 0; font-size: 11px; color: #8a8174; }
.drag-ghost img.art { width: 42px; height: 42px; }
/* Silenced: skill slots dim, a small note over them */
.skills.silenced .slot:not(.util) { filter: grayscale(.85) brightness(.55); }
.skills.silenced::before { content: '침묵'; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 2px 10px; font-size: 12px; font-weight: 700; color: #e0d0ff; background: rgba(40,20,70,.85); border: 1px solid rgba(180,144,255,.6); }

/* Story scenes (src/scene.js): subtitles in the lower letterbox, the speaker's name over the line */
.scene-hit { position: fixed !important; inset: 0; z-index: 5; cursor: pointer; background: transparent; }
.dialogue.scene { bottom: calc(2.2 * var(--vh)); width: min(920px, calc(94 * var(--vw))); grid-template-columns: 1fr; justify-items: center; gap: 6px; padding: var(--s2) var(--s5) var(--s3); background: none; border: 0; box-shadow: none; text-align: center; z-index: 7; }
#hud.cine .dialogue.scene { bottom: calc(2.2 * var(--vh)); }
.dialogue.scene .dl-portrait { display: none; }
.dialogue.scene .dl-body { align-items: center; gap: 6px; }
.dialogue.scene .dl-name { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; letter-spacing: .12em; text-shadow: 0 0 14px color-mix(in srgb, var(--sc) 60%, transparent), 0 1px 3px #000; }
.dialogue.scene .dl-name::before, .dialogue.scene .dl-name::after { content: ''; width: 46px; height: 1px; background: linear-gradient(90deg, transparent, var(--sc)); }
.dialogue.scene .dl-name::after { background: linear-gradient(90deg, var(--sc), transparent); }
.dialogue.scene .dl-text { font-size: 20px; line-height: 1.6; color: #fff6e6; text-shadow: 0 2px 6px #000, 0 0 2px #000; min-height: 1.6em; }
.dialogue.scene .dl-ctrl { position: fixed; right: calc(3 * var(--vw)); bottom: calc(3 * var(--vh)); flex-direction: row; align-items: center; gap: var(--s4); }
.dialogue.scene .dl-next { margin: 0; }
.dialogue.scene .dl-skip { font-size: 13px; color: #cfc4b0; }
.dialogue.scene.in { animation: sceneIn .35s ease-out both; }
@keyframes sceneIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 800px) { .dialogue.scene .dl-text { font-size: 16px; } .dialogue.scene .dl-ctrl { position: absolute; right: 0; bottom: auto; top: -30px; } }
/* Chapter 10: a fading name on the status panel */
.st-name[data-fade]:not([data-fade=""])::after { content: attr(data-fade); margin-left: 8px; font-size: 11px; font-weight: 600; color: #c8a8ff; }

/* The ending (src/ui/ending.js): the empty gravestone and what to carve on it */
.ending { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: var(--s5); background: radial-gradient(ellipse at 50% 40%, rgba(40,30,60,.92), rgba(4,3,8,.98)); opacity: 0; transition: opacity 1.2s; }
.ending.in { opacity: 1; }
.en-stone { width: min(640px, 100%); text-align: center; }
.en-q { margin: 0 0 var(--s6); font-family: var(--display); font-size: 30px; letter-spacing: .08em; color: #f0e2c8; text-shadow: 0 0 24px rgba(200,160,255,.35); }
.en-picks { display: flex; flex-direction: column; gap: var(--s3); align-items: center; }
.en-pick { min-width: 280px; padding: var(--s3) var(--s5); font: 600 18px var(--display); letter-spacing: .06em; color: #f0e2c8; background: rgba(255,255,255,.04); border: 1px solid rgba(232,210,170,.35); cursor: pointer; transition: background .2s, border-color .2s, opacity .6s; }
.en-pick:hover { background: rgba(232,210,170,.1); border-color: var(--gold2); }
.ending.chosen .en-pick:not(.on) { opacity: 0; pointer-events: none; height: 0; padding: 0; border: 0; margin: 0; overflow: hidden; }
.ending.chosen .en-pick.on { border-color: var(--gold2); box-shadow: 0 0 24px rgba(255,210,122,.3); cursor: default; }
.en-text { margin-top: var(--s5); min-height: 8em; }
.en-line { margin: var(--s3) 0; font-size: 17px; line-height: 1.7; color: #e8dcc8; animation: enLine 1.2s ease-out both; }
.en-title { margin: var(--s5) 0 0; font-family: var(--display); font-size: 20px; letter-spacing: .1em; color: var(--gold2); animation: enLine 1.4s ease-out both; }
.en-go { margin-top: var(--s5); padding: var(--s2) var(--s6); font: 600 15px var(--font); color: #1a1208; background: var(--gold2); border: 0; cursor: pointer; }
@keyframes enLine { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 800px) { .en-q { font-size: 22px; } .en-pick { min-width: 0; width: 100%; font-size: 16px; } .en-line { font-size: 15px; } }
/* the camp's gear merchant */
.sh-gear { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }
.ggear { display: flex; flex-direction: column; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer; font-family: var(--font); color: var(--text); }
.ggear .islot { width: 100%; }
.ggear .gp { font-size: 11px; color: var(--muted); text-align: center; }
.ggear .gp b { font-family: var(--latin); font-size: 13px; color: #ffd27a; }
.ggear .gup { position: absolute; top: 2px; left: 4px; font-style: normal; font-size: 10px; color: #7ee07a; text-shadow: 0 1px 2px #000; }
.ggear.off .islot, .ggear.off .gp { opacity: .45; }
.ggear.off { cursor: default; }
.ggear.deny { animation: deny .25s; }
.ggear:nth-child(4n) .itip, .ggear:nth-child(4n-1) .itip { left: auto; right: calc(100% + 8px); }
/* party: waiting for everyone's opening lines */
.talk-wait { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 18px 12px; background: rgba(10,8,9,.82); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0,0,0,.5); pointer-events: none; animation: invrise .25s ease-out both; }
.talk-wait.hidden { display: none; }
.talk-wait p { margin: 0; font-size: 13px; color: var(--gold2); letter-spacing: .02em; }
.tw-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.tw-list span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #cfc4b0; }
.tw-list span small { font-size: 10px; color: var(--muted); }
.tw-list span em { font-style: normal; font-size: 11px; color: var(--muted); }
.tw-list span.ok { color: #9be39a; }
.tw-list i { font-style: normal; font-weight: 700; }
.tw-list .dots { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: twpulse 1s ease-in-out infinite; }
@keyframes twpulse { 50% { opacity: .25; } }
#hud.cine .talk-wait { top: calc(calc(11 * var(--vh)) + 12px); }
@media (max-width: 600px) { .talk-wait { top: 182px; width: max-content; max-width: calc(calc(100 * var(--vw)) - 32px); padding: 8px 14px 10px; } .talk-wait p { font-size: 12px; } #hud.cine .talk-wait { top: calc(calc(11 * var(--vh)) + 8px); } }
