/* The Undercroft - HUD and panels. The world is one canvas; everything here
   sits on top of it. Gothic serif for anything the dungeon says, the site's own
   Bricolage for numbers and buttons. */
@font-face { font-family: 'Bricolage'; src: url('/assets/fonts/bricolage-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Silkscreen'; src: url('/assets/fonts/silkscreen-400-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #f4f1f9; --dim: #a59cbb; --faint: #6f6788;
  --gold: #ffd35d; --life: #d1263f; --mana: #3c5cff;
  --panel: rgba(14, 11, 22, .94); --line: rgba(201, 162, 39, .35);
  --serif: Georgia, 'Palatino Linotype', 'Book Antiqua', serif;
  --ui: 'Bricolage', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07060c; color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; touch-action: none; user-select: none; -webkit-user-select: none; }
#cr-canvas { position: fixed; inset: 0; display: block; cursor: crosshair; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------------ top */
.cr-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; pointer-events: none; z-index: 5;
  background: linear-gradient(rgba(5, 4, 9, .8), transparent); }
.cr-top > * { pointer-events: auto; }
.cr-back { color: var(--dim); text-decoration: none; font-size: 14px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 3px 10px 3px 3px; background: rgba(10,8,16,.6); }
.cr-back:hover { color: var(--ink); border-color: var(--line); }
.cr-where { display: grid; line-height: 1.15; }
.cr-where b { font-family: var(--serif); font-size: 18px; color: var(--gold); letter-spacing: .02em; }
.cr-where span { font-family: var(--serif); font-size: 13px; color: var(--dim); font-style: italic; }
.cr-purse { margin-left: auto; margin-right: 182px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 3px 10px 3px 3px; background: rgba(10,8,16,.7); border: 1px solid var(--line); }
.cr-purse b { font-size: 15px; color: var(--gold); font-variant-numeric: tabular-nums; }
.coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e0b02a 55%, #8a6510); box-shadow: 0 0 8px rgba(255,211,93,.5); }
.cr-mini { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 6; border-radius: 50%; border: 2px solid rgba(201,162,39,.6); box-shadow: 0 0 0 4px rgba(10,8,16,.6), 0 10px 30px rgba(0,0,0,.6); pointer-events: none; }
.cr-mini.big { top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); border-radius: 6px; z-index: 20; }
.cr-buffs { position: fixed; top: 74px; left: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 5; pointer-events: none; }
.cr-buffs span { font-size: 12px; padding: 4px 9px; border-left: 3px solid var(--c); background: rgba(10,8,16,.75); color: var(--c); font-variant-numeric: tabular-nums; }
.cr-menu { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 5; font-size: 12px; padding: 6px 12px; background: rgba(10,8,16,.6); border: 1px solid rgba(255,255,255,.12); border-radius: 3px 10px 3px 3px; color: var(--dim); cursor: pointer; }
.cr-menu:hover { color: var(--ink); }

/* ------------------------------------------------------------------ HUD */
.cr-hud { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: auto minmax(0, 640px) auto; justify-content: center; align-items: end; gap: 16px; padding: 0 14px max(12px, env(safe-area-inset-bottom)); pointer-events: none;
  background: linear-gradient(transparent, rgba(5, 4, 9, .85) 60%); }
