/* ── Naragun theme ────────────────────────────────────────────────────────── */
:root {
  --bg-black       : #000000;
  --panel-bg       : #4e412d;
  --panel-bg-inner : #2c2419;
  --panel-bg-alt   : #484433;

  --border-tan     : #bd9c5a;
  --border-tan-dim : #6b5733;

  --text-cream     : #dfc89d;
  --text-gold      : #f0cd87;
  --text-link      : #d09d00;
  --text-link-hover: #ffd24a;
  --text-dark      : #392d1d;

  --accent-orange  : #c69e56;
  --accent-orange-2: #a87a35;

  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", Times, serif;
  --sans : Arial, Helvetica, FreeSans, sans-serif;
  --mono : Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-black);
  color: var(--text-cream);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

body {
  background:
    /* Dark overlay so panels and text stay readable. */
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.7)),
    url('/images/site-bg.jpg') center center / cover no-repeat fixed,
    var(--bg-black);
  min-height: 100vh;
}

/* Keep all chrome above the body background. */
.site-header,
.layout,
.site-footer { position: relative; z-index: 1; }

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover { color: var(--text-link-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  margin: 0 0 0.5em;
  color: var(--text-gold);
}

code { font-family: var(--mono); color: var(--text-cream); background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 2px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(180deg, #c69e56 0%, #a87a35 100%);
  border-bottom: 3px double var(--border-tan-dim);
  box-shadow: 0 2px 0 #000;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
}

.site-title {
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: var(--text-dark) !important;
  text-decoration: none;
  text-shadow: 1px 1px 0 #d8b574;
}

.site-header nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  display: block;
  padding: 6px 10px;
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--text-dark) !important;
  border: 1px solid transparent;
  border-radius: 3px;
}

.site-header nav a:hover,
.site-header nav a.nav-active {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border-tan-dim);
  color: var(--text-gold) !important;
  text-decoration: none;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 38px 18px;
  margin-bottom: 24px;
  background:
    linear-gradient(180deg, rgba(78, 65, 45, 0.9) 0%, rgba(44, 36, 25, 0.95) 100%);
  border: 1px solid var(--border-tan-dim);
  border-radius: 4px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.hero h1 {
  font-size: 3rem;
  margin: 0 0 8px;
  color: var(--text-gold);
  text-shadow: 0 0 16px rgba(208, 157, 0, 0.4), 2px 2px 0 #000;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-cream);
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1rem;
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.05s;
}

.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #d4a850 0%, #a87a35 100%);
  color: var(--text-dark) !important;
  text-shadow: 1px 1px 0 #e8c98a;
}

.btn-secondary {
  background: linear-gradient(180deg, #4e412d 0%, #2c2419 100%);
  color: var(--text-gold) !important;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-tan-dim);
  border-radius: 4px;
  margin-bottom: 18px;
  box-shadow: 0 2px 0 #000;
}

.panel-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #bd9c5a 0%, #8a6d34 100%);
  border-bottom: 1px solid #000;
  border-radius: 3px 3px 0 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  text-shadow: 1px 1px 0 #d8b574;
}

.panel-body {
  padding: 14px 16px 16px;
  background: var(--panel-bg-inner);
  color: var(--text-cream);
  border-radius: 0 0 3px 3px;
}

