/* The Photo 101 Commons. Same type and red as the hub. */

:root {
  --bg: #000;
  --card: #0d0d0d;
  --line: #262626;
  --ink: #ececec;
  --muted: #c4c4c4;
  --dim: #9c9c9c;
  --red: #e60028;
  --red-light: #ff3355;
  --f-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #bfe1f5;
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--red-light); }

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  opacity: 0;
  transition: opacity 1s ease;
}
body.ready #world { opacity: 1; }
#labels { position: fixed; inset: 0; pointer-events: none; }
#labels > div { pointer-events: none; }
#labels > .tag.peer { pointer-events: auto; cursor: pointer; }

.tag {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  text-align: center;
}
.tag[data-act]:not([data-act=""])::after {
  content: attr(data-act);
  display: block;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 0.66rem;
  color: #f0f0f0;
}
.tag.muted { opacity: 0.4; text-decoration: line-through; }
.bubble {
  max-width: 220px;
  background: #fff;
  color: #111;
  font-size: 0.92rem;
  line-height: 1.3;
  padding: 6px 10px;
  border-left: 3px solid var(--red);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  white-space: normal;
  text-align: left;
}

.label {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-light);
}
.btn {
  display: inline-block;
  font: 600 0.95rem var(--f-body);
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-light); border-color: var(--red-light); }

