/*
  Custom UI layer (no framework)
  Purpose: eliminate inline styles and standardize markup across SSR PHP views
  while preserving the legacy site look & feel.
*/

/* Global typography (override legacy theme text-shadows + inconsistent fonts) */
:root {
  --ui-font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ui-font-size: 14px;
  --ui-line-height: 1.55;
}

html, body {
  font-family: var(--ui-font-sans);
  font-size: var(--ui-font-size);
  line-height: var(--ui-line-height);
  color: #111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Kill the global "shadowy" text look from legacy CSS */
body, body * {
  text-shadow: none !important;
}

/* Sensible defaults */
p, li, td, th, label, input, textarea, button, select {
  font-family: var(--ui-font-sans);
  font-size: 14px;
  line-height: var(--ui-line-height);
}

small {
  font-size: 12px;
}

h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.25; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

/* Auth shell */
.ui-auth {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 0 0;
}

.ui-auth__title {
  text-align: center;
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 400;
}

/* Form base */
.ui-form {
  margin: 0;
}

.ui-field {
  margin: 0 0 14px;
}

.ui-label {
  display: block;
  margin: 0 0 6px;
  font-weight: bold;
}

.ui-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #9aa0a6;
  border-radius: 4px;
  background: #fff;
}

.ui-help {
  display: block;
  margin: 6px 0 0;
  color: #333;
}

.ui-error {
  display: none;
  margin-top: 6px;
  color: #c62828;
  font-weight: bold;
}

/* Actions */
.ui-actions {
  margin-top: 10px;
}

/* Legacy error spans used by the old registration JS */
.ui-form .error {
  display: none;
  margin-top: 6px;
  color: #c62828;
  font-weight: bold;
}

/* Legacy register loader (moved from inline <style>) */
#loader-div {
  display: none;
}

.ui-spinner {
  border: 10px solid #f3f3f3;
  border-radius: 50%;
  border-top: 10px solid #32CD32;
  border-bottom: 10px solid #32CD32;
  width: 60px;
  height: 60px;
  animation: ui-spin 2s linear infinite;
}

@keyframes ui-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Captcha image */
.ui-captcha-img {
  border: 0;
}

/* Register page legacy layout helpers */
.ui-register__note {
  margin-left: 182px;
}

.ui-register__agreement {
  margin-left: 30px;
}

.ui-register__captcha-input {
  text-align: center;
  margin-left: 182px;
  max-width: 220px;
}

.ui-register__country {
  background-position: 304px 7px;
  background-repeat: no-repeat;
}

.ui-register__submit {
  padding-top: 10px;
}

.ui-center-flex {
  display: flex;
  justify-content: center;
}

.ui-link-gap {
  margin-top: 12px;
}

/* Character page */
.ui-char {
  margin: 6px 0 18px;
  color: #111;
}

.ui-char__title {
  margin: 2px 0 12px;
}

.ui-char__name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.ui-char__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #2b2b2b;
  font-size: 12px;
}

.ui-char__tag {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
}

.ui-char__dot {
  opacity: 0.55;
}

.ui-char__status {
  margin-left: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.ui-char__status--online {
  background: rgba(46, 125, 50, 0.14);
  color: #1b5e20;
}

.ui-char__status--offline {
  background: rgba(66, 66, 66, 0.12);
  color: #424242;
}

.ui-card {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 12px;
}

.ui-card--tight .ui-card__body {
  padding: 12px;
}

.ui-card__header {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.ui-card__body {
  padding: 14px;
}

.ui-char__banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.75);
}

.ui-char__banner--danger {
  border-color: rgba(198, 40, 40, 0.35);
  background: rgba(255, 235, 238, 0.75);
  color: #b71c1c;
}

.ui-char__banner--warn {
  border-color: rgba(245, 124, 0, 0.35);
  background: rgba(255, 243, 224, 0.75);
  color: #e65100;
}

.ui-char__ban-countdown {
  font-weight: 900;
  margin-left: 6px;
}

.ui-char__kv {
  margin: 0;
}

.ui-char__kv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.ui-char__kv-row:last-child {
  border-bottom: 0;
}

.ui-char__kv dt {
  margin: 0;
  font-weight: 800;
  color: #1c1c1c;
}

.ui-char__kv dd {
  margin: 0;
  color: #111;
  min-width: 0;
}

.ui-char__muted {
  color: rgba(0, 0, 0, 0.55);
}

.ui-char__vip {
  color: #b71c1c;
  font-weight: 900;
}

.ui-char__flag {
  width: 16px;
  height: 11px;
  vertical-align: -2px;
  margin-left: 6px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.ui-char__social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ui-char__social-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.ui-char__social-link:hover {
  background: rgba(0, 0, 0, 0.1);
}

.ui-char__bars {
  display: grid;
  gap: 10px;
}

.ui-char__bar-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
  align-items: center;
}

.ui-char__bar-label {
  font-weight: 800;
  color: #1c1c1c;
}