.muted { color: #a89377; font-style: italic; }
.text-error { color: #e88a6a; }

/* ── Patch notes ────────────────────────────────────────────────────────── */
.patch-section {
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  background: var(--panel-bg-alt);
  margin-bottom: 14px;
  overflow: hidden;
}

.patch-section:last-child { margin-bottom: 0; }

.patch-section--server   { border-color: #6e9a4d; }
.patch-section--client   { border-color: #4d7eaa; }
.patch-section--launcher { border-color: #b89030; }
.patch-section--website  { border-color: #a060a0; }

.patch-section-header {
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

.patch-type-badge {
  display: inline-block;
  padding: 2px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: 2px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.patch-type-badge--server   { background: linear-gradient(180deg, #6e9a4d 0%, #3e6228 100%); }
.patch-type-badge--client   { background: linear-gradient(180deg, #4d7eaa 0%, #2a4f70 100%); }
.patch-type-badge--launcher { background: linear-gradient(180deg, #b89030 0%, #7a5e18 100%); }
.patch-type-badge--website  { background: linear-gradient(180deg, #a060a0 0%, #5e3060 100%); }

.patch-latest { padding: 12px 14px 14px; }

.patch-latest-version {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 8px;
}

.patch-latest-date {
  font-size: 0.78rem;
  color: #a89377;
  font-style: italic;
  margin-top: 6px;
}

.patch-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.patch-notes-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
  color: var(--text-cream);
}

.patch-notes-list li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
  color: var(--border-tan);
  font-weight: 700;
}

.patch-section--server   .patch-notes-list li::before { color: #8fc06b; }
.patch-section--client   .patch-notes-list li::before { color: #6ea3ce; }
.patch-section--launcher .patch-notes-list li::before { color: #d4ae4e; }
.patch-section--website  .patch-notes-list li::before { color: #c285c2; }

/* Older entries (collapsible) */
.patch-older { border-top: 1px solid rgba(189, 156, 90, 0.2); }

.patch-older-toggle {
  display: block;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a89377;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: rgba(0, 0, 0, 0.2);
}

.patch-older-toggle::-webkit-details-marker { display: none; }

.patch-older-toggle::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 6px;
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

details[open] > .patch-older-toggle::before { transform: rotate(90deg); }

.patch-older-toggle:hover {
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.35);
}

.patch-older-list {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patch-older-entry {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(189, 156, 90, 0.15);
  border-radius: 3px;
}

.patch-older-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.patch-older-version {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-gold);
}

.patch-older-date {
  font-size: 0.74rem;
  color: #a89377;
  font-style: italic;
}

.patch-notes-list--small li {
  font-size: 0.86rem;
  margin-bottom: 2px;
}

/* ── Login form ─────────────────────────────────────────────────────────── */
.layout-narrow { max-width: 480px; }

.login-intro { margin: 0 0 14px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label {
  font-family: var(--serif);
  font-variant: small-caps;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--text-gold);
  margin-top: 6px;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"],
.login-form input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.login-submit {
  margin-top: 14px;
  width: 100%;
}

.login-altlink {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-cream);
}

/* Visual break between Sign In and Create Account so the secondary action
   doesn't read like part of the login form. */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: #a89377;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-tan-dim);
}

.login-create-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  border-color: var(--border-tan);
  background: linear-gradient(180deg, #5e4f37 0%, #38301f 100%);
  color: var(--text-gold) !important;
  text-shadow: 1px 1px 0 #000;
}

.login-create-btn:hover {
  filter: brightness(1.15);
  border-color: var(--text-link-hover);
}

.register-birthday {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

.register-bday-day,
.register-bday-month,
.register-bday-year {
  text-align: center;
  font-family: var(--mono);
}

/* Hide spinner buttons — birthday inputs read more cleanly without them. */
.register-birthday input::-webkit-outer-spin-button,
.register-birthday input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.register-birthday input { -moz-appearance: textfield; appearance: textfield; }

.form-error {
  background: rgba(180, 60, 50, 0.2);
  border: 1px solid #a04030;
  color: #ffb09a;
  padding: 9px 12px;
  border-radius: 3px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.form-success {
  background: rgba(80, 140, 60, 0.2);
  border: 1px solid #4f8a3d;
  color: #b8e89a;
  padding: 9px 12px;
  border-radius: 3px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.form-warning {
  background: rgba(190, 150, 50, 0.18);
  border: 1px solid #b88a30;
  color: #f0d290;
  padding: 9px 12px;
  border-radius: 3px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.account-info {
  margin: 0 0 18px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-info-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-gold);
  font-size: 0.9rem;
}

.account-info strong {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--text-cream);
}

.account-section-title {
  margin: 8px 0 12px;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-tan-dim);
  padding-bottom: 6px;
}

/* ── Invite system (account page) ───────────────────────────────────────── */
/* The account page uses the standard 820px layout so the key table fits;
   the password panel is capped to 480px so it keeps its narrow form look. */
.account-layout #password-panel,
.account-layout #info-panel { max-width: 520px; }

.info-update-help {
  margin: -4px 0 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.invite-message {
  margin-bottom: 14px;
  word-break: break-all;
}

.invite-help {
  margin: -4px 0 10px;
  font-size: 0.85rem;
}

.invite-own .muted { margin: 0; }

.invite-key-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.invite-key-value {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-tan-dim);
  color: var(--text-gold);
  padding: 7px 11px;
  border-radius: 3px;
  white-space: nowrap;
  overflow-x: auto;
  user-select: all;
  position: relative;
}

.invite-copy-btn {
  flex: 0 0 auto;
  padding: 4px 14px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  position: relative;
}

/* Click-to-copy feedback — shows a tooltip-style "Copied" overlay without
   replacing the visible key text. */
.invite-copy-btn.is-copied::after {
  content: 'Copied';
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: rgba(80, 140, 60, 0.85);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 2px;
  pointer-events: none;
}

code.invite-key-value.invite-copy-btn {
  cursor: pointer;
}

code.invite-key-value.invite-copy-btn:hover {
  border-color: var(--border-tan);
}

.invite-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}

.invite-mints {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

/* Beats the inline-flex above, which would otherwise override the UA
   stylesheet's [hidden] { display: none } rule by source-order tie-break. */
.invite-mints[hidden] { display: none; }

.invite-mints-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  color: #a89377;
}

.invite-mints-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-gold);
}

.invite-mints-value--empty {
  color: #ffb09a;
}

.invite-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  margin-top: 4px;
}

.invite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.invite-table thead th {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid var(--border-tan-dim);
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-gold);
  text-align: left;
  padding: 7px 10px;
  z-index: 1;
  white-space: nowrap;
}

.invite-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(107, 87, 51, 0.4);
  vertical-align: middle;
}

.invite-table .invite-key-cell {
  width: 100%;
}

.invite-table .invite-key-cell code.invite-key-value {
  display: inline-block;
  max-width: 100%;
}

.invite-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.invite-status {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.invite-status--unused { color: #b8e89a; }
.invite-status--used   { color: #d09d00; }

.invite-date-cell {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #a89377;
  white-space: nowrap;
}

/* ── Statistics page ────────────────────────────────────────────────────── */
.stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.stats-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}

.stats-summary-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: #a89377;
}

.stats-summary-value {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-cream);
}

.stats-summary-value--gold { color: var(--text-gold); }
.stats-summary-value--small { font-family: var(--sans); font-size: 0.92rem; font-weight: 400; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stat-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.stat-cell-name {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  color: var(--text-gold);
}

.stat-cell-levels {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-cream);
}

.stat-cell-current { color: #f0cd87; }
.stat-cell-sep    { opacity: 0.5; margin: 0 2px; }
.stat-cell-max    { color: var(--text-cream); }

.stat-cell-xp {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* Player lookup form on the statistics page. */
.stats-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-tan-dim);
}

.stats-search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 220px;
}

.stats-search-field span {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--text-gold);
}

.stats-search-field input {
  padding: 8px 10px;
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--sans);
}

.stats-search-field input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.stats-search-form .btn {
  height: 38px;
  padding: 0 18px;
}

/* Aggregate scalar totals — flexible row of label+number cards. */
.stat-totals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.stat-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.stat-total-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--text-gold);
}

.stat-total-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-cream);
}

/* Top-N item lists per category, arranged in a responsive grid. */
.stat-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.stat-list {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  overflow: hidden;
}

.stat-list-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-tan-dim);
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.92rem;
  color: var(--text-gold);
}

.stat-list-total {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant: normal;
  letter-spacing: 0;
  color: #a89377;
  font-style: italic;
}

.stat-list ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 12px;
  font-size: 0.9rem;
}

.stat-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }

