/* =====================================================================================================================
   The Grimoire (the skill tree), in the workshop style (ART_STYLE.md section 9): a full-screen iron page, the web drawn
   as SVG with an ink line under every thread and an ink ring round every node, coloured light with a job each:
   potion green for what's yours, paper for what you can take next, cyan for the way to the node you've picked, amber
   for the pick itself, magenta for what a search found, brass for notables and keystones. js/ui/grimoire*.js.
   ===================================================================================================================== */
#skills { padding: 0; align-items: stretch; justify-content: stretch; flex-direction: column; overflow: hidden; background: #0e1016 var(--wk-stripes); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- the strip along the top ---------- */
.gwtop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; position: relative; z-index: 2;
  background: var(--wk-plate), var(--wk-iron); border-bottom: 3px solid var(--wk-ink); box-shadow: 0 4px 0 var(--wk-ink);
}
.gwtop h2 { margin: 0 6px 0 0; font-family: var(--f-head); font-weight: 400; font-size: clamp(20px, 3.4vw, 32px); color: var(--wk-brass); text-shadow: 2px 2px 0 var(--wk-ink); transform: rotate(-1deg); }
.gwpts { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; color: #9aa8b8; }
.gwpts b { font-size: 22px; color: var(--wk-potion); text-shadow: 0 0 10px rgba(122, 255, 42, 0.5); margin-right: 2px; }
.gwfind { display: flex; align-items: center; gap: 6px; margin-left: auto; }
#gwsearch {
  width: 190px; min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 3px solid var(--wk-ink); background: var(--wk-well);
  color: var(--wk-paper); font: 500 15px var(--f-ui);
}
#gwsearch:focus { outline: 3px solid var(--wk-magenta); outline-offset: 1px; }
#gwfound { font-size: 12px; color: var(--wk-magenta); white-space: nowrap; }
.gwtop .shopclose { position: static; flex: none; }
#gwnote { display: none; padding: 8px 14px; font-weight: 800; color: var(--wk-ink); background: var(--wk-potion); border-bottom: 3px solid var(--wk-ink); }
#gwnote.show { display: block; }

