:root {
  color-scheme: light dark;
  --font-body: Georgia, "Times New Roman", serif;
  --font-ui: system-ui, sans-serif;
  --max-width: 42rem;
}

body {
  font-family: var(--font-body);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  line-height: 1.6;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-ui);
  margin-bottom: 2rem;
}

.site-header nav a {
  margin-left: 1rem;
}

.profile-menu {
  display: inline-block;
  margin-left: 1rem;
  position: relative;
}

.profile-menu summary {
  cursor: pointer;
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu summary::after {
  content: " \25BE";
}

.profile-menu-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: canvas;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  min-width: 14rem;
  font-size: 0.9rem;
  z-index: 1;
}

.profile-menu-panel p {
  margin: 0.5rem 0;
}

.form-error {
  font-weight: bold;
}

.site-title {
  font-weight: bold;
  text-decoration: none;
}

.word-count {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.7;
}

.share-links {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.7;
}

.share-links a {
  margin-left: 0.35rem;
}

.story-paragraph {
  margin: 1.5rem 0;
}

.story-paragraph.pending {
  opacity: 0.6;
}

.volume-heading,
.chapter-heading {
  font-family: var(--font-ui);
  margin-top: 2.5rem;
}

.vote-options {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin: 1rem 0;
  padding-bottom: 0.75rem;
}

.vote-option {
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  padding: 1rem;
  flex: 0 0 18rem;
  scroll-snap-align: start;
}

.leaderboard {
  list-style: decimal;
  padding-left: 1.5rem;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid currentColor;
}

.leaderboard-count {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.7;
  white-space: nowrap;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: canvas;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  max-width: calc(100% - 3rem);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  font-weight: bold;
}

.site-footer {
  margin-top: 3rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  opacity: 0.6;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Redundant with [hidden]'s own display:none, but authoritative: an
     author stylesheet rule at equal specificity beats the UA stylesheet
     rule [hidden] relies on, so this class must not set display
     unconditionally or it would silently defeat the hidden attribute. */
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: canvas;
  border-top: 1px solid currentColor;
  padding: 1rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  z-index: 20;
}

.cookie-consent:not([hidden]) {
  display: flex;
}

.cookie-consent p {
  margin: 0;
  flex: 1 1 20rem;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