.stat-list-name {
  color: var(--text-cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-list-count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-gold);
  flex-shrink: 0;
}

/* ── Stats: in-game `/stats` scroll-style tabs ─────────────────────────── */
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-tan-dim);
  padding-bottom: 8px;
}

.stats-tab {
  padding: 5px 11px;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.12s, color 0.12s, background 0.12s;
}

.stats-tab:hover {
  filter: brightness(1.15);
  color: var(--text-gold);
}

.stats-tab.is-active {
  background: linear-gradient(180deg, #d4a850 0%, #a87a35 100%);
  border-color: var(--border-tan);
  color: var(--text-dark);
  text-shadow: 1px 1px 0 #e8c98a;
}

.stats-tab-panel { display: none; }
.stats-tab-panel.is-active { display: block; }

.scroll-title {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  color: var(--text-gold);
  border-bottom: 1px solid var(--border-tan-dim);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.scroll-divider {
  font-family: var(--mono);
  color: var(--text-gold);
  margin: 14px 0 6px;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.scroll-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 4px;
  border-bottom: 1px dotted rgba(189, 156, 90, 0.18);
  font-size: 0.92rem;
}

.scroll-row span:first-child {
  color: var(--text-cream);
}

.scroll-row-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-gold);
}

.scroll-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scroll-list li {
  display: grid;
  grid-template-columns: 6.5em 0.6em 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 3px 4px;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.scroll-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }

