/* map.css — War Room live tactical map section. Paired with js/map.js. */

.warroom {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.warroom-head { text-align: center; max-width: 60ch; margin: 0 auto 2rem; padding-inline: 1rem; }
.warroom .kicker {
  font: 700 .72rem/1 'Manrope', sans-serif;
  letter-spacing: .22em; text-transform: uppercase;
  color: #c2772a; margin: 0 0 .8rem;
}
.warroom-head h2 {
  font-family: 'Forum', 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .6rem; color: #f3e8d6;
}
.warroom-sub { color: #b9ab97; font-size: 1.02rem; line-height: 1.55; margin: 0; }

/* ---- app shell ---- */
.warroom-app {
  max-width: 1180px; margin: 0 auto; padding-inline: clamp(.6rem, 2vw, 1.2rem);
}

/* ---- gate ---- */
.warroom-gate { display: flex; justify-content: center; }
.warroom-gate-card {
  background: linear-gradient(180deg, #2a2118, #1d1711);
  border: 1px solid #4a3a26; border-radius: 16px;
  padding: 2.6rem 2.2rem; max-width: 30rem; text-align: center;
  box-shadow: 0 24px 60px #0008, inset 0 1px 0 #6a4f2e44;
}
.warroom-gate-lock { width: 44px; height: 44px; color: #c2772a; opacity: .9; }
.warroom-gate-title { font-family: 'Forum', serif; font-size: 1.5rem; color: #f3e8d6; margin: .6rem 0 .4rem; }
.warroom-gate-msg { color: #b09a7e; line-height: 1.5; margin: 0 0 1.2rem; }
.wr-cta {
  appearance: none; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #d8923a, #b96c22); color: #fff;
  font: 700 .95rem 'Manrope', sans-serif; padding: .7rem 1.6rem; border-radius: 10px;
  box-shadow: 0 8px 22px #b96c2255;
}
.wr-cta:hover { filter: brightness(1.08); }

/* ---- board ---- */
.warroom-board { display: flex; flex-direction: column; gap: .6rem; }

.warroom-toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .55rem .7rem; border-radius: 12px;
  background: linear-gradient(180deg, #241d15ee, #1a140eee);
  border: 1px solid #3e3122; backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px #0006;
}
.wr-group { display: flex; gap: .3rem; align-items: center; padding-inline: .35rem; }
.wr-group + .wr-group { border-left: 1px solid #3e3122; }

.wr-tool, .wr-btn {
  appearance: none; cursor: pointer; min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #322617; color: #e7d5bb; border: 1px solid #4a3a26; border-radius: 9px;
  font-size: 1.05rem; line-height: 1; transition: background .12s, transform .06s;
}
.wr-tool:hover, .wr-btn:hover { background: #3f3019; }
.wr-tool:active, .wr-btn:active { transform: translateY(1px); }
.wr-tool.is-on { background: #c2772a; color: #1a120a; border-color: #e6a23c; box-shadow: 0 0 0 2px #e6a23c44; }
.wr-marker { padding: 3px; }
.wr-marker img { width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 1px 1px #000a); }
.wr-danger { color: #f0a3a3; }
.wr-danger:hover { background: #4a2420; }

.wr-colors { gap: .25rem; }
.wr-color {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid #00000055; box-shadow: 0 0 0 1px #ffffff22;
}
.wr-color.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c2772a; }

.wr-bgselect {
  background: #322617; color: #e7d5bb; border: 1px solid #4a3a26; border-radius: 9px;
  height: 36px; padding: 0 .5rem; font: 500 .85rem 'Manrope', sans-serif; cursor: pointer;
}

/* ---- stage / viewport ---- */
.warroom-stage {
  position: relative; overflow: hidden; touch-action: none;
  height: clamp(420px, 62vh, 760px);
  border-radius: 14px; border: 1px solid #3e3122;
  background:
    radial-gradient(120% 120% at 50% 0%, #1c2733 0%, #0f1620 60%, #0a0f16 100%);
  box-shadow: inset 0 0 90px #000a, 0 18px 50px #0007;
  cursor: grab;
}
.warroom-stage[data-tool="arrow"], .warroom-stage[data-tool="pen"],
.warroom-stage[data-tool="rect"], .warroom-stage[data-tool="text"],
.warroom-stage[data-tool="timer"], .warroom-stage[data-tool="marker"] { cursor: crosshair; }
.warroom-stage:active { cursor: grabbing; }

.warroom-viewport { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.warroom-bg { position: absolute; top: 0; left: 0; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 30px 40px #000a); }
.warroom-overlay { position: absolute; top: 0; left: 0; overflow: visible; }
.warroom-cursors { position: absolute; top: 0; left: 0; pointer-events: none; }

/* ---- objects ---- */
.wr-obj.is-sel { outline: none; }
.wr-obj.is-sel :is(line, polyline, rect, polygon, circle, image, text) {
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px #e6a23c);
}
.wr-textobj { font-family: 'Manrope', sans-serif; font-weight: 700; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.wr-label { fill: #f3e8d6; font-family: 'Manrope', sans-serif; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.wr-timer-txt { font-family: 'Russo One', 'Manrope', sans-serif; paint-order: stroke; stroke: #000; stroke-width: 3px; }

/* ---- cursors (counter-scaled so they stay constant size) ---- */
.wr-cursor {
  position: absolute; transform: scale(var(--inv, 1)); transform-origin: 0 0;
  pointer-events: none; will-change: transform, left, top; transition: left .05s linear, top .05s linear;
}
.wr-cursor-name {
  position: absolute; left: 12px; top: 10px; white-space: nowrap;
  font: 600 11px 'Manrope', sans-serif; color: #fff; padding: 1px 6px; border-radius: 6px;
  box-shadow: 0 2px 6px #0007;
}

/* ---- status bar ---- */
.warroom-statusbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .4rem .6rem; color: #a8997f; font: 500 .85rem 'Manrope', sans-serif;
}
.warroom-presence { display: flex; align-items: center; gap: .4rem; }
.wr-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #67c23a; box-shadow: 0 0 0 0 #67c23a88; animation: wrPulse 2s infinite; }
@keyframes wrPulse { 0% { box-shadow: 0 0 0 0 #67c23aaa; } 70% { box-shadow: 0 0 0 7px #67c23a00; } 100% { box-shadow: 0 0 0 0 #67c23a00; } }
.wr-peer {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #1a120a; font: 800 .72rem 'Manrope', sans-serif; margin-left: -4px; border: 2px solid #1a140e;
}
.warroom-zoom { display: flex; gap: .3rem; margin-left: auto; }
.warroom-conn { display: inline-flex; align-items: center; gap: .4rem; }
.warroom-conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #888; }
.warroom-conn[data-state="live"]::before { background: #67c23a; }
.warroom-conn[data-state="connecting"]::before,
.warroom-conn[data-state="loading"]::before { background: #e6a23c; }
.warroom-conn[data-state="off"]::before { background: #f56c6c; }

@media (max-width: 640px) {
  .warroom-toolbar { gap: .3rem; padding: .45rem; }
  .wr-tool, .wr-btn { min-width: 32px; height: 32px; font-size: .95rem; }
  .wr-group { padding-inline: .2rem; }
}

/* ============ dedicated full-page /map/ (body.map-page) ============ */
.map-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.map-page .site-nav { flex: 0 0 auto; }
.map-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; }

.map-titlebar {
  display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap;
  padding: .55rem clamp(.8rem, 2.5vw, 1.6rem) .4rem;
}
.map-titlebar .subpage-eyebrow {
  color: #c2772a; font: 700 .68rem/1 'Manrope', sans-serif;
  letter-spacing: .2em; text-transform: uppercase;
}
.map-title { font-family: 'Cinzel', 'Forum', serif; font-size: clamp(1.15rem, 3vw, 1.75rem); color: #f3e8d6; margin: 0; }

.map-page .warroom { flex: 1 1 auto; min-height: 0; padding: 0 clamp(.5rem, 2vw, 1.2rem) clamp(.6rem, 2vw, 1.1rem); display: flex; }
.map-page .warroom-app { max-width: none; width: 100%; padding: 0; display: flex; flex-direction: column; min-height: 0; }
.map-page .warroom-board { flex: 1 1 auto; min-height: 0; }
.map-page .warroom-stage { height: auto; flex: 1 1 auto; min-height: 0; }
.map-page .warroom-gate { flex: 1 1 auto; align-items: center; }

/* ============ Leaflet deep-zoom integration ============ */
.warroom-stage.leaflet-container { background: #0a0f16; outline: none; }
.warroom-stage[data-tool="arrow"], .warroom-stage[data-tool="pen"],
.warroom-stage[data-tool="rect"], .warroom-stage[data-tool="text"],
.warroom-stage[data-tool="timer"], .warroom-stage[data-tool="marker"] { cursor: crosshair !important; }
.warroom-overlay { overflow: visible; position: absolute; }
.warroom-overlay .wr-obj { pointer-events: none; }
.leaflet-control-zoom { display: none; }            /* we use our own status-bar zoom */
/* live cursors are Leaflet divIcons */
.wr-cursor-icon { background: none; border: 0; }
.wr-cursor { position: relative; display: block; }
.wr-cursor svg { display: block; filter: drop-shadow(0 1px 1px #000a); }
