/* Rune Links stays in the unified Daily Six shell; the glowing network is the hero. */
body[data-game="rune"]:has(.rune-links){background:linear-gradient(#11132552,#0d102443),url("./assets/runes/forge/rune-forge-room.webp") center top/cover fixed no-repeat}
.game-view.daily-game-screen.rune-links{background:transparent;border:0;box-shadow:none;--daily-side-width:280px}
.rune-links::before{display:none}
.rune-links-main{max-width:760px;width:100%;justify-self:center}
.rune-links-objective{text-align:center;margin:0 0 15px;padding:10px 15px;border:3px solid #242439;border-radius:12px;color:#fff2ca;background:linear-gradient(#4c4261,#27273e);box-shadow:0 3px #111626;font-weight:950;font-size:.84rem;letter-spacing:.04em;text-shadow:0 2px #090e1c}
.rune-links-frame{position:relative;padding:13px;border:9px solid #75667f;border-radius:28px;background:repeating-linear-gradient(35deg,#5e5266 0 70px,#43394e 71px 75px,#817089 77px 80px);box-shadow:0 0 0 4px #1a1429,inset 0 0 0 3px #b5938d,inset 0 -5px #bd7d40,0 9px 0 #070c17,0 0 24px #ff9a242e}
.rune-links-frame::before,.rune-links-frame::after{position:absolute;z-index:4;top:-3px;width:18px;height:18px;border:3px solid #c2a37d;background:#4b455f;transform:rotate(45deg);content:"";pointer-events:none}.rune-links-frame::before{left:12px}.rune-links-frame::after{right:12px}
.rune-links-grid{position:relative;width:100%;aspect-ratio:1;border:4px solid #bb7839;border-radius:13px;background:#070d1e;box-shadow:0 0 0 4px #1a1226,inset 0 0 20px #000;touch-action:none;user-select:none;-webkit-user-select:none;isolation:isolate}
.links-cell{position:absolute;z-index:auto;left:calc(var(--col)*20%);top:calc(var(--row)*20%);width:20%;height:20%;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:crosshair;color:var(--rune-color);touch-action:none;user-select:none}
.links-cell::before{position:absolute;inset:2%;border:2px solid #61647c;border-radius:10%;background:linear-gradient(140deg,#4b4f68,#242b45 63%,#26243c);box-shadow:inset 2px 2px #89869b55,inset -3px -3px #11192b,0 2px #000;content:"";transition:background 100ms}
.links-cell.is-painted::before{background:radial-gradient(circle,color-mix(in srgb,var(--rune-color) 14%,#232b43),#1d2339);border-color:color-mix(in srgb,var(--rune-color) 35%,#4a5265)}
.links-cell:hover::before{border-color:#b8b3d2}.links-cell:focus-visible{outline:3px solid #fff3ac;outline-offset:-5px;z-index:auto}
.links-cell:disabled{opacity:1;cursor:default}
.links-path-layer{position:absolute;z-index:2;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.links-wire polyline{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke:var(--rune-color)}
.links-wire-halo{stroke-width:42;opacity:.35;filter:blur(6px)}.links-wire-core{stroke-width:24;filter:drop-shadow(0 0 5px var(--rune-color))}.links-wire .links-wire-shine{stroke-width:5;stroke:#ffffff8c}
.links-rune-stone{position:absolute;z-index:3;inset:9%;display:grid;place-items:center;border:4px solid color-mix(in srgb,var(--rune-color) 75%,white);border-radius:24%;background:radial-gradient(circle,color-mix(in srgb,var(--rune-color) 25%,#152234),#0a162a 85%);box-shadow:inset 0 0 0 3px #1b2031,inset 0 0 15px var(--rune-color),0 0 12px color-mix(in srgb,var(--rune-color) 65%,transparent);clip-path:polygon(20% 0,80% 0,100% 20%,100% 80%,80% 100%,20% 100%,0 80%,0 20%);pointer-events:none}
.links-glyph{display:block;width:66%;height:66%;color:inherit;filter:drop-shadow(0 0 4px var(--rune-color));pointer-events:none}
.is-endpoint .links-rune-stone{z-index:4;border-width:5px;box-shadow:inset 2px 3px 2px #ffffff88,inset -4px -5px 2px #040d25,inset 0 0 16px var(--rune-color);filter:drop-shadow(0 5px 1px #060a18) drop-shadow(0 0 4px var(--rune-color))}
/* Flat floor engravings sit below the SVG path layer (z=2); endpoints sit above it. */
.links-forge-mark{position:absolute;z-index:1;inset:15%;display:grid;place-items:center;border:2px solid color-mix(in srgb,var(--rune-color) 55%,#343047);border-radius:50%;background:radial-gradient(circle,#111a2844,transparent 75%);box-shadow:inset 1px 2px 3px #080d23,0 1px #ffffff18;color:var(--rune-color);opacity:.68;pointer-events:none}
.links-forge-mark::before{position:absolute;inset:-9%;content:"";border:1px dashed currentColor;border-radius:50%;opacity:.6}
.links-forge-mark .links-glyph{width:66%;height:66%;filter:drop-shadow(0 1px #050b18);stroke-width:3}
.is-mark-touched .links-forge-mark{opacity:.8;box-shadow:inset 0 0 10px color-mix(in srgb,var(--rune-color) 25%,transparent)}
.is-mark-satisfied .links-forge-mark{opacity:1;border-color:var(--rune-color);box-shadow:inset 0 0 12px color-mix(in srgb,var(--rune-color) 30%,transparent),0 0 10px color-mix(in srgb,var(--rune-color) 40%,transparent)}
.links-mark-check{position:absolute;z-index:5;right:7%;top:5%;padding:0 3px;border:1px solid #4c6729;border-radius:50%;color:#1b321a;background:#efffae;font-size:.75rem;font-weight:900;pointer-events:none}
.is-pair-powered .links-rune-stone{background:radial-gradient(circle,color-mix(in srgb,var(--rune-color) 40%,#152234),#0a162a 85%);filter:brightness(1.16) drop-shadow(0 4px 1px #060a18) drop-shadow(0 0 8px var(--rune-color))}
.links-wire.is-powered .links-wire-halo{opacity:.52}.links-wire.is-powered .links-wire-core{filter:drop-shadow(0 0 8px var(--rune-color))}.links-wire.is-powered .links-wire-shine{stroke:#ffffffb3}
.links-wire .links-energy-pulse{stroke:#fff6ce;stroke-width:12;stroke-dasharray:.13 .87;filter:drop-shadow(0 0 8px white);animation:links-power-flow 600ms linear both}
.is-powering.is-endpoint .links-rune-stone{animation:links-endpoint-power 600ms ease-out both}
.is-powering.is-rune-mark .links-forge-mark{animation:links-mark-flash 180ms ease-out var(--mark-delay) both}
.is-powering.is-rune-mark .links-forge-mark::after{position:absolute;inset:-10%;content:"✦";text-align:right;color:#fff4b8;animation:links-sparkle 220ms ease-out var(--mark-delay) both}
.is-missed-pair .links-rune-stone{animation:links-missed-pair 450ms ease-out both}.is-mark-missing .links-forge-mark{opacity:1;outline:2px solid #ffbd62;outline-offset:3px;animation:links-missing-mark 500ms ease-out both}
.rune-links-objective.is-power{color:#ffec9a;border-color:#b59250;background:linear-gradient(#50513c,#242c3f)}.rune-links-objective.is-missing-mark{color:#ffe3ad;border-color:#c78242}
.rune-links-progress.is-pair-forged strong:first-child{animation:links-counter-pop 140ms ease-out 450ms both}
.rune-links-mark-key{display:flex;align-items:center;justify-content:center;gap:17px;margin:18px 0 0;padding:12px 15px;border:2px solid #9b875f;border-radius:12px;background:#fff0c9;color:#263a50;font-size:.75rem;line-height:1.5;box-shadow:0 3px #10182b}.rune-links-mark-key .links-forge-mark{position:relative;inset:auto;flex:none;width:46px;height:46px;opacity:.9;background:#20273d}.rune-links-mark-key p{margin:0}.rune-links-mark-key strong{color:#223a50}
@keyframes links-power-flow{0%{stroke-dashoffset:1;opacity:0}12%,82%{opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes links-endpoint-power{0%{filter:brightness(1.45) drop-shadow(0 0 9px var(--rune-color))}55%{transform:scale(1.02)}75%{transform:scale(1.09);filter:brightness(1.8) drop-shadow(0 0 15px var(--rune-color))}100%{transform:scale(1)}}
@keyframes links-mark-flash{0%{filter:brightness(1)}45%{filter:brightness(2.7);box-shadow:0 0 20px var(--rune-color)}100%{filter:brightness(1)}}
@keyframes links-sparkle{0%{opacity:0;transform:scale(.7)}40%{opacity:1}100%{opacity:0;transform:scale(1.35)}}
@keyframes links-missed-pair{0%,100%{filter:brightness(1)}40%{filter:brightness(1.5) drop-shadow(0 0 12px #ff663b)}}
@keyframes links-missing-mark{0%,100%{filter:brightness(1)}40%{filter:brightness(2);box-shadow:0 0 17px #ff9f44}}
@keyframes links-counter-pop{50%{color:#fff1a2;transform:scale(1.1)}}
.links-cell.is-path-head::before{border:3px solid #fff1a2;box-shadow:inset 0 0 13px #ffdf6d,0 0 10px #ffdc63}.links-head-dot{position:absolute;z-index:3;left:42%;top:42%;width:16%;height:16%;border:2px solid #fff;border-radius:50%;background:var(--rune-color);pointer-events:none}
.links-wire.is-hint .links-wire-core{stroke-width:13;stroke-dasharray:12 17;stroke:#fff1a2;animation:links-hint-flow 1.2s linear infinite}.links-wire.is-hint .links-wire-shine{display:none}.links-wire.is-hint .links-wire-halo{opacity:.5}
.rune-links-frame.is-forged{box-shadow:0 0 0 4px #1a1429,inset 0 0 0 3px #ffe4a4,0 6px #070c17,0 0 28px #fbc94d77}
.rune-links-progress{display:flex;justify-content:center;gap:20px;flex-wrap:wrap;margin:15px 0 0;padding:11px 13px;border:3px solid #625b71;border-radius:10px;color:#f3e4bc;background:linear-gradient(#263047,#111a2f);box-shadow:0 3px #0c1120;text-align:center;font-size:.8rem}.rune-links-progress strong{color:#fff6d3;font-size:1.05rem}
.rune-links-controls{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:13px;margin:19px 0 0}.links-tool{display:flex;align-items:center;justify-content:center;gap:9px;min-height:69px;padding:10px 12px;border:4px solid #958293;border-radius:16px;color:#fff4ca;background:linear-gradient(#64556f,#302d48);box-shadow:0 0 0 2px #1b1425,inset 0 0 0 1px #b59d9c,0 5px #0a1020;cursor:pointer;text-shadow:0 2px #12182b;font-size:1rem}.links-tool>span{color:#ffcf4f;font-size:2.1rem;line-height:1;filter:drop-shadow(0 2px #5a300c)}.links-tool strong{display:grid;gap:3px;line-height:1.1}.links-tool small{font-size:.62rem;letter-spacing:.05em}.links-tool.reset-tool{border-color:#ffcb57;background:linear-gradient(#f3b340,#a1480e)}.links-tool:hover:not(:disabled){filter:brightness(1.15)}.links-tool:focus-visible{outline:3px solid #7ae5ff;outline-offset:4px}.links-tool:disabled{opacity:.5;cursor:default}
.rune-links-input-help{text-align:center;color:#ddd7e7;font-size:.76rem;margin:16px 0 0;line-height:1.5;text-shadow:0 2px #0a1124}.rune-links-input-help small{display:block;color:#cabcd6;margin-top:3px}.rune-links-hint-note{margin:10px 0 0;color:#fff1a2;text-align:center;font-size:.78rem;font-weight:800}
.game-view.daily-game-screen.rune-links .daily-tracker.rune-energy{width:280px;min-height:0;padding:15px 17px;text-align:center;gap:8px}.rune-energy .daily-tracker-label{font-size:.8rem;color:#4e3923}.rune-energy-value{font-size:3.1rem;line-height:1.05;color:#142a42;letter-spacing:-.04em}.rune-energy-value small{font-size:1.65rem;color:#66513c;letter-spacing:-.03em}.rune-energy-meter{position:relative;height:19px;overflow:hidden;border:2px solid #6e5436;border-radius:12px;background:#142f4c;box-shadow:inset 0 2px 3px #081325}.rune-energy-meter>span{display:block;height:100%;background:linear-gradient(#d9fc69,#89c820);box-shadow:0 0 7px #edff98;transition:width 140ms ease}.rune-energy-meter>i{position:absolute;top:-1px;bottom:0;width:2px;background:#fff1c9}.rune-energy-tiers{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.rune-energy-tiers>span{display:grid;gap:3px;justify-items:center}.rune-energy-tiers b{font-size:1.05rem;color:#ecb627;line-height:1;-webkit-text-stroke:.5px #8a5b25}.rune-energy-tiers small{font-weight:900;font-size:.8rem;color:#3a403d}.rune-energy-tiers .is-spent b{color:#9a9389;-webkit-text-stroke:0}.rune-energy-range{font-size:.63rem;color:#765a32;font-weight:850}.energy-tier-2 .rune-energy-meter>span{background:linear-gradient(#ffe273,#d8ad27)}.energy-tier-1 .rune-energy-meter>span{background:linear-gradient(#ffbd78,#dc7a36)}.energy-tier-0 .rune-energy-meter>span{background:linear-gradient(#c3b8df,#80769e)}
.rune-links .rune-links-rules{display:grid;gap:12px;list-style:none;margin:18px 0 0;padding:0}.rune-links-rules li{display:flex;align-items:center;gap:10px;font-weight:850;font-size:.86rem;line-height:1.3}.rune-links-rules b{display:grid;place-items:center;flex:none;width:29px;height:29px;border:2px solid #8c6d43;border-radius:8px;background:#efdcad;color:#50405c}.rune-links-math{border-top:1px solid #d5b987;padding-top:14px;font-size:.72rem!important;color:#796142!important;line-height:1.55!important}.rune-links-math strong{color:#354858}.rune-links .reaction-copy .links-solved-title{color:#51670c}
@keyframes links-hint-flow{to{stroke-dashoffset:-29}}
@media(max-width:800px){.rune-links-main{max-width:620px}.rune-links-objective{font-size:.76rem}.rune-links .daily-side-panel .rune-links-rules{grid-template-columns:1fr 1fr}.game-view.daily-game-screen.rune-links .daily-tracker.rune-energy{width:230px;padding:12px}.rune-energy-value{font-size:2.7rem}.rune-energy-value small{font-size:1.3rem}}
@media(max-width:560px){.game-view.daily-game-screen.rune-links{--daily-side-width:174px}.game-view.daily-game-screen.rune-links .daily-tracker.rune-energy{width:174px;padding:10px 9px;gap:6px}.rune-energy .daily-tracker-label{font-size:.61rem}.rune-energy-value{font-size:2.1rem}.rune-energy-value small{font-size:1.1rem}.rune-energy-meter{height:14px}.rune-energy-tiers b{font-size:.76rem}.rune-energy-tiers small{font-size:.62rem}.rune-energy-range{font-size:.5rem}.rune-links-frame{padding:7px;border-width:6px;border-radius:18px}.rune-links-grid{border-width:3px;border-radius:9px}.links-cell::before{border-width:1px}.links-rune-stone{border-width:3px}.is-rune-mark .links-rune-stone{inset:14%;border-width:2px}.links-mark-corner{font-size:.48rem}.links-mark-check{font-size:.55rem}.rune-links-controls{gap:9px;margin-top:16px}.links-tool{min-height:61px;padding:8px 5px;gap:4px;border-width:3px;border-radius:12px;font-size:.84rem}.links-tool>span{font-size:1.65rem}.links-tool small{font-size:.52rem}.rune-links-objective{font-size:.68rem;padding:9px 8px;margin-bottom:12px}.rune-links-progress{gap:12px;padding:9px;font-size:.7rem}.rune-links-progress strong{font-size:.9rem}.rune-links-input-help{font-size:.7rem}.rune-links .daily-side-panel .rune-links-rules{grid-template-columns:1fr}.rune-links-frame::before,.rune-links-frame::after{width:12px;height:12px;border-width:2px}}
@media(max-width:360px){.game-view.daily-game-screen.rune-links .daily-tracker.rune-energy{width:151px}.game-view.daily-game-screen.rune-links .daily-game-heading{gap:9px}.game-view.daily-game-screen.rune-links .daily-game-heading h1{font-size:2.2rem}.rune-energy-tiers b{font-size:.65rem}.rune-energy-value{font-size:1.9rem}.rune-energy-range{font-size:.48rem}}
@media(prefers-reduced-motion:reduce){.links-wire.is-hint .links-wire-core{animation:none}.rune-energy-meter>span,.links-cell::before{transition:none}}
@media(prefers-reduced-motion:reduce){.links-energy-pulse{display:none}.rune-links-grid .links-cell .links-rune-stone,.rune-links-grid .links-forge-mark,.rune-links-grid .links-forge-mark::after,.rune-links-progress strong{animation:none!important}.is-powering .links-forge-mark::after{display:none}}

.links-cell:hover:not(:disabled) { transform:none; filter:none; }
.links-cell.is-unfilled::before{border-width:3px;border-color:#ffdc7c;box-shadow:inset 0 0 0 1px #ffdf8caa,0 0 11px #ffcd5788;animation:links-empty-nudge 1.5s ease-in-out infinite}
.is-forge-mark-needed .links-forge-mark{opacity:1;outline:2px solid var(--rune-color);outline-offset:3px;animation:links-forge-nudge 1.5s ease-in-out infinite}
.rune-links-modal-backdrop{position:fixed;z-index:1200;inset:0;display:grid;place-items:center;padding:16px;background:#03091b66}
.rune-links-validation{position:relative;width:min(430px,100%);max-height:calc(100dvh - 32px);overflow:auto;padding:0 25px 25px;border:12px solid #63526e;border-radius:28px;background:radial-gradient(ellipse at 50% 30%,#fff8dd,#f5d69c);color:#543d3b;box-shadow:0 0 0 3px #241c36,inset 0 0 0 3px #b99569,inset 0 0 0 7px #efcf9d,0 10px 0 #090d21,0 16px 40px #0009;text-align:center}
.rune-check-kicker{display:flex;justify-content:center;gap:14px;margin:0 -10px 19px;padding:13px 12px;border:3px solid #d2a64e;border-top:0;border-radius:0 0 17px 17px;background:linear-gradient(#4a3a60,#252742);box-shadow:0 3px #694531;color:#ffe3a0;font-size:.85rem;font-weight:950;letter-spacing:.09em;text-transform:uppercase}
.rune-check-kicker span{color:#ffc347}.rune-links-validation h2{margin:0 0 19px;color:#39213e;font:900 clamp(1.8rem,6vw,2.35rem)/1.05 Georgia,serif;letter-spacing:-.03em}.rune-links-validation p{line-height:1.45}.rune-check-problem{font-size:1.05rem;font-weight:900}.rune-check-encouragement{margin:18px 0;color:#654170;font:italic 900 1.25rem Georgia,serif}
.rune-check-continue{width:100%;min-height:53px;padding:12px 17px;border:4px solid #e2b958;border-radius:13px;background:linear-gradient(#8a469b,#57216e);box-shadow:0 0 0 2px #34233d,inset 0 2px #e7aaff77,0 4px #402442;color:#fff2cb;font:900 1.25rem Georgia,serif;cursor:pointer;text-shadow:0 2px #2c153f}.rune-check-continue:hover{filter:brightness(1.12)}.rune-check-continue:focus-visible{outline:3px solid #142b45;outline-offset:5px}
@keyframes links-empty-nudge{50%{box-shadow:inset 0 0 0 1px #ffdf8ccc,0 0 15px #ffcd57bb}}
@keyframes links-forge-nudge{50%{filter:brightness(1.5);box-shadow:0 0 14px var(--rune-color)}}
@media(max-width:400px){.rune-links-validation{padding:0 18px 21px;border-width:9px;border-radius:22px}.rune-links-validation h2{margin-bottom:15px}.rune-check-problem{font-size:.95rem}.rune-check-kicker{margin-bottom:16px;font-size:.75rem}.rune-links-validation #rune-check-description{font-size:.9rem}}
@media(prefers-reduced-motion:reduce){.links-cell.is-unfilled::before,.is-forge-mark-needed .links-forge-mark{animation:none}}
@media(max-width:640px) {
  .rune-links .daily-game-status { flex-direction:row; }
}
/* Keep the network and controls close to the shared header on wide screens. */
@media(min-width:1000px) {
  .rune-links-main { max-width:620px; }
  .game-view.daily-game-screen.rune-links .daily-game-heading { align-items:start; }
  .rune-links .daily-game-status { gap:8px; }
  .game-view.daily-game-screen.rune-links .daily-tracker.rune-energy { padding:12px 15px; gap:6px; }
  .rune-energy-value { font-size:2.6rem; }
  .rune-energy-value small { font-size:1.3rem; }
  .rune-energy-tiers b { font-size:.9rem; }
  .rune-energy-tiers small { font-size:.72rem; }
  .rune-energy .daily-tracker-label { font-size:.7rem; }
  .rune-energy-range { font-size:.57rem; }
}
