/* ===== YOUR COLORS: change them here, main3d.js reads them too ===== */
:root {
  --pink: #e934ed;     /* the liquid, the words, the eye rims */
  --hot: #d6007a;      /* dark hot pink: the orchids (people) */
  --green: #70f04d;    /* the grids and the radar */
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: var(--pink);
  font-family: "Share Tech Mono", "Vazirmatn", monospace;
}

/* the 3D drawing fills the whole window */
#stage {
  position: fixed;
  inset: 0;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

/* ----- words floating in the 3D space ----- */
.name {
  font-size: 12px;
  white-space: nowrap;
  color: var(--pink);
  text-shadow: 0 0 6px rgba(233, 52, 237, 0.55);
  transition: font-size 0.25s, opacity 0.25s;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}
.name.on { font-size: 16px; font-weight: 600; }
.name.dim { opacity: 0.3; }
.name.gone { opacity: 0; pointer-events: none; }
/* a spoke name: a point on the page, with the words turned around it */
.name.spoke { width: 0; height: 0; font-size: 11px; }
.name.spoke span { position: absolute; top: 0; white-space: nowrap; }
.name.spoke.on { font-size: 14px; }

.city {
  padding: 3px 7px;
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--pink);
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 8px rgba(233, 52, 237, 0.35);
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}
.city.on { background: rgba(233, 52, 237, 0.22); }
.city.slim { padding: 1px 6px; font-size: 11px; }

/* ----- the flat layer on top ----- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--green);
}
.corner.tl { top: 18px; left: 18px; border-right: none; border-bottom: none; }
.corner.tr { top: 18px; right: 18px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 18px; left: 18px; border-right: none; border-top: none; }
.corner.br { bottom: 18px; right: 18px; border-left: none; border-top: none; }
#title { position: absolute; top: 26px; left: 56px; font-size: 15px; }
#count { position: absolute; top: 46px; left: 56px; opacity: 0.8; }
#last { position: absolute; bottom: 64px; left: 56px; }
#source { position: absolute; bottom: 88px; left: 56px; }
#hint { position: absolute; top: 26px; right: 56px; opacity: 0.6; font-size: 11px; text-align: right; }
#legend { position: absolute; bottom: 18px; left: 56px; font-size: 13px; }
#legend span { margin-right: 16px; }
#legend img {
  width: 36px;
  height: 36px;
  margin-right: 2px;
  vertical-align: middle;
}

/* the button that opens the form panel */
#add {
  position: absolute;
  top: 20px;
  right: 56px;
  padding: 11px 22px;
  font: inherit;
  font-size: 17px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: #000000;
  background: var(--pink);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 14px rgba(233, 52, 237, 0.7);
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.4s, background 0.2s;
}
#add:hover { background: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(112, 240, 77, 0.7); }
#add span[lang="fa"] { display: block; margin-top: 3px; font-family: "Vazirmatn", sans-serif; font-size: 0.85em; letter-spacing: 0; }
#add { text-align: center; line-height: 1.25; }
#add.hidden { opacity: 0; pointer-events: none; }

/* ----- the form panel, floating in front of the eye ----- */
#entry {
  display: flex;
  flex-direction: column;
  width: 520px;
  min-height: 390px;
  box-sizing: border-box;
  padding: 14px 26px 14px;
  color: var(--pink);
  background: rgba(0, 0, 0, 0.84);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 22px rgba(233, 52, 237, 0.35);
  font-size: 13px;
  letter-spacing: 0.05em;
  backface-visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s;
}
#entry.open { opacity: 1; }
#entry i { font-style: normal; font-family: "Vazirmatn", sans-serif; letter-spacing: 0; }
#entry button {
  font: inherit;
  letter-spacing: 0.06em;
  color: var(--pink);
  cursor: pointer;
}
#entry .top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; opacity: 0.8; }
#entry .top .close { padding: 0; background: none; border: none; font-size: 11px; }
#entry .top .close:hover { text-decoration: underline; }

/* one question at a time */
#entry .step { display: none; flex: 1; flex-direction: column; justify-content: center; padding: 12px 0 4px; }
#entry .step.on { display: flex; }
#entry .q { font-size: 17px; text-align: center; }
#entry .q.fa { margin-top: 4px; font-family: "Vazirmatn", sans-serif; font-size: 15px; letter-spacing: 0; }
#entry .q.big { font-size: 22px; }
#entry .q.fa.big { margin-top: 6px; font-size: 19px; }
#entry .q.small { font-size: 12px; line-height: 1.65; }
#entry .q.fa.small { margin-top: 10px; font-size: 12px; line-height: 1.8; }
#entry .q.small.but { margin-top: 16px; }
#entry .math { font-family: "Times New Roman", serif; font-style: italic; font-size: 1.1em; letter-spacing: 0; white-space: nowrap; }
#entry .choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
#entry .choices button, #entry .actions button {
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid var(--pink);
}
#entry .choices button:hover, #entry .actions button:hover { background: rgba(233, 52, 237, 0.22); }

