/*
  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__btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff !important;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.ui-char__btn:hover {
  background: #256628;
}

.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;
  }
}


