:root {
  --ink: #f2e6c9;
  --muted: #b9a888;
  --gold: #c9a45c;
  --danger: #a33a2c;
  --ok: #3d7a4a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: #0c0907;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 70, 28, 0.35), transparent 55%),
    linear-gradient(180deg, #1a120c 0%, #0a0806 100%);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 28px 28px 8px;
}
.header-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.auth-panel { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.auth-link { color: var(--gold); }

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

.eyebrow.repeal,
h2.repeal {
  color: #e25a4c;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.badge {
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
}
.badge.online { border-color: var(--ok); color: #cfe8d4; }
.badge.offline { border-color: #6a5040; color: var(--muted); }

.panel {
  margin: 16px 28px 24px;
  padding: 22px 24px;
  background: linear-gradient(165deg, #5a3a22 0%, #2e1a10 100%);
  border: 7px solid #24140c;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.phrase-panel .phrase {
  margin: 10px 0 6px;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  line-height: 1.35;
  color: var(--ink);
}

.short { margin: 0; color: var(--gold); }
.meta, .muted, .status, .lead { color: var(--muted); }
.status { margin: 14px 0 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field span { letter-spacing: 0.04em; }

select, input[type="text"], input[type="number"], textarea {
  font: inherit;
  color: var(--ink);
  background: #1a100a;
  border: 1px solid #6a5040;
  border-radius: 4px;
  padding: 10px 12px;
}
textarea {
  width: 100%;
  min-height: 4.5em;
  resize: vertical;
}
.admin-add { margin-top: 16px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.inline input { min-width: 140px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #1a1008;
  border-radius: 4px;
  padding: 12px 18px;
  color: var(--ink);
  background: linear-gradient(#6a4428, #3f2616);
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: wait; }
button.ghost { background: transparent; border-color: #6a5040; }
button.danger {
  background: linear-gradient(#8a3a2c, #5a2218);
  border-color: #3a140e;
}

.error { min-height: 1.2em; margin: 12px 0 0; color: #f0a090; }
.hidden { display: none !important; }
.amend { margin-top: 18px; padding-top: 8px; border-top: 1px solid rgba(201,164,92,.25); }
.extras { margin-top: 14px; }

.equipment-panel { margin-top: 20px; padding: 20px; border: 1px solid rgba(201,164,92,.5); background: #160f0b; }
.equipment-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.equipment-heading h2 { margin: 3px 0 0; }
.equipment-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; margin: 18px 0; }
.equipment-slot { min-height: 76px; padding: 10px; border: 1px solid #695132; background: linear-gradient(135deg,#332719,#1c1510); }
.equipment-slot span { display: block; color: var(--muted); font-size: 12px; }
.equipment-slot strong { display: block; margin-top: 7px; font-size: 14px; overflow-wrap: anywhere; }
.equipment-slot:is(button) { width: 100%; text-align: left; color: var(--ink); }
.equipment-slot.selected { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.equipment-panel h3 { margin: 20px 0 8px; color: var(--gold); font-size: 16px; }
.spell-slots { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }

.law-list, .history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.commands {
  margin: 10px 0 0;
  padding-left: 1.2em;
  line-height: 1.55;
}
.commands code {
  color: var(--gold);
}
.law-list li, .history li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(201, 164, 92, 0.18);
}
.law-list li, .history li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(201, 164, 92, 0.18);
}
.law-list .title { font-weight: 600; color: var(--gold); }
.law-list .body { margin: 4px 0; line-height: 1.35; }
.law-list .tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.law-list button { padding: 8px 12px; font-size: 14px; }
#adminPanel .queue-heading { margin-top: 22px; }
.history .meta { display: block; margin-top: 2px; font-size: 13px; }

@media (max-width: 640px) {
  .top, .panel { padding-left: 16px; padding-right: 16px; margin-left: 12px; margin-right: 12px; }
  .top { flex-direction: column; align-items: flex-start; }
  .actions button { width: 100%; }
}
