/* Vision & spell areas (vision-aoe): line of sight on the GM map. Behind Settings > GM test features. */
.dm-map-grid .los-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.los-shade .los-dim { fill: var(--c-night-04); fill-opacity: 0.62; }
.dm-map-grid.los-solo .los-shade .los-dim { fill-opacity: 0.7; }
.dm-map-grid .map-token.los-unseen { opacity: 0.62; filter: saturate(0.45) brightness(0.8); }
.dm-map-grid .map-token .los-tag {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px);
  font: 600 9px/1.2 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: 0.02em;
  color: var(--c-red-85-b); background: rgb(from var(--lock-night-06) r g b / 0.86); border: 1px solid rgb(from var(--c-red-77-c) r g b / 0.55);
  border-radius: 999px; padding: 1px 6px; white-space: nowrap; pointer-events: none; z-index: 3;
}
.dm-map-grid .map-token.los-unseen .map-token-caption { display: none; }

/* pressed: the app's brass ring (the Hearth palette's [aria-pressed] rule), the eye stays gold */
.gm2-iconbtn.los-btn.on { color: var(--gm-gold, var(--c-gold-77)); }
.gm2-stage .los-fab { display: none; }

.los-panel {
  position: absolute; z-index: 30; right: 12px; top: 12px; width: 236px; max-width: calc(100% - 24px);
  padding: 14px 14px 12px; border-radius: 16px;
  background: rgb(from var(--c-night-10) r g b / 0.97); border: 1px solid var(--gm-line, var(--c-night-18));
  box-shadow: 0 12px 34px rgb(from var(--c-black) r g b / 0.5); color: var(--c-paper-90);
  font: 14px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.los-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.los-head b { font-size: 17px; color: var(--gm-gold, var(--c-gold-65)); }
.los-x { width: 36px; height: 36px; margin: -6px -6px -6px 0; border: 0; background: none; color: var(--c-paper-75); font-size: 22px; border-radius: 10px; }
.los-switch {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px; border-radius: 999px; border: 1px solid var(--gm-line, var(--c-night-18));
  background: var(--c-night-08); color: var(--c-paper-90); font: 600 14px/1 inherit; font-family: inherit;
}
.los-switch.on { background: linear-gradient(var(--c-gold-81-c), var(--c-gold-62) 55%, var(--c-gold-52-b)); border-color: var(--c-gold-82); color: var(--c-night-10); }
.los-switch b { font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.los-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.los-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--c-paper-90); font: 14px/1.2 inherit; font-family: inherit; text-align: left;
}
.los-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.los-row em { font-style: normal; color: var(--c-gold-68-b); font-size: 12px; }
.los-row.on { background: rgb(from var(--c-gold-65) r g b / 0.12); border-color: rgb(from var(--c-gold-65) r g b / 0.55); }
.los-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgb(from var(--c-black) r g b / 0.35); }
.los-dot.all { background: var(--lock-paper-90); }
.los-legend { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gm-line, var(--c-night-18)); color: var(--c-gold-68-b); font-size: 12.5px; }
.los-note { margin: 10px 2px 0; color: var(--c-gold-68-b); font-size: 13px; }

/* phones: the panel is a sheet across the bottom of the map, above the wheel */
@media (max-width: 719px) {
  .gm2-top .los-btn { display: none; }
  .gm2-stage .los-fab { display: inline-flex; position: absolute; left: 10px; top: 124px; z-index: 6; border-radius: 50%; background: rgb(from var(--c-night-08) r g b / 0.92); border-color: var(--gm-line, var(--c-night-18)); }
  .los-panel { left: 8px; right: 8px; top: auto; bottom: 112px; width: auto; max-width: none; padding: 10px 12px; }
  .los-panel.min { left: auto; right: 8px; padding: 6px 6px 6px 8px; }
  .los-panel.min .los-switch { min-width: 150px; padding: 0 12px; }
  .los-head { margin-bottom: 6px; }
  .los-list { flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin-top: 8px; padding-bottom: 2px; scrollbar-width: none; }
  .los-list::-webkit-scrollbar { display: none; }
  .los-row { flex: none; padding: 0 12px 0 8px; border-color: var(--gm-line, var(--c-night-18)); border-radius: 999px; }
  .los-row span { overflow: visible; }
  .los-legend { flex-direction: row; flex-wrap: wrap; column-gap: 12px; margin-top: 8px; padding-top: 8px; font-size: 12px; }
}