.ui-char__bar {
  position: relative;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.ui-char__bar-fill {
  position: absolute;
  inset: 0;
  transform-origin: left;
}

.ui-char__bar-fill--hp {
  background: linear-gradient(90deg, #c62828, #ef5350);
}

.ui-char__bar-fill--mp {
  background: linear-gradient(90deg, #1565c0, #42a5f5);
}

.ui-char__bar-fill--rb {
  background: linear-gradient(90deg, #6a1b9a, #ab47bc);
}

.ui-char__bar-text {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-char__equip {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  justify-content: center;
  gap: 10px;
}

.ui-char__equip-table {
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 10px 10px;
}

.ui-char__equip-cell,
.ui-char__equip-meta-cell {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.14);
  vertical-align: middle;
  padding: 6px;
}

.ui-char__equip-meta-cell {
  width: 84px;
  font-weight: 900;
  font-size: 12px;
}

.ui-char__equip-meta-cell small {
  display: block;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.7);
}

.ui-char__equip-table img {
  image-rendering: pixelated;
}

.ui-char__equip-slot {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-char__equip-slot img {
  image-rendering: pixelated;
}

.ui-char__equip-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2px;
}

.ui-char__equip-meta-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 90px;
}

.ui-char__list {
  margin: 0;
  padding-left: 18px;
}

.ui-char__list li {
  margin: 6px 0;
}

.ui-char__star {
  color: #f9a825;
  margin-right: 6px;
}

.ui-char__sp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}

.ui-char__sp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.ui-char__sp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-char__sp-icon {
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.ui-char__sp-icon--on {
  background: rgba(46, 125, 50, 0.16);
  color: #1b5e20;
}

.ui-char__sp-icon--off {
  background: rgba(198, 40, 40, 0.12);
  color: #b71c1c;
}

.ui-char__table {
  width: 100%;
  border-collapse: collapse;
}

.ui-char__table th,
.ui-char__table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

.ui-char__table th {
  text-align: left;
  font-weight: 900;
  color: #1c1c1c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.ui-char__table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

.ui-char__char-name {
  font-weight: 900;
  text-decoration: none;
}

.ui-char__pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.ui-char__pill--on {
  background: rgba(46, 125, 50, 0.14);
  color: #1b5e20;
}

.ui-char__pill--off {
  background: rgba(66, 66, 66, 0.12);
  color: #424242;
}


.ui-char__deaths {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ui-char__death {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.ui-char__death-date {
  font-weight: 900;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.ui-char__death-text {
  color: #111;
}

@media (max-width: 980px) {
  .ui-char__kv-row,
  .ui-char__bar-row,
  .ui-char__death {
    grid-template-columns: 1fr;
  }

  .ui-char__sp {
    grid-template-columns: 1fr;
  }
}



/* Buttons live in /template/ui-buttons.css (shared with the forum layout) */

/* Account page (single page: identity, stats, characters, security) */
.ui-account {
  max-width: 760px;
  margin: 0 auto;
}

.ui-account__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}

.ui-account__crest {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1f4d4a;
  border: 2px solid #c9a227;
  color: #f3e3a3;
  font-size: 24px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.ui-account__who {
  flex: 1;
  min-width: 0;
}

.ui-account__name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ui-account__meta {
  color: #555;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ui-account__logout {
  margin: 0;
  flex: none;
}

.ui-account__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.ui-account__stat {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.ui-account__stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #555;
}

.ui-account__stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.ui-account__stat-foot {
  font-size: 12px;
  color: #555;
}

.ui-account__chars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ui-account__char {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.ui-account__char-outfit {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ui-account__char-info {
  flex: 1;
  min-width: 0;
}

.ui-account__char-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ui-account__char-line {
  font-size: 12px;
  color: #555;
}

.ui-account__char-delete {
  margin: 0;
  flex: none;
}

.ui-account__char-delete button {
  border: 0;
  background: none;
  padding: 6px;
  color: #888;
  cursor: pointer;
}

.ui-account__char-delete button:hover {
  color: #c62828;
}

.ui-account__char--new {
  display: block;
  border-style: dashed;
  background: none;
}

.ui-account__char--new summary {
  cursor: pointer;
  font-weight: 700;
  padding: 22px 6px;
  list-style: none;
}

.ui-account__char--new summary::-webkit-details-marker {
  display: none;
}

.ui-account__char--new[open] summary {
  padding: 4px 6px 12px;
}

.ui-account__security {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: start;
}

.ui-account__security-intro {
  padding: 16px;
  border-radius: 8px;
  background: #1f4d4a;
  color: #e6efee;
}

.ui-account__security-intro p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #cfdedc;
}

.ui-account__security-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 0 10px;
  border-radius: 50%;
  border: 2px solid #c9a227;
  color: #f3e3a3;
  font-size: 16px;
}

.ui-account__security-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.ui-account__tips {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.ui-account__tips li {
  margin: 0 0 4px;
}

.ui-account__tips i {
  width: 16px;
  color: #c9a227;
  font-size: 11px;
}

.ui-account__input {
  position: relative;
}

.ui-account__input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8f94;
  font-size: 13px;
  pointer-events: none;
}

.ui-account .ui-account__input .ui-input {
  padding-left: 36px;
  padding-right: 40px;
}

.ui-account__input:focus-within .ui-account__input-icon {
  color: #1f6f6a;
}

.ui-account__reveal {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #8a8f94;
  cursor: pointer;
}

.ui-account__reveal:hover {
  color: #222;
}

.ui-account__mismatch {
  margin: -6px 0 12px;
  color: #c62828;
  font-size: 13px;
  font-weight: 700;
}

/* Focus: a clear ring on every control of the account page */
.ui-account .ui-input {
  border: 1px solid #b4b9bd;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-account .ui-input:hover {
  border-color: #7d8489;
}

.ui-account .ui-input:focus {
  outline: none;
  border-color: #1f6f6a;
  box-shadow: 0 0 0 3px rgba(31, 111, 106, 0.28);
}

.ui-account__reveal:focus-visible,
.ui-account__char-delete button:focus-visible,
.ui-account__char--new summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.55);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .ui-account__stats,
  .ui-account__chars,
  .ui-account__security {
    grid-template-columns: 1fr;
  }
}

/* the legacy theme floats labels and fixes inputs at 350px; undo that inside the account page */
.ui-account .ui-label {
  float: none;
  width: auto;
  padding: 0;
}

.ui-account .ui-input {
  width: 100%;
  height: auto;
  padding: 10px 12px;
}

.ui-account__char-line span {
  white-space: nowrap;
}

/* News article body: staff-written HTML/BB code rendered like the forum */
.news-body ul,
.news-body ol {
  margin: 8px 0;
  padding-left: 24px;
}

.news-body ul {
  list-style: disc;
}

.news-body ol {
  list-style: decimal;
}

.news-body li {
  margin: 4px 0;
}

/* Line breaks turned into <br> sit between list items and would add blank lines */
.news-body ul > br,
.news-body ol > br {
  display: none;
}

.news-body img {
  max-width: 100%;
  height: auto;
}

/* Character search (/characters) */
.ui-search {
  max-width: 760px;
  margin: 0 auto;
}

.ui-search__title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 35px;
}

.ui-search__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ui-search__form {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 0 0 14px;
}

.ui-search__field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.ui-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8f94;
  font-size: 13px;
  pointer-events: none;
}

/* The legacy theme floats and sizes inputs; reset for this form. */
.ui-search .ui-search__input {
  float: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  border: 1px solid #b4b9bd;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-search .ui-search__input:hover {
  border-color: #7d8489;
}

.ui-search .ui-search__input:focus {
  outline: none;
  border-color: #1f6f6a;
  box-shadow: 0 0 0 3px rgba(31, 111, 106, 0.28);
}

.ui-search__field:focus-within .ui-search__icon {
  color: #1f6f6a;
}

.ui-search__hint,
.ui-search__count {
  margin: 0 0 12px;
  color: #555;
  font-size: 12px;
}

.ui-search__hint {
  text-align: center;
}

.ui-search__empty {
  padding: 28px 12px;
  text-align: center;
  color: #555;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.ui-search__empty i {
  font-size: 24px;
  color: #8a8f94;
}

.ui-search__empty p {
  margin: 8px 0 0;
}

.ui-search__results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-search__results li {
  margin: 0;
  padding: 0;
  background: none;
}

.ui-search__result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-search__result:hover,
.ui-search__result:focus-visible {
  border-color: #1f6f6a;
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.ui-search__result:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 111, 106, 0.28);
}

.ui-search__result--exact {
  border-color: rgba(31, 111, 106, 0.55);
  background: rgba(31, 111, 106, 0.08);
}

.ui-search__outfit {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ui-search__info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.ui-search__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ui-search__result:hover .ui-search__name {
  text-decoration: underline;
}

.ui-search__line {
  font-size: 12px;
  color: #555;
}

.ui-search__chevron {
  flex: none;
  color: #9aa0a6;
  font-size: 12px;
}

.ui-search__result:hover .ui-search__chevron {
  color: #1f6f6a;
}

@media (max-width: 640px) {
  .ui-search__results {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Character search autocomplete */
.ui-suggest {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid #b4b9bd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.ui-suggest[hidden] {
  display: none;
}

.ui-suggest li {
  margin: 0;
  background: none;
}

.ui-suggest__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.ui-suggest__option[aria-selected="true"] {
  background: rgba(31, 111, 106, 0.12);
}

.ui-suggest__outfit {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.ui-suggest__outfit img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.ui-suggest__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ui-suggest__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ui-suggest__name .ui-char__pill {
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
}

.ui-suggest__line {
  font-size: 12px;
  color: #555;
}

.ui-suggest__empty {
  padding: 10px 8px;
  color: #555;
  font-size: 12px;
}

/* Sidebar server status (heartbeat from ServerStatusService) */
.ui-status {
  --status-color: #2e7d32;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.ui-status.is-offline {
  --status-color: #c62828;
}

.ui-status__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ui-status__crest {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1f4d4a;
  border: 2px solid #c9a227;
  color: #f3e3a3;
  font-size: 20px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.ui-status__dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--status-color);
  border: 2px solid #fff;
}

.is-online .ui-status__dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--status-color);
  animation: ui-status-pulse 2s ease-out infinite;
}

@keyframes ui-status-pulse {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .is-online .ui-status__dot::after {
    animation: none;
  }
}

.ui-status__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #555;
}

.ui-status__state {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--status-color);
}