.scroll-count {
  text-align: right;
  font-weight: 700;
  color: var(--text-gold);
}

.scroll-x {
  color: #a89377;
  text-align: center;
}

.scroll-name {
  color: var(--text-cream);
  font-family: var(--sans);
}

.scroll-empty {
  padding: 6px 4px;
  color: #a89377;
  font-style: italic;
}

/* ── Highscores page ─────────────────────────────────────────────────────── */
.hiscore-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-tan-dim);
}

.hiscore-picker-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.hiscore-picker-group-label {
  width: 78px;
  flex-shrink: 0;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  color: var(--text-gold);
  opacity: 0.85;
}

.hiscore-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.hiscore-tab {
  padding: 4px 10px;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  color: var(--text-cream) !important;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  text-decoration: none;
  transition: filter 0.12s, color 0.12s;
}

.hiscore-tab:hover {
  filter: brightness(1.15);
  color: var(--text-gold) !important;
  text-decoration: none;
}

.hiscore-tab.is-active {
  background: linear-gradient(180deg, #d4a850 0%, #a87a35 100%);
  border-color: var(--border-tan);
  color: var(--text-dark) !important;
  text-shadow: 1px 1px 0 #e8c98a;
}

.hiscore-table-wrap {
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

/* Keep the column headers visible while scrolling through 100 rows. */
.hiscore-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.hiscore-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.hiscore-table th,
.hiscore-table td {
  padding: 7px 12px;
  text-align: left;
}

.hiscore-table th {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-tan-dim);
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-gold);
}

.hiscore-table td.hiscore-rank,
.hiscore-table th.hiscore-rank {
  width: 80px;
  font-family: var(--mono);
  color: var(--text-gold);
  font-weight: 700;
}

.hiscore-table td.hiscore-name { color: var(--text-cream); }

.hiscore-table td.hiscore-value,
.hiscore-table th.hiscore-value {
  text-align: right;
  font-family: var(--mono);
  color: var(--text-cream);
}

.hiscore-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.hiscore-table tbody tr.is-self {
  background: rgba(208, 157, 0, 0.12);
}

.hiscore-table tbody tr.is-self td {
  color: var(--text-gold);
}

.hiscore-footnote {
  margin: 10px 4px 0;
  font-size: 0.82rem;
  color: #a89377;
  font-style: italic;
}

.hiscore-personal-intro {
  margin: 0 0 12px;
  color: var(--text-cream);
}

.hiscore-personal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.hiscore-personal-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.hiscore-personal-cell.is-unranked {
  opacity: 0.55;
}

.hiscore-personal-name {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--text-gold);
  font-size: 0.9rem;
}

.hiscore-personal-value {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-cream);
  font-size: 0.9rem;
}

.hiscore-personal-rank {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.hiscore-personal-cell.is-unranked .hiscore-personal-rank {
  font-weight: 400;
  color: #a89377;
  font-style: italic;
}

/* ── Compare players form + table ──────────────────────────────────────── */
.hiscore-compare-form {
  margin-bottom: 14px;
}

.hiscore-compare-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.hiscore-compare-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.hiscore-compare-field span {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--text-gold);
}

.hiscore-compare-field input {
  padding: 8px 10px;
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--sans);
}

.hiscore-compare-field input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.hiscore-compare-fields .btn {
  height: 38px;
  padding: 0 18px;
}

.hiscore-compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.hiscore-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.hiscore-compare-table th,
.hiscore-compare-table td {
  padding: 6px 12px;
  text-align: left;
}

.hiscore-compare-table th {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-tan-dim);
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-gold);
}

.hiscore-compare-table th.hiscore-compare-val,
.hiscore-compare-table th.hiscore-compare-diff,
.hiscore-compare-table td.hiscore-compare-val,
.hiscore-compare-table td.hiscore-compare-diff {
  text-align: right;
  font-family: var(--mono);
}

.hiscore-compare-table td.hiscore-compare-cat {
  color: var(--text-cream);
}

.hiscore-compare-table td.hiscore-compare-val {
  color: var(--text-cream);
}

