/* Options, the sightings panel, arrows between popup panels */

/* Options */
.options-panel {
  flex-direction: column;
  gap: 12px;
  width: min(320px, 100%);
  padding: 24px;
}

.options-panel h2 {
  margin: 0 0 8px;
}

.options-panel .ui-button {
  width: 100%;
}

/* ---- Sightings panel: everywhere a glyph has been seen ---- */

/* Glyphs in the notebook's lists open it */
.glyph.has-sightings {
  cursor: pointer;
}

.notebook-empty {
  margin-top: 14px;
  font-style: italic;
  color: rgba(43, 33, 24, 0.7);
}

.sightings-overlay {
  z-index: 15; /* above the notebook */
}

/* Fixed size, so going through the places moves nothing */
.sightings-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(560px, 100%);
  /* its usual size, growing only if a long line wraps (and never taller than the screen) */
  min-height: min(360px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  padding: 28px 24px 20px;
  color: var(--stone-light);
  background: var(--forest-dark);
  border: 1px solid var(--stone);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* The glyph and its meaning */
.sightings-glyph {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sightings-glyph .glyph-meaning {
  width: auto;
  font-size: 1.6rem;
}

.sightings-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.sightings-content {
  flex: 1;
  min-width: 0; /* lets its line of glyphs wrap instead of pushing the panel wider */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 150px;
  padding: 16px;
  background: var(--forest-darkest);
  border: 1px solid var(--stone-dark);
  border-radius: 6px;
}

.sightings-where {
  margin: 0;
  font-size: 1.15rem;
  text-align: center;
  color: var(--stone-light);
}

.sightings-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

/* Smaller glyphs here, so a line of four or five fits; longer ones wrap onto another row */
.sightings-line .glyph {
  width: 56px;
  height: 56px;
  font-size: 0.95rem;
}

.sightings-glyph .glyph {
  width: 64px;
  height: 64px;
}


.sightings-nav {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0 0 6px;
  font: inherit;
  font-size: 3rem;
  line-height: 1;
  color: var(--stone-light);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.sightings-nav:hover:not(:disabled) {
  color: var(--sunlight);
  transform: scale(1.15);
}

.sightings-nav:disabled {
  opacity: 0.2;
  cursor: default;
}

.sightings-count {
  margin: 0;
  color: var(--stone);
}

/* ---- Arrows between the panels of a popup (e.g. the spirit's narrative and conversation) ---- */
.panel-arrow {
  width: 64px;
  height: 64px;
  padding: 0 0 8px;
  font: inherit;
  font-size: 4.2rem;
  line-height: 1;
  color: var(--stone-light);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.panel-arrow:hover,
.panel-arrow:focus-visible {
  color: var(--sunlight);
  outline: none;
}

/* Forward: at the end of the narrative, on the right */
.panel-arrow.is-forward {
  align-self: flex-end;
  margin: -8px -20px -12px 0;
}

/* Forward, in the bottom right corner of the last lines (the light in the grass, a spirit's narrative):
   it adds no room below; the text beside it keeps clear of it (the same on both sides, so it stays centred) */
.poi-step:has(> .poi-step-content .panel-arrow.is-corner) .poi-step-content,
.poi-step:has(> .panel-arrow.is-corner) .poi-step-content {
  padding: 0 40px;
}

/* (the arrow itself) */
.panel-arrow.is-forward.is-corner {
  position: absolute;
  right: -20px;
  bottom: -18px;
  margin: 0;
}

.panel-arrow.is-forward:hover {
  transform: translateX(4px) scale(1.1);
}

/* Back: in the conversation's top left corner */
.panel-arrow.is-back {
  position: absolute;
  top: 6px;
  left: 10px;
  z-index: 1;
}

.panel-arrow.is-back:hover {
  transform: translateX(-4px) scale(1.1);
}