.ui-status__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ui-status__stat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(31, 77, 74, 0.08);
  color: #111;
  text-decoration: none;
}

a.ui-status__stat:hover,
a.ui-status__stat:focus-visible {
  background: rgba(31, 77, 74, 0.16);
}

.ui-status__stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #1f4d4a;
}

.ui-status__stat-label {
  font-size: 11px;
  color: #555;
}

.ui-status__note {
  margin: 12px 0 0;
  font-size: 13px;
  color: #555;
}

/* Header server status, on the second hanging sign of logo-wrapper-bg2.png (panel 311x100 at x+117 from centre, y 155) */
#logo-wrapper {
  position: relative;
  background-image: url(images/logo-wrapper-bg2.png);
}

.hdr-status {
  --status-color: #5dea6f;
  position: absolute;
  top: 155px;
  left: calc(50% + 117px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 311px;
  height: 100px;
  padding: 8px 14px;
  color: #d9e6e4;
  font-family: Roboto, Arial, sans-serif;
  text-decoration: none;
}

.hdr-status.is-offline {
  --status-color: #ff5a4f;
}

.hdr-status__state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--status-color);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px color-mix(in srgb, var(--status-color) 55%, transparent), 0 2px 2px #000;
}

.hdr-status__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 0 var(--status-color);
  animation: hdr-status-pulse 2s ease-out infinite;
}

.hdr-status.is-offline .hdr-status__dot {
  animation: none;
}

@keyframes hdr-status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-color) 70%, transparent); }
  70%, 100% { box-shadow: 0 0 0 10px transparent; }
}

.hdr-status__stats {
  display: flex;
  gap: 8px;
  width: 100%;
}