/* 2 Nov review: a clearer "unseen" tag, a foldable panel */
.dm-map-grid .map-token.los-unseen { opacity: 0.8; filter: saturate(0.5) brightness(0.85); outline: 2px dashed rgb(from var(--c-red-79) r g b / 0.95); outline-offset: 3px; }
.dm-map-grid .map-token .los-tag {
  font: 700 11px/1.15 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: 0.03em;
  color: var(--c-white); background: var(--c-red-43); border: 1px solid var(--c-red-85-b); padding: 2px 8px 2px 6px;
  box-shadow: 0 2px 6px rgb(from var(--c-black) r g b / 0.6); display: inline-flex; align-items: center; gap: 4px; transform: translate(-50%, 5px); z-index: 4;
}
.dm-map-grid .map-token .los-tag svg { width: 12px; height: 12px; flex: none; }
.los-hbtns { display: inline-flex; gap: 2px; }
.los-head .los-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px -8px -10px 0; }
.los-panel.min { width: auto; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 999px; }
.los-panel.min .los-switch { width: auto; min-width: 168px; }
.los-panel.min .los-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; border-radius: 50%; }
.los-minwho { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
.los-minwho .los-dot { width: 12px; height: 12px; }

/* step 2: darkvision, light, auras */
.los-shade .los-dim.dark { fill-opacity: 0.78; }
.dm-map-grid .los-rings { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.dm-map-grid .los-carry { position: absolute; pointer-events: none; }
.dm-map-grid .los-carry svg { position: absolute; inset: 0; overflow: visible; }
.los-ring { fill: none; }
.los-ring.dv { stroke: var(--lock-ink-81); stroke-opacity: 0.7; stroke-width: 1.6; stroke-dasharray: 7 5; }
.los-ring.dim { stroke: var(--lock-paper-93-b); stroke-opacity: 0.22; stroke-width: 1; stroke-dasharray: 2 4; }
.los-ring.bright { stroke: none; }
.los-ring.aura { stroke: var(--lock-gold-77); stroke-opacity: 0.6; stroke-width: 1.6; }
.los-amb { margin: 10px 2px 0; color: var(--c-paper-75); font-size: 12.5px; }
.los-row em.lit { color: var(--c-gold-77); }
.los-detail { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--c-night-08); border: 1px solid var(--gm-line, var(--c-night-18)); display: flex; flex-direction: column; gap: 4px; }
.los-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-paper-90); }
.los-key { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.los-key.dv { border: 1.6px dashed var(--c-ink-81); }
.los-key.aura { border: 2px solid var(--c-gold-77); background: radial-gradient(circle, transparent 50%, rgb(from var(--c-gold-77) r g b / 0.35)); }
.los-key.light { background: radial-gradient(circle, var(--c-paper-89) 0 35%, rgb(from var(--c-gold-82-c) r g b / 0.35) 36% 100%); }
.los-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.los-chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--gm-line, var(--c-night-18)); background: var(--c-night-10); color: var(--c-paper-90); font: 600 13px/1 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.los-chip.on { color: var(--gm-gold, var(--c-gold-77)); }
@media (max-width: 719px) {
  .los-chip { padding: 0 12px; }
}

/* 2 Nov review: a shorter panel, so it can find a spot clear of the tokens */
.los-panel { width: 272px; padding: 12px 12px 10px; }
.los-head { margin-bottom: 8px; }
.los-amb { margin-top: 8px; }
.los-list { margin-top: 6px; gap: 0; }
.los-row { min-height: 44px; }
.los-legend { display: grid; grid-template-columns: auto auto; column-gap: 8px; row-gap: 2px; margin-top: 8px; padding-top: 8px; font-size: 12px; }
.los-legend .wide { grid-column: 1 / -1; }
@media (max-width: 719px) { .los-legend .wide { display: none; } .los-panel { width: auto; } }

