/* Layout and semantic skill colours. Panel/control skins live in ui/. */
:root { color-scheme:dark; --text:var(--ui-text); --muted:var(--ui-muted); --accent:var(--ui-accent); --gold:var(--ui-accent); --line:var(--ui-line); font:14px/1.5 var(--ui-font-body); color:var(--ui-text); background:#060710; }
* { box-sizing:border-box; }
body { margin:0; min-height:100dvh; isolation:isolate; background:#060710; }
.scene-background { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none; }
.scene-background img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; opacity:0; transition:opacity 2.5s ease-in-out; }
.scene-background img.is-visible { opacity:1; }
.scene-background::after { content:''; position:absolute; inset:0; background:linear-gradient(#0009,transparent 180px); }
@media (prefers-reduced-motion:reduce) { .scene-background img { transition:none; } }
button { font:inherit; color:inherit; cursor:pointer; }
button:focus-visible { outline:2px solid #e8ceff; outline-offset:4px; }
button:disabled { cursor:default; opacity:.35; }
[hidden] { display:none!important; }
.masthead { display:flex; justify-content:space-between; align-items:flex-start; padding:32px 42px; }
.eyebrow { color:var(--gold); font-size:10px; text-transform:uppercase; letter-spacing:.24em; margin:0 0 2px; }
h1,h2 { font-family:var(--ui-font-heading); font-weight:400; margin:0; color:#f3e9dc; }
h1 { font-size:34px; letter-spacing:.13em; text-transform:uppercase; line-height:1.3; }
.subtitle { margin:6px 0 0; font-size:10px; text-transform:uppercase; letter-spacing:.18em; color:var(--muted); }
.subtitle span { padding:0 8px; color:#72627f; }
.welcome { position:absolute; top:41%; left:50%; transform:translate(-50%,-50%); text-align:center; width:min(90%,440px); }
.sigil { font-size:54px; color:#c7acdf7a; text-shadow:0 0 38px #c7acdf50; }
.welcome h2 { font-size:30px; letter-spacing:.025em; }
.welcome p { font-size:13px; color:var(--muted); }
.ornament { height:18px; width:220px; margin:25px auto 0; background:url('/assets/thalassai-divider-rail.png') center/100% 100% no-repeat; opacity:.65; }
.panel { padding:12px 16px; box-shadow:0 18px 70px #0008; }
dialog.ui-window { position:fixed;inset:0;margin:auto; }
dialog.skills-panel { inset:24px auto auto 24px;margin:0; }
/* The collection alone fits its contents, anchored at the top. Other menus keep fixed frames. */
.skills-panel { position:fixed; z-index:3; isolation:isolate; top:24px; left:24px; margin:0; width:min(860px,calc(100% - 48px)); --ui-window-height:auto; max-height:calc(100dvh - 48px); padding:26px 28px 28px; }
.skills-panel>.panel-header,.skills-panel>.panel-footer,.school-tabs,.panel-hint,.affinity-selectors { flex-shrink:0; }
.affinity-selectors { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:10px 0 0; }
.affinity-selectors label { min-width:0; color:var(--ui-muted); font-size:10px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
.affinity-control { position:relative; display:block; height:36px; margin-top:4px; }
.affinity-control::after { content:''; position:absolute; right:13px; top:13px; width:6px; height:6px; border-right:1.5px solid var(--ui-accent); border-bottom:1.5px solid var(--ui-accent); transform:rotate(45deg); pointer-events:none; }
.affinity-selectors select { appearance:none; display:block; width:100%; height:100%; margin:0; padding:0 28px 0 40px; border:1px solid var(--ui-control-line); border-radius:var(--ui-control-radius); color:var(--ui-text); background:var(--ui-control-surface); font:12px var(--ui-font-body); cursor:pointer; }
.affinity-art { position:absolute; width:25px; height:25px; object-fit:contain; left:8px; top:5px; pointer-events:none; }
.affinity-control:hover { filter:none; }
.affinity-selectors select:focus-visible { outline:1px solid var(--ui-focus); outline-offset:2px; }
.school-tabs { display:flex; gap:24px; margin:10px 0; border-bottom:1px solid var(--ui-line); background:rgba(0,0,0,.35); }
.school-tabs button { flex:1; display:flex; align-items:center; justify-content:center; gap:8px; padding:6px 12px; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:var(--ui-muted); font-size:12px; }
.school-tabs img { width:24px; height:24px; object-fit:contain; opacity:.75; }
.school-tabs [aria-selected="true"] img { opacity:1; }
.school-tabs button[aria-selected="true"] { border-bottom-color:var(--ui-accent); color:var(--ui-heading); background:none; }
.school-tabs button:hover { color:#fff0dc; }
#skill-list { flex:0 1 auto; align-content:start; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; min-height:0; padding:0 4px 4px 0; scrollbar-gutter:auto; }
.skill-column { display:flex; flex-direction:column; gap:18px; min-width:0; }
.skill-column-wide { grid-column:span 2; }
.skill-column-wide .skill-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 12px; align-content:start; }
.skill-column-wide .skill-group-title { grid-column:1/-1; margin-bottom:2px; }
.skill-column-wide .skill-card+.skill-card { margin-top:0; }
@media(max-width:700px) {
  .skill-column-wide { grid-column:auto; }
  .skill-column-wide .skill-group { display:block; }
  .skill-column-wide .skill-group-title { margin-bottom:8px; }
  .skill-column-wide .skill-card+.skill-card { margin-top:6px; }
}
.skill-group { min-width:0; }
.skill-group .skill-pick { flex-direction:row; align-items:center; gap:10px; padding:8px; height:100%; min-width:0; }
.skill-group .skill-card { align-items:center; min-height:68px; }
.skill-pick>span { min-width:0; }
.skill-pick[aria-disabled="true"] { opacity:.5; cursor:default; }
.skill-group .tree-arrow { margin:0; }
.skill-group .skill-subtitle { font-size:11px; line-height:1.5; }
.skill-group-title { margin:0 0 8px; color:var(--ui-muted); font-size:10px; text-transform:uppercase; letter-spacing:.1em; font-weight:700; }
.skill-group-title:first-child { margin-top:0; }
.skill-card+.skill-card { margin-top:6px; }
@media(min-width:701px) {
  #skill-list.skill-list-aligned { grid-template-rows:auto; grid-auto-rows:minmax(68px,auto); row-gap:6px; }
  .skill-list-aligned>.skill-column { display:grid; grid-template-rows:subgrid; grid-row:1 / span var(--skill-row-count); row-gap:6px; }
  .skill-list-aligned .skill-group { display:grid; grid-template-rows:subgrid; grid-row:span var(--skill-group-rows); row-gap:6px; }
  .skill-list-aligned .skill-group-title { align-self:end; margin:0 0 2px; }
  .skill-list-aligned .skill-card+.skill-card { margin-top:0; }
}
.empty-school { grid-column:1/-1; padding:24px 8px; margin:0; text-align:center; color:var(--muted); }

.panel-header { display:flex; justify-content:space-between; align-items:center; gap:14px; min-height:52px; padding:0 0 8px; border-bottom:1px solid var(--ui-line); }
.panel-header h2 { font:500 clamp(25px,2vw,34px)/1.05 var(--ui-font-heading); }
.close { width:36px; height:36px; min-height:36px; flex:0 0 36px; padding:0; font-size:23px; line-height:1; }
.close:hover { color:var(--ui-heading); }
.panel-hint { font-size:12px; color:var(--muted); margin:12px 0; }
.skill-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border:1px solid var(--ui-control-line); border-radius:var(--ui-control-radius); background:var(--ui-control-surface); }
.skill-card-actions { display:flex;align-items:center;gap:4px;padding-right:3px; }
.skill-socketed .skill-pick { opacity:1; }
.skill-socketed .skill-pick>img,.skill-socketed .skill-name { opacity:.5; }
.skill-socket-marker { display:block;color:var(--gold);font-size:10px;margin-top:5px; }
.skill-socket-link { position:relative;display:grid;place-items:center;width:27px;height:27px;min-height:0;padding:2px; }
.skill-socket-link img { width:22px;height:22px;object-fit:contain;border-radius:4px; }
.skill-socket-link>span { position:absolute;right:-3px;bottom:-5px;color:var(--gold);font-size:12px;text-shadow:0 1px 3px #000; }
.skill-pick { display:flex; align-items:center; gap:13px; width:100%; padding:12px 6px 12px 10px; background:none; border:0; text-align:left; touch-action:none; user-select:none; }
.skill-pick img { width:46px; height:46px; flex-shrink:0; object-fit:contain; pointer-events:none; }
.skill-name { display:block; font-family:var(--ui-font-heading); color:var(--ui-heading); font-size:16px; line-height:1.2; }
.skill-subtitle { display:block; color:var(--muted); font-size:10px; margin-top:5px; }
.skill-card:hover { border-color:var(--ui-focus); background:var(--ui-hover-surface); }
/* Affinity is a quiet material under the art, with a readable glyph above it.
   Outer gold/blue highlights remain reserved for equipment/socket state. */
.affinity-surface { --affinity-color:#c7acdf; --affinity-material:var(--affinity-glyph); --affinity-opacity:.28; position:relative;isolation:isolate; }
.affinity-surface[data-affinity="divine"] { --affinity-color:#edcc76;--affinity-material:url('/assets/affinity-divine-material.webp');--affinity-opacity:.2; }
.affinity-surface[data-affinity="lightning"] { --affinity-color:#78cfff;--affinity-material:url('/assets/affinity-lightning-material.webp');--affinity-opacity:.55; }
.affinity-surface[data-affinity="resonance"] { --affinity-color:#e8a5ca;--affinity-material:url('/assets/affinity-resonance-material.webp');--affinity-opacity:.55; }
.affinity-surface[data-affinity="fire"] { --affinity-color:#f3a477; }
.stat-fire,.affinity-fire { color:#f3a477; }
.stat-duration { color:#cab3ec; }
.affinity-surface[data-affinity="water"] { --affinity-color:#72ced9; }
.affinity-surface[data-affinity="ice"] { --affinity-color:#b9e8fa; }
.affinity-surface[data-affinity="earth"] { --affinity-color:#bdac7c; }
.affinity-surface[data-affinity="air"] { --affinity-color:#b3e2dc; }
.affinity-surface[data-affinity="cosmic"] { --affinity-color:#bba4ed; }
.affinity-surface[data-affinity="temporal"] { --affinity-color:#84dccd; }
.affinity-surface[data-affinity="aether"] { --affinity-color:#b5baf3; }
.affinity-surface::before { content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--affinity-material) left center/180px auto repeat;opacity:var(--affinity-opacity);mask-image:linear-gradient(90deg,#000,rgba(0,0,0,.45) 45%,transparent 90%); }
.affinity-skill-art { position:relative;display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;border-radius:7px;border:1px solid color-mix(in srgb,var(--affinity-color) 40%,transparent);background:rgba(0,0,0,.3); }
.affinity-skill-art>img:not(.skill-affinity-glyph) { width:42px;height:42px;filter:drop-shadow(0 1px 3px #000); }
.affinity-skill-art>img.skill-affinity-glyph { position:absolute;right:-6px;bottom:-5px;width:20px;height:20px;padding:1px;border-radius:50%;background:#09090e;border:1px solid color-mix(in srgb,var(--affinity-color) 60%,transparent);object-fit:contain; }
.skill-socketed .affinity-skill-art>img:not(.skill-affinity-glyph) { opacity:.7; }
/* Selection accents sit behind the art; only transform/opacity animate. */
.skill-card[data-skill-id] { position:relative;isolation:isolate; }
.skill-card>.skill-pick,.skill-card>.skill-card-actions { position:relative;z-index:1; }
.skill-state-shimmer { display:none;position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none;z-index:0; }
.skill-equipped { --skill-state-rgb:238,198,111; }
.skill-socketed { --skill-state-rgb:108,188,244; }
.skill-card:is(.skill-equipped,.skill-socketed) { border-color:rgba(var(--skill-state-rgb),.46);box-shadow:0 0 8px rgba(var(--skill-state-rgb),.06); }
.skill-card:is(.skill-equipped,.skill-socketed):hover { border-color:rgba(var(--skill-state-rgb),.8); }
.skill-card:is(.skill-equipped,.skill-socketed)>.skill-state-shimmer { display:block; }
.skill-state-shimmer::before { content:'';position:absolute;inset:0 auto 0 0;width:45%;background:linear-gradient(110deg,transparent 5%,rgba(var(--skill-state-rgb),.025) 32%,rgba(var(--skill-state-rgb),.12) 50%,rgba(var(--skill-state-rgb),.025) 68%,transparent 95%);animation:skill-state-sheen 7s ease-in-out infinite; }
.skill-state-shimmer i { position:absolute;left:12%;top:16%;width:5px;height:5px;background:rgb(var(--skill-state-rgb));clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);animation:skill-state-spark 4.7s ease-in-out infinite;opacity:0; }
.skill-state-shimmer i:nth-child(2) { left:56%;top:84%;width:4px;height:4px;animation-delay:-1.8s; }
.skill-state-shimmer i:nth-child(3) { left:87%;top:11%;width:3px;height:3px;animation-delay:-3.2s; }
.skill-column:nth-child(2) .skill-state-shimmer::before { animation-delay:-2.4s; }
.skill-column:nth-child(3) .skill-state-shimmer::before { animation-delay:-4.8s; }
.skill-card:nth-of-type(2) .skill-state-shimmer i { animation-delay:-.9s; }
.skill-card:nth-of-type(3) .skill-state-shimmer i { animation-delay:-2.7s; }
.skill-socketed .skill-socket-marker { color:rgb(var(--skill-state-rgb)); }
.skill-socketed .skill-pick>img,.skill-socketed .skill-name { opacity:.7; }
@keyframes skill-state-sheen { 0%,14% { transform:translateX(-110%);opacity:0; } 20% { opacity:1; } 65% { transform:translateX(330%);opacity:0; } 100% { transform:translateX(330%);opacity:0; } }
@keyframes skill-state-spark { 0%,12%,70%,100% { opacity:0;transform:translateY(2px) scale(.5); } 35% { opacity:.7;transform:translateY(0) scale(1); } 58% { opacity:0;transform:translateY(-4px) scale(.55); } }
body.dragging .skill-state-shimmer::before,body.dragging .skill-state-shimmer i { animation-play-state:paused; }
@media(prefers-reduced-motion:reduce) { .skill-state-shimmer::before { animation:none;opacity:0; } .skill-state-shimmer i { animation:none;opacity:.25; } }
.tree-arrow { display:grid; place-items:center; background:url('/assets/thalassai-icon-socket.png') center/contain no-repeat; border:0; color:#e4d4b2; padding:5px; width:29px; height:29px; transition:filter .15s; }
.tree-arrow svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; filter:drop-shadow(0 1px 1px #000); }
.tree-arrow:hover { color:#fff2d3; filter:brightness(1.4) drop-shadow(0 0 4px #c7acdf55); }
.panel-footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; border-top:1px solid var(--ui-line); margin-top:8px; padding-top:6px; font-size:11px; color:var(--ui-muted); }
.text-button { font-size:11px; }
.hud { position:fixed;z-index:2;bottom:42px;left:50%;transform:translateX(-50%);display:grid;grid-template-columns:minmax(0,1fr) 600px minmax(0,1fr);align-items:end;gap:28px;width:min(1440px,calc(100% - 80px));pointer-events:none; }
.hud-unit { display:grid;grid-template-columns:128px minmax(0,1fr);align-items:center;gap:4px;min-width:0;width:100%;max-width:392px;pointer-events:auto; }
.hud-unit--target { grid-template-columns:minmax(0,1fr) 128px;justify-self:end; }
.hud-unit-body { position:relative;min-width:0;min-height:110px;padding:12px 14px;display:flex;flex-direction:column;justify-content:center;gap:7px; }
.hud-identity { display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;line-height:22px; }
.hud-unit-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px;font-family:var(--ui-font-heading); }
.hud-unit-kind { flex:none;font-size:10px;letter-spacing:.12em;text-transform:uppercase; }
.hud-portrait { position:relative;isolation:isolate;width:128px;height:128px; }
.hud-portrait::before { content:'';position:absolute;inset:10.5%;border-radius:50%;background:#10131c; }
.hud-portrait-art { position:absolute;inset:10.5%;width:79%;height:79%;object-fit:cover;object-position:50% 28%;border-radius:50%; }
.hud-portrait-frame { position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none; }
.hud-portrait-placeholder { position:absolute;inset:0;display:grid;place-items:center;font-size:32px; }
.hud-target-empty { margin:0;font-size:12px; }
.hud-vitals { display:grid;gap:4px; }
.hud-vitals[hidden],.hud-unit [hidden] { display:none; }
.vital-meter { position:relative;isolation:isolate;height:24px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-inline:11px; }
.vital-meter.health { height:30px; }
.vital-track { position:absolute;z-index:-1;inset:3px;overflow:hidden;border-radius:4px;background:#0b1019; }
.vital-fill { position:absolute;inset:0 auto 0 0;width:var(--fill,0%);background:linear-gradient(0deg,var(--deep),var(--bright));transition:width .2s ease-out; }
.vital-label { font-size:10px;line-height:1; }
.vital-value { font-size:13px;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600; }
.vital-meter.health .vital-value { font-size:14px; }
.shield { --deep:#285774;--bright:#70bed2; }
.health { --deep:#145733;--bright:#4caf6c; }
.essence { --deep:#4c2a70;--bright:#9565ba; }
.vital-loss { position:absolute;inset:0 auto 0 0;opacity:0;background:linear-gradient(#ed6962,#aa242b); }
.vital-loss.is-hit { animation:health-loss 1.2s ease-out forwards; }
@keyframes health-loss { 0%,45% {opacity:1;} 100% {opacity:0;} }
.hud-actions { min-width:0;display:grid;gap:6px;pointer-events:auto; }
.hud-counters { min-height:54px;max-width:calc(100% - 44px);margin-left:44px;justify-self:center;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px;padding:5px 6px; }
.hud-counters.is-empty { visibility:hidden; }
.hud-counter { position:relative;display:grid;grid-template-columns:max-content max-content;grid-template-rows:28px 13px;justify-content:center;align-items:center;flex:0 0 32px;row-gap:2px;padding:1px 0;color:#fff2d3;font-size:12px;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px #000,0 0 4px #000;outline-offset:2px; }
.hud-counter img { grid-column:1/-1;justify-self:center;width:28px;height:28px;object-fit:contain;filter:drop-shadow(0 1px 2px #000); }
.hud-counter img.hud-counter-badge { position:absolute;left:-1px;top:19px;width:12px;height:12px; }
.hud-counter-badge[hidden] { display:none; }
.hud-counter small { font-size:11px;color:#cfc8dc;white-space:pre; }
.hud-counter .hud-rail-value { font-weight:600; }
.hud-counter .hud-effect-timer { display:none; }
.hud-counter.is-target::after { content:'⌖';position:absolute;right:0;top:0;color:#edb1a4;font:12px/1 sans-serif;text-shadow:0 1px 2px #000; }
.hud-counter.is-ready { color:#ffe198;text-shadow:0 0 5px #bf842d,0 1px 3px #000; }
.hud-counter.is-ready img { filter:drop-shadow(0 0 4px #efb44b); }
.hud-status-rail { position:absolute;left:12px;right:12px;display:flex;align-items:center;gap:4px;height:32px; }
.hud-status-rail--buffs { bottom:calc(100% + 5px);--effect-glow:#79c9c16b;--effect-color:#c4f1dd; }
.hud-status-rail--debuffs { top:calc(100% + 3px);--effect-glow:#e46c626b;--effect-color:#ffd0b9; }
.hud-status-rail.is-empty { visibility:hidden; }
.hud-effect { position:relative;isolation:isolate;display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;color:var(--effect-color);font-variant-numeric:tabular-nums;text-shadow:0 1px 2px #000,0 0 3px #000;outline-offset:2px; }
.hud-effect::before { content:'';position:absolute;inset:2px;border-radius:50%;background:conic-gradient(var(--effect-color) calc(var(--remaining,1) * 1turn),#272431bb 0);opacity:.6;z-index:-2; }
.hud-effect::after { content:'';position:absolute;inset:0;background:url('/assets/thalassai-icon-socket.png') center/contain no-repeat;z-index:-1;filter:drop-shadow(0 0 2px var(--effect-glow)); }
.hud-effect img { width:25px;height:25px;object-fit:contain; }
.hud-effect .hud-rail-value { position:absolute;right:0;top:-3px;font-size:11px;line-height:1.15; }
.hud-effect .hud-rail-maximum { display:none; }
.hud-effect-timer { position:absolute;bottom:-7px;left:50%;transform:translateX(-50%);font-size:10px;line-height:1.1;color:#fff1d9; }
.hud-effect-tip { width:280px;gap:5px;padding:14px 16px;font-size:12px; }
.hud-effect-tip strong { font:20px/1.15 var(--ui-font-heading);color:#f0dab3; }
.hud-effect-tip>span { color:#d5ccdd; }
.hud-effect-tip>span:last-child { color:#f1ede3; }
.hud-counter:focus-visible,.hud-effect:focus-visible { outline:1px solid #ead7a3; }
.hud-xp { position:fixed;z-index:2;bottom:0;left:0;right:0;height:5px;background:#11121ca0;border-top:1px solid #d0ba9760; }
.hud-xp::before { content:'';position:absolute;inset:-8px 0 0; }
.hud-xp-fill { height:100%;width:var(--xp-fill,0%);background:linear-gradient(90deg,#706292,#c3b1e5);box-shadow:0 0 6px #bea7e277,inset 0 1px 0 #ffffff66; }
.hud-xp-tooltip { position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:10;display:grid;gap:5px;padding:14px 20px;max-width:calc(100vw - 32px);width:max-content;text-align:center;pointer-events:none;visibility:hidden;opacity:0;font-variant-numeric:tabular-nums; }
.hud-xp-tooltip strong { font:20px var(--ui-font-heading);color:var(--accent); }
.hud-xp-tooltip span { font-size:14px;color:var(--ui-text); }
.hud-xp-tooltip small { font-size:12px;color:var(--muted); }
.hud-xp:hover + .hud-xp-tooltip,.hud-xp:focus-visible + .hud-xp-tooltip { visibility:visible;opacity:1; }
@media(prefers-reduced-motion:reduce) { .vital-fill {transition:none;} .vital-loss.is-hit {animation-duration:.01ms;} }
.ability-tray { display:flex;align-items:flex-end;gap:8px;text-align:center; }
.ability-tray>.slots { flex:1;min-width:0; }
.hud-dps { flex:0 0 36px;min-width:0;width:36px;height:32px;padding:0;font-size:10px;margin-bottom:6px; }
@media(max-width:1250px) { .hud { grid-template-columns:1fr 1fr;width:min(980px,calc(100% - 32px));column-gap:24px;row-gap:8px; } .hud-unit--target { grid-column:2;grid-row:1; } .hud-actions { grid-column:1/-1;grid-row:2;width:min(600px,100%);justify-self:center; } }
.menu-nav { display:flex;align-items:center;gap:6px; }
.menu-nav .ui-button { white-space:nowrap; }
.menu-nav [data-menu-destination] { display:inline-flex;align-items:center;justify-content:center;gap:6px; }
.menu-destination-icon { flex:none;width:18px;height:18px;object-fit:contain;pointer-events:none;filter:drop-shadow(0 1px 2px #0008); }
.panel-header.has-menu-nav { display:grid;grid-template-columns:28px minmax(0,1fr) auto 36px;gap:10px; }
.panel-header.has-menu-back:not(.has-menu-nav) { display:grid;grid-template-columns:28px minmax(0,1fr) 36px;gap:10px; }
.panel-header.has-menu-back>div,.panel-header.has-menu-back>h2 { min-width:0; }
.menu-back { display:grid;place-items:center;width:28px;height:28px;min-height:0;padding:4px; }
.menu-back svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round; }
.menu-covered { filter:brightness(.55); }
@media(max-width:800px) {
  .panel-header.has-menu-nav { grid-template-columns:28px minmax(0,1fr) 36px; }
  .panel-header.has-menu-nav>.close { grid-column:3;grid-row:1; }
  .panel-header.has-menu-nav>.menu-nav { grid-column:1/-1;grid-row:2; }
}
@media(max-width:560px) {
  .masthead { flex-wrap:wrap;gap:16px; }
  .menu-nav .ui-button { padding-inline:8px;font-size:11px; }
  .hud-dps { flex-basis:28px;width:28px;font-size:9px; }
  .ability-tray { gap:5px; }
}
.slots { display:flex; gap:7px; }
.slot-wrap { position:relative; padding-top:24px; flex:1; min-width:0; }
.slot-wrap:nth-child(7) { margin-left:18px; }
.slot { display:block; position:relative; width:100%; aspect-ratio:1; padding:5px; border:1px solid var(--ui-control-line); border-radius:8px; background:var(--ui-control-surface); transition:filter .15s,box-shadow .15s; touch-action:none; }
.slot:hover,.slot.selected { filter:brightness(1.3); box-shadow:0 0 17px #ad86d126; }
.slot.drop-target { outline:2px solid #e9d1ff; box-shadow:0 0 24px #c7acdf70; }
.slot img { width:100%; height:100%; object-fit:contain; pointer-events:none; }
.slot .slot-main-art { position:relative;z-index:2; }
.slot-socket-art { position:absolute;right:-5px;bottom:-4px;width:40%;aspect-ratio:1;padding:2px;display:grid;place-items:center;border:1px solid var(--ui-control-line);border-radius:6px;background:var(--ui-control-surface);z-index:1;pointer-events:none; }
.slot-number { z-index:3; }
.slot.affinity-unavailable { border-color:#92474c; background:#17171c; }
.slot.slot-reserved { cursor:default;border-color:#383842;opacity:.55; }
.slot.affinity-unavailable img,.slot-socket-art.affinity-unavailable img { filter:grayscale(1);opacity:.38; }
.slot.affinity-unavailable::after,.slot-socket-art.affinity-unavailable::after { content:"";position:absolute;inset:12%;z-index:4;pointer-events:none;background:linear-gradient(45deg,transparent 46%,#e45b66 47%,#e45b66 53%,transparent 54%),linear-gradient(-45deg,transparent 46%,#e45b66 47%,#e45b66 53%,transparent 54%);filter:drop-shadow(0 1px 2px #090909); }
.slot .plus { font-size:23px; color:#bba8c660; font-weight:200; }
.slot-number { position:absolute; bottom:-8px; left:50%; transform:translateX(-50%); padding:0 5px; color:#cfbfd9; background:#0b0b13; font-size:10px; border:1px solid #927d9d55; line-height:16px; }
.slot-wrap>.tree-arrow { position:absolute; top:0; left:50%; transform:translateX(-50%); width:30px; }
.status { position:fixed; bottom:205px; left:50%; transform:translateX(-50%); margin:0; text-align:center; color:var(--muted); font-size:12px; width:min(90%,480px); pointer-events:none; }
.drag-ghost { position:fixed; z-index:1000; width:56px; height:56px; pointer-events:none; filter:drop-shadow(0 0 10px #c7acdf); }
body.dragging,body.dragging button { cursor:grabbing; }
.tree-panel { width:min(1180px,calc(100% - 32px)); --ui-window-height:min(900px,calc(100dvh - 32px)); padding:26px 28px 28px; }
.tree-layout { display:grid; grid-template-columns:250px minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:24px; padding-block:10px; }
.tree-information { min-width:0; padding-top:26px; }
.skill-totals { margin:0; padding:0 10px 12px 0; }
.total-row { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:3px 0; background:none; }
.total-row:nth-child(5) { margin-top:8px; padding-top:10px; border-top:1px solid var(--line); }
.total-row dt { font-size:12px; color:var(--muted); }
.total-row dd { margin:0; text-align:right; font-size:18px; font-variant-numeric:tabular-nums; }
.total-sequence { flex-direction:column; gap:2px; }
.total-sequence dd { font-size:12px; text-align:left; color:#edb287; }
.tree-panel::backdrop { background:var(--ui-backdrop-color); }
.tree-toolbar { display:flex; flex:none; justify-content:space-between; align-items:center; gap:12px; margin-top:12px; }
.tree-legend { display:flex; flex-wrap:wrap; gap:20px; color:var(--muted); font-size:11px; }
#tree-exclusive { color:var(--gold); }
.tree-canvas { height:100%; min-height:360px; position:relative; }
.tree-lines { position:absolute; width:100%; height:100%; overflow:visible; }
.tree-link { stroke:#67547166; stroke-width:1.5px; fill:none; }
.tree-link.available { stroke:#baa0ce99; }
.tree-link.active { stroke:#e9cf91; stroke-width:2.5px; filter:drop-shadow(0 0 3px #e4c27577); }
.tree-origin { position:absolute; left:50%; top:6%; transform:translate(-50%,-50%); width:58px; height:58px; padding:5px; border-radius:9px; border:1px solid #cdb281; background:#15121e; box-shadow:0 0 30px #e2c27615; }
.tree-origin>img { width:100%; height:100%; object-fit:contain; pointer-events:none; }
.tree-node { position:absolute; transform:translate(-50%,-50%); display:grid; place-items:center; padding:0; border:0; background:none; color:#c8b5d8; font:17px var(--ui-font-heading); isolation:isolate; }
.tree-node::before { content:''; position:absolute; inset:0; z-index:-1; background:#151321; border:1px solid #9378aa; box-shadow:inset 0 0 12px #ad87cc0d; transition:background .15s,border-color .15s; }
.tree-node.major { width:54px; height:54px; }
.tree-node.major::before { border-radius:8px; border-width:1px; }
.tree-node.minor { width:32px; height:32px; font-size:24px; }
.tree-node.minor::before { border-radius:6px; }
.node-art { width:100%; height:100%; object-fit:contain; padding:4px; border-radius:inherit; pointer-events:none; }
.minor .node-art { padding:3px; }
.node-rank { position:absolute; bottom:-7px; right:-5px; min-width:20px; padding:1px 4px; border:1px solid #96809e80; border-radius:3px; background:#100e1b; color:inherit; font:10px/1.2 var(--ui-font-heading); pointer-events:none; }
.node-symbol { pointer-events:none; }
.socket .node-symbol { color:var(--node-accent,var(--gold)); font:32px/1 var(--ui-font-body); font-weight:200; }
.socket::before { border-style:dashed; }
.tree-node:disabled { opacity:.45; }
.tree-node.excluded { opacity:.55; }
.tree-node:not(:disabled):hover { color:#fff5db; opacity:1; }
.tree-node:not(:disabled):hover::before { border-color:#eed5a4; }
.tree-node.chosen { color:#ffedbb; }
.tree-node.chosen::before { border-color:#e8c478; background:#463b27; box-shadow:0 0 24px #e8c47835,inset 0 0 12px #e8c47822; }
.tree-node:focus-visible { outline:2px solid #f5e4ff; outline-offset:12px; }
.tree-empty { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); color:var(--muted); font-size:13px; }
.tree-footer { display:flex; justify-content:space-between; border-top:1px solid var(--line); padding-top:12px; color:var(--muted); font-size:11px; }
.skill-edit-controls { display:flex; align-items:center; gap:12px; flex-wrap:wrap; font-size:11px; }
.skill-edit-controls label { display:flex; align-items:center; gap:5px; cursor:pointer; }
.skill-edit-controls input { accent-color:var(--gold); }
#skill-edit-status { color:var(--gold); width:17ch; min-height:1.5em; }
.skill-edit-confirm { width:min(460px,calc(100vw - 40px)); padding:26px; color:var(--text); }
.skill-edit-confirm::backdrop { background:#0009; }
.skill-edit-confirm h2 { margin:0 0 12px; }
.skill-edit-confirm p { color:var(--muted); }
.skill-edit-confirm > div { display:flex; gap:10px; flex-wrap:wrap; margin-top:22px; }
.stat-row { display:flex; flex-wrap:wrap; gap:6px; }
.stat-row:empty { display:none; }
#tree-stats { margin-top:0; }
.stat-chip { display:inline-flex; gap:4px; align-items:baseline; font:10px/1.5 var(--ui-font-body); border:1px solid currentColor; border-radius:4px; padding:2px 5px; white-space:nowrap; }
.stat-chip b { font-size:13px; }
.stat-damage { color:#edb287; background:#5f311925; }
.stat-divine { color:#fff0a8; }
.stat-lightning { color:#75eaff; }
.stat-earth,.affinity-earth { color:#bdac7c; }
.stat-resonance,.affinity-resonance { color:#e5acd6; }
.school-tabs small { display:block; font-size:9px; color:var(--muted); }
.total-row dt { display:flex; align-items:center; gap:5px; }
.affinity-icon { width:19px!important; height:19px!important; flex:0 0 19px; object-fit:contain; vertical-align:middle; }
.affinity-icon { fill:none; stroke:currentColor; stroke-width:1.45; stroke-linecap:round; stroke-linejoin:round; }
.affinity-divine { color:#fff0a8; }
.affinity-lightning { color:#75eaff; }
.target-detail dd { font-size:12px; color:#75eaff; }
.stat-healing { color:#92d5a3; background:#24553325; }
.stat-essence { color:#c8a4ef; background:#713cac25; }
.stat-shield { color:#a5d4e9; background:#24536b25; }
.stat-threat { color:#e1bf76; background:#5a442125; }
.stat-speed { color:#8dd7dc; }
.stat-cost { color:#eb939b; background:#6a293325; }
.stat-neutral { color:var(--muted); background:#242131; }
#tree-modifiers { display:flex; flex-direction:column; gap:11px; margin-top:0; padding:16px 10px 8px 0; border-top:1px solid var(--line); }
#tree-modifiers .stat-chip { max-width:100%; white-space:normal; font-size:11px; line-height:1.6; }
#tree-modifiers:empty { margin:0; }
.tree-node[data-tone="damage"] { --node-accent:#edb287; }
.tree-node[data-tone="healing"] { --node-accent:#92d5a3; }
.tree-node[data-tone="threat"] { --node-accent:#e1bf76; }
.tree-node[data-tone="shield"] { --node-accent:#a5d4e9; }
.tree-node[data-tone="speed"] { --node-accent:#8dd7dc; }
.node-caption { position:absolute; top:calc(100% + 10px); left:50%; transform:translateX(-50%); width:155px; color:var(--node-accent,#bcb0c9); font:11px/1.3 var(--ui-font-body); pointer-events:none; }
.minor .node-caption { top:calc(100% + 5px); font-size:10px; }
.tree-node[aria-disabled="true"] { opacity:.5; cursor:default; }
.tree-node.socket-linked { opacity:.8; }
.tree-node.socket-linked::before { border-style:dashed; }
.socket-tree-link { position:absolute; transform:translateY(-50%); width:28px; height:28px; min-height:0; padding:0; font-size:18px; z-index:6; }
.tree-node:hover,.tree-node:focus-visible { z-index:5; opacity:1; }
.node-tip { display:none; flex-direction:column; position:fixed; z-index:20; width:max-content; max-width:min(360px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); padding:10px 12px; gap:10px; justify-content:flex-start; text-align:left; box-shadow:0 8px 24px #000b; font:12px/1.4 var(--ui-font-body); }
.node-tip .stat-chip { white-space:normal; }
.skill-detail-tip { width:360px; }
.skill-description { margin:0; color:var(--ui-text,#e4dfeb); font:13px/1.5 var(--ui-font-body); white-space:normal; overflow-wrap:break-word; }
.skill-description .description-number { background:none; font-weight:600; font-variant-numeric:tabular-nums; }
#tree-description { margin:12px 0; }
.socket-picker { width:min(580px,calc(100% - 32px)); --ui-window-height:min(680px,calc(100dvh - 48px)); }
.socket-picker::backdrop { background:var(--ui-backdrop-color); }
#socket-options { display:grid; grid-auto-rows:max-content; align-content:start; gap:8px; }
.socket-choice { display:flex; align-items:center; gap:14px; padding:12px; text-align:left; }
.socket-choice>img { flex:0 0 48px; }
.socket-choice>span { min-width:0; overflow-wrap:anywhere; }
.socket-choice[aria-pressed="true"],.socket-choice:hover { border-color:var(--ui-focus); }
.socket-choice img { width:48px; height:48px; object-fit:contain; }
.socket-choice strong { display:block; color:var(--gold); font:18px var(--ui-font-heading); }
.socket-choice small { display:block; color:var(--muted); margin:4px 0; }
.socket-choice .stat-chip { border:0; background:none; padding:0; }
.socket-choice .stat-row { gap:14px; }
.socket-choice>span:not(.socket-dps):not(.affinity-skill-art) { flex:1; }
.socket-choice>.affinity-skill-art { flex:0 0 46px; }
.socket-choice.affinity-surface::before { right:auto;width:min(220px,100%); }
.socket-choice>span>strong { color:var(--ui-heading); }
.socket-filter.affinity-selectors { grid-template-columns:minmax(0,240px) 1fr;align-items:end;margin:0 0 12px; }
#socket-count { text-align:right;font-size:11px;color:var(--muted);padding-bottom:8px; }
#socket-affinity:has(option[value=""]:checked) { padding-left:12px; }
.socket-choice .socket-dps { min-height:70px; flex:0 0 100px;text-align:right;font-variant-numeric:tabular-nums; }
.socket-choice .socket-dps strong { font:22px var(--ui-font-heading); }
.socket-choice .socket-dps .socket-dps-gain { color:#92d5a3; }
.socket-choice .socket-dps .socket-dps-loss { color:#edb287; }
@media(max-width:560px) {
  .socket-choice { flex-wrap:wrap; }
  .socket-choice .socket-dps { flex:1 0 calc(100% - 62px);margin-left:62px;text-align:left; }
}
#socket-preview:not(:empty) { border-top:1px solid var(--line); margin-top:18px; padding-top:12px; display:flex; flex-direction:column; gap:8px; }
#socket-preview h3 { font:17px var(--ui-font-heading); color:var(--gold); margin:3px 0; }
#socket-preview>.stat-chip { border:0; background:none; padding:0; white-space:normal; }
.tooltip-totals { width:100%; margin:2px 0 4px; }
.tooltip-totals .total-row { padding:2px 0; }
.tooltip-totals .total-row dd { font-size:14px; }
.tip-heading { display:flex; align-items:center; gap:10px; }
.tip-heading img { width:38px; height:38px; object-fit:contain; }
.tip-heading strong { color:#faf1e4; font:18px/1.2 var(--ui-font-heading); }
.tree-information .total-row,.node-tip .total-row { background:none; }
.mechanics { display:flex; flex-direction:column; gap:11px; }
.mechanic { display:block; background:none; font:12px/1.45 var(--ui-font-body); }
.mechanic-lead { display:block; font-weight:600; }
.mechanic-detail { display:block; margin-top:2px; color:var(--muted); font-size:11px; }
.mechanic-detail b { font-weight:600; color:var(--text); font-variant-numeric:tabular-nums; }
.node-tip .mechanics { border-top:1px solid var(--line); padding-top:10px; }
.node-tip .stat-chip { border:0; border-radius:0; padding:0; background:none; font-size:11px; white-space:normal; }
.tip-meta { display:flex; flex-wrap:wrap; gap:3px 14px; }
.node-tip>.stat-chip { color:var(--muted); }
.node-tip .mechanic-detail { font-size:12px; }
.skill-hit-tags { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-bottom:8px; }
.hit-type-tag { display:inline-block; vertical-align:middle; border:1px solid #ad96704d; border-radius:4px; padding:1px 5px; color:#e0c69d; font:10px/1.5 var(--ui-font-body); cursor:help; white-space:nowrap; }
.hit-type-magical { border-color:#ad99de55; color:#c7b3eb; }
.hit-type-damage-readout .hit-type-help,.hit-type-healing-readout .hit-type-help { width:280px; white-space:pre-line; }
.hit-type-tag:hover,.hit-type-tag:focus-visible { background:#82709033; outline:1px solid #cbb48b88; }
.skill-description-term { display:inline; vertical-align:baseline; padding:0; border:0; border-bottom:1px dotted currentColor; border-radius:0; color:inherit; font:inherit; white-space:normal; }
.hit-type-help { display:none; position:fixed; z-index:100; width:220px; max-width:calc(100vw - 24px); padding:8px 10px; border:1px solid var(--ui-control-line); border-radius:7px; background:rgba(0,0,0,.98); box-shadow:0 5px 18px #000b; color:var(--ui-text); font:12px/1.45 var(--ui-font-body); white-space:normal; text-align:left; pointer-events:none; }
.masthead-actions { display:flex; align-items:center; gap:18px; }
.main-menu-toggle { display:flex;align-items:center;justify-content:center;gap:9px;min-width:104px;height:38px;font-size:13px; }
.main-menu-toggle svg { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round; }
.main-menu-panel { position:fixed;inset:auto;margin:0;width:360px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 96px);overflow:auto;padding:20px 22px 24px; }
.main-menu-panel:popover-open { display:grid;gap:14px; }
.main-menu-header { display:flex;align-items:center;justify-content:space-between;gap:16px; }
.main-menu-header h2 { font-size:22px; }
.main-menu-header>.ui-button { width:30px;padding:0;font-size:19px; }
.main-menu-panel .menu-nav { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.main-menu-panel .menu-nav>.ui-button { height:38px;font-size:13px;font-weight:500; }
.main-menu-panel .menu-nav>[data-menu-destination] { justify-content:flex-start;padding-inline:14px;gap:8px; }
.main-menu-panel .menu-destination-icon { width:24px;height:24px; }
.main-menu-panel .menu-nav>.ui-button:last-child:nth-child(odd) { grid-column:1/-1; }
.loadout-button { min-width:132px; font:16px var(--ui-font-heading); }
.loadout-button:hover { filter:brightness(1.2); }
.loadout-panel { width:min(1120px,calc(100vw - 32px)); }
.loadout-panel::backdrop { background:var(--ui-backdrop-color); }
.loadout-header-actions { display:flex; align-items:center; gap:20px; }
.loadout-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:30px; padding-top:20px; }
.character-stats { border-right:1px solid var(--line); padding-right:22px; min-width:0; }
.character-stats section + section { margin-top:17px; }
.character-stats h3,.loadout-section-heading h3 { font:10px/1.4 var(--ui-font-body); letter-spacing:.18em; text-transform:uppercase; color:var(--gold); margin:0 0 6px; }
.character-stats details { padding:3px 0; }
.character-stats summary { list-style:none; display:flex; align-items:baseline; justify-content:space-between; gap:8px; cursor:pointer; font-size:12px; color:var(--muted); }
.character-stats summary::-webkit-details-marker { display:none; }
.character-stats summary>span::before { content:'›'; display:inline-block; margin-right:6px; color:#8f799f; }
.character-stats details[open]>summary>span::before { transform:rotate(90deg); }
.character-stats summary strong { color:#e8d8b1; font-weight:400; font-variant-numeric:tabular-nums; white-space:nowrap; }
.character-stats summary:hover { color:#eee3f0; }
.stat-sources { margin:6px 0 8px 10px; padding-left:8px; border-left:1px solid #a995ba44; font-size:12px; color:var(--muted); }
.stat-sources>div:not(.resistance-members) { display:flex; justify-content:space-between; gap:6px; margin:3px 0; }
.stat-sources b { font-weight:400; white-space:nowrap; color:#cdbfdb; }
.stat-sources small { display:block; margin-top:6px; color:#8d849c; }
.resistance-members { color:#c5b5d9; border-top:1px solid var(--line); margin-top:7px; padding-top:6px; }
.loadout-scope { font-size:10px; color:#877c95; margin:18px 0 0 10px; }
.loadout-equipment { min-width:0; padding-right:6px; }
.loadout-section-heading { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.loadout-section-heading>span { color:var(--muted); font-size:10px; }
.equipment-layout { position:relative;width:100%;max-width:460px;min-height:410px;margin:auto; }
.equipment-figure { position:absolute;top:0;left:50%;transform:translateX(-50%);height:330px;width:190px;stroke:#c0b6aa60;stroke-width:1; }
.figure-ring { fill:none;stroke:#b6a17735; }
.figure-seams { fill:none;stroke:#c9bd9c35; }
.gear-position { display:flex;flex-direction:column;align-items:center;gap:5px; }
.equipment-layout>.gear-position { position:absolute; }
.gear-position--chest { top:52px;left:8%; }
.gear-position--underarmor { top:52px;right:8%; }
.gear-position--hands { top:153px;left:3%; }
.gear-position--belt { top:153px;right:3%; }
.gear-position--pants { top:254px;left:8%; }
.gear-position--boots { top:254px;right:8%; }
.gear-square.ui-button { width:64px;height:64px;min-height:0;padding:7px;position:relative;display:grid;place-items:center;border:1px solid #a896bb88;border-radius:5px;background:radial-gradient(ellipse at center,#60516c28,transparent 75%),#070910ad;box-shadow:inset 0 0 0 2px #13101d;touch-action:none;user-select:none; }
.gear-square[aria-pressed="true"] { border-color:#d6bd85;box-shadow:inset 0 0 10px #d2ae5b25,0 0 6px #cda75d20; }
.gear-square:hover { border-color:#e9d6a8; }
.gear-square.drop-ready { border-color:#83c4d7;box-shadow:0 0 8px #7fbad442; }
.gear-square.drop-over { border-color:#fff1bd;background:#a28c4e55; }
.gear-art { display:grid;place-items:center;width:46px;height:46px;pointer-events:none; }
.gear-art img { width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 5px #ac8cd240); }
.gear-art svg { width:100%;height:100%;fill:#c2b4d515;stroke:#c2b0d1;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round; }
.gear-tier { position:absolute;bottom:2px;right:4px;font-size:9px;color:#cebfdb;text-shadow:0 1px 2px black; }
.equipment-cores { position:absolute;bottom:0;left:50%;transform:translateX(-50%);display:flex;gap:12px; }
.equipment-bag { border-left:1px solid var(--line);padding-left:16px;min-width:0; }
#equipment-filter { width:100%;padding:7px 4px;color:var(--ui-text);border:1px solid var(--ui-control-line);border-radius:4px;background:var(--ui-control-surface);font:12px var(--ui-font-body); }
#equipment-options { display:grid;grid-template-columns:repeat(2,64px);gap:10px;align-content:start;margin-top:14px;max-height:330px;padding:2px; }
.gear-drag-ghost { position:fixed;z-index:1000;width:56px;height:56px;pointer-events:none;filter:drop-shadow(0 0 8px #ccb6e0); }
.loadout-equipment .attribute-controls { margin-bottom:16px; }
.gear-item-stats { margin:9px 0 5px; }
.gear-item-stats>div { display:flex; justify-content:space-between; gap:8px; font-size:10px; padding:2px 0; }
.gear-item-stats dt { color:var(--muted); }
.gear-item-stats dd { color:#c4d5e9; margin:0; white-space:nowrap; }
@media(max-width:800px) { .loadout-layout { grid-template-columns:230px minmax(0,1fr); gap:16px; } .character-stats { padding-right:12px; } .masthead-actions { gap:6px; } .masthead-actions .draft-label { display:none; } }
@media(max-width:560px) { .loadout-layout { grid-template-columns:1fr; align-content:start; } .character-stats,.loadout-equipment { overflow:visible; scrollbar-gutter:auto; } .character-stats { border:0; padding:0; } #loadout-stats { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .character-stats section+section { margin:0; } .character-stats summary { font-size:10px; } .loadout-panel .draft-label { display:none; } .loadout-equipment { padding:0; } .masthead { padding:24px 20px; } .loadout-button { min-width:98px; padding:15px; } .loadout-panel .panel-footer { font-size:10px; } }

.skill-group .skill-pick img:not(.skill-affinity-glyph) { width:42px; height:42px; border-radius:6px; }
.skill-group .stat-row { margin-top:8px; }
.skill-name { display:block; font-family:var(--ui-font-heading); color:var(--ui-heading); font-size:16px; line-height:1.2; }
@media(max-width:1000px) { .tree-layout { grid-template-columns:170px minmax(0,1fr); gap:12px; } .node-caption { width:112px; font-size:10px; } .total-row dd { font-size:15px; } }
@media(max-width:760px) { .tree-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:max-content 420px; align-content:start; } .tree-information { overflow:visible; padding-top:15px; display:grid; grid-template-columns:1fr 1fr; gap:12px; } #tree-modifiers { margin:0; padding:0; border:0; } .tree-canvas { min-width:0; } .node-caption { width:88px; font-size:9px; } }
@media(max-width:700px) { .masthead { padding:22px; } h1 { font-size:25px; } .draft-label { font-size:8px; } .hud { bottom:22px; column-gap:22px; } .resource-stack { gap:5px; } .meter span { font-size:9px; margin-bottom:2px; } .slots { gap:5px; } .slot { padding:3px; border-radius:6px; } .slot-wrap:nth-child(7) { margin-left:12px; } .skills-panel { top:12px; left:12px; width:calc(100% - 24px); }  .panel-header h2 { font-size:23px; } .status { bottom:190px; font-size:11px; } .welcome { top:36%; } .welcome h2 { font-size:26px; } .welcome p { font-size:12px; } }
@media(max-height:620px) and (min-width:701px) { .masthead { padding:16px 30px; }  .tree-canvas { min-height:240px; } }
@media(max-width:700px) { #skill-list { grid-template-columns:1fr; gap:14px; } .skill-group .skill-pick { flex-direction:row; align-items:center; } .skills-panel { overflow:hidden; max-width:none; } .affinity-selectors { gap:6px; } .affinity-selectors label { font-size:10px; } .affinity-selectors select { font-size:11px; padding:0 18px 0 29px; } .affinity-art { width:19px; height:19px; left:6px; top:8px; } .affinity-control::after { right:8px; width:5px; height:5px; top:13px; } .school-tabs button { gap:4px; padding-inline:5px; font-size:12px; } .school-tabs img { width:20px; height:20px; } }
@media(max-width:700px) { dialog.skills-panel { inset:12px auto auto 12px;max-height:calc(100dvh - 24px); } }


.loadout-stat-tip { width:340px; max-width:calc(100vw - 24px); z-index:30; }
.attribute-controls { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:0 0 22px; }
.attribute-control { display:flex; flex-direction:column; gap:7px; padding:9px; border-bottom:1px solid var(--ui-line); }
.attribute-control label { color:var(--gold); font:13px var(--ui-font-heading); cursor:help; }
.attribute-control input { width:100%; min-width:0; padding:4px 6px; border:1px solid var(--ui-control-line); border-radius:var(--ui-control-radius); background:var(--ui-control-surface); color:var(--ui-text); font:16px var(--ui-font-body); }
@media(max-width:800px) { .attribute-controls { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.stat-tip-title { color:var(--gold); font:18px var(--ui-font-heading); }
.loadout-stat-tip .stat-sources { margin:0; padding:0; border:0; font-size:12px; }
.loadout-stat-tip .stat-sources>div { padding:3px 0; }
.stat-sources .mitigation-total { border-bottom:1px solid var(--line); padding-bottom:5px; margin-bottom:5px; color:var(--gold); }
.stat-sources .mitigation-total b { color:var(--gold); }
.stat-sources .stat-source-heading { margin-top:12px; padding-top:7px; border-top:1px solid var(--line); color:var(--gold); text-transform:uppercase; letter-spacing:.1em; }
@media(min-width:561px) {
  .loadout-layout { overflow:hidden; grid-template-rows:minmax(0,1fr); scrollbar-gutter:auto; }
  .character-stats,.loadout-equipment { height:100%; min-height:0; }
  .character-stats { padding-bottom:12px; }
}

.skill-unavailable { opacity:.45; }
.builds-panel { width:min(1120px,calc(100vw - 32px));--ui-window-height:min(830px,calc(100dvh - 32px)); }
.builds-layout { display:grid;grid-template-columns:240px minmax(0,1fr);gap:24px;padding-top:16px;overflow:hidden; }
.build-workspace { display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden; }
.builds-toolbar { display:flex;align-items:end;gap:14px;padding:0 10px 16px 0;flex-shrink:0; }
.build-name-control { display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:11px;min-width:0;flex:0 1 290px; }
.build-name-control input { width:100%;min-width:0;height:36px;padding:8px 10px;color:var(--ui-heading);background:var(--ui-control-surface);border:1px solid var(--ui-control-line);border-radius:var(--ui-control-radius);font:14px var(--ui-font-body); }
.build-actions { display:flex;gap:7px;margin-left:auto;flex-shrink:0; }
.build-actions .ui-button { min-height:36px;min-width:60px; }
#build-library { display:flex;flex-direction:column;gap:8px;padding:0 14px 14px 0;border-right:1px solid var(--line); }
.build-entry { display:flex;flex-direction:column;align-items:stretch;gap:7px;text-align:left;flex-shrink:0;padding:12px;min-width:0; }
.build-entry[aria-pressed="true"] { border-color:var(--ui-focus); }
.build-entry small { color:var(--muted);font-size:9px;letter-spacing:.12em; }
.build-entry strong { color:var(--ui-heading);font:16px var(--ui-font-heading);overflow-wrap:anywhere; }
.build-mini-skills { display:flex;gap:3px; }
.build-mini-art { width:24px;height:24px;object-fit:contain;border-radius:5px; }
#build-details { padding:0 10px 16px 0;min-width:0;min-height:0;flex:1; }
.build-preview-heading { display:flex;align-items:center;justify-content:space-between;gap:14px; }
.build-preview-heading .eyebrow { margin:0 0 9px; }
#build-affinities { display:flex;flex-wrap:wrap;gap:12px; }
.build-affinity { display:inline-flex;align-items:center;gap:5px;text-transform:capitalize;color:var(--muted);font-size:12px; }
.build-affinity img { width:22px;height:22px;object-fit:contain; }
.build-dps { display:flex;flex-direction:column;align-items:end;flex-shrink:0; }
.build-dps strong { color:var(--gold);font:36px var(--ui-font-heading);font-variant-numeric:tabular-nums; }
.build-dps span,.build-assumptions { color:var(--muted);font-size:11px; }
.build-assumptions { margin:12px 0 20px; }
#build-summary { display:flex;flex-wrap:wrap;gap:12px 24px;margin:0;padding:0 0 14px;border-bottom:1px solid var(--line); }
#build-summary dt { color:var(--muted);font-size:11px; }
#build-summary dd { margin:5px 0 0;color:var(--ui-text);font-size:16px; }
#build-skills { display:grid;grid-template-columns:1fr 1fr;gap:0 20px; }
.build-skill { display:grid;grid-template-columns:12px 46px minmax(0,1fr);align-items:start;gap:9px;padding:17px 0;border-bottom:1px solid var(--line); }
.build-slot-number { padding-top:15px;color:var(--muted);font-size:10px; }
.build-skill-art { width:46px;height:46px;object-fit:contain;border-radius:7px;background:var(--ui-control-surface); }
.build-skill-body { display:flex;flex-direction:column;gap:7px;min-width:0; }
.build-skill strong { color:var(--ui-heading);font:16px var(--ui-font-heading); }
.build-skill small { color:var(--muted);font-size:11px;line-height:1.5; }
.build-child { display:flex;align-items:center;gap:6px;color:var(--gold);font-size:11px; }
.build-more { margin-top:18px;color:var(--muted);font-size:12px; }
.build-more summary { cursor:pointer;color:var(--ui-text); }
#build-equipment,#build-allocations { display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;padding-top:15px; }
#build-allocations section { display:flex;flex-direction:column;gap:5px; }
#build-allocations strong { color:var(--gold); }
.builds-footer { display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding-top:10px;border-top:1px solid var(--line);flex-shrink:0; }
#build-status { flex:1 1 160px;min-width:0;min-height:24px;max-height:54px;color:var(--gold);font-size:12px;overflow:auto; }
#builds-search { flex:0 1 300px; }
@media(max-width:900px) { .builds-layout { grid-template-columns:180px minmax(0,1fr);gap:14px; } #build-skills { grid-template-columns:1fr; } .build-preview-heading { flex-wrap:wrap; } .builds-toolbar { flex-wrap:wrap;gap:10px; } .build-name-control { flex:1 1 240px;max-width:320px; } .build-actions { margin-left:0; } .build-mini-skills .build-mini-art { width:18px;height:18px; } }
@media(max-width:560px) { .builds-layout { grid-template-columns:1fr;grid-template-rows:128px minmax(0,1fr); } #build-library { flex-direction:row;border-right:0;border-bottom:1px solid var(--line);padding:0 0 10px; } .build-entry { width:155px;padding:10px;gap:5px; } .build-entry strong { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;flex-shrink:0; } .build-name-control { flex-basis:100%;max-width:none; } #build-equipment,#build-allocations { grid-template-columns:1fr; } .build-dps strong { font-size:28px; } #builds-search { flex-basis:100%; } }
.skill-unavailable .skill-pick { cursor:default; }


/* Short viewports keep the collection scrollable. */


/* A stable shared-frame meter; skill rows and rules scroll inside it. */
.heading-actions { display:flex;align-items:center;gap:16px; }
.dps-panel { width:min(1080px,calc(100vw - 32px));--ui-window-height:min(740px,calc(100dvh - 32px)); }
.dps-layout { display:grid;grid-template-columns:280px minmax(0,1fr);gap:24px;overflow:hidden; }
.dps-results { display:flex;flex-direction:column;min-width:0;min-height:0; }
.dps-bonuses { padding:20px 16px 12px 0;border-right:1px solid var(--line); }
.dps-bonuses h3 { margin:0;color:var(--ui-heading);font:20px var(--ui-font-heading); }
.dps-bonuses>p { color:var(--muted);font-size:11px;margin:7px 0 14px; }
.dps-bonus { display:grid;grid-template-columns:16px 32px minmax(0,1fr);align-items:start;gap:9px;padding:16px 0;border-bottom:1px solid var(--line);cursor:pointer; }
.dps-bonus input { width:15px;height:15px;margin:3px 0;accent-color:var(--gold);cursor:pointer; }
.skill-option { display:flex;align-items:flex-start;gap:9px;padding:10px 0;font-size:12px;color:var(--ui-heading);cursor:pointer; }
.skill-option input { flex:0 0 15px;width:15px;height:15px;margin:1px 0;accent-color:var(--gold);cursor:pointer; }
.dps-bonus img { width:32px;height:32px;object-fit:contain; }
.dps-bonus-body { display:flex;flex-direction:column;gap:5px;font-size:12px; }
.dps-bonus-body strong { color:var(--ui-heading);font:15px var(--ui-font-heading); }
.dps-bonus-body small { color:var(--muted);font-size:11px;line-height:1.5; }
.dps-bonus:has(input:not(:checked)) .dps-bonus-body { opacity:.5; }
.dps-summary { display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 0 12px; }
.dps-summary>div { display:flex;align-items:baseline;gap:12px; }
.dps-summary strong { color:var(--gold);font:42px var(--ui-font-heading);font-variant-numeric:tabular-nums; }
.dps-summary span,.dps-summary label { color:var(--muted);font-size:12px; }
.dps-summary label { display:flex;align-items:center;gap:10px; }
.dps-summary select { color:var(--ui-text);background:var(--ui-control-surface);border:1px solid var(--ui-control-line);border-radius:var(--ui-control-radius);padding:7px;font:inherit; }
.dps-overview { display:flex;gap:28px;margin:0;padding:0 0 20px;border-bottom:1px solid var(--line); }
.dps-overview dt { color:var(--muted);font-size:11px; }
.dps-overview dd { color:var(--ui-text);font-variant-numeric:tabular-nums;margin:5px 0 0;font-size:15px; }
.dps-content { margin-top:12px; }
.dps-contribution { position:relative;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;width:100%;padding:14px 8px 20px;text-align:left; }
.dps-contribution img { width:42px;height:42px;object-fit:contain;border-radius:6px; }
.dps-identity,.dps-values { display:flex;flex-direction:column;gap:5px;min-width:0; }
.dps-skill-name { color:var(--ui-heading);font:17px var(--ui-font-heading); }
.dps-contribution small { color:var(--muted);font:11px var(--ui-font-body); }
.dps-values { text-align:right;font-variant-numeric:tabular-nums; }
.dps-values strong { color:var(--gold);font-size:17px; }
.dps-share { position:absolute;bottom:7px;left:64px;right:8px;height:3px;background:var(--ui-line); }
.dps-share>span { display:block;height:100%;background:var(--gold);opacity:.65; }
.dps-method { margin:18px 6px 12px;color:var(--muted);font-size:12px; }
.dps-method summary { cursor:pointer;color:var(--ui-text); }
.dps-method ul { padding-left:18px;line-height:1.7; }
.dps-empty { color:var(--muted);padding:20px 4px; }
@media(max-width:800px) {
  .dps-layout { display:block;overflow:auto;scrollbar-gutter:stable;overflow-anchor:none; }
  .dps-bonuses { border-right:0;border-bottom:1px solid var(--line);padding-right:0;overflow:visible; }
  #dps-bonus-options { display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:0 16px; }
  .dps-results .dps-content { overflow:visible;flex:none; }
}
@media(max-width:560px) { .dps-summary strong { font-size:30px; } .dps-summary label { flex-direction:column;align-items:flex-end;gap:3px; } .dps-contribution { grid-template-columns:32px minmax(0,1fr); } .dps-contribution img { width:32px;height:32px;grid-row:1/3; } .dps-values { grid-column:2;text-align:left; } .dps-share { left:52px; } .dps-panel .panel-footer { font-size:10px; } }

/* Skill summaries expose authored mechanics on demand without moving the menu frame. */
.modifier-disclosure { width:100%; min-width:0; overflow-anchor:none; }
.modifier-toggle { color:var(--muted); font-size:11px; text-align:left; margin:0 0 6px; }
.modifier-content[hidden] { display:none !important; }
.node-tip .modifier-content { border-top:0; padding-top:5px; }
.skill-detail-tip>* { flex-shrink:0; }
.tags-disclosure { width:100%; min-width:0; overflow-anchor:none; border-top:1px solid var(--line); padding-top:8px; }
.tags-toggle { color:var(--muted); font-size:11px; text-align:left; margin:0 0 6px; }
.detail-content[hidden] { display:none !important; }
.component-tag-list { display:flex; flex-direction:column; gap:12px; padding:4px 0 12px; }
.component-tag-row { min-width:0; }
.component-tag-row>strong { display:block; font-size:12px; font-weight:600; color:var(--text); margin-bottom:5px; }
.component-tag-row .skill-hit-tags { margin:0; gap:5px; }

/* Compact actions float independently of fixed menu frames. */
.skill-equip { font-size:10px;padding:4px 7px;min-height:26px; }
.skill-action-popup { position:fixed;inset:auto;margin:0;width:max-content;max-width:min(280px,calc(100vw - 16px));padding:12px;box-sizing:border-box;color:var(--ui-heading); }
.skill-action-popup:popover-open { display:flex;flex-direction:column;gap:8px; }
.skill-action-popup>strong { font-family:var(--ui-font-heading);font-size:16px; }
.equip-slot-grid { display:grid;grid-template-columns:repeat(3,58px);gap:6px; }
.equip-slot-choice { display:flex;align-items:center;justify-content:center;gap:4px;height:44px;padding:4px; }
.equip-slot-choice img { width:28px;height:28px;object-fit:contain; }
.equip-slot-choice[aria-pressed="true"] { border-color:var(--gold);color:var(--gold); }

/* Selected inspection is stronger than equipped/socketed state, without moving cards. */
.skill-card.skill-inspected { --skill-state-rgb:248,211,137;border-color:var(--gold);box-shadow:0 0 12px #eac77855; }
.skill-card.skill-inspected>.skill-state-shimmer { display:block; }
.skill-card.skill-inspected>.skill-state-shimmer::before { background:linear-gradient(110deg,transparent,rgba(var(--skill-state-rgb),.4),transparent);animation-duration:3s;animation-delay:0s; }
.skill-card.skill-inspected::after { content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:rgba(var(--skill-state-rgb),.1);animation:skill-selected-pulse 2.4s ease-in-out infinite; }
@keyframes skill-selected-pulse { 0%,100% {opacity:.25;} 50% {opacity:1;} }
.skill-card-actions { gap:2px; }
.skill-card-actions .tree-arrow,.skill-equip { flex-shrink:0;width:25px;height:27px;min-height:0;padding:4px; }
.skill-equip { display:grid;place-items:center;border:0;background:url('/assets/thalassai-icon-socket.png') center/contain no-repeat;color:var(--gold); }
.skill-equip svg { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round; }
.skill-equip:hover { filter:brightness(1.4); }
@media(prefers-reduced-motion:reduce){.skill-card.skill-inspected::after {animation:none;opacity:.5;}.skill-card.skill-inspected>.skill-state-shimmer::before {animation:none;opacity:0;}}
