/* PHOTO 3D — capture companion for Great Neck V */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0b0f14;
  --panel: #131b23;
  --line: #22303c;
  --ink: #e6eef5;
  --dim: #8fa6bd;
  --gold: #f2c14e;
  --red: #e2574c;
  --amber: #e8a33c;
  --green: #4cc26a;
  --ui: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: var(--ui); color: var(--ink); display: flex; flex-direction: column; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 11px; }
button { font-family: var(--ui); cursor: pointer; }

/* ---------------- top bar ---------------- */
#bar {
  display: flex; align-items: center; gap: 16px; padding: 9px 14px;
  background: #0f151c; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { font-size: 19px; font-weight: 900; font-style: italic; letter-spacing: -0.5px; }
.brand span { color: var(--gold); }
.progress { flex: 1; min-width: 160px; }
.pbar { height: 6px; background: #1d2833; border-radius: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber), var(--green)); transition: width .3s; }
.pnum { font-size: 11px; color: var(--dim); margin-top: 3px; }
.pnum b { color: var(--ink); }
.tools { display: flex; gap: 7px; align-items: center; }
#search {
  background: #18222c; border: 1px solid var(--line); border-radius: 5px; color: var(--ink);
  padding: 7px 10px; font-size: 13px; width: 190px;
}
#search::placeholder { color: #63788c; }
.tools button {
  background: #1b2733; border: 1px solid var(--line); color: var(--ink);
  border-radius: 5px; padding: 7px 11px; font-size: 11px; font-weight: 700; letter-spacing: 1px;
}
.tools button:hover { background: #24333f; }
.tools button.on { background: var(--gold); color: #10161d; border-color: var(--gold); }
.tools button.primary { background: var(--gold); color: #10161d; border-color: var(--gold); }

/* ---------------- map ---------------- */
main { flex: 1; position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }

#legend {
  position: absolute; left: 12px; bottom: 12px; background: rgba(11, 15, 20, 0.86);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 12px;
}
#legend div { display: flex; align-items: center; gap: 7px; margin: 3px 0; color: #c4d3e0; }
.sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.sw.red { background: var(--red); } .sw.amber { background: var(--amber); } .sw.green { background: var(--green); }
#legend .built { outline: 1.5px solid rgba(255,255,255,0.85); outline-offset: 1px; }
#legend .hint { display: block; color: var(--dim); font-size: 11px; margin-top: 6px; }

#nearby {
  position: absolute; right: 12px; top: 12px; width: 210px;
  background: rgba(11, 15, 20, 0.9); border: 1px solid var(--line); border-radius: 6px; padding: 10px;
}
.nearby-title { font-size: 10px; letter-spacing: 2px; color: var(--gold); margin-bottom: 6px; }
#nearbyList div {
  font-size: 12px; padding: 5px 7px; border-radius: 4px; cursor: pointer; display: flex;
  justify-content: space-between; gap: 8px;
}
#nearbyList div:hover { background: #1b2733; }
#nearbyList .d { color: var(--dim); }

/* ---------------- house panel ---------------- */
#panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(400px, 100%);
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 5;
}
.p-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px; border-bottom: 1px solid var(--line); }
#pAddr { font-size: 19px; font-weight: 700; }
#pMeta { font-size: 12px; margin-top: 2px; }
#pClose { background: none; border: 0; color: var(--dim); font-size: 20px; }

.shots { padding: 14px; border-bottom: 1px solid var(--line); }
.shootbtn {
  display: block; text-align: center; background: var(--gold); color: #10161d;
  border-radius: 6px; padding: 13px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
}
.shot-hint { font-size: 11px; color: var(--dim); margin-top: 8px; }
#thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
#thumbs .t { position: relative; aspect-ratio: 4/3; border-radius: 5px; overflow: hidden; background: #0c1218; }
#thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
#thumbs .x {
  position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,0.7); color: #fff;
  border: 0; border-radius: 4px; width: 20px; height: 20px; font-size: 12px; line-height: 1;
}