.cr-hud > * { pointer-events: auto; }
.cr-orb { position: relative; width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: #0b0910;
  border: 3px solid #6b5418; box-shadow: 0 0 0 2px #1b1408, inset 0 0 18px rgba(0,0,0,.9), 0 8px 30px rgba(0,0,0,.6); }
.cr-orb i { position: absolute; inset: 0; transition: transform .2s linear; }
.cr-orb.life i { background: radial-gradient(circle at 40% 30%, #ff7a8a, #c4142f 45%, #5a0612 100%); }
.cr-orb.mana i { background: radial-gradient(circle at 40% 30%, #8ab0ff, #2a49d6 45%, #0b1660 100%); }
.cr-orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 22%, rgba(255,255,255,.35), transparent 30%); pointer-events: none; }
.cr-orb span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 6px #000; font-variant-numeric: tabular-nums; z-index: 1; }
.cr-bar { display: grid; gap: 8px; padding-bottom: 6px; }
.cr-xp { position: relative; height: 18px; border: 1px solid var(--line); background: rgba(10,8,16,.85); overflow: hidden; border-radius: 2px; }
.cr-xp i { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(90deg, #8a6510, #ffd35d); opacity: .75; }
.cr-xp span { position: relative; display: block; text-align: center; font-size: 11.5px; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }
.cr-skills { display: flex; gap: 8px; align-items: center; }
.cr-skill { --cd: 0deg; position: relative; width: 56px; height: 56px; border-radius: 6px; border: 2px solid #6b5418; background: linear-gradient(160deg, #2a2140, #120e1c); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: inset 0 0 12px rgba(0,0,0,.8); }
.cr-skill svg { width: 30px; height: 30px; fill: none; stroke: #c7d8ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(126,203,255,.7)); }
#cr-sk-blink svg { fill: rgba(200,240,255,.35); }
.cr-skill.potion svg { fill: #c4142f; stroke: #ff9aa8; filter: drop-shadow(0 0 6px rgba(255,80,100,.6)); }
.cr-skill::after { content: ""; position: absolute; inset: 0; border-radius: 4px; background: conic-gradient(rgba(0,0,0,.72) var(--cd), transparent 0); pointer-events: none; }
.cr-skill.no-mana { filter: grayscale(.8) brightness(.6); }
.cr-skill kbd { position: absolute; left: 3px; top: 1px; font: 400 10px 'Silkscreen', monospace; color: var(--gold); z-index: 1; }
.cr-skill > b { position: absolute; right: 3px; bottom: 1px; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; z-index: 1; }
.cr-skill:hover { border-color: var(--gold); }
.cr-skill:active { transform: scale(.94); }
.cr-gap { flex: 1; }
.cr-tool { height: 40px; padding: 0 14px; border-radius: 3px 10px 3px 3px; border: 1px solid var(--line); background: rgba(14,11,22,.85); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.cr-tool:hover { border-color: var(--gold); color: var(--gold); }

/* --------------------------------------------------------------- banner */
.cr-banner { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 8; opacity: 0; }
.cr-banner b { display: block; font-family: var(--serif); font-size: clamp(30px, 5vw, 56px); font-weight: 400; color: var(--gold); letter-spacing: .04em; text-shadow: 0 0 30px rgba(255,180,60,.45), 0 2px 4px #000; }
.cr-banner span { display: block; margin-top: 6px; font-family: var(--serif); font-style: italic; font-size: 17px; color: #d8cfe8; text-shadow: 0 2px 4px #000; }
.cr-banner.show { animation: banner 3.2s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px); } 12% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; } }
.cr-flash { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 9; font-size: 14px; padding: 8px 14px; background: rgba(14,11,22,.92); border: 1px solid var(--line); border-radius: 3px 10px 3px 3px; opacity: 0; pointer-events: none; }
.cr-flash.show { animation: flash 2.4s ease forwards; }
@keyframes flash { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ----------------------------------------------------------------- panel */
.cr-panel { position: fixed; right: 16px; top: 64px; bottom: 140px; width: min(760px, calc(100% - 32px)); z-index: 12; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 18px 4px 4px; box-shadow: 0 30px 80px rgba(0,0,0,.7); display: flex; flex-direction: column; overflow: hidden; }
.cr-panel[hidden] { display: none; }
.cr-panel header { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(201,162,39,.2); background: linear-gradient(rgba(201,162,39,.08), transparent); }
.cr-panel h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--gold); }
.cr-shards { margin-left: auto; font-size: 13px; color: var(--dim); }
.cr-shards b { color: #c9b8ff; }
.cr-x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: transparent; cursor: pointer; }
.cr-x:hover { border-color: var(--gold); }
.cr-panel-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: auto; }
.cr-left { padding: 14px; border-right: 1px solid rgba(255,255,255,.06); }
.cr-right { padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cr-doll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.cr-slot, .cr-cell { aspect-ratio: 1; border-radius: 4px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); display: grid; place-items: center; cursor: pointer; padding: 4px; position: relative; }
.cr-slot em { font-style: normal; font-size: 9.5px; color: var(--faint); text-align: center; line-height: 1.1; }
.cr-slot svg, .cr-cell svg { width: 80%; height: 80%; }
.cr-slot .cr-ico, .cr-cell .cr-ico { width: 100%; height: 100%; display: block; image-rendering: auto; }
/* The frame is painted into the icon itself (ItemArt.frame): the cell only adds what a
   raster cannot, the bloom that spills past the edge and the sweep of light over the glass. */
.r-magic { border-color: rgba(111,140,255,.5); }
.r-set { border-color: rgba(124,242,154,.8); box-shadow: 0 0 14px -2px rgba(124,242,154,.55), 0 0 28px -8px rgba(124,242,154,.45); }
.cr-tip-lore { font-style: italic; color: #c4bcd8; opacity: .85; margin: 6px 0 2px; font-size: 12px; }
.cr-tip-set { margin: 6px 0; padding: 6px 8px; border-left: 2px solid #7cf29a; background: rgba(124,242,154,.06); font-size: 12px; }
.cr-tip-set > b { color: #7cf29a; } .cr-tip-set > span { color: var(--faint); margin-left: 6px; }
.cr-tip-set div { color: var(--faint); margin-top: 3px; } .cr-tip-set div.on { color: #d9ffe3; }
.r-rare { border-color: rgba(244,211,94,.6); box-shadow: 0 0 10px -2px rgba(244,211,94,.35); }
.r-legendary { border-color: rgba(255,138,61,.8); box-shadow: 0 0 14px -2px rgba(255,138,61,.6), 0 0 28px -8px rgba(255,138,61,.5); }
.r-ancient { border-color: rgba(255,79,109,.85); box-shadow: 0 0 14px -2px rgba(255,79,109,.65), 0 0 30px -8px rgba(255,79,109,.55); }
.r-mythic { border-color: rgba(232,121,249,.9); box-shadow: 0 0 16px -2px rgba(232,121,249,.75), 0 0 34px -8px rgba(232,121,249,.6); animation: myth 2s ease-in-out infinite; }
@keyframes myth { 50% { box-shadow: 0 0 22px -2px rgba(232,121,249,.95), 0 0 44px -6px rgba(232,121,249,.8); } }
.cr-slot.r-legendary, .cr-slot.r-ancient, .cr-slot.r-mythic, .cr-cell.r-legendary, .cr-cell.r-ancient, .cr-cell.r-mythic { overflow: hidden; }
.cr-slot.r-legendary::after, .cr-slot.r-ancient::after, .cr-slot.r-mythic::after, .cr-cell.r-legendary::after, .cr-cell.r-ancient::after, .cr-cell.r-mythic::after {
  content: ""; position: absolute; inset: -40% -60%; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.22) 50%, transparent 58%);
  transform: translateX(-70%); animation: sweep 3.2s ease-in-out infinite;
}
.cr-cell.r-mythic::after, .cr-slot.r-mythic::after { animation-duration: 2.2s; }
@keyframes sweep { 0%, 55% { transform: translateX(-70%); } 85%, 100% { transform: translateX(70%); } }
/* a fresh drop in the bag lands with a pop, the way a good roll should */
.cr-cell.up .cr-ico { animation: landed .5s cubic-bezier(.2, 1.4, .3, 1); }
@keyframes landed { 0% { transform: scale(.6); filter: brightness(2); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .cr-slot::after, .cr-cell::after, .cr-cell.up .cr-ico, .r-mythic { animation: none !important; } }
.cr-slot.sel, .cr-cell.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cr-cell.up::before { content: ""; position: absolute; right: 2px; top: 2px; border: 5px solid transparent; border-right-color: #4ade80; border-top-color: #4ade80; }
.cr-stats { display: grid; gap: 2px; font-size: 12.5px; }
.cr-stats div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.cr-stats span { color: var(--dim); }
.cr-stats b { font-variant-numeric: tabular-nums; }
.cr-bag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.cr-bag-head b { font-family: var(--serif); font-size: 16px; color: var(--gold); font-weight: 400; }
.cr-bag-head > span { color: var(--dim); }
.cr-bag-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.cr-mini-btn { font-size: 12px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); border-radius: 3px 8px 3px 3px; cursor: pointer; }
.cr-mini-btn:hover { border-color: var(--gold); }
.cr-bag { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.cr-detail { min-height: 140px; }
.cr-hint { color: var(--dim); font-size: 13px; margin: 0; }
.cr-tip { border: 1px solid var(--rc); background: rgba(5,4,9,.7); padding: 12px 14px; border-radius: 3px 12px 3px 3px; }
.cr-tip-head { display: flex; align-items: center; gap: 10px; }
.cr-tip-head .cr-ico { width: 44px; height: 44px; flex: none; }
.cr-tip-title { min-width: 0; }
.cr-tip-name { font-family: var(--serif); font-size: 18px; color: var(--rc); }
.cr-tip-kind { font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.cr-tip-main { font-size: 14px; margin-bottom: 4px; }
.cr-tip-main b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.cr-tip-main i { color: var(--dim); font-style: normal; margin-left: 6px; font-size: 12px; }
.cr-tip ul { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.cr-tip li { font-size: 13px; color: #8ea6ff; }
.cr-tip li::before { content: "+ "; color: var(--faint); }
.cr-tip-power { margin: 8px 0 4px; font-size: 13px; color: #ffb37a; font-family: var(--serif); font-style: italic; }
.cr-tip-power b { font-style: normal; }
.cr-tip-foot { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.cr-tip-cmp { margin-top: 6px; font-size: 13px; font-weight: 600; }
.cr-tip-cmp.up { color: #4ade80; }
.cr-tip-cmp.down { color: #f87171; }
.cr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* -------------------------------------------------------------- buttons */
.cr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; font-size: 14.5px; font-weight: 650; border-radius: 3px 12px 3px 3px; border: 1px solid rgba(201,162,39,.45); background: rgba(20,15,30,.85); color: var(--ink); cursor: pointer; text-decoration: none; }
.cr-btn:hover { border-color: var(--gold); color: var(--gold); }
.cr-btn.primary { background: linear-gradient(180deg, #8a6510, #5a3f08); border-color: #ffd35d; color: #fff6dc; box-shadow: 0 8px 30px -8px rgba(255,180,60,.6); }
.cr-btn.primary:hover { color: #fff; filter: brightness(1.12); }
.cr-btn.ghost { border-color: rgba(255,255,255,.14); }

/* ---------------------------------------------------------------- title */
.cr-title, .cr-death { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 40%, rgba(40,20,60,.55), rgba(5,4,9,.94)); overflow: auto; }
.cr-title[hidden], .cr-death[hidden] { display: none; }
.cr-title-in { width: min(640px, 100%); text-align: center; }
.cr-kicker { font: 400 11px 'Silkscreen', monospace; letter-spacing: .14em; text-transform: uppercase; color: #c9a227; margin: 0 0 10px; }
.cr-title h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 9vw, 92px); line-height: .95; color: #f6e7c1; letter-spacing: .02em; text-shadow: 0 0 40px rgba(255,170,60,.35), 0 4px 0 #2a1a08; }
.cr-lede { color: #cfc6de; font-size: 16px; line-height: 1.6; max-width: 520px; margin: 18px auto 24px; }
.cr-title-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cr-title-meta { margin: 18px 0 10px; color: var(--dim); font-size: 13.5px; }
.cr-checkpoints { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.cr-cp { display: grid; gap: 2px; padding: 8px 12px; border-radius: 3px 10px 3px 3px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); cursor: pointer; font-size: 14px; font-weight: 600; }
.cr-cp em { font-style: italic; font-weight: 400; font-family: var(--serif); font-size: 12px; color: var(--dim); }
.cr-cp:hover { border-color: var(--gold); }
.cr-how { text-align: left; margin: 10px auto 0; max-width: 520px; font-size: 13.5px; color: #cfc6de; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.cr-how summary { cursor: pointer; color: var(--gold); font-family: var(--serif); font-size: 16px; }
.cr-how ul { padding-left: 18px; line-height: 1.6; }
.cr-sound { margin-top: 16px; font-size: 12px; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--dim); cursor: pointer; }
.cr-death > div { text-align: center; }
.cr-death h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 8vw, 80px); color: #d1263f; text-shadow: 0 0 40px rgba(209,38,63,.5); }
.cr-death p { color: #cfc6de; margin: 0 0 20px; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  .cr-top { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .cr-where b { font-size: 15px; } .cr-where span { font-size: 11.5px; }
  .cr-purse { margin-right: 112px; padding: 4px 8px; }
  .cr-hud { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding-left: 8px; padding-right: 8px; }
  .cr-orb { width: 70px; height: 70px; }
  .cr-orb span { font-size: 10px; }
  .cr-skill { width: 46px; height: 46px; }
  .cr-skill svg { width: 24px; height: 24px; }
  .cr-skills { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .cr-gap { display: none; }
  .cr-tool { height: 32px; padding: 0 10px; font-size: 12px; }
  .cr-xp span { font-size: 10px; }
  .cr-menu { top: auto; bottom: 176px; left: auto; right: 10px; transform: none; }
  .cr-panel { left: 8px; right: 8px; width: auto; top: 56px; bottom: 8px; }
  .cr-panel-grid { grid-template-columns: 1fr; }
  .cr-left { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .cr-doll { grid-template-columns: repeat(5, 1fr); }
  .cr-bag { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ======================================================= 2026-11-03 pass
   Purpose, reward and a front door: the objective tracker, loot cards, the
   rarity flare, camp, the pause menu and a title screen with some weight. */

/* objective tracker, top left under the floor name */
.cr-side { position: fixed; top: 70px; left: 16px; z-index: 5; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(300px, 46vw); }
.cr-side .cr-buffs { position: static; }
.cr-track { display: grid; gap: 5px; }
.cr-track:empty { display: none; }
.tk-main { display: flex; gap: 10px; align-items: center; padding: 8px 12px 9px 10px; background: linear-gradient(90deg, rgba(14,11,22,.9), rgba(14,11,22,.55)); border-left: 3px solid var(--gold); border-radius: 0 12px 3px 0; }
.tk-main b { display: block; font-family: var(--serif); font-weight: 400; font-size: 15px; color: #f6e7c1; }
.tk-main span { display: block; font-size: 11.5px; color: var(--dim); }
.tk-lamp { flex: none; width: 16px; height: 22px; border-radius: 6px 6px 4px 4px; border: 2px solid #c9a227; background: radial-gradient(circle at 50% 60%, #ffd35d 0 3px, rgba(255,180,60,.25) 4px, transparent 8px); box-shadow: 0 0 14px rgba(255,180,60,.55); animation: tk-flick 2.2s ease-in-out infinite; }
.tk-main.lit .tk-lamp { background: radial-gradient(circle at 50% 60%, #fff 0 3px, #ffd35d 4px, rgba(255,180,60,.4) 8px); }
@keyframes tk-flick { 50% { box-shadow: 0 0 22px rgba(255,180,60,.85); } }
.tk-b { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px 6px; font-size: 12px; color: #d8cfe8; background: rgba(14,11,22,.6); border-radius: 0 8px 2px 0; overflow: hidden; }
.tk-b em { font-style: normal; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-b i { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, #8a6510, #ffd35d); transition: width .4s ease; }
.tk-b.done { color: #b6f5c0; }
.tk-b.done em { color: #7cf09a; }
.tk-b.done i { background: #7cf09a; }

/* loot cards: the half second of "what did I get" */
.cr-loot { position: fixed; right: 16px; bottom: 150px; z-index: 9; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.cr-lc { --rc: #d8d4e0; position: relative; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 320px; padding: 8px 14px 8px 8px; background: linear-gradient(90deg, rgba(14,11,22,.96), rgba(22,17,34,.92)); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); border-radius: 4px 14px 4px 4px; box-shadow: 0 12px 30px rgba(0,0,0,.6), inset 0 0 24px color-mix(in srgb, var(--rc) 14%, transparent); animation: lc-in .38s cubic-bezier(.2,1.4,.4,1) both; overflow: hidden; }
.cr-lc::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--rc) 35%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: lc-shine 1.1s .15s ease-out; }
.cr-lc img { width: 44px; height: 44px; flex: none; border-radius: 6px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%); image-rendering: auto; }
.cr-lc small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--rc); opacity: .85; }
.cr-lc strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--rc); line-height: 1.2; }
.cr-lc b { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 700; }
.lc-up { color: #7cf09a; }
.lc-down { color: var(--faint); }
.cr-lc.up { border-color: #7cf09a; }
.cr-lc.r3, .cr-lc.r4, .cr-lc.r5 { min-width: 300px; padding: 12px 18px 12px 10px; border-width: 2px; box-shadow: 0 0 40px color-mix(in srgb, var(--rc) 45%, transparent), 0 12px 30px rgba(0,0,0,.6); animation: lc-in-big .6s cubic-bezier(.2,1.6,.4,1) both; }
.cr-lc.r3 img, .cr-lc.r4 img, .cr-lc.r5 img { width: 58px; height: 58px; }
.cr-lc.r3 strong, .cr-lc.r4 strong, .cr-lc.r5 strong { font-size: 18px; text-shadow: 0 0 14px var(--rc); }
.cr-lc.out { animation: lc-out .45s ease forwards; }
@keyframes lc-in { from { transform: translateX(60px) scale(.9); opacity: 0; } }
@keyframes lc-in-big { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } }
@keyframes lc-out { to { transform: translateX(40px); opacity: 0; } }
@keyframes lc-shine { to { transform: translateX(100%); } }

/* the flare: a rarity-coloured wash for drops worth stopping for */
.cr-flare { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0; background: radial-gradient(70% 60% at 50% 55%, transparent 30%, var(--flare, #ff8a3d) 140%); mix-blend-mode: screen; }
.cr-flare.on { animation: flare 1.1s ease-out; }
.cr-flare.big { animation: flare 1.8s ease-out; background: radial-gradient(70% 60% at 50% 55%, color-mix(in srgb, var(--flare) 22%, transparent) 0%, transparent 40%, var(--flare, #ff8a3d) 130%); }
@keyframes flare { 0% { opacity: 0; } 12% { opacity: .95; } 100% { opacity: 0; } }

/* buttons: sizes and kbd chips */
.cr-btn.sm { padding: 7px 12px; font-size: 13px; }
.cr-btn.big { padding: 14px 30px; font-size: 16px; letter-spacing: .02em; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; font: 600 11px var(--ui); color: #f6e7c1; background: linear-gradient(#2a2238, #191424); border: 1px solid rgba(255,255,255,.18); border-bottom-width: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- title */
.cr-title { background: radial-gradient(50% 45% at 50% 62%, rgba(255,150,50,.16), transparent 70%), radial-gradient(80% 70% at 50% 40%, rgba(40,20,60,.5), rgba(5,4,9,.96)); }
.cr-title::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 3px); }
.cr-title-in { position: relative; z-index: 1; width: min(860px, 100%); }
.cr-title h1 { font-size: clamp(40px, 8.4vw, 98px); text-transform: uppercase; letter-spacing: .04em; line-height: .9; background: linear-gradient(180deg, #fff3cf 0%, #f2c66a 45%, #9a5d14 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 30px rgba(255,160,50,.35)) drop-shadow(0 4px 0 #2a1a08); }
.cr-title h1 span { display: block; }
.cr-title .cr-kicker { display: inline-flex; align-items: center; gap: 12px; }
.cr-title .cr-kicker::before, .cr-title .cr-kicker::after { content: ''; width: 40px; height: 1px; background: linear-gradient(90deg, transparent, #c9a227); }
.cr-title .cr-kicker::after { transform: scaleX(-1); }
.cr-lede { font-family: var(--serif); font-style: italic; font-size: 17px; color: #d8cfe8; }
.cr-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 6px auto 14px; max-width: 600px; font-size: 12.5px; color: var(--dim); }
.cr-keys span { display: inline-flex; align-items: center; gap: 3px; }
.cr-keys kbd { margin-right: 1px; }
.cr-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cr-embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 8px 2px rgba(255,150,40,.7); animation: ember 9s linear infinite; opacity: 0; }
.cr-embers i:nth-child(1) { left: 12%; animation-delay: 0s; } .cr-embers i:nth-child(2) { left: 22%; animation-delay: 2.1s; animation-duration: 11s; }
.cr-embers i:nth-child(3) { left: 31%; animation-delay: 4.4s; } .cr-embers i:nth-child(4) { left: 42%; animation-delay: 1.2s; animation-duration: 12s; }
.cr-embers i:nth-child(5) { left: 50%; animation-delay: 6s; } .cr-embers i:nth-child(6) { left: 58%; animation-delay: 3.3s; animation-duration: 10s; }
.cr-embers i:nth-child(7) { left: 66%; animation-delay: 7.5s; } .cr-embers i:nth-child(8) { left: 74%; animation-delay: .6s; animation-duration: 13s; }
.cr-embers i:nth-child(9) { left: 83%; animation-delay: 5.2s; } .cr-embers i:nth-child(10) { left: 90%; animation-delay: 2.8s; }
.cr-embers i:nth-child(11) { left: 36%; animation-delay: 8.4s; animation-duration: 14s; } .cr-embers i:nth-child(12) { left: 63%; animation-delay: 9.6s; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(30px, -50vh); } 100% { transform: translate(-20px, -105vh); opacity: 0; } }

/* ---------------------------------------------------------------- camp */
.cr-camp { --glow: .2; position: fixed; inset: 0; z-index: 25; overflow: auto; padding: 24px 20px 30px; background:
  radial-gradient(40% 30% at 50% 100%, rgba(255,140,40, calc(var(--glow) * .55)), transparent 70%),
  radial-gradient(90% 70% at 50% 30%, rgba(34,22,52,.75), rgba(5,4,9,.97)); }
body.in-camp .cr-panel { z-index: 40; }
body.in-camp .cr-loot { z-index: 41; bottom: 24px; }
body.in-camp .cr-top, body.in-camp .cr-hud, body.in-camp .cr-side, body.in-camp .cr-mini, body.in-camp .cr-menu { visibility: hidden; }
.cr-camp-sky { position: fixed; left: 50%; bottom: 0; width: 220px; height: 160px; transform: translateX(-50%); pointer-events: none; }
.cr-camp-sky .fire { position: absolute; left: 50%; bottom: 0; width: 70px; height: 90px; transform: translateX(-50%); background: radial-gradient(50% 60% at 50% 100%, #fff3c4, #ffb347 30%, #e2582a 55%, transparent 72%); filter: blur(4px); opacity: calc(.35 + var(--glow) * .65); animation: fire 1.2s ease-in-out infinite alternate; }
@keyframes fire { to { transform: translateX(-50%) scale(1.08, 1.18); } }
.cr-camp-in { position: relative; width: min(1120px, 100%); margin: 0 auto; }
.cr-camp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.cr-camp-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.6vw, 48px); color: #f6e7c1; text-shadow: 0 0 30px rgba(255,170,60,.35); }
.cr-camp-head .cr-kicker { margin-bottom: 4px; }
.cr-camp-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-camp-stats span { padding: 6px 11px; font-size: 12.5px; color: var(--dim); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 3px 10px 3px 3px; }
.cr-camp-stats b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 3px; }
.cr-camp-stats .g b { color: var(--gold); } .cr-camp-stats .s b { color: #c4b4ff; }
.cr-camp-grid { display: grid; grid-template-columns: 1.05fr 1.25fr .8fr; gap: 16px; align-items: start; }
.cr-camp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 18px 4px 4px; padding: 16px 16px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.cr-camp-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--gold); }
.cr-camp-card h3 em { font-family: var(--ui); font-style: normal; font-size: 12px; color: var(--dim); }
.cr-lanterns { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-lanterns li { --lc: #ffd35d; position: relative; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 9px 10px; border-radius: 3px 10px 3px 3px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.06); }
.cr-lanterns li i { grid-row: span 2; align-self: center; width: 22px; height: 30px; margin: 0 auto; border-radius: 8px 8px 5px 5px; border: 2px solid #4b4258; background: #120f1a; position: relative; }
.cr-lanterns li i::before { content: ''; position: absolute; left: 50%; top: -7px; width: 8px; height: 6px; transform: translateX(-50%); border: 2px solid #4b4258; border-bottom: 0; border-radius: 6px 6px 0 0; }
.cr-lanterns li b { font-family: var(--serif); font-weight: 400; font-size: 15px; color: #8d84a3; }
.cr-lanterns li span { font-size: 12px; line-height: 1.4; color: var(--faint); }
.cr-lanterns li.lit { background: linear-gradient(90deg, color-mix(in srgb, var(--lc) 14%, transparent), transparent); border-color: color-mix(in srgb, var(--lc) 35%, transparent); }
.cr-lanterns li.lit i { border-color: #c9a227; background: radial-gradient(circle at 50% 60%, #fff 0 2px, var(--lc) 3px, color-mix(in srgb, var(--lc) 30%, transparent) 9px); box-shadow: 0 0 18px var(--lc), 0 0 40px color-mix(in srgb, var(--lc) 50%, transparent); animation: tk-flick 2.4s ease-in-out infinite; }
.cr-lanterns li.lit i::before { border-color: #c9a227; }
.cr-lanterns li.lit b { color: #f6e7c1; } .cr-lanterns li.lit span { color: #cfc6de; font-style: italic; font-family: var(--serif); }
.cr-lanterns li.next { border-color: rgba(255,211,93,.4); border-style: dashed; }
.cr-lanterns li.next b { color: var(--gold); }
.cr-lanterns li.next b::after { content: ' - next'; font: 600 10px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cr-bounties { display: grid; gap: 10px; }
.cr-bounty { padding: 12px 13px 11px; border-radius: 3px 12px 3px 3px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.08); }
.cr-bounty header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cr-bounty header b { font-family: var(--serif); font-weight: 400; font-size: 16.5px; color: #f6e7c1; }
.cr-bounty header em { font-style: normal; font-size: 12px; color: var(--gold); font-variant-numeric: tabular-nums; }
.cr-bounty p { margin: 3px 0 8px; font-size: 13px; color: #cfc6de; }
.cr-prog { height: 5px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.cr-prog i { display: block; height: 100%; background: linear-gradient(90deg, #8a6510, #ffd35d); border-radius: inherit; }
.cr-bounty footer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12px; color: var(--dim); }
.cr-bounty footer .cr-btn { margin-left: auto; }
.rw { display: inline-flex; align-items: center; gap: 5px; }
.rw .coin { width: 12px; height: 12px; }
.rw.sh { color: #c4b4ff; } .rw.it { font-weight: 700; }
.cr-bounty.done { border-color: rgba(124,240,154,.5); background: linear-gradient(180deg, rgba(124,240,154,.09), rgba(124,240,154,.02)); box-shadow: 0 0 30px -10px rgba(124,240,154,.5); }
.cr-bounty.done header em { color: #7cf09a; }
.cr-bounty.done .cr-prog i { background: #7cf09a; }
.cr-bounty.done .cr-btn.primary { animation: claim 1.4s ease-in-out infinite; }
@keyframes claim { 50% { box-shadow: 0 0 26px rgba(255,211,93,.75); } }
.cr-dives { display: grid; gap: 8px; }
.cr-dive { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 10px 12px; border-radius: 3px 12px 3px 3px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03); cursor: pointer; }
.cr-dive b { font-size: 14px; } .cr-dive span { grid-column: 1; font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--dim); }
.cr-dive kbd { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.cr-dive:hover { border-color: var(--gold); }
.cr-dive.main { padding: 16px 14px; background: linear-gradient(180deg, #8a6510, #5a3f08); border-color: #ffd35d; box-shadow: 0 10px 34px -10px rgba(255,180,60,.7); }
.cr-dive.main b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: #fff6dc; }
.cr-dive.main span { color: #f3dca3; }
.cr-dive.main:hover { filter: brightness(1.12); }
.cr-camp-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------------------------------------------------------------- pause */
.cr-pause { position: fixed; inset: 0; z-index: 28; display: grid; place-items: center; padding: 20px; background: rgba(5,4,9,.72); backdrop-filter: blur(6px) saturate(.7); -webkit-backdrop-filter: blur(6px) saturate(.7); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.cr-pause-in { width: min(380px, 100%); padding: 24px 22px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 20px 4px 4px; box-shadow: 0 30px 90px rgba(0,0,0,.8); }
.cr-pause h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; color: #f6e7c1; }
.cr-pause-where { margin: 4px 0 16px; font-size: 13px; color: var(--dim); font-family: var(--serif); font-style: italic; }
.cr-pause nav { display: grid; gap: 6px; }
.cr-pause nav button { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; text-align: left; padding: 11px 14px; border-radius: 3px 12px 3px 3px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); cursor: pointer; font-size: 14px; }
.cr-pause nav button b { font-weight: 650; }
.cr-pause nav button span { grid-column: 1; font-size: 12px; color: var(--dim); }
.cr-pause nav button kbd { grid-row: 1 / span 2; grid-column: 2; }
.cr-pause nav button:hover, .cr-pause nav button:focus-visible { border-color: var(--gold); color: var(--gold); }
.cr-pause nav button[data-p="resume"] { background: linear-gradient(180deg, #8a6510, #5a3f08); border-color: #ffd35d; color: #fff6dc; }

@media (max-width: 980px) {
  .cr-camp-grid { grid-template-columns: 1fr 1fr; }
  .cr-camp-card.go { grid-column: 1 / -1; order: -1; }
  .cr-dives { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .cr-dive.main { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .cr-camp { padding: 14px 10px 24px; }
  .cr-camp-grid { grid-template-columns: 1fr; }
  .cr-side { top: 58px; left: 8px; width: min(250px, 62vw); }
  .tk-b { font-size: 11px; }
  .tk-main b { font-size: 13px; }
  .cr-loot { right: 8px; bottom: 190px; }
  .cr-lc { min-width: 200px; max-width: 260px; }
  .cr-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cr-embers, .cr-camp-sky .fire { animation: none; }
  .cr-lc, .cr-lc::before, .cr-flare.on, .cr-flare.big { animation: none; }
}

/* ===================================================== skills, tree, classes */
/* the skill bar: one gem per skill in its own colour, with mana cost and name */
.cr-skillset { display: flex; gap: 8px; }
.cr-skill.sk { --sc: #9fd8ff; width: 60px; height: 60px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--sc) 55%, #3a2f12);
  background: radial-gradient(120% 90% at 50% 15%, color-mix(in srgb, var(--sc) 30%, #1a1428), #0d0a16 75%);
  box-shadow: inset 0 0 14px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.6), 0 6px 14px rgba(0,0,0,.5); transition: transform .08s, box-shadow .2s; }
.cr-skill.sk svg { width: 30px; height: 30px; stroke: var(--sc); filter: drop-shadow(0 0 6px var(--sc)); }
.cr-skill.sk:hover { box-shadow: inset 0 0 14px rgba(0,0,0,.6), 0 0 18px color-mix(in srgb, var(--sc) 55%, transparent); }
.cr-skill.sk::after { border-radius: 10px; }
.cr-skill .mc { position: absolute; right: 3px; bottom: 1px; font: 600 10px var(--ui); font-style: normal; color: #8fb0ff; text-shadow: 0 1px 2px #000; z-index: 1; }
.cr-skill .sk-name { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 6px; background: rgba(10,8,16,.92); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink); opacity: 0; pointer-events: none; transition: opacity .15s; }
.cr-skill:hover .sk-name { opacity: 1; }
.cr-tool.tree { position: relative; }
.cr-tool.tree b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #1a1206; font-size: 11px; }
.cr-tool.tree.has-points { border-color: var(--gold); color: var(--gold); animation: claim 1.4s ease-in-out infinite; }

/* the tree */
.cr-tree { position: fixed; inset: 0; z-index: 26; display: grid; place-items: center; padding: 14px; background: rgba(5,4,9,.82); backdrop-filter: blur(4px); }
.cr-tree-in { width: min(1180px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; background: radial-gradient(70% 70% at 40% 50%, #1b1428, #0b0912 80%); border: 1px solid var(--line); border-radius: 4px 20px 4px 4px; box-shadow: 0 30px 90px rgba(0,0,0,.8); overflow: hidden; }
.cr-tree-in > header { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.cr-tree-in h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; color: #f6e7c1; }
.cr-tree-in .cr-kicker { margin: 0 0 2px; }
.cr-tree-points { margin-left: auto; padding: 6px 12px; border-radius: 99px; background: rgba(255,211,93,.12); border: 1px solid rgba(255,211,93,.45); color: var(--gold); font-size: 13px; }
.cr-tree-body { flex: 1; display: grid; grid-template-columns: 1fr 280px; min-height: 0; }
.cr-tree-board { position: relative; min-height: 0; }
.cr-tree-board svg { width: 100%; height: 100%; display: block; }
#cr-tree-svg line { stroke: rgba(255,255,255,.12); stroke-width: 3; }
#cr-tree-svg line.on { stroke: var(--nc); stroke-width: 4; filter: drop-shadow(0 0 4px var(--nc)); }
#cr-tree-svg .nd { cursor: pointer; }
#cr-tree-svg .nd .halo { fill: transparent; }
#cr-tree-svg .nd .dot { fill: #15101f; stroke: rgba(255,255,255,.25); stroke-width: 2; }
#cr-tree-svg .nd.notable .dot { stroke-width: 3; }
#cr-tree-svg .nd.keystone .dot { stroke-width: 4; stroke: color-mix(in srgb, var(--nc) 50%, #333); }
#cr-tree-svg .nd.avail .dot { stroke: var(--nc); }
#cr-tree-svg .nd.avail .halo { fill: color-mix(in srgb, var(--nc) 18%, transparent); animation: tree-pulse 1.6s ease-in-out infinite; }
#cr-tree-svg .nd.taken .dot { fill: var(--nc); stroke: #fff; filter: drop-shadow(0 0 8px var(--nc)); }
#cr-tree-svg .nd.core .dot { fill: #2a1d0a; stroke: var(--gold); stroke-width: 4; }
#cr-tree-svg .nd.core text { fill: var(--gold); font: 400 15px var(--serif); text-anchor: middle; pointer-events: none; }
#cr-tree-svg .nd.sel .halo { fill: transparent; stroke: #fff; stroke-width: 2; stroke-dasharray: 4 4; }
@keyframes tree-pulse { 50% { opacity: .35; } }
.cr-tree-side { padding: 16px; border-left: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 12px; background: rgba(0,0,0,.2); }
#cr-tree-info b { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; }
#cr-tree-info .k { display: inline-block; margin: 4px 0; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.06); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
#cr-tree-info p { font-size: 13.5px; line-height: 1.5; color: #d8cfe8; }
#cr-tree-info em { font-style: normal; font-size: 12.5px; color: var(--dim); }
#cr-tree-respec { margin-top: auto; }
@media (max-width: 760px) {
  .cr-tree { padding: 0; }
  .cr-tree-in { border-radius: 0; height: 100%; }
  .cr-tree-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cr-tree-side { border-left: 0; border-top: 1px solid rgba(255,255,255,.06); max-height: 34vh; overflow: auto; }
  .cr-skill.sk { width: 50px; height: 50px; }
}

/* the class picker */
.cr-classes { position: fixed; inset: 0; z-index: 32; overflow: auto; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 40%, rgba(40,20,60,.6), rgba(5,4,9,.97)); }
.cr-classes-in { width: min(1100px, 100%); text-align: center; }
.cr-classes-in h2 { margin: 0 0 18px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 52px); color: #f6e7c1; }
.cr-class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cr-class { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 14px 16px; border-radius: 4px 18px 4px 4px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(180deg, color-mix(in srgb, var(--c0) 30%, #120e1c), #0d0a16); cursor: pointer; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.cr-class:hover, .cr-class.is-on { transform: translateY(-4px); border-color: var(--ce); box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--ce) 60%, transparent); }
.cr-class canvas { width: 120px; height: 140px; }
.cr-class b { font-family: var(--serif); font-weight: 400; font-size: 24px; color: #f6e7c1; }
.cr-class em { font-family: var(--serif); font-size: 13px; color: var(--ce); }
.cr-class p { margin: 6px 0 8px; font-size: 13px; line-height: 1.45; color: #cfc6de; }
.cr-class-sk { display: flex; gap: 6px; }
.cr-class-sk i { --sc: #fff; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent); background: #120e1c; }
.cr-class-sk svg { width: 20px; height: 20px; fill: none; stroke: var(--sc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cr-class-note { margin: 16px 0 10px; color: var(--dim); font-size: 13px; }
@media (max-width: 900px) { .cr-class-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cr-class-grid { grid-template-columns: 1fr; } }
body.in-camp .cr-tree { z-index: 41; }
.cr-skill.sk.locked { filter: grayscale(1) brightness(.45); }
.cr-skill.sk.locked::before { content: 'Lv ' attr(data-lvl); position: absolute; inset: auto 0 18px 0; text-align: center; font: 700 11px var(--ui); color: #ffd35d; z-index: 2; text-shadow: 0 1px 2px #000; }
.cr-class-grid { grid-template-columns: repeat(4, 1fr); }
.cr-class canvas { width: 96px; height: 112px; }
.cr-class p { font-size: 12px; }
/* eight buttons on the bar now: tighter, and the tools wrap before they reach an orb */
.cr-skills { flex-wrap: wrap; row-gap: 6px; }
.cr-skill, .cr-skill.sk { width: 50px; height: 50px; }
.cr-skill.sk svg, .cr-skill svg { width: 26px; height: 26px; }
.cr-tool { height: 36px; padding: 0 11px; font-size: 13px; }
.cr-skillset { gap: 6px; }

/* modes in camp */
.cr-modes { display: grid; gap: 8px; margin-bottom: 10px; }
.cr-mode { --mc: #ffd35d; display: grid; gap: 3px; padding: 11px 12px; border-radius: 3px 12px 3px 3px; border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--mc) 10%, transparent), rgba(255,255,255,.02)); text-align: left; }
.cr-mode b { font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--mc); }
.cr-mode em { font-style: normal; font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.cr-mode p { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.45; color: #cfc6de; }
.cr-mode .cr-btn { justify-self: start; }
.cr-mode.is-on { gap: 8px; }
.cr-mode-sub { margin: 8px 0 4px; font-family: var(--serif); color: var(--gold); font-size: 15px; }
/* boons and the end of a run */
.cr-boons { position: fixed; inset: 0; z-index: 33; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 40%, rgba(60,20,50,.6), rgba(5,4,9,.95)); }
.cr-boons-in { width: min(820px, 100%); text-align: center; }
.cr-boons-in h2 { margin: 0 0 16px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 48px); color: #f6e7c1; }
.cr-boon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cr-boon { display: grid; gap: 6px; padding: 22px 14px; border-radius: 4px 18px 4px 4px; border: 1px solid rgba(244,114,182,.4); background: linear-gradient(180deg, rgba(244,114,182,.14), rgba(13,10,22,.9)); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.cr-boon:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -12px rgba(244,114,182,.6); }
.cr-boon b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: #fbcfe8; }
.cr-boon span { font-size: 14px; color: #f6e7c1; }
.cr-run-line { margin: 8px 0; color: #d8cfe8; font-size: 15px; }
.cr-boons-in .cr-btn { margin-top: 14px; }
@media (max-width: 640px) { .cr-boon-grid { grid-template-columns: 1fr; } }

/* skill gems: a glow pass, a bright core, a bevelled frame */
.cr-skill.sk { border: 0; background: linear-gradient(145deg, #e8c35a, #6b4a12 40%, #2a1d08 60%, #c9a227); padding: 3px; }
.cr-skill.sk .gem { position: absolute; inset: 3px; border-radius: 9px; background: radial-gradient(90% 80% at 35% 25%, color-mix(in srgb, var(--sc) 55%, #fff) 0%, color-mix(in srgb, var(--sc) 40%, #120e1c) 35%, #0b0812 85%); box-shadow: inset 0 -6px 12px rgba(0,0,0,.6), inset 0 2px 3px rgba(255,255,255,.25); }
.cr-skill.sk svg { position: relative; z-index: 1; width: 30px; height: 30px; overflow: visible; filter: none; }
.cr-skill.sk svg .glow { stroke: var(--sc); stroke-width: 5; opacity: .55; filter: blur(2.2px); }
.cr-skill.sk svg .core { stroke: #fff; stroke-width: 2; }
.cr-skill.sk::after { inset: 3px; border-radius: 9px; }
/* difficulty, hardcore, the fallen */
.cr-diffs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 10px; }
.cr-diffs > span { width: 100%; font-family: var(--serif); color: var(--gold); font-size: 15px; }
.cr-diffs em { width: 100%; font-style: normal; font-size: 12px; color: var(--dim); }
.cr-diff { --dc: #ccc; padding: 6px 10px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--dc) 45%, transparent); background: rgba(255,255,255,.03); color: var(--dc); font-size: 12.5px; cursor: pointer; }
.cr-diff.is-on { background: color-mix(in srgb, var(--dc) 22%, transparent); border-color: var(--dc); }
.cr-diff:disabled { opacity: .4; cursor: not-allowed; }
.cr-hc-badge { margin: 0 0 8px; padding: 6px 10px; border-radius: 4px; background: rgba(209,38,63,.2); border: 1px solid #d1263f; color: #ff8a9a; font: 700 12px var(--ui); letter-spacing: .12em; text-align: center; }
.cr-hc { display: inline-flex; align-items: center; gap: 10px; margin: 18px auto 0; padding: 10px 16px; border-radius: 4px 14px 4px 4px; border: 1px solid rgba(209,38,63,.5); background: rgba(209,38,63,.1); cursor: pointer; text-align: left; max-width: 520px; }
.cr-hc b { color: #ff6b81; font-family: var(--serif); font-weight: 400; font-size: 18px; }
.cr-hc span { font-size: 12.5px; color: #e9c7cd; }
.cr-fallen { margin-bottom: 10px; font-size: 12.5px; color: var(--dim); }
.cr-fallen summary { cursor: pointer; color: #ff8a9a; }
.cr-fallen span { display: block; padding: 2px 0; }

/* ===================================================== camp, take two: fewer words, more things to touch */
.cr-camp-in { width: min(980px, 100%); }
.cc-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 18px; margin-bottom: 14px; border-radius: 24px; background: linear-gradient(120deg, rgba(255,211,93,.10), rgba(124,58,237,.10)); border: 1px solid rgba(255,211,93,.25); box-shadow: 0 20px 60px -20px rgba(0,0,0,.7); }
.cc-portrait { width: 110px; height: 125px; border-radius: 20px; background: radial-gradient(circle at 50% 80%, rgba(255,180,60,.35), rgba(20,15,30,.9) 70%); border: 2px solid rgba(255,211,93,.4); }
.cc-who h2 { margin: 2px 0 8px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.5vw, 44px); color: #f6e7c1; line-height: 1; }
.cc-hc { font: 800 12px var(--ui); font-style: normal; padding: 3px 8px; border-radius: 99px; background: #d1263f; color: #fff; vertical-align: middle; letter-spacing: .1em; }
.cr-camp-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-camp-stats span { display: grid; place-items: center; min-width: 64px; padding: 6px 10px; border-radius: 14px; border: 0; background: rgba(255,255,255,.06); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.cr-camp-stats b { margin: 0; font-size: 18px; color: #fff; letter-spacing: 0; }
.cr-camp-stats .lv b { color: #c4b4ff; } .cr-camp-stats .g b { color: var(--gold); } .cr-camp-stats .s b { color: #9fe8ff; }
.cc-tools { display: grid; grid-template-columns: repeat(2, 64px); gap: 8px; }
.cc-tools button { position: relative; display: grid; place-items: center; gap: 2px; height: 60px; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); cursor: pointer; font-size: 11px; color: var(--dim); transition: transform .12s, border-color .12s; }
.cc-tools button:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--gold); }
.cc-tools svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: #f6e7c1; }
.cc-tools b { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #1a1206; font-size: 11px; display: grid; place-items: center; }
.cc-tools b[hidden] { display: none; }
.cc-row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.cc-row-head b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--gold); }
.cc-row-head em { font-style: normal; font-size: 12px; color: var(--dim); }
.cc-lanterns { padding: 14px 18px 12px; margin-bottom: 14px; border-radius: 20px; background: rgba(14,11,22,.75); border: 1px solid rgba(255,255,255,.07); }
.cc-lanterns .cr-lanterns { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.cc-lanterns .cr-lanterns li { display: grid; place-items: center; padding: 10px 0 8px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); cursor: help; grid-template-columns: none; }
.cc-lanterns .cr-lanterns li i { grid-row: auto; }
.cc-lanterns .cr-lanterns li.next { border: 1px dashed rgba(255,211,93,.6); background: rgba(255,211,93,.06); }
.cc-lanterns .cr-lanterns li.lit { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--lc) 25%, transparent), transparent 75%); }
.cc-lanterns .cr-lanterns li:hover, .cc-lanterns .cr-lanterns li:focus { outline: none; border-color: var(--lc); }
.cc-lore { margin: 10px 2px 0; min-height: 18px; font-family: var(--serif); font-style: italic; font-size: 14px; color: #d8cfe8; }
.cc-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.cc-card { padding: 14px 16px 16px; border-radius: 20px; background: rgba(14,11,22,.82); border: 1px solid rgba(255,255,255,.07); }
.cc-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cc-mode { --mc: #ffd35d; display: grid; justify-items: center; gap: 4px; padding: 14px 6px 12px; border-radius: 18px; border: 2px solid transparent; background: color-mix(in srgb, var(--mc) 8%, rgba(255,255,255,.03)); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.cc-mode svg { width: 30px; height: 30px; fill: none; stroke: var(--mc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--mc)); }
.cc-mode b { font-family: var(--serif); font-weight: 400; font-size: 17px; color: #f6e7c1; }
.cc-mode em { font-style: normal; font-size: 11px; color: var(--dim); text-align: center; line-height: 1.3; }
.cc-mode:hover:not(:disabled) { transform: translateY(-3px); }
.cc-mode.is-on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 18%, transparent); box-shadow: 0 10px 30px -12px var(--mc); }
.cc-mode:disabled { opacity: .45; cursor: default; }
.cr-diffs { gap: 6px; margin-bottom: 8px; }
.cr-diff { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-weight: 600; }
.cr-diff i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 6px var(--dc); }
.cc-hint { margin: 0 0 10px; font-size: 12px; color: var(--dim); }
.cr-dive.main { width: 100%; margin-top: 4px; border-radius: 18px; }
.cr-dive.main[style*="--mc"] { background: linear-gradient(180deg, color-mix(in srgb, var(--mc) 70%, #3a2a08), color-mix(in srgb, var(--mc) 35%, #120e1c)); border-color: var(--mc); }
.cc-cps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--dim); }
.cc-cp { min-width: 36px; height: 30px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); cursor: pointer; font-weight: 700; }
.cc-cp:hover { border-color: var(--gold); color: var(--gold); }
.cc-abandon { margin-top: 8px; background: none; border: 0; color: #ff8a9a; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.cc-card .cr-bounty { border-radius: 16px; padding: 11px 12px 10px; }
.cc-card .cr-bounty p { margin: 2px 0 7px; font-size: 12.5px; }
.cc-card .cr-bounty footer { margin-top: 8px; }
.rw.it { color: var(--rc); }
.cc-swap { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); cursor: pointer; color: var(--dim); font-size: 15px; }
.cc-swap:hover { color: var(--gold); border-color: var(--gold); }
@media (max-width: 860px) {
  .cc-hero { grid-template-columns: auto 1fr; }
  .cc-tools { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .cc-grid { grid-template-columns: 1fr; }
  .cc-lanterns .cr-lanterns { grid-template-columns: repeat(6, 1fr); }
}
