:root {
  color-scheme: light;
  --bg: #f4ede2;
  --card: rgba(255, 250, 244, 0.92);
  --border: #d3c0aa;
  --text: #2f241d;
  --muted: #7a695c;
  --accent: #bc5f3e;
  --accent-dark: #96462d;
  --accent-soft: rgba(188, 95, 62, 0.14);
  --table-line: rgba(47, 36, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(188, 95, 62, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 84, 58, 0.12), transparent 24%),
    linear-gradient(180deg, #efe2d2 0%, var(--bg) 100%);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 860px);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(46, 36, 29, 0.12);
}

.header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  color: #fff8f0;
  background: var(--accent);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(150, 70, 45, 0.22);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid rgba(47, 36, 29, 0.12);
  box-shadow: none;
}

.secondary-button:hover {
  background: rgba(243, 232, 221, 0.95);
  box-shadow: none;
}

.danger-button {
  background: #9e3d31;
}

.danger-button:hover {
  background: #7f2f25;
}

.add-word-form {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(188, 95, 62, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 247, 239, 0.94));
}

.add-word-form[hidden],
.admin-form[hidden],
.pending-panel[hidden] {
  display: none !important;
}

.admin-form {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(47, 36, 29, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 248, 0.78);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fffdf9;
}

input:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.status-message {
  margin: 0;
  color: var(--muted);
}

.status-message[data-state="error"] {
  color: #9e3d31;
}

.status-message[data-state="success"] {
  color: #3f6b48;
}

.definition-list {
  display: grid;
  gap: 10px;
}

.definition-item {
  display: flex;
  gap: 8px;
  align-items: start;
}

.definition-item strong {
  min-width: 1.5rem;
}

.definition-actions {
  display: grid;
  gap: 10px;
}

.pending-panel {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid rgba(47, 36, 29, 0.12);
  border-radius: 20px;
  background: rgba(255, 252, 248, 0.84);
}

.panel-header {
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.pending-list {
  display: grid;
  gap: 14px;
}

.pending-card {
  padding: 16px;
  border: 1px solid var(--table-line);
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.96);
}

.pending-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.pending-card p {
  margin: 0;
}

.pending-meta {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 0.9rem;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--table-line);
  border-radius: 18px;
  background: rgba(255, 252, 248, 0.86);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(188, 95, 62, 0.1);
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

tbody tr + tr td {
  border-top: 1px solid var(--table-line);
}

tbody td:first-child {
  width: 32%;
  font-weight: 600;
}

.empty {
  margin: 20px 0 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .card {
    padding: 24px;
  }

  .header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: stretch;
  }

  button {
    width: 100%;
  }

  th,
  td {
    padding: 12px 14px;
  }
}