.hiscore-compare-table td.hiscore-compare-val.is-leader {
  color: var(--text-gold);
  font-weight: 700;
}

.hiscore-compare-table td.hiscore-compare-diff.is-pos { color: #8fc06b; }
.hiscore-compare-table td.hiscore-compare-diff.is-neg { color: #e8866a; }
.hiscore-compare-table td.hiscore-compare-diff       { color: #a89377; }

.hiscore-compare-table tr.hiscore-compare-group td {
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--text-gold);
  padding: 5px 12px;
  border-top: 1px solid var(--border-tan-dim);
}

.hiscore-compare-table tbody tr:not(.hiscore-compare-group):nth-child(odd) {
  background: rgba(255, 255, 255, 0.025);
}

/* ── Downloads page ─────────────────────────────────────────────────────── */
.release-status {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.release-status-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  color: var(--text-cream);
}

.release-status-value {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-gold);
  text-shadow: 0 0 12px rgba(208, 157, 0, 0.4);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(78, 65, 45, 0.85) 0%, rgba(44, 36, 25, 0.95) 100%);
  border: 1px solid var(--border-tan-dim);
  border-radius: 4px;
  text-decoration: none !important;
  color: var(--text-cream) !important;
  transition: filter 0.15s, transform 0.05s, border-color 0.15s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}

.download-card:hover {
  filter: brightness(1.15);
  border-color: var(--border-tan);
}

.download-card:active { transform: translateY(1px); }

.download-os {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-gold);
}

.download-arch {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-cream);
  opacity: 0.75;
}

.download-action {
  margin-top: 6px;
  align-self: flex-start;
  padding: 4px 10px;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  background: linear-gradient(180deg, #d4a850 0%, #a87a35 100%);
  color: var(--text-dark) !important;
  border-radius: 3px;
  text-shadow: 1px 1px 0 #e8c98a;
}

/* ── Admin page ─────────────────────────────────────────────────────────── */
.admin-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.admin-action-status {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-cream);
}

.admin-action-status.is-busy { color: var(--text-gold); }
.admin-action-status.is-busy::before {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}

.admin-action-status.is-success { color: #b8e89a; }
.admin-action-status.is-error   { color: #ffb09a; }

@keyframes spin { to { transform: rotate(360deg); } }

.admin-output {
  margin: 0;
  padding: 10px 14px;
  max-height: 480px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-cream);
  white-space: pre-wrap;
  word-break: break-word;
}

.broadcast-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 6px;
}

.broadcast-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.broadcast-input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.broadcast-form .btn { flex-shrink: 0; padding: 0 22px; }

/* ── Admin · Player Ban ─────────────────────────────────────────────────── */
.ban-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 6px;
}

.ban-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ban-input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.ban-form .btn { flex-shrink: 0; padding: 0 22px; }

.ban-status-card {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  display: grid;
  gap: 6px 14px;
  grid-template-columns: max-content 1fr;
  font-size: 0.92rem;
}

.ban-status-row {
  display: contents;
}

.ban-status-label {
  color: #a89377;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  align-self: center;
}

.ban-status-value {
  color: var(--text-cream);
  word-break: break-word;
}

.ban-status-state--banned { color: #d76a6a; font-weight: 600; }
.ban-status-state--clear  { color: #6fb86f; font-weight: 600; }

.ban-controls {
  margin-top: 16px;
}

.ban-duration-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ban-duration-input {
  width: 90px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
}

.ban-duration-input:focus,
.ban-duration-unit:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.ban-duration-input:disabled,
.ban-duration-unit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ban-duration-unit {
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
}

.ban-permanent-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-cream);
  font-size: 0.92rem;
  cursor: pointer;
}

.ban-permanent-label input { accent-color: var(--text-gold); }

.ban-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Admin · Manage Mints ───────────────────────────────────────────────── */
.mints-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 6px;
}

.mints-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mints-input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.mints-form .btn { flex-shrink: 0; padding: 0 22px; }

.mints-status-card {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  display: grid;
  gap: 6px 14px;
  grid-template-columns: max-content 1fr;
  font-size: 0.92rem;
}

.mints-status-row { display: contents; }

.mints-status-label {
  color: #a89377;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  align-self: center;
}

.mints-status-value {
  color: var(--text-cream);
  word-break: break-word;
}

.mints-status-key {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-gold);
}