/* ---------- the stage: the web, and the plates over it ---------- */
.gwstage { position: relative; flex: 1; min-height: 0; }
#tree {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 154, 42, 0.07), transparent 60%), var(--wk-deep) var(--wk-stripes);
}
#tree:active { cursor: grabbing; }
.gwsvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gwhalo { fill: rgba(42, 224, 255, 0.025); stroke: rgba(242, 182, 50, 0.12); stroke-width: 4; stroke-dasharray: 18 14; }
.gwregion { font-family: var(--f-head); font-size: 66px; text-anchor: middle; dominant-baseline: central; opacity: 0.6; paint-order: stroke; stroke: var(--wk-ink); stroke-width: 12px; stroke-linejoin: round; }
.gwedge { fill: none; stroke-linecap: round; }
.gwedge.ink { stroke: var(--wk-ink); stroke-width: 10; }
.gwedge.shut { stroke: #3a4048; stroke-width: 4; }
.gwedge.open { stroke: #9aa8b8; stroke-width: 4; }
.gwedge.held { stroke: var(--wk-potion); stroke-width: 6; }
.gwedge.path { stroke: var(--wk-cyan); stroke-width: 6; stroke-dasharray: 12 8; animation: gwmarch 0.8s linear infinite; }
@keyframes gwmarch { to { stroke-dashoffset: -20; } }

.gwdot { fill: var(--wk-iron); stroke: var(--wk-ink); stroke-width: 3.5; }
.gwnode.ks .gwdot { fill: color-mix(in srgb, var(--rc, #9aa8b8) 28%, var(--wk-iron)); }
.gwnode.kn .gwdot, .gwnode.ka .gwdot, .gwnode.kg .gwdot { stroke: var(--wk-brass); stroke-width: 4.5; }
.gwnode.ka .gwdot { stroke: var(--wk-cyan); }
.gwnode.kk .gwdot { stroke: var(--wk-brass); stroke-width: 5; fill: #1a1218; }
.gwring { fill: none; stroke: var(--wk-brass); stroke-width: 4; stroke-dasharray: 7 6; opacity: 0.8; }
.gwnode.kr .gwdot { fill: #3a1418; stroke: var(--wk-red); stroke-width: 5; }
.gwicon { text-anchor: middle; dominant-baseline: central; pointer-events: none; filter: grayscale(0.85) brightness(0.8); }
.gwnode.held .gwicon, .gwnode.open .gwicon, .gwnode.path .gwicon, .gwnode.sel .gwicon, .gwnode.found .gwicon { filter: none; }
.gwnode.held .gwdot { fill: #3a5a20; stroke: var(--wk-potion); }
.gwnode.ks.held .gwdot { fill: var(--wk-potion); stroke: var(--wk-ink); }
.gwnode.held .gwring { stroke: var(--wk-potion); stroke-dasharray: none; }
.gwnode.open .gwdot { stroke: var(--wk-paper); animation: gwopen 1.6s ease-in-out infinite; }
@keyframes gwopen { 50% { stroke: #9aa8b8; } }
.gwnode.path .gwdot { stroke: var(--wk-cyan); }
.gwnode.found .gwdot { stroke: var(--wk-magenta); stroke-width: 6; }
.gwnode.sel .gwdot { stroke: var(--wk-amber); stroke-width: 7; filter: drop-shadow(0 0 8px rgba(255, 154, 42, 0.9)); }

/* ---------- the plates: what the picked node does, yer totals, the zoom buttons, the mouse's little note ---------- */
#skilldetail, #gwtotals, #gwtip {
  border-radius: 10px; border: 3px solid var(--wk-ink); background: var(--wk-plate), var(--wk-iron); box-shadow: var(--wk-drop-sm); color: var(--wk-paper);
}
#skilldetail { position: absolute; left: 12px; bottom: 12px; z-index: 2; width: min(380px, calc(100% - 84px)); max-height: 46%; overflow-y: auto; padding: 12px 14px; text-align: left; }
#skilldetail h3 { margin: 0; font-family: var(--f-head); font-weight: 400; font-size: 21px; color: var(--wk-brass); text-shadow: 2px 2px 0 var(--wk-ink); border-left: 5px solid var(--rc, var(--wk-brass)); padding-left: 8px; }
#skilldetail .meta { margin: 4px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #9aa8b8; }
#skilldetail .hint { margin: 0; color: #9aa8b8; }
#skilldetail .reqs { margin: 6px 0 0; font-size: 13px; color: #9aa8b8; }
.gwlines { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.35; }
.gwlines li { margin: 2px 0; }
.gwacts { display: flex; gap: 8px; margin-top: 10px; }
.gwacts .gob { flex: 1; min-height: 48px; }
.gwacts .gwlearn { --edge: var(--wk-potion); }
.gwacts .gwback { --edge: var(--wk-red); }
.gwacts .gob:disabled { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; }
#gwtotals { display: none; position: absolute; top: 12px; right: 12px; z-index: 3; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; padding: 12px 14px; text-align: left; }
#gwtotals.open { display: block; }
.gwthead { display: flex; align-items: center; justify-content: space-between; border-bottom: 3px dashed var(--wk-ink); padding-bottom: 6px; }
.gwthead h3 { margin: 0; font-family: var(--f-head); font-weight: 400; color: var(--wk-brass); text-shadow: 2px 2px 0 var(--wk-ink); }
#gwtotals h4 { margin: 10px 0 2px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--wk-potion); }
.gwzoom { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.gwzoom .chip { width: 48px; min-height: 48px; padding: 0; font-size: 20px; }
#gwtip { position: fixed; z-index: 90; display: none; max-width: 280px; padding: 8px 10px; font-size: 13px; pointer-events: none; }
#gwtip.show { display: block; }
#gwtip b { display: block; color: var(--wk-brass); margin-bottom: 2px; }
/* (the guide and bell buttons sit where the zoom buttons are: away while the tree's open) */
body:has(#skills.open) :is(#bellbtn, #guidebtn) { display: none; }
.gwkeys { padding: 6px 14px; font-size: 12px; color: #9aa8b8; border-top: 3px solid var(--wk-ink); background: var(--wk-well); }
body.touchy .gwkeys { display: none; }

/* ---------- phones: the strip wraps, the plates take the width ---------- */
@media (max-width: 720px) {
  .gwtop { padding: 8px 10px; gap: 6px 8px; }
  .gwtop h2 { flex: 1 1 auto; font-size: 20px; }
  .gwtop .shopclose { order: 1; }
  .gwpts { order: 2; flex: 1 1 auto; font-size: 11px; }
  .gwpts b { font-size: 19px; }
  .gwtop .chip { order: 3; padding: 6px 10px; font-size: 12px; }
  .gwfind { order: 5; flex: 1 1 100%; margin-left: 0; }
  #gwsearch { flex: 1; width: auto; min-width: 0; }
  #skilldetail { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 42%; }
  .gwzoom { top: 8px; bottom: auto; right: 8px; }
  #gwtotals { top: 8px; left: 8px; right: 8px; width: auto; }
  .gwregion { font-size: 80px; }
  .gwkeys { display: none; }
}
