:root {
  --bg: #0f0c14;
  --panel: rgba(25, 18, 10, 0.78);
  --panel-light: rgba(241, 224, 189, 0.9);
  --ink: #2a1606;
  --gold: #d7b56d;
  --gold-soft: #f1dc9a;
  --accent: #7c1927;
  --accent-dark: #4c0d17;
  --line: rgba(88, 55, 18, 0.35);
  --success: #245c3d;
  --error: #7f1d1d;
  --white: #f8f4eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Cormorant Garamond', serif;
  color: var(--white);
  background:
    radial-gradient(circle at top, rgba(124, 25, 39, 0.35), transparent 32%),
    radial-gradient(circle at bottom, rgba(120, 87, 28, 0.25), transparent 28%),
    linear-gradient(180deg, #110d18 0%, #09070c 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.02), rgba(255,255,255,0.02)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015), rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  opacity: 0.4;
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px;
}

.topbar,
.panel,
.guess-card,
.message,
.button,
input,
select,
textarea,
table {
  border-radius: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid rgba(215, 181, 109, 0.3);
  background: linear-gradient(180deg, rgba(20, 12, 6, 0.82), rgba(32, 18, 10, 0.72));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

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

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

h1,
h2,
h3,
label,
th {
  font-family: 'Cinzel Decorative', serif;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--gold-soft);
}

h2 {
  margin-top: 0;
  color: #5b2b07;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

p,
li,
td,
input,
select,
textarea,
button {
  font-size: 1.15rem;
}

.panel {
  padding: 28px;
  border: 1px solid rgba(215, 181, 109, 0.25);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.parchment {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.24), transparent 22%),
    linear-gradient(180deg, rgba(250, 236, 206, 0.98), rgba(227, 201, 156, 0.96));
  position: relative;
  overflow: hidden;
}

.parchment::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 25%, rgba(123, 54, 12, 0.07), transparent 18%),
    radial-gradient(circle at 80% 75%, rgba(123, 54, 12, 0.08), transparent 18%),
    repeating-linear-gradient(45deg, rgba(112, 69, 22, 0.025), rgba(112, 69, 22, 0.025) 2px, transparent 2px, transparent 7px);
  mix-blend-mode: multiply;
}

.narrow {
  max-width: 620px;
  margin: 0 auto;
}

.intro {
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.guess-form,
.login-form,
.admin-layout,
.field-group,
.actions,
.table-wrap {
  position: relative;
  z-index: 1;
}

.field-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #4a2100;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(91, 43, 7, 0.28);
  background: rgba(255, 250, 239, 0.84);
  color: #2d1705;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 25, 39, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 25, 39, 0.14);
  transform: translateY(-1px);
}

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

.guess-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.guess-card {
  padding: 16px;
  background: rgba(255, 248, 233, 0.48);
  border: 1px solid rgba(91, 43, 7, 0.16);
  backdrop-filter: blur(2px);
}

.actions {
  margin-top: 24px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border: 1px solid rgba(80, 34, 9, 0.3);
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff5d5;
  font-family: 'Cinzel Decorative', serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(76, 13, 23, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(76, 13, 23, 0.3);
  filter: brightness(1.04);
}

.button.ghost {
  background: linear-gradient(180deg, rgba(33, 21, 11, 0.88), rgba(21, 14, 8, 0.92));
  color: var(--gold-soft);
}

.button.danger {
  background: linear-gradient(180deg, #8b1f1f, #611414);
}

.message {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid transparent;
}

.message.success {
  color: #e9ffe9;
  background: rgba(36, 92, 61, 0.88);
  border-color: rgba(255,255,255,0.15);
}

.message.error {
  color: #fff1ee;
  background: rgba(127, 29, 29, 0.88);
  border-color: rgba(255,255,255,0.12);
}

.message ul {
  margin: 8px 0 0 20px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: rgba(255, 248, 233, 0.58);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-align: left;
}

th {
  background: rgba(91, 43, 7, 0.1);
  color: #4a2100;
  position: sticky;
  top: 0;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.18);
}

select option:disabled {
  color: #977657;
}

@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }

  .panel {
    padding: 20px;
  }
}