/* the long box that has to be scrolled to the end */
#entry .scroller {
  height: 200px;
  margin-top: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  border-top: 1px dashed rgba(233, 52, 237, 0.45);
  border-bottom: 1px dashed rgba(233, 52, 237, 0.45);
  scrollbar-width: thin;
  scrollbar-color: var(--pink) transparent;
}
#entry .scroller .long { padding-top: 10px; }
#entry .scroller .long div { height: 90px; font-size: 11px; opacity: 0.45; }
#entry .scroller button {
  margin: 24px 0 28px;
  padding: 6px 18px;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 8px rgba(233, 52, 237, 0.35);
}
#entry .scroller button:hover { background: rgba(233, 52, 237, 0.22); }

#entry label, #entry .agerow { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
#entry label > span, #entry .agerow > span { width: 96px; flex: none; }
/* the tick box under the question about servers and oppressors */
#entry label.tick { justify-content: center; gap: 10px; margin-top: 18px; cursor: pointer; }
#entry label.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#entry label.tick .box {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
#entry label.tick:hover .box, #entry label.tick input:focus-visible + .box { border-color: var(--green); }
#entry label.tick input:checked + .box { background: var(--pink); color: #000000; }
#entry label.tick input:checked + .box::after { content: "\2713"; }
#entry input {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  color: var(--pink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--pink);
  outline: none;
  font-family: "Share Tech Mono", "Vazirmatn", monospace;
  font-size: 15px;
  user-select: text;
}
#entry input:hover, #entry input:focus { border-bottom-color: var(--green); }
#entry .ages { display: flex; flex: 1; justify-content: space-between; }
#entry .ages button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 3px 3px;
  font-size: 11px;
  background: none;
  border: 1px solid transparent;
}
#entry .ages button img { width: 34px; height: 34px; }
#entry .ages button:hover { border-color: rgba(233, 52, 237, 0.5); }
#entry .ages button.on { border-color: var(--pink); background: rgba(233, 52, 237, 0.22); }
#entry .note { margin-top: 14px; font-size: 11px; line-height: 1.6; text-align: center; opacity: 0.85; }
#entry .actions { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
#entry .actions .send { box-shadow: 0 0 8px rgba(233, 52, 237, 0.35); }
#entry .actions button:disabled { opacity: 0.5; cursor: default; }
#entry .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#entry .msg { min-height: 16px; margin-top: 8px; font-size: 12px; text-align: center; }

#tooltip {
  position: fixed;
  z-index: 2;
  display: none;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--pink);
  color: var(--pink);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  pointer-events: none;
}

/* the hover box for a person: no box, just the body outline */
#tooltip.body {
  padding: 0;
  background: none;
  border: none;
  white-space: normal;
}
#tooltip.body svg {
  display: block;
  filter: drop-shadow(0 0 6px rgba(233, 52, 237, 0.35));
}

/* the green glare of the lighthouse moment, over everything */
#glare {
  position: fixed;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
#glare i { position: absolute; }
#glare .flood {
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
    rgba(245, 255, 240, 1) 0%,
    rgba(200, 255, 180, 1) 6%,
    rgba(112, 240, 77, 0.95) 16%,
    rgba(112, 240, 77, 0.65) 38%,
    rgba(112, 240, 77, 0.42) 70%,
    rgba(112, 240, 77, 0.35) 100%);
}
#glare .ring {
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  border: 2px solid rgba(200, 255, 180, 0.55);
  box-shadow: 0 0 18px rgba(112, 240, 77, 0.6), inset 0 0 18px rgba(112, 240, 77, 0.6);
}
#glare .streak {
  left: 0;
  right: 0;
  top: var(--y, 50%);
  height: 4px;
  margin-top: -2px;
  background: linear-gradient(90deg, transparent, rgba(235, 255, 225, 0.95) 50%, transparent);
  box-shadow: 0 0 26px 10px rgba(112, 240, 77, 0.6);
}

@media (max-width: 640px) {
  #hint { display: none; }
  #title { font-size: 13px; }
  #add { right: 50%; transform: translateX(50%); top: 20px; white-space: nowrap; font-size: 14px; padding: 9px 16px; }
  #legend { left: 44px; right: 44px; bottom: 18px; font-size: 10px; }
  #legend span { margin-right: 6px; white-space: nowrap; }
  #legend img { width: 22px; height: 22px; }
  #last { left: 44px; bottom: 108px; font-size: 11px; }
  #source { display: none; }
  #entry { width: 340px; min-height: 430px; padding: 12px 16px 12px; }
  #entry .q.big { font-size: 19px; }
  #entry .choices button { padding: 6px 10px; }
  #entry label > span, #entry .agerow > span { width: 70px; }
  #entry .agerow { align-items: flex-start; }
  #entry .ages button img { width: 26px; height: 26px; }
  #entry .ages button { font-size: 9px; padding: 1px; }
}
