:root {
  color-scheme: dark;
  --bg: #05040b;
  --panel: rgba(10, 8, 22, 0.5);
  --panel-border: rgba(255, 214, 170, 0.14);
  --text: #fff4ea;
  --muted: #c8b6d9;
  --accent: #ffffff;
  --danger: #ff9ea8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(rgba(5, 4, 11, 0.54), rgba(5, 4, 11, 0.82)),
    url("/background.png") center center / cover no-repeat,
    radial-gradient(circle at top, rgba(255, 201, 163, 0.1), transparent 32%),
    var(--bg);
  color: var(--text);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.shell > * {
  width: min(100%, 34rem);
}

.eyebrow {
  margin: 0 0 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.78rem;
}

.current-word {
  margin: 0 0 1.5rem;
  font-size: clamp(2.8rem, 10vw, 6rem);
  line-height: 0.95;
  text-wrap: balance;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.word-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  margin: 0 auto;
  padding: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.word-form input,
.word-form button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
}

.word-form input {
  min-width: 0;
  padding: 0.95rem 1.2rem;
  background: transparent;
  color: var(--text);
  outline: none;
}

.word-form input::placeholder {
  color: #808080;
}

.word-form button {
  padding: 0.95rem 1.2rem;
  background: #ffe9d2;
  color: #1a1020;
  cursor: pointer;
}

.message,
.meta,
.published-label,
#published-text,
.footer-note {
  margin: 1rem auto 0;
}

.message {
  min-height: 1.5rem;
  color: var(--muted);
}

.message.error {
  color: var(--danger);
}

.meta,
.published-label,
.footer-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.message + .meta {
  margin-top: 2.5rem;
}

.story-notes {
  margin-top: 3rem;
}

.story-notes .meta,
.story-notes .footer-note {
  margin-top: 0.5rem;
}

.footer-note {
  max-width: 28rem;
  line-height: 1.6;
}

.published-story {
  margin-top: 1rem;
}

#published-text {
  line-height: 1.7;
}

.hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .word-form {
    grid-template-columns: 1fr;
    border-radius: 1.25rem;
  }
}