.mints-controls { margin-top: 16px; }

.mints-update-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mints-new-input {
  width: 120px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
}

.mints-new-input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

/* ── Admin · Key Info lookup ────────────────────────────────────────────── */
.key-info-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 6px;
}

.key-info-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.key-info-input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.key-info-form .btn { flex-shrink: 0; padding: 0 22px; }

.key-info-result {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.key-info-tree-meta {
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #a89377;
}

.key-info-tree-meta code {
  color: var(--text-gold);
}

.key-info-tree,
.key-info-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Indent + connector line for nested children. The 18px left padding leaves
   room for the vertical guide; ::before draws the elbow into each item. */
.key-info-children {
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px dashed var(--border-tan-dim);
}

.key-info-node {
  position: relative;
  margin: 8px 0 0;
  padding: 8px 10px 8px 12px;
  background: rgba(78, 65, 45, 0.4);
  border: 1px solid var(--border-tan-dim);
  border-left: 3px solid var(--accent-orange-2);
  border-radius: 3px;
}

.key-info-children > .key-info-node::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -14px;
  width: 12px;
  height: 1px;
  border-top: 1px dashed var(--border-tan-dim);
}

.key-info-node--root { border-left-color: #d4a850; }
.key-info-node--self {
  border-left-color: #b8e89a;
  background: rgba(80, 110, 60, 0.25);
  box-shadow: 0 0 0 1px rgba(184, 232, 154, 0.25);
}

.key-info-node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.key-info-node-owner {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--text-cream);
  font-weight: 700;
}

.key-info-node-owner--none {
  color: #a89377;
  font-style: italic;
  font-weight: 400;
}

.key-info-node-uid {
  color: #a89377;
  font-size: 0.82rem;
  font-weight: 400;
}

.key-info-node-mints {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-gold);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  padding: 1px 7px;
  border-radius: 2px;
}

.key-info-key {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-gold);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 2px;
  word-break: break-all;
  user-select: all;
}

.changelog-editor {
  width: 100%;
  margin: 6px 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-cream);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 2;
}

.changelog-editor:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.changelog-editor:disabled {
  opacity: 0.6;
}

/* Auto-refresh pill on the Server Status panel header. */
#admin-status-panel .panel-header {
  position: relative;
}

.admin-refresh-indicator {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-cream);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.admin-refresh-text {
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--text-gold);
}

.admin-refresh-age { color: #c0a880; }

.admin-refresh-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6ed060;
  box-shadow: 0 0 8px #6ed060;
}

.admin-refresh-indicator.is-error .admin-refresh-dot {
  background: #e8866a;
  box-shadow: 0 0 8px #e8866a;
}

.admin-refresh-indicator.is-error {
  border-color: #a04030;
  box-shadow: 0 0 12px rgba(224, 102, 80, 0.4);
}

/* Pulse animation — runs once per refresh tick. */
.admin-refresh-indicator.pulse .admin-refresh-dot {
  animation: refresh-dot-pulse 0.7s ease-out;
}
.admin-refresh-indicator.pulse {
  animation: refresh-pill-flash 0.7s ease-out;
}

@keyframes refresh-dot-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 8px  currentColor; }
  40%  { transform: scale(1.7); box-shadow: 0 0 18px currentColor; }
  100% { transform: scale(1);   box-shadow: 0 0 8px  currentColor; }
}

@keyframes refresh-pill-flash {
  0%   { border-color: var(--border-tan-dim); }
  40%  { border-color: var(--border-tan); box-shadow: 0 0 12px rgba(110, 208, 96, 0.5); }
  100% { border-color: var(--border-tan-dim); box-shadow: none; }
}

/* Player chips — shared between the global list and per-world expands. */
.admin-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.admin-player-chip {
  display: inline-block;
  padding: 2px 9px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 2px;
  cursor: pointer;
  transition: filter 0.12s, border-color 0.12s, color 0.12s;
}

.admin-player-chip:hover {
  filter: brightness(1.15);
  border-color: #b04030;
  color: #ffb09a;
}

.admin-player-chip:hover::after {
  content: ' ✕';
  color: #e8866a;
  font-weight: 700;
}

.admin-player-chip.is-busy {
  opacity: 0.5;
  pointer-events: none;
}

.admin-kick-hint {
  margin: 4px 0 8px;
  font-size: 0.82rem;
  font-style: italic;
}

