/* Turn entries, roll breakdown, health loss, act headers */

.turn-entry { border-left: 2px solid var(--border-color); padding-left: 0.75rem; }
.turn-entry.prologue { border-left-color: var(--theme-accent); }
.turn-entry.success { border-left-color: var(--color-success); }
.turn-entry.partial { border-left-color: var(--color-partial); }
.turn-entry.failure { border-left-color: var(--color-failure); }
.turn-entry.ending { border-left-color: var(--theme-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 12%, transparent), transparent); padding: 0.8rem 0.75rem; border-radius: 2px; }
.turn-entry.ending.completed { border-left-color: var(--theme-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 12%, transparent), transparent); }
.turn-entry.ending.failed { border-left-color: var(--color-failure); background: linear-gradient(180deg, rgba(144, 48, 48, 0.12), transparent); }
.turn-ending-label { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.3em; color: var(--theme-accent); text-transform: uppercase; margin-bottom: 0.6rem; }
.turn-entry.ending.completed .turn-ending-label { color: var(--theme-accent); }
.turn-entry.ending.failed .turn-ending-label { color: var(--color-failure-text); }
.turn-action { font-family: 'Lora', Georgia, serif; font-style: italic; color: var(--text-muted); font-size: 0.84rem; margin-bottom: 0.45rem; }
.turn-narrative { font-family: var(--theme-font); color: var(--theme-text); line-height: 1.7; font-size: 0.92rem; white-space: pre-wrap; }
.turn-meta { font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.2em; color: var(--text-dim); margin-top: 0.4rem; text-transform: uppercase; }
.turn-time { font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.2em; color: var(--text-dim); margin-bottom: 0.3rem; text-transform: uppercase; }
.act-header { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.3em; color: var(--theme-accent); text-transform: uppercase; text-align: center; margin-bottom: 0.6rem; opacity: 0.8; }
.roll-breakdown { display: grid; grid-template-columns: max-content max-content; column-gap: 1.2rem; row-gap: 0.18rem; align-items: center; width: max-content; margin-top: 0.4rem; margin-bottom: 0.7rem; font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-muted); }
.roll-row-label { color: var(--text-dim); text-transform: uppercase; font-size: 0.58rem; letter-spacing: 0.15em; }
.roll-row-value { text-align: right; color: var(--text-mid); }
.roll-divider { grid-column: 1 / -1; height: 1px; background: var(--text-dim); opacity: 0.3; margin: 0.15rem 0; }
.roll-total { font-weight: 600; color: var(--text-mid); }
.roll-threshold { color: var(--text-mid); font-weight: 600; }
.roll-verdict { display: inline-block; font-size: 0.6rem; letter-spacing: 0.15em; padding: 0.1rem 0.35rem; border-radius: 1px; }
.roll-verdict.success { color: var(--color-success); border: 1px solid var(--color-success); }
.roll-verdict.partial { color: var(--color-partial); border: 1px solid var(--color-partial); }
.roll-verdict.failure { color: var(--color-failure); border: 1px solid var(--color-failure); }
.roll-difficulty { font-size: 0.58rem; color: var(--text-dim); letter-spacing: 0.1em; }
.health-loss { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.12em; color: var(--color-danger-text); margin-top: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.health-loss-icon { font-size: 0.7rem; }
.health-loss-value { font-weight: 600; }
.health-gain { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.12em; color: var(--color-heal); margin-top: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.health-gain-icon { font-size: 0.7rem; }
.health-gain-value { font-weight: 600; }

/* Player continuation — resumes the previous turn's moment, so it reads as one
   passage: pull it up over the .turn-log flex gap and drop the left rule, but
   keep the 2px so the text stays aligned with the turn above. */
.turn-entry.continuation-player { margin-top: -1rem; border-left-color: transparent; }

/* Continue arrow. Only ever shown on the newest entry — while a turn streams,
   the JS placeholder is #turn-log's last child, so this hides itself and comes
   back when the finished turn is appended. */
.turn-continue { display: none; margin-top: 0.6rem; padding: 0.15rem 0.6rem; background: transparent; border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent); border-radius: 1px; color: var(--text-dim); font-size: 0.8rem; line-height: 1.2; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.turn-continue:hover { color: var(--theme-accent); border-color: color-mix(in srgb, var(--theme-accent) 55%, transparent); }
.turn-continue:disabled { opacity: 0.4; cursor: default; }
.turn-entry:last-child .turn-continue { display: inline-block; }

/* Turn failure notice — lives outside #turn-log so it can't displace the
   newest .turn-entry and hide the continue arrow. */
.turn-error { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.12em; color: var(--color-danger-text); text-transform: uppercase; padding: 0.5rem 1rem; }

/* Quest turn styles */
.turn-entry.quest-ending { border-left-color: var(--theme-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 8%, transparent), transparent); padding: 0.8rem 0.75rem; border-radius: 2px; }
.turn-entry.quest-completed { border-left-color: var(--color-success); background: linear-gradient(180deg, rgba(80, 122, 96, 0.08), transparent); }
.turn-entry.quest-failed { border-left-color: var(--color-failure); background: linear-gradient(180deg, rgba(144, 48, 48, 0.08), transparent); }
.quest-ending-label { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 0.6rem; }
.quest-ending-label.quest-completed { color: var(--color-success); }
.quest-ending-label.quest-failed { color: var(--color-failure-text); }
.quest-hook-indicator { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.2em; color: var(--theme-accent); text-transform: uppercase; margin-top: 0.6rem; opacity: 0.8; }

/* Loading indicator — three pulsing dots */
.loading-indicator {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0;
}
.loading-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted, #666);
  animation: loadPulse 1.4s ease-in-out infinite;
}
.loading-indicator span:nth-child(2) { animation-delay: 0.2s; }
.loading-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Scene intro (inline after narrative) */
.scene-intro {
  margin-top: 0.8rem;
  font-family: var(--theme-font);
  color: var(--theme-text);
  font-size: 0.92rem;
  line-height: 1.7;
}
.scene-intro-header {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--theme-accent);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.4rem;
}
.scene-intro-description {
  margin-bottom: 0.5rem;
  opacity: 0.85;
}
.scene-intro-entity {
  color: var(--text-mid);
}
.scene-intro-entity strong { color: var(--theme-text); }

/* Inline scenario images (act intros & scene entries) */
.turn-image { margin: 0.6rem 0; text-align: center; }
.turn-image img { max-width: 100%; max-height: 280px; border-radius: 4px; opacity: 0.9; }

/* Hints — a teaching note attached to the turn it came due on. Deliberately
   unlike the prose around it: sans-serif, indented behind a marker, so a
   reader's eye can skip the whole block without having to read a line of it
   first and discover it is not the story. */
.turn-hint {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-left: 2px solid var(--theme-accent);
  background: rgba(127, 127, 127, 0.07);
  border-radius: 0 3px 3px 0;
}
.turn-hint-icon {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  line-height: 1.05rem;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--theme-accent);
  color: var(--theme-accent);
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 0.1rem;
}
.turn-hint-body { flex: 1 1 auto; min-width: 0; }
.turn-hint-text {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted, #888);
}
.turn-hint-dismiss {
  margin-top: 0.4rem;
  padding: 0;
  background: none;
  border: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-muted, #888);
  opacity: 0.65;
  cursor: pointer;
  text-decoration: underline;
}
.turn-hint-dismiss:hover { opacity: 1; }