/* discovered: players see a blank token there */
.dm-map-grid .map-token.los-unseen.los-found { outline-color: rgb(from var(--c-gold-77) r g b / 0.95); }
.dm-map-grid .map-token .los-tag.found { background: var(--lock-gold-77); color: var(--lock-night-10); border-color: var(--lock-paper-92-b); }

/* step 3: spell areas */
.dm-map-grid .los-aims { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.dm-map-grid .los-aims svg { position: absolute; inset: 0; overflow: visible; }
.los-aim > * { fill: rgb(from var(--c-gold-77) r g b / 0.18); stroke: var(--c-gold-77); stroke-width: 2.5; stroke-dasharray: 8 5; animation: losAimDash 1.2s linear infinite; }
@keyframes losAimDash { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) { .los-aim > * { animation: none; } }
.dm-map-grid .los-aim-tag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: rgb(from var(--c-night-08) r g b / 0.94); border: 1px solid var(--c-gold-77); color: var(--c-paper-90); font: 600 12px/1.3 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.dm-map-grid .map-token.los-aim-in, .dm-map-grid .map-token.los-in-area { box-shadow: 0 0 0 3px var(--c-gold-77), 0 0 14px 4px rgb(from var(--c-gold-77) r g b / 0.75) !important; }

/* step 4: pushes */
.dm-map-grid .los-push-map { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: visible; }
.los-push-map line { stroke: var(--c-gold-77); stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgb(from var(--c-black) r g b / 0.7)); }
.los-push-map .land { fill: rgb(from var(--c-gold-77) r g b / 0.12); stroke: var(--c-gold-77); stroke-width: 2; stroke-dasharray: 5 4; }
.los-pushpanel {
  position: absolute; z-index: 31; left: 12px; top: 12px; width: 340px; max-width: calc(100% - 24px);
  padding: 12px; border-radius: 16px; background: rgb(from var(--c-night-10) r g b / 0.97); border: 1px solid var(--c-gold-77);
  box-shadow: 0 12px 34px rgb(from var(--c-black) r g b / 0.55); color: var(--c-paper-90); font: 14px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.los-pushpanel .los-head { display: flex; align-items: baseline; gap: 10px; justify-content: flex-start; }
.los-psub { color: var(--c-paper-75); font-size: 12.5px; }
.los-prows { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; max-height: 40vh; overflow: auto; }
.los-prow { display: flex; align-items: center; gap: 8px; }
.los-pwho { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.los-pwho b { font-size: 14px; }
.los-pwho span { color: var(--c-gold-68-b); font-size: 12px; }
.los-pacts { display: flex; gap: 8px; margin-top: 10px; }
.los-pbtn { flex: 1; min-height: 44px; border-radius: 999px; border: 1px solid var(--gm-line, var(--c-night-18)); background: var(--c-night-08); color: var(--c-paper-90); font: 600 14px/1 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.los-pbtn.go { background: linear-gradient(var(--c-gold-81-c), var(--c-gold-62) 55%, var(--c-gold-52-b)); color: var(--c-night-10); border-color: var(--c-gold-82); }
.los-pbtn:disabled { opacity: 0.5; }
@media (max-width: 719px) { .los-pushpanel { top: auto; bottom: 112px; left: 8px; right: 8px; width: auto; padding: 10px 12px; } .los-prows { max-height: 26vh; } .los-pushpanel .los-note { display: none; } }

/* lingering spells at the start of a turn */
.los-tick { border-color: var(--c-gold-77); }
.los-tdmg { width: 64px; min-height: 44px; border-radius: 10px; border: 1px solid var(--gm-line, var(--c-night-18)); background: var(--c-night-08); color: var(--c-paper-90); font: 600 15px/1 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; text-align: center; }
.los-tick .los-head { flex-wrap: wrap; row-gap: 2px; }
.los-tick .los-head b { font-size: 16px; }
.los-ring.cone { stroke: var(--lock-paper-93-b); stroke-opacity: 0.3; stroke-width: 1; stroke-dasharray: 2 4; }
