/* Night Watch (client/panels-nightwatch.js) — moonlit gunmetal: indigo night sky, moon gold, core cyan, rust red for the horde. */
.nw-root { --us: #4a9be0; --us2: #1f4f8a; --them: #d0503a; --them2: #8a2a1a; --moon: var(--c-amber-hi); --arc: #58d6ff;
  min-height: 100%; display: flex; flex-direction: column; margin: -12px -12px 0;
  background: radial-gradient(ellipse at 50% 0%, #4a5068, #1a1d2a 70%); }
.nw-root.night { background: radial-gradient(ellipse at 50% 0%, #2f3768, #10121f 70%); }
#panel .pn-wrap.nw-root { padding-bottom: 0; min-height: calc(100% + 12px); }
.nw-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px;
  background: radial-gradient(1px 1px at 12% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 31% 68%, #cfd8ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 54% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 60%, #cfd8ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 34%, #fff 50%, transparent 51%), linear-gradient(#1c2146, #12142a);
  border-bottom: 3px solid var(--moon); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.nw-head .tt { flex: 1; min-width: 0; display: grid; }
.nw-head .tt b { font: 900 20px/1.15 system-ui; color: var(--moon); text-shadow: 0 2px 0 #000; letter-spacing: .02em; }
.nw-head .tt small { color: #c9d1e8; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-help { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 2px solid var(--moon); background: #1a1d36; color: var(--moon); font: 900 18px/1 system-ui; }
.nw-body { flex: 1; display: grid; align-content: start; gap: 12px; padding: 12px 12px 16px; }
.nw-body .pn-empty { color: #c9d1e8; }

/* shared bits */
.nw-card { padding: 12px; border-radius: 14px; background: linear-gradient(#262b3c, #1a1e2b); border: 1px solid #3a4258; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); display: grid; gap: 10px; }
.nw-card .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.nw-card h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--moon); }
.nw-sub { margin: 0; font-size: 12px; line-height: 1.35; color: #aab4cc; }
.nw-pill { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; background: #2a3044; color: #aab4cc; font: 800 11px/1.3 system-ui; white-space: nowrap; }
.nw-pill.good { background: #1f3a1c; color: var(--c-good-hi); } .nw-pill.warn { background: #3d3212; color: var(--c-amber-hi); } .nw-pill.bad { background: #3a1f1a; color: #ff8a6a; } .nw-pill.off { color: #8791a8; }
.nw-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nw-chip { padding: 3px 9px; border-radius: 999px; background: #10131f; border: 1px solid #3a4258; font-size: 13px; white-space: nowrap; }
.nw-costs { display: flex; flex-wrap: wrap; gap: 5px; }
.nw-cost { padding: 3px 8px; border-radius: 8px; background: #10131f; border: 1px solid #3a4258; font: 700 12px/1.3 system-ui; white-space: nowrap; }
.nw-cost.no { color: #ff8a6a; border-color: #7a3a30; }
.nw-wide { width: 100%; min-height: 44px; font-weight: 800; }
.nw-root .bad { color: #ff8a6a; } .nw-root .dim { color: #8791a8; }

/* watch: clock */
.nw-clock { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, #f0b43c33, #262b3c 60%); border: 1px solid #6a5a34; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.nw-clock.night { background: linear-gradient(135deg, #3b44a055, #161a2e 60%); border-color: #4a54a8; }
.nw-dial { position: relative; width: 116px; height: 116px; border-radius: 50%; box-shadow: 0 0 0 3px #10131f, 0 0 0 5px #59637d, 0 6px 14px rgba(0,0,0,.5); }
.nw-dial.night { box-shadow: 0 0 0 3px #10131f, 0 0 0 5px #6d78d8, 0 0 22px rgba(109,120,216,.55); }
.nw-hand { position: absolute; left: 50%; top: 0; width: 4px; height: 50%; margin-left: -2px; transform-origin: 50% 100%; }
.nw-hand::before { content: ''; position: absolute; left: -4px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #10131f, 0 0 10px #fff; }
.nw-mark { position: absolute; z-index: 2; width: 22px; height: 22px; margin: -11px 0 0 -11px; display: grid; place-items: center; font-size: 13px; border-radius: 50%; background: #3a1f1a; box-shadow: 0 0 0 2px #ff8a6a; }
.nw-dial-mid { position: absolute; inset: 13px; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 1px; background: radial-gradient(circle at 50% 35%, #2c3350, #12152a); box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.nw-dial-mid span { font-size: 30px; line-height: 1.1; } .nw-dial-mid b { font: 900 13px/1 system-ui; color: #fff; letter-spacing: .08em; text-transform: uppercase; }
.nw-clock .tx { display: grid; gap: 6px; min-width: 0; }
.nw-clock .tx > small { font: 800 11px/1 system-ui; letter-spacing: .1em; color: var(--moon); }
.nw-clock .cd { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 10px; background: rgba(0,0,0,.4); }
.nw-clock .cd span { font-size: 12px; color: #d8deef; } .nw-clock .cd b { font: 900 15px/1 ui-monospace, Menlo, monospace; color: var(--moon); white-space: nowrap; }
.nw-clock .cd.raid b { color: #ff9a7a; }
.nw-clock .tx p { margin: 0; font-size: 12px; color: #aab4cc; }

/* watch: alerts */
.nw-alert { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 12px; text-align: left; color: #fff; border: 1px solid; }
.nw-alert > span { font-size: 22px; text-align: center; } .nw-alert b { display: block; font-size: 14px; } .nw-alert small { display: block; font-size: 12px; color: #d8deef; } .nw-alert small b { display: inline; font-size: 12px; }
.nw-alert > i { font: 800 12px/1 system-ui; font-style: normal; color: var(--moon); white-space: nowrap; }
.nw-alert.bad { background: linear-gradient(#4a1f1a, #2e1512); border-color: #c8553a; animation: nw-pulse 1.6s ease-in-out infinite; }
.nw-alert.warn { background: linear-gradient(#40340f, #2a220c); border-color: var(--c-amber-lo); }
.nw-alert.info { background: linear-gradient(#1d3050, #152238); border-color: #3f7fd1; }
@keyframes nw-pulse { 50% { box-shadow: 0 0 14px rgba(255,106,90,.55); } }

/* watch: forecast */
.nw-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.nw-vs small { display: block; font-size: 12px; color: #aab4cc; } .nw-vs b { font: 900 24px/1.1 system-ui; }
.nw-vs .us b { color: #8fc4f5; } .nw-vs .them { text-align: right; } .nw-vs .them b { color: #f5a08a; }
.nw-vs > span { font: italic 900 16px/1.6 system-ui; color: #fff; text-shadow: 0 0 8px #ff8a3a; }
.nw-pbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px #000; }
.nw-pbar .us { background: linear-gradient(#6fb0f0, var(--us)); } .nw-pbar .them { background: linear-gradient(#f08a6a, var(--them)); }
.nw-seg { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #10131f; gap: 1px; }
.nw-seg i { display: block; height: 100%; }
.nw-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: #d8deef; }
.nw-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.nw-warn { padding: 8px 10px; border-radius: 10px; background: #3a1f1a; border: 1px solid #c8553a; color: #ffb39a; font-size: 13px; }
.nw-rw { display: grid; gap: 5px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.07); } .nw-rw small { font-size: 12px; color: #aab4cc; }

/* watch: stance + record */
.nw-stances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nw-stance { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; min-height: 104px; border-radius: 12px; border: 0; color: #fff;
  background: linear-gradient(#3a4258, #262b3c); box-shadow: 0 0 0 2px #59637d, 0 4px 0 #12141f; }
.nw-stance:active { transform: translateY(2px); }
.nw-stance .ic { font-size: 28px; line-height: 1.1; } .nw-stance b { font: 800 12px/1.15 system-ui; text-align: center; }
.nw-stance small { font: 700 11px/1.2 system-ui; color: #aab4cc; } .nw-stance small.off { color: #ff8a6a; }
.nw-stance.on { background: linear-gradient(var(--c-amber-hi), #e3a03a); color: #2a1a04; box-shadow: 0 0 0 2px #fff3c8, 0 4px 0 #8a5a10, 0 0 14px rgba(255,215,106,.45); }
.nw-stance.on small { color: #5a3d08; } .nw-stance.on small.off { color: #8a2a1a; }
.nw-record { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.nw-record > div { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; background: #1c2030; border: 1px solid #343b50; }
.nw-record b { font: 900 16px/1.1 system-ui; color: #fff; white-space: nowrap; } .nw-record small { font-size: 10px; color: #aab4cc; }

/* core */
.nw-core { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 14px;
  background: radial-gradient(circle at 18% 50%, rgba(88,214,255,.22), transparent 55%), linear-gradient(135deg, #24304a, #171b2a); border: 2px solid #3f8fb0; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.nw-core.dark { background: linear-gradient(135deg, #2a2226, #15131a); border-color: #6a3a34; }
.nw-reactor { position: relative; width: 104px; height: 104px; display: grid; place-content: center; justify-items: center; }
.nw-reactor i { position: absolute; border-radius: 50%; }
.nw-reactor .r1 { inset: 0; border: 3px dashed rgba(88,214,255,.7); animation: nw-spin 9s linear infinite; }
.nw-reactor .r2 { inset: 12px; border: 2px solid rgba(255,215,106,.7); border-top-color: transparent; border-bottom-color: transparent; animation: nw-spin 6s linear infinite reverse; }
.nw-reactor .glow { inset: 24px; background: radial-gradient(circle, #eafcff, #58d6ff 45%, rgba(88,214,255,.15) 72%, transparent 74%); animation: nw-glow 2.4s ease-in-out infinite; }
.nw-reactor span { position: relative; font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 0 #000); } .nw-reactor b { position: relative; font: 900 13px/1.2 system-ui; color: #06202c; }
.nw-core.dark .r1, .nw-core.dark .r2 { border-color: #4a4048; animation: none; } .nw-core.dark .r2 { border-top-color: transparent; border-bottom-color: transparent; }
.nw-core.dark .glow { background: radial-gradient(circle, #3a3238, #1c181c 70%, transparent 72%); animation: none; } .nw-core.dark .nw-reactor b { color: #aab4cc; }
@keyframes nw-spin { to { transform: rotate(360deg); } } @keyframes nw-glow { 50% { transform: scale(1.1); filter: brightness(1.2); } }
.nw-core .tx { display: grid; gap: 6px; min-width: 0; }
.nw-core .top { display: flex; justify-content: space-between; align-items: center; gap: 6px; } .nw-core .top b { font: 900 18px/1.1 system-ui; color: #fff; }
.nw-core small { font-size: 12px; color: #d8deef; } .nw-core small b { font: 800 12px/1 ui-monospace, Menlo, monospace; color: var(--moon); }
.nw-fuel { position: relative; height: 24px; border-radius: 12px; overflow: hidden; background: #0c0e18; box-shadow: inset 0 0 0 1px #3a4258; }
.nw-fuel i { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 8px, transparent 8px 16px), linear-gradient(90deg, #2f9fc8, #58d6ff); transition: width .4s; }
.nw-fuel.low i { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 8px, transparent 8px 16px), linear-gradient(90deg, #c8712a, var(--c-amber-hi)); }
.nw-fuel span { position: absolute; inset: 0; display: grid; place-items: center; font: 900 13px/1 system-ui; color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.nw-fx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nw-fx > div { display: grid; justify-items: center; gap: 2px; padding: 9px 4px; border-radius: 12px; background: #1c2030; border: 1px solid #343b50; }
.nw-fx span { font-size: 20px; line-height: 1.1; } .nw-fx b { font: 900 16px/1.1 system-ui; } .nw-fx small { font-size: 11px; color: #aab4cc; }
.nw-fx .good b { color: var(--c-good-hi); } .nw-fx .bad b { color: #ff8a6a; } .nw-fx .bad { border-color: #6a3a34; }
.nw-buys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nw-buy { display: grid; justify-items: center; gap: 3px; min-height: 56px; padding: 8px 4px; border-radius: 12px; border: 0; color: #06202c; background: linear-gradient(#8fe6ff, #3fb4dc); box-shadow: 0 4px 0 #1a5f7a; }
.nw-buy.fill { background: linear-gradient(var(--c-amber-hi), #e3a03a); color: #2a1a04; box-shadow: 0 4px 0 #8a5a10; }
.nw-buy:active { transform: translateY(2px); } .nw-buy b { font: 900 16px/1 system-ui; } .nw-buy small { font: 800 12px/1 system-ui; } .nw-buy small.no { color: #a01a0a; }
.nw-cell { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.nw-cell .ic { font-size: 24px; text-align: center; } .nw-cell b { display: block; font-size: 14px; } .nw-cell small { font-size: 12px; color: #aab4cc; } .nw-cell button { min-height: 40px; min-width: 64px; }
.nw-gain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nw-gain > div { padding: 7px 8px; border-radius: 10px; background: #10131f; border: 1px solid #343b50; min-width: 0; }
.nw-gain small { display: block; font-size: 10px; color: #aab4cc; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-gain b { display: block; font: 800 14px/1.3 system-ui; color: #fff; } .nw-gain i { display: block; font: 800 13px/1.2 system-ui; font-style: normal; color: var(--c-good-hi); white-space: nowrap; }
.nw-prog { height: 14px; border-radius: 7px; overflow: hidden; background: #0c0e18; box-shadow: inset 0 0 0 1px #3a4258; } .nw-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-amber-lo), var(--c-amber-hi)); }
.nw-time { font: 900 15px/1 ui-monospace, Menlo, monospace; color: var(--moon); }

/* wall */
.nw-gate { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, #4a3f2c, #262b3c 70%); border: 1px solid #8a6a3a; }
.nw-gate .ic { font-size: 32px; text-align: center; } .nw-gate b { display: block; font-size: 15px; } .nw-gate small { font-size: 12px; color: #d8deef; } .nw-gate button { min-height: 40px; }
.nw-parts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 12px; border-radius: 12px; background: #1c2030; border: 1px dashed #59637d; font-size: 13px; }
.nw-parts b { color: var(--moon); } .nw-parts small { flex: 1 0 100%; font-size: 11px; color: #aab4cc; }
.nw-def { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 10px; border-radius: 14px; background: linear-gradient(#262b3c, #1a1e2b); border: 1px solid #3a4258; }
.nw-def.turret { border-left: 3px solid var(--arc); } .nw-def.trap { border-left: 3px solid #8fb26a; } .nw-def.fire { border-left: 3px solid #f08a3a; }
.nw-def > .ic { align-self: start; width: 60px; height: 68px; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 2px; background: radial-gradient(circle at 50% 30%, #3f4864, #171b2a); box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.nw-def > .ic span { font-size: 30px; line-height: 1.1; } .nw-def > .ic b { font: 900 12px/1 system-ui; color: var(--moon); }
.nw-def.unbuilt > .ic span { filter: grayscale(.9) brightness(.65); } .nw-def.dead > .ic { box-shadow: inset 0 0 0 2px #7a3a30; } .nw-def.dead > .ic span { filter: grayscale(.8) brightness(.6); }
.nw-def .tx { display: grid; gap: 5px; min-width: 0; }
.nw-def .nm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; } .nw-def .nm > b { font-size: 15px; }
.nw-def .tag { font: 800 9px/1 system-ui; letter-spacing: .08em; padding: 3px 5px; border-radius: 5px; background: #10131f; color: #aab4cc; }
.nw-def p { margin: 0; font-size: 12px; line-height: 1.3; color: #aab4cc; }
.nw-def .fx { font: 700 12px/1.3 system-ui; color: #fff; } .nw-def .fx i { font-style: normal; color: var(--c-good-hi); }
.nw-def .buy { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .nw-def .buy button { flex: 0 0 auto; min-height: 40px; min-width: 84px; font-weight: 800; }
.nw-def .nw-lock { font-size: 12px; white-space: nowrap; }

/* log */
.nw-raid { display: grid; gap: 5px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(#262b3c, #1a1e2b); border: 1px solid #3a4258; }
.nw-raid.win { box-shadow: inset 3px 0 0 var(--c-good); } .nw-raid.loss { box-shadow: inset 3px 0 0 var(--c-blood); }
.nw-raid .hd { display: flex; align-items: center; gap: 8px; } .nw-raid .hd b { font-size: 15px; } .nw-raid .hd small { margin-left: auto; font-size: 12px; color: #aab4cc; white-space: nowrap; }
.nw-raid .new { padding: 2px 6px; border-radius: 6px; background: #e33; color: #fff; font: 900 10px/1.2 system-ui; }
.nw-raid .ln { font-size: 13px; color: #d8deef; } .nw-raid .us { color: #8fc4f5; font-weight: 800; } .nw-raid .them { color: #f5a08a; font-weight: 800; }
.nw-raid .rw { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.07); }
.nw-raid .rw button { flex: 0 0 auto; min-height: 38px; font-weight: 800; } .nw-raid .done { font: 800 12px/1 system-ui; color: var(--c-good-hi); white-space: nowrap; }
.nw-chips.stolen small { font-size: 12px; color: #ff8a6a; } .nw-chips.stolen .nw-chip { border-color: #7a3a30; }

/* rules popup */
.nw-rules { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.4; }

/* bottom tab slider */
.nw-tabs { position: sticky; bottom: 0; display: flex; gap: 2px; align-items: stretch; padding: 6px 6px calc(8px + var(--safe-bottom));
  background: linear-gradient(#262b48, #141628); border-top: 3px solid var(--moon); box-shadow: 0 -6px 14px rgba(0,0,0,.5); }
.nw-back { flex: 0 0 48px; height: 48px; align-self: center; border-radius: 50%; border: 0; font-size: 22px; color: #fff; background: radial-gradient(circle at 50% 35%, #59637d, #2a3044); box-shadow: 0 0 0 2px var(--moon); }
.nw-tab { position: relative; flex: 1 0 60px; padding: 6px 2px; border: 0; border-radius: 10px 10px 4px 4px; background: none; display: grid; justify-items: center; gap: 2px; color: #fff; }
.nw-tab .ic { font-size: 26px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.nw-tab b { font: 900 12px/1.1 system-ui; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.nw-tab.on { background: linear-gradient(var(--c-amber-hi), #e3a03a); box-shadow: 0 -2px 0 #fff3c8 inset; }
.nw-tab .hud-bdg { top: 2px; right: calc(50% - 30px); }
