:root {
  --bg: #14110f;
  --panel: #201b18;
  --panel-2: #2a231f;
  --text: #f4ede4;
  --muted: #b8a99b;
  --border: #403630;
  --accent: #d9a441;
  --accent-dark: #a97819;
  --danger: #e57373;
  --good: #8bc48a;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 164, 65, 0.16), transparent 30%),
    linear-gradient(135deg, #14110f, #211b18 55%, #100d0c);
  color: var(--text);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1d160c;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: #efbd58;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: var(--panel-2);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  background: #120f0d;
  color: var(--text);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 48px 0 24px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  margin: 0 0 12px;
}

h1 {
  font-family: "Aptos Display", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 0.98;
  margin: 0;
  letter-spacing: -0.045em;
  font-weight: 750;
}

h2,
.book-title,
button,
input {
  font-family: "Aptos", "Inter", "Segoe UI", system-ui, sans-serif;
}

h2 {
  margin: 0;
  font-size: 1.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 680px;
  line-height: 1.6;
}

.panel {
  background: rgba(32, 27, 24, 0.84);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 24px 60px var(--shadow);
  backdrop-filter: blur(10px);
}

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

.section-header p {
  color: var(--muted);
  margin: 6px 0 0;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.status {
  min-height: 24px;
  color: var(--muted);
  margin-top: 12px;
}

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

.status.good {
  color: var(--good);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.book-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.cover-wrap {
  height: 260px;
  background: #15110f;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
}

.cover-wrap img {
  max-height: 240px;
  max-width: 165px;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.no-cover {
  color: var(--muted);
  border: 1px dashed var(--border);
  padding: 28px;
  border-radius: 12px;
}

.book-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.book-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.book-meta,
.book-rating,
.book-description {
  color: var(--muted);
  line-height: 1.45;
}

.book-description {
  font-size: 0.95rem;
  max-height: 105px;
  overflow: hidden;
}

.nomination-list,
.results,
.vote-choices {
  display: grid;
  gap: 12px;
}

.nomination-item,
.result-item,
.vote-choice {
  background: #171310;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}

.nomination-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
}

.nomination-item img {
  width: 72px;
  height: 108px;
  object-fit: cover;
  border-radius: 8px;
  background: #0f0c0b;
}

.vote-box {
  display: grid;
  gap: 12px;
}

.vote-choice label {
  display: flex;
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.vote-choice input {
  width: auto;
  margin-top: 4px;
}

.result-bar {
  margin-top: 8px;
  height: 10px;
  background: #0f0c0b;
  border-radius: 999px;
  overflow: hidden;
}

.result-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
}

dialog {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 24px;
  padding: 0;
  width: min(560px, calc(100% - 24px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.dialog-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

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

.preview {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: start;
  background: #171310;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
}

.preview img {
  width: 76px;
  height: 114px;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 680px) {
  .search-row,
  .nomination-item,
  .preview {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
  }

  .cover-wrap {
    height: 220px;
  }
}

.admin-panel {
  border-color: rgba(229, 115, 115, 0.35);
}

.admin-box {
  display: grid;
  gap: 12px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button.danger {
  background: #8f2f2f;
  color: #fff4f4;
}

button.danger:hover {
  background: #b43b3b;
}
