/* Patchnotes Server — dark, flat, restrained.
 * Palette: near-black cool grays, one warm amber accent.
 * No gradients, glows, or glassmorphism on purpose. */

:root {
  color-scheme: dark;
  --bg: #0e1013;
  --panel: #15181d;
  --panel-2: #1a1e24;
  --field: #0b0d10;
  --border: #262b33;
  --border-strong: #333a44;
  --text: #e6e8eb;
  --muted: #8f98a4;
  --faint: #6b737e;
  --accent: #e5a54c;
  --accent-hover: #f0b664;
  --accent-ink: #1a1206;
  --ok: #74b98a;
  --warn: #d9a455;
  --danger: #dd6b6b;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(229, 165, 76, .28); }

a { color: var(--muted); text-decoration: none; transition: color .12s; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- top bar ---------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  height: 48px;
  background: #101318;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

#brand {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 9px;
}

#brand-mark {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

#nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13.5px;
}

#nav .small { color: var(--faint); }

/* ---------- layout ---------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 22px 96px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
}

.panel.narrow { max-width: 400px; margin: 56px auto; }

h1 { font-size: 19px; font-weight: 650; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--text); }

.mt { margin-top: 14px; }
.crumbs { margin-bottom: 12px; font-size: 13.5px; }
.page-head { margin-bottom: 16px; }
.urlwrap { margin: 12px 0; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.space-between { justify-content: space-between; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.error { color: var(--danger); margin: 10px 0; font-size: 13.5px; }
.success { color: var(--ok); margin: 10px 0; font-size: 13.5px; }

/* ---------- forms ---------- */

label {
  display: block;
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

label.inline-label { display: inline-flex; margin: 0; }

input[type=text],
input[type=password],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font: inherit;
  transition: border-color .12s;
}

input:hover, select:hover, textarea:hover { border-color: #454e5a; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

input::placeholder, textarea::placeholder { color: var(--faint); }

select { width: auto; min-width: 120px; }

textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 380px;
  resize: vertical;
  white-space: pre;
  margin-top: 12px;
}

button {
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  transition: background-color .12s, border-color .12s;
}

button:hover { background: #222730; border-color: #454e5a; }
button:disabled { opacity: .55; cursor: default; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

button.danger { background: transparent; border-color: #5a3538; color: var(--danger); }
button.danger:hover { background: #2a1a1c; border-color: var(--danger); }

code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--field);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ---------- tabs (segmented) ---------- */

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 16px;
}

.tabs button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.tabs button:hover { background: var(--panel-2); color: var(--text); }
.tabs button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }

/* ---------- tables ---------- */

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

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--faint);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom-color: var(--border-strong);
}

tbody tr:last-child td { border-bottom: none; }

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }

td .muted { color: var(--faint); }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  margin-right: 6px;
  white-space: nowrap;
}

.badge.kind { color: var(--accent); border-color: rgba(229, 165, 76, .45); }
.badge.public { color: var(--ok); border-color: rgba(116, 185, 138, .45); }
.badge.unlisted { color: var(--warn); border-color: rgba(217, 164, 85, .45); }
.badge.owner { color: var(--text); border-color: var(--border-strong); }

/* ---------- editor bits ---------- */

.urlbox {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 11px;
  word-break: break-all;
  color: var(--muted);
}

.conflict {
  border: 1px solid rgba(217, 164, 85, .5);
  background: rgba(217, 164, 85, .07);
  border-radius: 9px;
  padding: 14px;
  margin-bottom: 14px;
}

.conflict p { margin: 6px 0 10px; }

pre.audit {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  max-height: 340px;
  color: var(--muted);
}

/* ---------- quest board preview ---------- */

.tabs.seg { margin-bottom: 0; padding: 2px; }
.tabs.seg button { padding: 5px 11px; font-size: 12.5px; }

.editor-body.board-on textarea { display: none; }
.editor-body:not(.board-on) .quest-board-wrap { display: none; }

.quest-board-wrap { margin-top: 14px; }
.board-hint { margin-bottom: 12px; }

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

.quest-card {
  position: relative;
  aspect-ratio: 2 / 3;
  background: url('/quest-parchment.png') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30% 11% 11%;
  border-radius: 3px;
}

.quest-card-text {
  color: #000; /* matches the in-world TMP colour */
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 100%;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.quest-num {
  position: absolute;
  top: 9px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  letter-spacing: .05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

/* ---------- scrollbars ---------- */

* { scrollbar-width: thin; scrollbar-color: #2e343d transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2e343d; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a424e; }
::-webkit-scrollbar-track { background: transparent; }