/* Top-of-page toast banner shared by kick / broadcast / etc. */
.admin-toast {
  margin: 0 0 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

/* Online/offline dot indicator. */
.admin-world-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 0;
  box-shadow: 0 0 6px currentColor;
}

.admin-world-dot.is-online  { background: #6ed060; color: #6ed060; }
.admin-world-dot.is-offline { background: #6a4c3a; color: #6a4c3a; box-shadow: none; }

/* Compact flag badges for world capability columns. */
.admin-world-flag {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 3px;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 2px;
  color: #fff;
}

.admin-world-flag--members { background: linear-gradient(180deg, #b89030, #7a5e18); }
.admin-world-flag--pvp     { background: linear-gradient(180deg, #b04030, #7a2e20); }
.admin-world-flag--quick   { background: linear-gradient(180deg, #4d7eaa, #2a4f70); }
.admin-world-flag--loot    { background: linear-gradient(180deg, #6e9a4d, #3e6228); }
.admin-world-flag--star    { background: linear-gradient(180deg, #d4a850, #a87a35); color: var(--text-dark); }

.admin-worlds-table th.admin-worlds-actions,
.admin-worlds-table td.admin-worlds-actions {
  width: 80px;
  text-align: right;
}

.admin-world-toggle { padding: 4px 12px; font-size: 0.82rem; }

.admin-world-detail-row td {
  padding: 8px 12px !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

.admin-world-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Coming-soon placeholder ────────────────────────────────────────────── */
.coming-soon {
  text-align: center;
  padding: 48px 16px;
}

.coming-soon-title {
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: var(--text-gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(208, 157, 0, 0.35), 1px 1px 0 #000;
}

/* ── User nav (signed-in chrome) ──────────────────────────────────────────── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-dark);
}

.nav-user-label {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.nav-user-name {
  font-weight: 700;
  color: #1d1408;
}

.nav-logout-form { margin: 0; padding: 0; display: inline; }

.nav-logout {
  padding: 6px 14px;
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: linear-gradient(180deg, #d4a850 0%, #a87a35 100%);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  cursor: pointer;
}

.nav-logout:hover { filter: brightness(1.1); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 18px;
  margin-top: 32px;
  border-top: 1px solid var(--border-tan-dim);
  color: #8a7a5a;
  font-size: 0.85rem;
}

.site-footer p { margin: 2px 0; }

.footer-disclaimer { font-style: italic; opacity: 0.8; }

/* ── Grand Exchange ─────────────────────────────────────────────────────── */
.ge-intro { margin: 0 0 12px; }

.ge-search-field input {
  width: 100%;
  max-width: 520px;
  padding: 9px 11px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text-cream);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ge-search-field input:focus {
  border-color: var(--border-tan);
  box-shadow: 0 0 0 2px rgba(189, 156, 90, 0.25);
}

.ge-status { margin: 12px 0 0; }

.ge-results {
  margin-top: 12px;
  max-width: 520px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
}

.ge-result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-tan-dim);
  color: var(--text-cream);
  font-family: var(--sans);
  font-size: 0.95rem;
  cursor: pointer;
}

.ge-result:last-child { border-bottom: none; }
.ge-result:hover { background: rgba(189, 156, 90, 0.15); color: var(--text-gold); }

.ge-result-name { font-weight: 700; }
.ge-result-id { color: #a89377; font-family: var(--mono); font-size: 0.85rem; }

.ge-card {
  margin-top: 16px;
  max-width: 520px;
  padding: 16px;
  background: var(--panel-bg-alt);
  border: 1px solid var(--border-tan);
  border-radius: 4px;
}

.ge-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--border-tan-dim);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ge-card-name {
  font-family: var(--serif);
  font-variant: small-caps;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  color: var(--text-gold);
}

.ge-card-id { color: #a89377; font-family: var(--mono); font-size: 0.9rem; }

.ge-card-priceline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ge-card-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-cream);
}

.ge-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.ge-trend.is-up   { background: rgba(80, 140, 60, 0.25);  border: 1px solid #4f8a3d; color: #8fe06a; }
.ge-trend.is-down { background: rgba(180, 60, 50, 0.22);   border: 1px solid #a04030; color: #ff8a6a; }
.ge-trend.is-flat { background: rgba(160, 140, 90, 0.18);  border: 1px solid var(--border-tan-dim); color: #cbb888; }

.ge-trend-label {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.ge-trend-label.is-up   { color: #8fe06a; }
.ge-trend-label.is-down { color: #ff8a6a; }
.ge-trend-label.is-flat { color: #cbb888; }

/* Current offers — 3×2 grid mirroring the in-game GE summary (slots 0-5). */
.ge-offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.ge-offer {
  display: flex;
  flex-direction: column;
  min-height: 120px;
  border: 1px solid var(--border-tan-dim);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.ge-offer-empty {
  align-items: center;
  justify-content: center;
  opacity: 0.65;
}

.ge-offer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--border-tan-dim);
}

.ge-offer-empty .ge-offer-head {
  width: 100%;
  background: none;
  border-bottom: none;
  flex-direction: column;
  gap: 2px;
}

.ge-offer-title {
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
  color: var(--text-gold);
}

.ge-offer-empty .ge-offer-title { color: #a89377; }

.ge-offer-slot {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #a89377;
}

.ge-offer-tag {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 3px;
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  /* Defaults to the registered (no-colour) status; partial/complete below. */
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-tan-dim);
  color: #cbb888;
}

.ge-offer.ge-status-partial  .ge-offer-tag { background: rgba(212, 175, 55, 0.22); border: 1px solid #d4af37; color: #f0d24a; }
.ge-offer.ge-status-complete .ge-offer-tag { background: rgba(80, 140, 60, 0.3);   border: 1px solid #4f8a3d; color: #8fe06a; }

/* Status highlight, matching the in-game GE: registered = no colour,
   partially filled = yellow, complete = green. */
.ge-offer.ge-status-partial  { border-left: 3px solid #d4af37; }
.ge-offer.ge-status-complete { border-left: 3px solid #4f8a3d; }

.ge-offer-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;        /* push the progress bar to the bottom of the box */
}

.ge-offer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
}

.ge-offer-row span:first-child { color: #a89377; }
.ge-offer-row span:last-child  { color: var(--text-cream); font-weight: 700; }

.ge-offer-state {
  margin-top: 2px;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: #cbb888;
}

.ge-offer-state.ge-status-registered { color: #cbb888; }
.ge-offer-state.ge-status-partial    { color: #f0d24a; }
.ge-offer-state.ge-status-complete   { color: #8fe06a; }

/* Fill bar pinned to the bottom of the box, like the in-game GE offer bar. */
.ge-offer-progress {
  height: 13px;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid var(--border-tan-dim);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.ge-offer-progress-fill {
  height: 100%;
  min-width: 0;
  transition: width 0.2s ease;
}

.ge-offer-progress-fill.ge-status-registered { background: transparent; }
.ge-offer-progress-fill.ge-status-partial {
  background: linear-gradient(180deg, #f0d24a 0%, #c9962a 100%);
}
.ge-offer-progress-fill.ge-status-complete {
  background: linear-gradient(180deg, #7fce5a 0%, #3f7a30 100%);
}

.ge-offer-collect {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-tan-dim);
}

.ge-offer-collect-label {
  display: block;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--text-gold);
  margin-bottom: 2px;
}

.ge-offer-collect ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.9rem;
  color: var(--text-cream);
}

@media (max-width: 720px) {
  .ge-offer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Transaction history — mirrors the in-game "Item Back History" panel. */
.ge-history {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ge-history thead th {
  padding: 8px 12px;
  text-align: center;
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: var(--text-gold);
  border-bottom: 1px solid var(--border-tan-dim);
}

.ge-history tbody td {
  padding: 9px 12px;
  text-align: center;
  color: var(--text-cream);
  border-bottom: 1px solid rgba(107, 87, 51, 0.4);
}

.ge-history tbody tr:last-child td { border-bottom: none; }
.ge-history tbody tr:nth-child(even) td { background: rgba(0, 0, 0, 0.18); }

.ge-history-name { font-weight: 700; color: var(--text-gold); }
.ge-history-num  { font-family: var(--mono); }

.ge-history-type {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.ge-history-sold   { color: #8fe06a; }
.ge-history-bought { color: #f0c060; }

.ge-card-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0;
}

.ge-card-detail > div {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-tan-dim);
  border-radius: 3px;
}

.ge-card-detail dt {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  color: var(--text-gold);
  margin-bottom: 2px;
}

.ge-card-detail dd { margin: 0; font-size: 0.95rem; color: var(--text-cream); }