.tags { flex: 1; overflow-y: auto; padding: 14px; }
.tag-group { margin-bottom: 13px; }
.tag-group h4 { font-size: 10px; letter-spacing: 2px; color: var(--gold); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button {
  background: #18222c; border: 1px solid var(--line); color: #c4d3e0;
  border-radius: 20px; padding: 6px 12px; font-size: 12px;
}
.chips button.on { background: var(--gold); color: #10161d; border-color: var(--gold); font-weight: 700; }
.colours { display: flex; gap: 12px; flex-wrap: wrap; }
.colours label { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.colours input[type=color] { width: 42px; height: 28px; border: 1px solid var(--line); border-radius: 4px; background: none; }
#pNotes {
  width: 100%; min-height: 64px; background: #18222c; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); padding: 9px; font: 13px var(--ui); resize: vertical;
}
.p-foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.p-foot button { flex: 1; background: #1b2733; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 11px; font-size: 12px; font-weight: 700; }
.p-foot button.primary { background: var(--gold); color: #10161d; border-color: var(--gold); }

/* ---------------- toast + modal ---------------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #182430; border: 1px solid var(--line); border-radius: 6px; padding: 10px 18px;
  font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 90;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

#exportModal { position: fixed; inset: 0; background: rgba(5, 8, 11, 0.86); display: grid; place-items: center; z-index: 30; }
.modal-card { width: min(520px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.modal-card h2 { font-size: 20px; font-weight: 900; font-style: italic; margin-bottom: 8px; }
.export-opts { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.export-opts button { flex: 1; min-width: 130px; background: #1b2733; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 12px; font-weight: 700; font-size: 12px; }
.export-opts button.primary { background: var(--gold); color: #10161d; border-color: var(--gold); }
#expProgress { margin-top: 12px; font-size: 12px; color: var(--dim); }
#expProgress .pbar { margin-bottom: 6px; }

@media (max-width: 720px) {
  #bar { gap: 9px; padding: 8px 10px; }
  #search { width: 120px; }
  #nearby { display: none; }
  #panel { width: 100%; }
  #legend { font-size: 11px; padding: 7px 9px; }
}

/* ---------------- block mode dock ---------------- */
#shootDock {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; z-index: 6;
  background: rgba(11, 15, 20, 0.92); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; max-width: min(680px, 94vw);
}
#shootDock.hidden { display: none; }
#coverage { min-width: 170px; }
.cov-line { font-size: 12px; color: var(--dim); }
.cov-line b { font-size: 22px; color: var(--ink); font-weight: 800; }
.cov-list { font-size: 12px; color: #c4d3e0; margin-top: 3px; line-height: 1.45; }
.cov-list .n { color: var(--gold); font-weight: 700; }
.cov-list .done { color: var(--green); }

.bigshot {
  width: 76px; height: 76px; border-radius: 50%; background: var(--gold); color: #10161d;
  display: grid; place-items: center; font-size: 30px; cursor: pointer; flex: 0 0 auto;
  box-shadow: 0 6px 22px rgba(0,0,0,0.5); transition: transform .1s;
}
.bigshot:active { transform: scale(0.93); }
.bigshot.armed { box-shadow: 0 0 0 5px rgba(242,193,78,0.28), 0 6px 22px rgba(0,0,0,0.5); }

#guide { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.g-arrow {
  font-size: 30px; color: var(--gold); transition: transform .25s; line-height: 1;
}
.g-text b { display: block; font-size: 17px; font-weight: 800; }
.g-text span { font-size: 11px; color: var(--dim); }

/* heading wedge on the map */
@media (max-width: 720px) {
  #shootDock { gap: 9px; padding: 9px 11px; bottom: 10px; }
  #coverage { min-width: 116px; }
  .cov-list { font-size: 11px; }
  .bigshot { width: 64px; height: 64px; font-size: 25px; }
  #guide { min-width: 104px; }
  #legend { display: none; }
}

#syncModal { position: fixed; inset: 0; background: rgba(5,8,11,0.86); display: grid; place-items: center; z-index: 30; }
#syncKey { width: 100%; margin: 14px 0 6px; background: #18222c; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); padding: 11px; font: 14px var(--ui); }
#syncProgress { margin-top: 12px; font-size: 12px; color: var(--dim); }
#syncProgress .pbar { margin-bottom: 6px; }

#joinBox { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
#joinBox input { flex: 1; min-width: 140px; background: #18222c; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); padding: 11px; font: 14px var(--ui); }
.board-title { font-size: 10px; letter-spacing: 2px; color: var(--gold); margin: 16px 0 7px; }
#board .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #1b2733; color: #c4d3e0; }
#board .row b { color: var(--ink); }
#board .me { color: var(--gold); }
#whoami { font-size: 11px; color: var(--dim); margin-left: 8px; }

/* the team's photos: look, don't touch */
.t.theirs { position: relative; opacity: .92; cursor: zoom-in; }
.t.theirs img { border-color: #2b4a63; }
.t .by { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; letter-spacing: .5px;
  text-align: center; background: rgba(8,14,20,.78); color: var(--gold); padding: 2px 0;
  text-transform: uppercase; }
#btnTeam.on { border-color: var(--gold); color: var(--gold); }

/* on a phone the house panel is the whole screen — the shutter dock would sit
   on top of its buttons, so get it out of the way */
@media (max-width: 720px) {
  body.panel-open #shootDock { display: none; }
}

/* ---------------------------------------------------------------------------
   the live viewfinder
   --------------------------------------------------------------------------- */
#camView { position: fixed; inset: 0; z-index: 60; background: #000; }
#camView.hidden { display: none; }
#camVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#camOverlay { position: absolute; inset: 0; width: 100%; height: 100%; }

#camTop { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: linear-gradient(rgba(0,0,0,.62), transparent); }
#camTop button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.45); color: #fff; font-size: 17px; cursor: pointer; }
#camInfo { font: 12px var(--ui); color: #dfe9f2; letter-spacing: .4px; text-shadow: 0 1px 3px #000; }
#camInfo b { font-size: 18px; color: var(--gold); }

#camHint { position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  max-width: 88%; text-align: center; font: 12px var(--ui); color: #eaf2f8;
  background: rgba(6,12,18,.72); border-radius: 20px; padding: 8px 16px;
  pointer-events: none; transition: opacity .4s; }
#camHint.gone { opacity: 0; }

#camBottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.66)); }
#camNames { font: 12px var(--ui); color: #cfe0ee; text-align: center; min-height: 16px;
  text-shadow: 0 1px 3px #000; max-width: 92%; }
#camNames .done { color: #7ce89a; }
#camNames .n { color: #ff9b8e; }
#camShoot { width: 74px; height: 74px; border-radius: 50%; border: 5px solid rgba(255,255,255,.92);
  background: var(--gold); cursor: pointer; box-shadow: 0 4px 22px rgba(0,0,0,.5); transition: transform .08s; }
#camShoot:active { transform: scale(.92); }
#camShoot.busy { opacity: .55; pointer-events: none; }

/* the shooting spots on the map */
#legend .sw.spot { border-radius: 50%; background: #ff9d3c; box-shadow: 0 0 0 2px rgba(255,157,60,.28); }

/* panel tabs + the 3D model pane */
.tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.tabs button { flex: 1; background: #16212c; border: 1px solid var(--line); border-bottom: none;
  color: var(--dim); border-radius: 6px 6px 0 0; padding: 9px; font-weight: 800; font-size: 11px;
  letter-spacing: 1px; cursor: pointer; }
.tabs button.on { background: var(--panel); color: var(--gold); border-color: var(--gold); }
#modelPane { padding: 12px 14px 4px; }
#modelPane.hidden { display: none; }
#shotsPane.hidden { display: none; }
#modelCanvas { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 8px;
  display: block; cursor: grab; touch-action: none; background: #16232e; }
#modelCanvas:active { cursor: grabbing; }
.model-note { font-size: 11px; line-height: 1.5; margin-top: 9px; }
.model-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.model-tools button { background: #1b2733; border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 7px 12px; font-weight: 700; font-size: 11px; letter-spacing: .6px; }
.model-tools button.on { border-color: var(--gold); color: var(--gold); }
#modelFacts { font-size: 11px; }

/* spin control in the viewfinder */
.cam-row { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.cam-slot { width: 78px; }
#camSpin { width: 78px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.34);
  background: rgba(0,0,0,.45); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: 1px;
  cursor: pointer; }
#camSpin.on { background: #e2574c; border-color: #ff9b8e; animation: spinpulse 1.4s infinite; }
@keyframes spinpulse { 0%,100% { opacity: 1; } 50% { opacity: .62; } }
