body {
  font-family: "Cormorant Garamond", "Garamond", "Palatino", "Georgia", serif;
  background: #050505;
  color: #f5f5f5;
  line-height: 1.65;
  font-size: 20px;
}

a,
a:visited,
a:hover,
a:active {
  color: #f5f5f5;
}

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 300;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.word-scroll {
  margin-top: 3rem;
}

.word-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.word-list > li {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #2d2d2d;
}

.word-list h2 {
  font-size: 1.6rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
}

.sense-list {
  margin: 0;
  padding-left: 1.4rem;
}

.sense-list li {
  margin-bottom: 0.45rem;
}

.citation-snippets {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.citation-snippets blockquote {
  margin: 0;
  font-style: italic;
}

.citation-snippets cite {
  display: block;
  font-size: 0.85rem;
  color: #b3b3b3;
}

.random-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 0 auto 2.5rem;
  max-width: 600px;
  text-align: center;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.2rem;
    letter-spacing: 0.06em;
  }

  .random-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .random-grid .random-card:nth-child(9) {
    display: none;
  }
}


.random-card {
  border: 1px solid #666;
  padding: 1.5rem 0;
  font-size: 1.6rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: background 120ms ease, border-color 120ms ease;
}

.random-card .headword {
  display: inline-block;
  letter-spacing: 0.06em;
}

.random-card:hover,
.random-card:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: #888;
}

.random-detail {
  border-top: 1px solid #2d2d2d;
  padding-top: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
  min-height: 120px;
  font-family: inherit;
}

.random-detail h2 {
  font-weight: 500;
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.random-detail ol {
  margin: 0 0 1rem 1.6rem;
  font-size: 1.15rem;
  line-height: 1.6;
  font-family: inherit;
}

.random-detail ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: inherit;
}

.random-detail blockquote {
  margin: 0;
  font-style: italic;
  font-size: 1.1rem;
  font-family: inherit;
}

.random-detail cite {
  display: block;
  font-size: 0.95rem;
  color: #b3b3b3;
  margin-top: 0.35rem;
  font-family: inherit;
}

.themes-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.themes-list h2 {
  font-weight: normal;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.theme-word {
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #666;
  color: inherit;
  text-decoration: none;
  font-size: 1.4rem;
  line-height: 1;
}

.icon-button:hover {
  background: #111;
}

.back-link {
  margin-top: 2.5rem;
  text-align: center;
}

.back-link.top {
  margin-top: 0;
  margin-bottom: 2rem;
}

footer {
  margin-top: 4rem;
  text-align: center;
  color: #8a8a8a;
}

.random-list.only-words ol {
  list-style-position: outside;
  padding-left: 1.5rem;
}

.random-list.only-words li {
  padding-bottom: 0.4rem;
}

.editable-scroll .word-list > li {
  border-bottom: 1px solid #333;
}

.word-edit-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 120ms ease;
}

.word-edit-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.flash-success {
  margin-top: 1rem;
  color: #9ddf9f;
}

.flash-error {
  margin-top: 1rem;
  color: #f4a6a6;
}

.word-edit-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.edit-section h2 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sense-list-editor {
  display: grid;
  gap: 1rem;
}

.inline-action {
  margin-top: -1rem;
}

.form-group textarea,
.form-group input,
.citation-group textarea,
.citation-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #444;
  color: inherit;
  padding: 0.6rem 0.75rem;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.citation-group {
  border: 1px solid #444;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.citation-group legend {
  padding: 0 0.25rem;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.form-actions .button-primary {
  background: #f5f5f5;
  color: #050505;
  border: none;
  padding: 0.6rem 1.4rem;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
}

.form-actions .button-primary:hover {
  background: #e2e2e2;
}

.button-secondary {
  background: transparent;
  border: 1px solid #f5f5f5;
  color: #f5f5f5;
  padding: 0.85rem 1.6rem;
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

.form-actions .button-delete {
  background: transparent;
  border: 1px solid #f4a6a6;
  color: #f4a6a6;
  padding: 0.6rem 1.4rem;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
  margin-right: auto;
}

.form-actions .button-delete:hover {
  background: rgba(244, 166, 166, 0.1);
}