.hdr-status__stat {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 3px 6px 4px;
  border: 1px solid rgba(143, 196, 190, 0.25);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  color: #9fbab6;
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.hdr-status__stat b {
  color: #f6c85a;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.hdr-status__note {
  color: #c9d6d4;
  font-size: 12px;
}

.hdr-status:hover .hdr-status__stat {
  border-color: rgba(143, 196, 190, 0.55);
}

/* Online players page (/online) */
.ol { --ink:#d9e6e4; --mute:#8fa9a5; --line:rgba(143,196,190,.22); --gold:#f6c85a;
  --knight:#e8644f; --paladin:#f0a43a; --sorcerer:#9b86ff; --druid:#4cc38a;
  font-family:Roboto,Arial,sans-serif; color:var(--ink); margin:0 0 20px; }
.ol .v-knight{--c:var(--knight)} .ol .v-paladin{--c:var(--paladin)}
.ol .v-sorcerer{--c:var(--sorcerer)} .ol .v-druid{--c:var(--druid)}

.ol-hero { display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:18px 22px; border:1px solid rgba(143,196,190,.35); border-radius:10px;
  background:radial-gradient(120% 140% at 0% 0%, #2c4744 0%, #182224 55%, #121819 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.25); }
.ol-live { display:inline-flex; align-items:center; gap:7px; padding:3px 10px; border-radius:99px;
  background:rgba(93,234,111,.12); color:#5dea6f; font-size:11px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; }
.ol-live i { --status-color:#5dea6f; width:8px; height:8px; border-radius:50%; background:#5dea6f; animation:hdr-status-pulse 2s ease-out infinite; }
.ol-hero__title { margin:8px 0 2px; font-size:26px !important; font-weight:400; color:#fff; }
.ol-hero__title b { color:var(--gold); font-size:38px; font-weight:700; margin-right:4px; }
.ol-hero__sub { margin:0; color:var(--mute); font-size:12px; }
.ol-hero__peak { text-align:right; padding-left:18px; border-left:1px solid var(--line); }
.ol-hero__peak span { display:block; color:var(--mute); font-size:10px; letter-spacing:1px; text-transform:uppercase; }
.ol-hero__peak b { display:block; color:var(--gold); font-size:22px; }
.ol-hero__peak a { color:#bfe6df; font-size:13px; }

.ol-mix { display:flex; height:6px; margin:12px 2px 10px; border-radius:99px; overflow:hidden; gap:2px; }
.ol-mix__seg { background:var(--c); }

.ol-vocs { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.ol-voc { display:flex; align-items:center; gap:9px; padding:9px 12px; cursor:pointer;
  border:1px solid rgba(0,0,0,.15); border-left:3px solid var(--c); border-radius:7px;
  background:rgba(255,255,255,.7); color:#1d2a2c; font:600 13px Roboto,Arial,sans-serif; transition:.15s; }
.ol-voc i { color:var(--c); width:16px; text-align:center; }
.ol-voc b { margin-left:auto; font-size:18px; }
.ol-voc:hover, .ol-voc.is-on { background:#1d2a2c; color:#fff; border-color:var(--c); }

.ol-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 0 10px; }
.ol-search { flex:1; position:relative; max-width:300px; }
.ol-search i { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:#7d8d8b; font-size:12px; }
.ol-search input { width:100%; box-sizing:border-box; padding:8px 12px 8px 31px; border:1px solid rgba(0,0,0,.2);
  border-radius:7px; background:rgba(255,255,255,.85); font-size:13px; }
.ol-sort { display:flex; align-items:center; gap:4px; color:#3b4a49; font-size:12px; }
.ol-sort span { margin-right:4px; text-transform:uppercase; letter-spacing:1px; font-size:10px; font-weight:700; }
.ol-sort button { padding:6px 11px; border:1px solid rgba(0,0,0,.18); border-radius:6px; background:rgba(255,255,255,.7);
  color:#1d2a2c; cursor:pointer; font:600 12px Roboto,Arial,sans-serif; }
.ol-sort button.is-on { background:#1d2a2c; color:var(--gold); border-color:#1d2a2c; }

.ol-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.ol-row { display:grid; grid-template-columns:34px 60px 1fr 90px 110px; align-items:center; gap:12px;
  padding:6px 16px 6px 10px; border-radius:8px; border:1px solid rgba(143,196,190,.12);
  background:linear-gradient(90deg, #1f2c2e 0%, #192324 100%); transition:transform .12s, border-color .12s; }
.ol-row:hover { transform:translateX(3px); border-color:color-mix(in srgb, var(--c, #8fc4be) 60%, transparent); }
.ol-row[data-voc=knight]{--c:var(--knight)} .ol-row[data-voc=paladin]{--c:var(--paladin)}
.ol-row[data-voc=sorcerer]{--c:var(--sorcerer)} .ol-row[data-voc=druid]{--c:var(--druid)}
.ol-rank { text-align:center; color:#6f8682; font-weight:700; font-size:14px; }
.ol-row.is-top1 .ol-rank { color:#f6c85a; } .ol-row.is-top2 .ol-rank { color:#d5dde0; } .ol-row.is-top3 .ol-rank { color:#e09a5c; }
.ol-row.is-top1 { border-color:rgba(246,200,90,.45); background:linear-gradient(90deg, #3a3420 0%, #1f2a2b 45%, #192324 100%); }
.ol-outfit { position:relative; width:56px; height:56px; border-radius:8px; overflow:hidden;
  background:radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), #121819; }
.ol-outfit::before { content:"\f007"; font:900 20px "Font Awesome 5 Free"; color:rgba(255,255,255,.12);
  position:absolute; inset:0; display:grid; place-items:center; }
.ol-outfit img { position:relative; width:64px; height:64px; margin:-8px 0 0 -8px; image-rendering:pixelated; }
.ol-who { display:flex; flex-direction:column; gap:3px; min-width:0; }
.ol-who a { color:#fff !important; font-size:15px; font-weight:700; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ol-who a:hover { color:var(--gold) !important; }
/* the tag takes its colour from the row */
.ol-tag { align-self:flex-start; padding:1px 8px; border-radius:99px; font:600 11px Roboto,Arial,sans-serif;
  color:var(--c); background:color-mix(in srgb, var(--c) 14%, transparent); border:1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.ol-num { text-align:right; color:var(--ink); font-size:14px; font-variant-numeric:tabular-nums; }
.ol-num small { display:block; color:var(--mute); font-size:9px; letter-spacing:1px; text-transform:uppercase; }
.ol-num--lvl { color:var(--gold); font-size:16px; font-weight:700; }

@media (max-width:640px) {
  .ol-hero { flex-direction:column; align-items:flex-start; }
  .ol-hero__peak { text-align:left; border:0; padding:0; }
  .ol-vocs { grid-template-columns:repeat(2,1fr); }
  .ol-row { grid-template-columns:26px 48px 1fr 80px; }
  .ol-row .ol-num:not(.ol-num--lvl) { display:none; }
}

.ol-empty { margin:14px 0 0; padding:18px; border-radius:8px; text-align:center; color:#3b4a49; background:rgba(255,255,255,.6); }
.ol-row[hidden], .ol-empty[hidden] { display:none; }
.ol-voc.is-on { box-shadow:0 0 0 1px var(--c); }

/* Dark content area
   The light panel is baked into the frame images, so it is painted over here.
   Everything below is scoped to #page so the header, menu and footer are untouched. */
#page {
  --dk-ink: #d9e6e4;
  --dk-mute: #8fa9a5;
  --dk-line: rgba(143, 196, 190, 0.2);
  --dk-panel: rgba(255, 255, 255, 0.04);
  --dk-link: #6fd3c4;
  display: flow-root;
  color: var(--dk-ink);
  background: linear-gradient(180deg, rgba(20, 29, 31, 0.95), rgba(14, 20, 21, 0.97));
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

#page, #page p, #page td, #page th, #page li, #page label, #page dt, #page dd,
#page h1, #page h2, #page h3, #page h4, #page strong, #page b, #page small {
  color: var(--dk-ink);
}

#page a { color: var(--dk-link); }
#page a:hover { color: #f6c85a; }

/* Rules written for the light panel, recoloured (generated from the light-theme rules above
   by matching light backgrounds and dark text; hand-tuned rules below take precedence) */
#page .ui-input { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-help { color: var(--dk-ink); }
#page .ui-char { color: var(--dk-ink); }
#page .ui-char__meta { color: var(--dk-ink); }
#page .ui-char__tag { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__status--online { color: var(--dk-ink); }
#page .ui-char__status--offline { color: var(--dk-mute); }
#page .ui-card { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__banner { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__banner--danger { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__banner--warn { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__kv dt { color: var(--dk-ink); }
#page .ui-char__kv dd { color: var(--dk-ink); }
#page .ui-char__muted { color: var(--dk-mute); }
#page .ui-char__bar-label { color: var(--dk-ink); }
#page .ui-char__equip-meta-cell small { color: var(--dk-mute); }
#page .ui-char__equip-meta-item { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-char__sp-icon--on { color: var(--dk-ink); }
#page .ui-char__table th { color: var(--dk-ink); }
#page .ui-char__pill--on { color: var(--dk-ink); }
#page .ui-char__pill--off { color: var(--dk-mute); }
#page .ui-char__death-date { color: var(--dk-mute); }
#page .ui-char__death-text { color: var(--dk-ink); }
#page .ui-account__meta { color: var(--dk-mute); }
#page .ui-account__stat { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-account__stat-label { color: var(--dk-mute); }
#page .ui-account__stat-foot { color: var(--dk-mute); }
#page .ui-account__char { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-account__char-line { color: var(--dk-mute); }
#page .ui-account__input:focus-within .ui-account__input-icon { color: var(--dk-ink); }
#page .ui-account__reveal:hover { color: var(--dk-ink); }
#page .ui-account .ui-input { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-search .ui-search__input { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-search__field:focus-within .ui-search__icon { color: var(--dk-ink); }
#page .ui-search__hint, #page .ui-search__count { color: var(--dk-mute); }
#page .ui-search__empty { background: var(--dk-panel); border-color: var(--dk-line); color: var(--dk-mute); }
#page .ui-search__result { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-search__result:hover, #page .ui-search__result:focus-visible { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-search__line { color: var(--dk-mute); }
#page .ui-search__result:hover .ui-search__chevron { color: var(--dk-ink); }
#page .ui-suggest { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-suggest__line { color: var(--dk-mute); }
#page .ui-suggest__empty { color: var(--dk-mute); }
#page .ui-status { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-status__label { color: var(--dk-mute); }
#page .ui-status__stat { color: var(--dk-ink); }
#page .ui-status__stat-value { color: var(--dk-ink); }
#page .ui-status__stat-label { color: var(--dk-mute); }
#page .ui-status__note { color: var(--dk-mute); }
#page .ui-profile__hero { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-profile__meta { color: var(--dk-ink); }
#page .ui-profile__guild { color: var(--dk-mute); }
#page .ui-profile__guild i { color: var(--dk-ink); }
#page .ui-profile__badge--senior-tutor { color: var(--dk-ink); }
#page .ui-profile__badge--staff { color: var(--dk-ink); }
#page .ui-profile__stat { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-profile__stat dt { color: var(--dk-mute); }
#page .ui-profile__stat dd { color: var(--dk-ink); }
#page .ui-profile__count { color: var(--dk-mute); }
#page .ui-profile__sp-item i { color: var(--dk-mute); }
#page .ui-profile__sp-item--done { color: var(--dk-ink); }
#page .ui-profile__sp-item--done i { color: var(--dk-ink); }
#page .ui-profile__achievements li { background: var(--dk-panel); border-color: var(--dk-line); }

#page .ui-suggest { background: #1f2c2e; }
#page .ui-char__status--online, #page .ui-char__pill--on { background: rgba(76, 195, 138, 0.14); color: #7fe0a8; }
#page .ui-char__banner--danger { background: rgba(198, 40, 40, 0.16); color: #ff9a8f; }
#page .ui-char__banner--warn { background: rgba(230, 81, 0, 0.16); color: #ffb74d; }
#page .ui-search__result:hover, #page .ui-search__result:focus-visible { background: rgba(255, 255, 255, 0.08); }


#page input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=image]),
#page select, #page textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(143, 196, 190, 0.3);
  color: #fff;
}
#page input::placeholder, #page textarea::placeholder { color: #7d918e; }
#page select option { background: #1d2a2c; color: #fff; }

#page .ui-card, #page .ui-char__banner {
  background: var(--dk-panel);
  border-color: var(--dk-line);
  box-shadow: none;
}
#page .ui-card__header {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--dk-line);
}
#page .ui-help { color: var(--dk-mute); }
#page .ui-error, #page .ui-form .error { color: #ff7a6e; }

/* Online page pieces that assumed a light panel */
#page .ol-voc { background: var(--dk-panel); border-color: var(--dk-line); color: var(--dk-ink); }
#page .ol-voc.is-on, #page .ol-voc:hover { background: #253537; }
#page .ol-search input { background: rgba(255, 255, 255, 0.06); }
#page .ol-sort span { color: var(--dk-mute); }
#page .ol-sort button { background: var(--dk-panel); border-color: var(--dk-line); color: var(--dk-ink); }
#page .ol-sort button.is-on { background: #f6c85a; border-color: #f6c85a; color: #1d2a2c; }
#page .ol-row { background: linear-gradient(90deg, #223234, #1a2526); }
#page .ol-hero__sub, #page .ol-num small, #page .ol-hero__peak span { color: var(--dk-mute); }
#page .ol-hero__title b, #page .ol-num--lvl, #page .ol-hero__peak b { color: #f6c85a; }
#page .ol-tag { color: var(--c); }
#page .ol-empty { background: var(--dk-panel); color: var(--dk-ink); }

/* Legacy textured tables and boxes */
#page .table, #page .myOwnBox {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--dk-line);
  box-shadow: none;
}
#page .table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
#page #customers tr:nth-child(even), #page #customers tr:hover { background: rgba(255, 255, 255, 0.05); }
#page #customers th { color: #fff; }

/* Character profile */
#page .ui-profile__hero {
  background: linear-gradient(135deg, rgba(31, 111, 106, 0.3), rgba(255, 255, 255, 0.04) 60%);
  border-color: var(--dk-line);
}
#page .ui-profile__stat, #page .ui-profile__achievements li { background: var(--dk-panel); border-color: var(--dk-line); }
#page .ui-profile__stat dt, #page .ui-profile__count, #page .ui-profile__meta, #page .ui-profile__guild { color: var(--dk-mute); }
#page .ui-profile__stat dd { color: #fff; }
#page .ui-profile__guild i { color: var(--dk-link); }
#page .ui-profile__sp-item--done { background: rgba(76, 195, 138, 0.12); color: #7fe0a8; }
#page .ui-profile__sp-item--done i { color: #4cc38a; }

/* Inline colours written for the light panel */
#page [style*="color:#742005"], #page [style*="color: #742005"] { color: #ff9a6b !important; }
#page [style*="color:#444"], #page [style*="color: #444"], #page [style*="color:#666"], #page [style*="color: #666"],
#page [style*="color:#333"], #page [style*="color: #333"], #page [style*="color:#555"], #page [style*="color: #555"],
#page [style*="color: #2d3748"], #page [style*="color:#2d3748"] { color: var(--dk-mute) !important; }
#page [style*="color:#2c5282"], #page [style*="color: #2c5282"], #page [style*="color:#063677"], #page [style*="color: #063677"] { color: var(--dk-link) !important; }
#page [style*="background-color:white"], #page [style*="background-color: white"], #page [style*="background: white"],
#page [style*="background: #f7fafc"], #page [style*="background: #f9f9f9"], #page [style*="background: #e2e8f0"],
#page [style*="background-color: #f2f2f2"], #page [style*="background-color: #eee"],
#page [style*="background-color:rgb(245, 240, 220)"], #page [style*="background-color: rgb(245, 245, 245)"] {
  background: rgba(255, 255, 255, 0.05) !important;
}

#page .ui-card__header { color: #bcd3cf; }
#page .ui-char__status--offline { background: rgba(255, 255, 255, 0.08); color: var(--dk-mute); }

/* Tom Select (register country picker) */
#page .ts-control, #page .ts-wrapper.single.input-active .ts-control, #page .ts-dropdown {
  background: #1f2c2e;
  border-color: rgba(143, 196, 190, 0.3);
  color: #fff;
}
#page .ts-control input { color: #fff; }
#page .ts-dropdown .option, #page .ts-dropdown .item { color: var(--dk-ink); }
#page .ts-dropdown .active { background: #2b3f41; color: #fff; }

/* Reds and greens picked for the light panel */
#page .leaderboard .minus, #page [style*="color: darkred"], #page .boss-name { color: #ff7a6e !important; }
#page .leaderboard .plus { color: #6fdc7a; }

/* The frame's bottom image is light for 45px above its border: let the dark panel cover it */
#page { padding-bottom: 45px; }
#page-bgbtm { padding-bottom: 55px; }

/* Sidebar */
#sidebar .sb-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 14px; padding: 12px 14px; border-radius: 8px;
  background: linear-gradient(180deg, #ff3d6e, #d81b50); box-shadow: 0 6px 18px rgba(233, 30, 86, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff !important; font-size: 17px; font-weight: 700; letter-spacing: 0.5px; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s;
}
#sidebar .sb-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(233, 30, 86, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
#sidebar .sb-links { display: flex; flex-direction: column; gap: 4px; }
#sidebar .sb-links a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px;
  border: 1px solid transparent; color: #d9e6e4 !important; font-size: 15px; font-weight: 600; text-decoration: none; transition: background 0.12s, border-color 0.12s;
}
#sidebar .sb-links a > i:first-child { width: 18px; text-align: center; color: #6fd3c4; }
#sidebar .sb-links a:hover { background: rgba(111, 211, 196, 0.08); border-color: rgba(111, 211, 196, 0.25); color: #fff !important; }
#sidebar .sb-badge {
  margin-left: auto; min-width: 22px; padding: 1px 8px; border-radius: 99px; text-align: center;
  background: rgba(93, 234, 111, 0.15); color: #5dea6f; font-size: 12px;
}
#sidebar .sb-ext { margin-left: auto; color: #6f8682; font-size: 11px; }
#sidebar .sb-discord { overflow: hidden; border: 1px solid rgba(143, 196, 190, 0.25); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); line-height: 0; }
#sidebar .sb-discord iframe { display: block; width: 100%; }
#sidebar .sb-social { display: flex; flex-direction: column; gap: 8px; }
#sidebar .sb-social__item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(143, 196, 190, 0.18); background: rgba(255, 255, 255, 0.04); text-decoration: none; transition: border-color 0.12s, background 0.12s;
}
#sidebar .sb-social__item > i:first-child { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 17px; background: var(--brand); }
#sidebar .sb-social--facebook { --brand: #1877f2; }
#sidebar .sb-social--twitter { --brand: #1d9bf0; }
#sidebar .sb-social__item span { display: flex; flex-direction: column; line-height: 1.3; }
#sidebar .sb-social__item b { color: #fff; font-size: 14px; }
#sidebar .sb-social__item small { color: #8fa9a5; font-size: 12px; }
#sidebar .sb-social__item:hover { border-color: var(--brand); background: rgba(255, 255, 255, 0.07); }

/* Home banner buttons */
#banner .bn-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
#banner .bn-btn {
  position: relative; display: flex; align-items: center; gap: 13px; padding: 11px 16px; overflow: hidden;
  border-radius: 9px; text-decoration: none; text-transform: none; transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
#banner .bn-btn::after {
  /* light sweep on hover */
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg); transition: left 0.5s;
}
#banner .bn-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
#banner .bn-btn:hover::after { left: 120%; }
#banner .bn-btn > i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: rgba(0, 0, 0, 0.18); font-size: 17px; }
#banner .bn-btn span { display: flex; flex-direction: column; line-height: 1.2; }
#banner .bn-btn b { font-size: 17px; font-weight: 800; letter-spacing: 0.3px; }
#banner .bn-btn small { font-size: 11.5px; opacity: 0.85; }
#banner .bn-btn--gold {
  background: linear-gradient(180deg, #ffd977, #e7a92c); color: #2a1c05 !important;
  box-shadow: 0 6px 18px rgba(231, 169, 44, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
#banner .bn-btn--gold:hover { box-shadow: 0 10px 24px rgba(231, 169, 44, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
#banner .bn-btn--gold b, #banner .bn-btn--gold small, #banner .bn-btn--gold i { color: #2a1c05; }
#banner .bn-btn--pink {
  background: linear-gradient(180deg, #ff3d6e, #d81b50); color: #fff !important;
  box-shadow: 0 6px 18px rgba(233, 30, 86, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#banner .bn-btn--pink:hover { box-shadow: 0 10px 24px rgba(233, 30, 86, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
#banner .bn-btn--pink b, #banner .bn-btn--pink small, #banner .bn-btn--pink i { color: #fff; }

/* Home: latest news heading */
.news-head { position: relative; display: flex; align-items: center; gap: 16px; margin: 26px 40px 4px 50px; }
#page .news-head__title {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; flex: none;
  color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; text-transform: none;
}
.news-head__title i {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; font-size: 16px;
  color: #f6c85a; background: rgba(246, 200, 90, 0.12); border: 1px solid rgba(246, 200, 90, 0.35);
}
.news-head .news-head__more { margin-left: auto; flex: none; font-size: 13px; font-weight: 600; text-decoration: none; }
.news-head .news-head__more i { margin-left: 4px; font-size: 11px; transition: transform 0.12s; }
.news-head .news-head__more:hover i { transform: translateX(3px); }
/* rule under the heading */
.news-head__title + .news-head__more::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 1px;
  background: linear-gradient(90deg, rgba(246, 200, 90, 0.6), rgba(143, 196, 190, 0.15) 60%, transparent);
}

/* News archive (/archive) */
.na { margin: 0 0 20px; }
.na-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px;
  border: 1px solid rgba(143, 196, 190, 0.35); border-radius: 10px;
  background: radial-gradient(120% 140% at 0% 0%, #2c4744 0%, #182224 55%, #121819 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.25);
}
#page .na-kicker { display: inline-flex; align-items: center; gap: 7px; color: #f6c85a; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
#page .na-hero__title { margin: 6px 0 2px; color: #fff; font-size: 26px !important; font-weight: 400; }
#page .na-hero__title b { margin-right: 4px; color: #f6c85a; font-size: 38px; font-weight: 700; }
#page .na-hero__sub { margin: 0; color: #8fa9a5; font-size: 12px; }
#page .na-back {
  flex: none; padding: 8px 14px; border: 1px solid rgba(143, 196, 190, 0.3); border-radius: 7px;
  font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color 0.12s, background 0.12s;
}
#page .na-back:hover { border-color: #6fd3c4; background: rgba(111, 211, 196, 0.08); }

.na-search { position: relative; display: block; margin: 14px 0 4px; }
.na-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #7d8d8b; font-size: 12px; }
#page .na-search input { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 33px; border-radius: 7px; font-size: 13px; }

.na-year { margin-top: 18px; }
#page .na-year__title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #fff; font-size: 18px; font-weight: 700;
}
#page .na-year__title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(246, 200, 90, 0.5), transparent); }
#page .na-year__title small { padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: #8fa9a5; font-size: 11px; font-weight: 600; }

.na-list { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 0 18px; list-style: none; }
/* timeline rail */
.na-list::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: rgba(143, 196, 190, 0.18); }
.na-item { position: relative; }
.na-item::before {
  content: ""; position: absolute; left: -17px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: #1a2526; border: 2px solid #6fd3c4;
}
.na-item[hidden], .na-year[hidden], .na-empty[hidden] { display: none; }
#page .na-item > a {
  display: grid; grid-template-columns: 50px 1fr auto 14px; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  border: 1px solid rgba(143, 196, 190, 0.12); border-radius: 9px; background: linear-gradient(90deg, #223234, #1a2526);
  text-decoration: none; transition: transform 0.12s, border-color 0.12s;
}
#page .na-item > a:hover { transform: translateX(3px); border-color: rgba(111, 211, 196, 0.5); }
#page .na-item > a:hover .na-go { color: #f6c85a; }
#page .na-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50px; border-radius: 8px;
  background: rgba(246, 200, 90, 0.1); border: 1px solid rgba(246, 200, 90, 0.3);
  color: #f6c85a; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; line-height: 1.1;
}
#page .na-date b { color: #fff; font-size: 19px; letter-spacing: 0; }
.na-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#page .na-title { color: #fff; font-size: 15px; font-weight: 700; }
#page .na-excerpt { overflow: hidden; color: #8fa9a5; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
#page .na-meta { color: #8fa9a5; font-size: 12px; white-space: nowrap; }
#page .na-go { color: #4f6663; font-size: 12px; transition: color 0.12s; }
#page .na-empty { margin: 14px 0 0; padding: 18px; border-radius: 8px; text-align: center; background: rgba(255, 255, 255, 0.04); }

/* News post (/news/{title}) */
.np { margin: 0 0 20px; }
.np-hero {
  padding: 20px 24px; border: 1px solid rgba(143, 196, 190, 0.35); border-radius: 10px;
  background: radial-gradient(120% 140% at 0% 0%, #2c4744 0%, #182224 55%, #121819 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.25);
}
#page .np-kicker { display: inline-flex; align-items: center; gap: 7px; color: #f6c85a; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
#page .np-hero__title { margin: 8px 0 12px; color: #fff; font-size: 32px !important; font-weight: 700; line-height: 1.15; }
.np-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; }
#page .np-meta span { display: inline-flex; align-items: center; gap: 6px; color: #8fa9a5; font-size: 13px; }
#page .np-meta i { color: #6fd3c4; }
#page .np-meta .np-chip { padding: 2px 10px; border-radius: 99px; background: rgba(246, 200, 90, 0.12); color: #f6c85a; font-weight: 600; }
#page .np-meta .np-chip i { color: #f6c85a; }

.np-body { margin-top: 16px; padding: 20px 24px; border: 1px solid rgba(143, 196, 190, 0.14); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
#page .np-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; }
#page .np-body img { box-sizing: border-box; max-width: 100%; height: auto; border-radius: 8px; }
#page .np-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; padding: 0; list-style: none; }
#page .np-list li {
  position: relative; padding: 10px 14px 10px 40px; border-radius: 8px; border-left: 3px solid #6fd3c4;
  background: linear-gradient(90deg, rgba(111, 211, 196, 0.08), rgba(255, 255, 255, 0.02)); font-size: 14.5px; line-height: 1.55;
}
#page .np-list li::before {
  content: "\f00c"; position: absolute; left: 13px; top: 11px; color: #6fd3c4; font: 900 12px "Font Awesome 5 Free";
}

.np-comments { margin-top: 18px; }
#page .np-section { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #fff; font-size: 18px; font-weight: 700; }
#page .np-section small { padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: #8fa9a5; font-size: 11px; }
.np-comment { margin-bottom: 8px; padding: 12px 16px; border: 1px solid rgba(143, 196, 190, 0.12); border-radius: 9px; background: rgba(255, 255, 255, 0.03); }
.np-comment__head { display: flex; justify-content: space-between; margin-bottom: 6px; }
#page .np-comment__head span { color: #8fa9a5; font-size: 12px; }

.np-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin-top: 18px; }
#page .np-nav__link, #page .np-nav__all {
  display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 10px 14px; border-radius: 9px;
  border: 1px solid rgba(143, 196, 190, 0.18); background: rgba(255, 255, 255, 0.03); text-decoration: none; transition: border-color 0.12s, background 0.12s;
}
#page .np-nav__link--next { text-align: right; }
#page .np-nav__link small { color: #8fa9a5; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
#page .np-nav__link b { color: #fff; font-size: 14px; }
#page .np-nav__all { flex-direction: row; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
#page .np-nav__link:hover, #page .np-nav__all:hover { border-color: #6fd3c4; background: rgba(111, 211, 196, 0.08); }