/* ---- the gate ---------------------------------------------------------- */
.entry {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.5));
  overflow-y: auto;
}
.entry[hidden] { display: none; }
.entry-card {
  width: 100%;
  max-width: 460px;
  background: rgba(0, 0, 0, 0.88);
  border-top: 4px solid var(--red);
  padding: 28px 26px 22px;
}
.entry h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  line-height: 1;
  text-transform: uppercase;
  margin: 6px 0 10px;
}
.lede { color: var(--muted); font-size: 1.05rem; }
.entry form { display: grid; gap: 16px; margin: 20px 0 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.field input {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font: 600 1.15rem var(--f-body);
  padding: 8px 10px;
  outline: none;
}
.field input:focus { border-color: var(--red); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border: 2px solid transparent; outline: 1px solid rgba(255, 255, 255, 0.15); cursor: pointer; }
.swatch.on { border-color: #fff; }
.cams { display: flex; gap: 6px; flex-wrap: wrap; }
.cam {
  font: 700 0.95rem var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 10px;
  cursor: pointer;
}
.cam.on { background: var(--red); border-color: var(--red); color: #fff; }
.entry-count { font-family: var(--f-mono); font-size: 0.82rem; color: var(--ink); min-height: 1.3em; }
.small { font-size: 0.82rem; color: var(--dim); margin-top: 8px; }
.nogl { display: none; }
body.no-webgl .entry form, body.no-webgl .entry-count { display: none; }
body.no-webgl .nogl { display: block; margin-top: 14px; }

/* ---- HUD ----------------------------------------------------------------- */
.hud[hidden] { display: none; }
.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hud > * > *, .hud > .prompt, .hud > .poses { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.here { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.room-status {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  background: #000;
  padding: 2px 10px;
}
.stamp-btn {
  font: 600 0.85rem var(--f-mono);
  background: #fff;
  color: #111;
  border: 0;
  border-left: 4px solid var(--red);
  padding: 5px 10px;
  cursor: pointer;
}
.stamp-btn b { color: var(--red); }
.stamp-btn.done { background: var(--red); color: #fff; }
.stamp-btn.done b { color: #fff; }
.links { display: flex; gap: 2px; }
.links a {
  background: #000;
  color: var(--ink);
  font: 600 0.85rem var(--f-body);
  padding: 6px 12px;
  text-decoration: none;
}
.links a:hover { background: var(--red); }

.hud-bottom { display: flex; align-items: flex-end; }
.talk { width: min(360px, 100%); display: grid; gap: 6px; }
.feed { list-style: none; display: grid; gap: 3px; pointer-events: none; }
.feed li {
  font-size: 0.98rem;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: opacity 2s ease;
}
.feed .who { font: inherit; font-family: var(--f-display); font-weight: 700; color: #ffd0d8; background: none; border: 0; padding: 0; text-shadow: inherit; }
.feed button.who { pointer-events: auto; cursor: pointer; }
.feed li.mine .who { color: #fff; }
.feed li.sys { font-family: var(--f-mono); font-size: 0.78rem; }
.feed li.fade { opacity: 0; }
.chat input {
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--line);
  color: var(--ink);
  font: 1rem var(--f-body);
  padding: 8px 10px;
  outline: none;
}
.chat input:focus { border-color: var(--red); }

.prompt {
  position: fixed;
  left: 50%;
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  background: #fff;
  color: #111;
  border: 0;
  border-bottom: 4px solid var(--red);
  padding: 9px 16px;
  font: 700 1.1rem var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.prompt[hidden] { display: none; }
.prompt kbd { font: 600 0.75rem var(--f-mono); background: #111; color: #fff; padding: 2px 6px; }
@media (pointer: coarse) { .prompt kbd { display: none; } }

/* Club Hall: poses, the self-timer and the flash */
.poses {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.poses[hidden] { display: none; }
.poses::before {
  content: "Pose";
  font: 700 0.95rem var(--f-display);
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.pose {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  background: #fff;
  color: #111;
  border: 0;
  border-left: 4px solid #f5c400;
  padding: 7px 12px;
  font: 700 1rem var(--f-display);
  text-transform: uppercase;
  cursor: pointer;
}
.pose kbd { font: 600 0.72rem var(--f-mono); background: #111; color: #fff; padding: 1px 5px; }
.pose.on { background: #f5c400; }
@media (pointer: coarse) { .pose kbd { display: none; } }
@media (max-width: 640px) {
  .poses { top: 132px; bottom: auto; left: 16px; right: 16px; flex-direction: row; flex-wrap: wrap; }
  .poses::before { width: 100%; }
  .pose { min-width: 0; padding: 6px 10px; }
}
.countdown {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  font: 700 clamp(6rem, 22vw, 12rem) / 1 var(--f-display);
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}
.countdown[hidden], .flash[hidden] { display: none; }
.flash { position: fixed; inset: 0; z-index: 25; background: #fff; pointer-events: none; opacity: 0; }
.flash.go { animation: flash 0.8s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flash.go { animation: none; } }

.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  background: #000;
  border-left: 4px solid var(--red);
  color: var(--ink);
  padding: 8px 14px;
}
.toast[hidden] { display: none; }

.hide-menu {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 55;
  width: min(340px, calc(100vw - 32px));
  background: #000;
  border-top: 4px solid var(--red);
  padding: 18px;
  display: grid;
  gap: 14px;
  text-align: center;
}
.hide-menu[hidden] { display: none; }
.hide-menu div { display: flex; gap: 10px; justify-content: center; }

/* ---- panels --------------------------------------------------------------- */
.panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}
.panel[hidden] { display: none; }
.panel-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #000;
  border-top: 4px solid var(--red);
  padding: 24px 24px 22px;
}
.panel .close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
}
.panel h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 4px 0 12px;
}
.panel p { color: var(--muted); margin-bottom: 10px; }
.panel p b { color: var(--ink); }
.panel ul { margin: 0 0 12px 20px; color: var(--muted); }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.panel .due { font-family: var(--f-mono); font-size: 0.85rem; color: var(--red-light); }
.panel .challenge { background: var(--card); border-left: 3px solid var(--red); padding: 10px 12px; color: var(--ink); }
.panel .complete { font-family: var(--f-mono); color: #fff; background: var(--red); padding: 6px 10px; }
.panel .muted { color: var(--dim); font-size: 0.9rem; }
.panel img.art { display: block; width: 100%; max-height: 52vh; object-fit: contain; background: #111; margin-bottom: 12px; }
.stamps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 12px; }
.stamp { background: var(--card); border: 1px dashed var(--line); padding: 10px; font-size: 0.9rem; color: var(--dim); }
.stamp span { display: block; font: 700 1.3rem var(--f-display); text-transform: uppercase; color: var(--line); }
.stamp.got { border: 1px solid var(--red); color: var(--ink); }
.stamp.got span { color: var(--red); }

body.panel-open .prompt { display: none; }

@media (max-width: 640px) {
  .talk { width: 100%; }
  .prompt { bottom: calc(env(safe-area-inset-bottom) + 150px); }
  .links a { padding: 6px 9px; }
}

/* Photo walks (Club Hall board) */
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--dim); font: 700 1rem var(--f-display); text-transform: uppercase; padding: 6px 10px; cursor: pointer; }
.tab.on { color: var(--ink); border-bottom-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { background: var(--card); border: 1px solid var(--line); color: var(--muted); font: 600 0.85rem var(--f-body); padding: 4px 10px; cursor: pointer; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.walks { list-style: none; margin: 0 !important; display: grid; gap: 10px; }
.walk { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--who, var(--red)); padding: 10px 12px; }
.walk.is-mine { border-color: #f5c400; }
.walk p { margin-bottom: 6px; }
.walk-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--f-display); font-size: 1.15rem; }
.walk-head span { color: var(--muted); font-weight: 600; }
.panel .walk-when { font: 600 0.85rem var(--f-mono); color: var(--red-light); }
.walk-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.walk-tags span { font: 600 0.75rem var(--f-mono); background: #1d1d1d; color: var(--ink); padding: 2px 6px; }
.panel .going { font-size: 0.9rem; color: var(--ink); }
.walk-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.walk-mine { font: 700 0.85rem var(--f-mono); color: #f5c400; }
.panel .reach { color: var(--ink); background: #1d1d1d; border-left: 3px solid #2fb36d; padding: 6px 10px; margin: 0; }
.panel .walk-safe { font-size: 0.8rem; color: var(--dim); margin: 6px 0 0; }
.panel .walk-safety { font-size: 0.85rem; color: var(--dim); border-left: 3px solid #f5c400; padding-left: 10px; margin-top: 14px; }
.walk-form .field, .walk-code .field { display: grid; gap: 4px; margin-bottom: 12px; }
.walk-form .field > span, .walk-code .field > span { font: 600 0.75rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); }
.walk-form input, .walk-code input { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--ink); font: 1rem var(--f-body); padding: 8px 10px; color-scheme: dark; }
.walk-form input:focus, .walk-code input:focus { outline: none; border-color: var(--red); }
.walk-form small { color: var(--dim); font-size: 0.8rem; }
.walk-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.walk-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); background: var(--card); border-left: 3px solid #f5c400; padding: 10px; }
.walk-form .check input { width: auto; margin-top: 3px; }
.walk-code { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.walk-code .field { flex: 1 1 200px; margin: 0; }
@media (max-width: 480px) { .walk-form .two { grid-template-columns: 1fr; } }

/* Meeting Point: the ideas wall */
.note-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.note-form input { flex: 1 1 220px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font: 1rem var(--f-body); padding: 8px 10px; }
.note-form input:focus { outline: none; border-color: var(--red); }
.notes { list-style: none; margin: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.notes li { background: #fff3a8; color: #111; padding: 10px; border-top: 4px solid var(--who, #f5c400); }
.notes li:nth-child(4n+2) { background: #ffd0d8; }
.notes li:nth-child(4n+3) { background: #cfeaff; }
.notes li:nth-child(4n) { background: #d8f5c8; }
.panel .notes p { color: #111; margin-bottom: 6px; font-size: 0.95rem; line-height: 1.35; }
.notes span { font: 700 0.85rem var(--f-display); color: #444; }
.linkish { background: none; border: 0; padding: 0; color: var(--red); font: inherit; text-decoration: underline; cursor: pointer; }
/* on phones the chat feed keeps its last three lines, clear of the prompt */
@media (max-width: 640px) {
  .feed li:nth-last-child(n+4) { display: none; }
}

/* City map (overview on a first visit, Map button, M key) */
.panel-card.map-card { max-width: 520px; }
.city-map { display: block; width: 100%; max-height: 64vh; margin: 4px auto 10px; background: #5c8f45; }
.city-map .m-square { fill: #e9e4d6; }
.city-map .m-city { fill: #6fa352; }
.city-map .m-street { fill: #cfc8b6; }
.city-map .m-lot { fill: #b59a72; stroke: #8d7552; stroke-width: 0.15; stroke-dasharray: 0.6 0.4; }
.city-map .m-district { fill: #f2d9b1; stroke: #222; stroke-width: 0.12; }
.city-map .m-fire { fill: #ff8a1f; stroke: #7a3a00; stroke-width: 0.2; }
.city-map .m-wall { fill: #222; }
.city-map .m-place { fill: #fff; stroke: #111; stroke-width: 0.25; transition: fill 0.15s; }
.city-map .m-spot { cursor: pointer; outline: none; }
.city-map .m-spot:focus-visible .m-place { fill: #ffd84d; }
@media (hover: hover) { .city-map .m-spot:hover .m-place { fill: #ffd84d; } }
.city-map .m-spot:focus-visible .m-place { stroke: var(--red); stroke-width: 0.45; }
.city-map .m-spot[data-name="Meeting Point"] .m-place { fill: rgba(255, 255, 255, 0.18); stroke-dasharray: 0.8 0.5; }
@media (hover: hover) { .city-map .m-spot[data-name="Meeting Point"]:hover .m-place { fill: rgba(255, 216, 77, 0.35); } }
.city-map text { text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.city-map .m-name { font: 700 1.75px var(--f-display); fill: #111; text-transform: uppercase; letter-spacing: 0.02em; }
.city-map .m-sub { font: 600 1.25px var(--f-mono); fill: #111; stroke: rgba(255,255,255,0.6); stroke-width: 0.25; paint-order: stroke; }
.city-map .m-sub.dim { fill: rgba(0, 0, 0, 0.55); stroke: none; }
.city-map .m-peer { fill: #fff; stroke: #111; stroke-width: 0.2; opacity: 0.85; }
.city-map .m-you-ring { fill: none; stroke-width: 0.35; animation: m-pulse 1.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
.city-map .m-you circle:last-child { stroke: #fff; stroke-width: 0.3; }
.city-map .m-you-label { font: 700 1.6px var(--f-display); fill: #fff; stroke: #111; stroke-width: 0.35; paint-order: stroke; text-transform: uppercase; }
@keyframes m-pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .city-map .m-you-ring { animation: none; } }
