/* =========================================================
   UI SYSTEM – Shared Material Design System
   Used by: characters.php, account.php (transfer), etc.
   ========================================================= */

/* ----- THEME TOKENS ----- */
.theme-gold {
  --ui-accent-grad: linear-gradient(90deg, #DAA520 0%, #c89417 100%);
  --ui-accent-soft: rgba(218,165,32,.14);
  --ui-accent-hover: rgba(218,165,32,.08);
  --ui-link: #7a5b00;
  --ui-btn-grad: linear-gradient(180deg, #DAA520 0%, #b07f12 100%);
  --ui-accent-text: #fff;
  --ui-th-bg: rgba(199,150,27,.18);
  --ui-th-color: #6a5200;
}
.theme-red {
  --ui-accent-grad: linear-gradient(90deg, #b30000 0%, #7f0000 100%);
  --ui-accent-soft: rgba(179,0,0,.10);
  --ui-accent-hover: rgba(179,0,0,.06);
  --ui-link: #7a0000;
  --ui-btn-grad: linear-gradient(180deg, #b30000 0%, #7f0000 100%);
  --ui-accent-text: #fff;
  --ui-th-bg: rgba(179,0,0,.12);
  --ui-th-color: #7a0000;
}

/* ----- PAGE WRAPPER ----- */
.ui-page {
  width: 100%;
  margin: 0;
  padding: 0;
  color: #1c1c1c;
}
.ui-page a {
  color: var(--ui-link);
  text-decoration: none;
}
.ui-page a:hover {
  text-decoration: underline;
}

/* ----- TITLEBAR ----- */
.ui-titlebar {
  background: var(--ui-accent-grad);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ui-accent-text);
  font-family: Bebas Neue Bold, Bebas Neue, sans-serif;
  font-size: 19px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

/* ----- CARDS ----- */
.ch-card {
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  margin-bottom: 14px;
  position: relative;
  transition: transform .10s ease, box-shadow .14s ease,
              background-color .18s ease, border-color .18s ease;
}
.ch-card:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.92);
  border-color: rgba(0,0,0,.10);
  box-shadow:
    0 10px 25px rgba(0,0,0,.10),
    0 0 0 3px var(--ui-accent-soft);
}
.ch-card:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--ui-accent-hover);
  pointer-events: none;
}
.ch-card > * {
  position: relative;
  z-index: 1;
}
.ch-card p {
  font-size: 14px;
  line-height: 1.55em;
  margin: 0 0 10px 0;
  color: #333;
}

.ch-card-title {
  font-family: Georgia, serif;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  font-size: 12px;
  color: #111;
  margin: 0 0 10px 0;
}

/* ----- ALERTS ----- */
.ch-alert {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.92);
  margin-bottom: 10px;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.5em;
}
.ch-alert-danger {
  border-color: rgba(220,53,69,.35);
  box-shadow: 0 0 0 3px rgba(220,53,69,.10);
}
.ch-alert-warning {
  border-color: rgba(255,193,7,.50);
  box-shadow: 0 0 0 3px rgba(255,193,7,.12);
  background: rgba(255,248,225,.95);
}
.ch-alert-success {
  border-color: rgba(40,167,69,.35);
  box-shadow: 0 0 0 3px rgba(40,167,69,.10);
  background: rgba(212,237,218,.95);
}
.ch-alert-info {
  border-color: rgba(218,165,32,.35);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
  background: rgba(255,248,225,.60);
}
.ch-alert strong {
  font-weight: 900;
}
.ch-alert .fa {
  margin-right: 4px;
}

/* ----- TABLES ----- */
.ch-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.95);
}
.ch-table th,
.ch-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 13px;
  color: #111;
}
.ch-table th {
  background: var(--ui-th-bg);
  color: var(--ui-th-color);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 11px;
  text-align: left;
}
.ch-table tr:last-child td {
  border-bottom: 0;
}

/* ----- BUTTONS ----- */
.ch-btn {
  display: inline-block;
  height: 42px;
  line-height: 42px;
  border-radius: 10px;
  border: 0;
  padding: 0 18px;
  font-family: Bebas Neue Bold, Bebas Neue, sans-serif;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
  background: var(--ui-btn-grad);
  color: #fff !important;
  text-decoration: none !important;
  text-align: center;
  transition: filter .12s ease, box-shadow .14s ease;
}
.ch-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(0,0,0,.12), 0 0 0 3px var(--ui-accent-soft);
  text-decoration: none !important;
}
.ch-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.ch-btn-secondary {
  background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
  color: #333 !important;
}
.ch-btn-secondary:hover {
  filter: brightness(1.02);
  box-shadow: 0 10px 22px rgba(0,0,0,.08), 0 0 0 3px rgba(0,0,0,.06);
}

.ch-btn-danger {
  background: linear-gradient(180deg, #dc3545 0%, #a71d2a 100%);
}

.ch-btn-sm {
  height: 34px;
  line-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* ----- FORM INPUTS ----- */
.ch-input {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.98);
  outline: none;
  font-size: 14px;
  color: #111;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.ch-input:focus {
  border-color: rgba(218,165,32,.50);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}
.ch-input::placeholder {
  color: rgba(0,0,0,.35);
}

/* ----- FORM GROUPS ----- */
.ch-form-group {
  margin-bottom: 14px;
}
.ch-form-label {
  display: block;
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #111;
  margin-bottom: 6px;
}
.ch-form-help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(0,0,0,.50);
}

/* ----- FORM ACTIONS (button row) ----- */
.ch-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ----- SEARCH FORM ----- */
.ch-search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.ch-search .ch-input {
  min-width: 260px;
  width: auto;
  flex: 1;
}

/* ----- RADIO LIST (for character selection etc.) ----- */
.ch-radio-list {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.95);
}
.ch-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  cursor: pointer;
  transition: background .12s ease;
  font-size: 13px;
  color: #111;
}
.ch-radio-item:last-child {
  border-bottom: 0;
}
.ch-radio-item:hover {
  background: var(--ui-accent-hover);
}
.ch-radio-item input[type="radio"] {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}
.ch-radio-content {
  flex: 1;
  min-width: 0;
}
.ch-radio-content strong {
  font-weight: 900;
}
.ch-radio-content small {
  color: rgba(0,0,0,.55);
}
.ch-radio-item.is-disabled {
  opacity: .5;
  cursor: not-allowed;
}
.ch-radio-item.is-disabled:hover {
  background: transparent;
}

/* ----- BADGES ----- */
.ch-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: #111;
  white-space: nowrap;
  flex-shrink: 0;
}
.ch-badge-online,
.ch-badge-ready {
  background: #d8f2dd;
  border-color: rgba(0,0,0,.10);
  color: #0b6a1f;
}
.ch-badge-vip {
  background: #f3f0d6;
  border-color: rgba(0,0,0,.10);
  color: #6a5200;
}
.ch-badge-warning {
  background: #fff3cd;
  border-color: rgba(0,0,0,.10);
  color: #856404;
}
.ch-badge-danger {
  background: #f8d7da;
  border-color: rgba(0,0,0,.10);
  color: #721c24;
}
.ch-badge-info {
  background: #d1ecf1;
  border-color: rgba(0,0,0,.10);
  color: #0c5460;
}

/* ----- DIVIDER ----- */
.ch-divider {
  height: 1px;
  background: rgba(0,0,0,.08);
  border: 0;
  margin: 14px 0;
}

/* ----- ACCORDION ----- */
.ch-acc {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.95);
  margin-bottom: 12px;
}
.ch-acc summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 12px 14px;
  background: var(--ui-btn-grad);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ch-acc summary::-webkit-details-marker {
  display: none;
}
.ch-acc-body {
  padding: 12px 14px;
  color: #111;
  font-size: 13px;
  line-height: 1.55em;
  background: rgba(255,255,255,.97);
}

/* ----- CHARACTER-SPECIFIC (overview, bars, eq, skills) ----- */
.ch-overview {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
}
.ch-outfit {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ch-outfit img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.ch-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ch-name {
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: 22px;
  color: #111;
}
.ch-sub {
  margin-top: 2px;
  color: rgba(0,0,0,.70);
  font-size: 13px;
}

/* Bars */
.ch-bars {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ch-barbox {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.95);
  padding: 10px 12px;
}
.ch-barlabel {
  font-weight: 900;
  font-size: 12px;
  color: #111;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.ch-barline {
  height: 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.10);
  overflow: hidden;
  margin-top: 8px;
}
.ch-barfill {
  height: 100%;
  background: var(--ui-btn-grad);
  border-radius: 999px;
}
.ch-expbox {
  grid-column: 1 / -1;
}
.ch-exptext {
  margin-top: 8px;
  font-size: 13px;
  color: #111;
}

/* Equipment & Skills */
.ch-eqskills {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
}
.ch-panel {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  padding: 12px;
}
.ch-panel-title {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #111;
  margin: 0 0 10px 0;
}

/* EQ grid */
.ch-eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ch-eq-item,
.ch-eq-stat {
  height: 78px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}
.ch-eq-item {
  background: #c7961b;
  position: relative;
  overflow: visible;
  z-index: 1;
}
.ch-eq-item:hover {
  z-index: 10000;
}
.ch-eq-item img {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.ch-eq-empty {
  background: rgba(199,150,27,.28);
  border: 1px solid rgba(0,0,0,.08);
}
.ch-eq-stat {
  background: rgba(255,255,255,.60);
  border: 1px solid rgba(0,0,0,.12);
  flex-direction: column;
  gap: 4px;
}
.ch-eq-stat-label {
  font-weight: 900;
  font-size: 12px;
  color: #111;
}
.ch-eq-stat-val {
  font-weight: 900;
  font-size: 13px;
  color: #111;
}

/* Tooltip */
.ch-tip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-tipbox {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  top: auto;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  background: rgba(20,20,20,.95);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35em;
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  max-height: 220px;
  overflow: auto;
}
.ch-tip:hover .ch-tipbox {
  opacity: 1;
}

/* Skills */
.ch-skills {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  overflow: hidden;
}
.ch-srow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 13px;
  color: #111;
}
.ch-srow:last-child {
  border-bottom: 0;
}
.ch-skey {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-size: 11px;
  color: rgba(0,0,0,.75);
}
.ch-sval {
  font-weight: 900;
  color: #111;
}

/* Quick stats */
.ch-quickstats {
  margin-top: 14px;
}
.ch-qcard {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  padding: 12px;
}
.ch-qtitle {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #111;
  margin: 0 0 10px 0;
}

/* Stats tiles */
.ch-stats-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.ch-stat-tile {
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.95);
  overflow: hidden;
  text-align: center;
}
.ch-stat-icon {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-th-bg);
}
.ch-stat-icon img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}
.ch-stat-name {
  padding: 8px 6px 0 6px;
  font-weight: 900;
  font-size: 10px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #111;
}
.ch-stat-val {
  padding: 6px 6px 10px 6px;
  font-weight: 900;
  font-size: 13px;
  color: #111;
}

/* ----- ICON SPACING ----- */
.ui-titlebar .fa {
  margin-right: 6px;
}

/* ----- TRANSFER CHECKLIST ----- */
.ch-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
}
.ch-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ui-accent-soft);
  font-size: 13px;
  color: #333;
}
.ch-checklist-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ui-btn-grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ch-checklist-icon::after {
  content: "";
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Step title (numbered section headers) */
.ch-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
}
.ch-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ui-btn-grad);
  color: #fff;
  font-family: Bebas Neue Bold, Bebas Neue, sans-serif;
  font-size: 14px;
  flex-shrink: 0;
}
.ch-step-label {
  font-family: Georgia, serif;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  font-size: 12px;
  color: #111;
}

/* Coins highlight bar */
.ch-coins-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(218,165,32,.12), rgba(218,165,32,.04));
  border: 1px solid rgba(218,165,32,.25);
  margin: 10px 0;
  font-size: 13px;
  color: #6a5200;
}
.ch-coins-bar .fa {
  color: #DAA520;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
  .ch-overview { grid-template-columns: 1fr; }
  .ch-outfit { margin: 0 auto; }
  .ch-eqskills { grid-template-columns: 1fr; }
  .ch-stats-tiles { grid-template-columns: repeat(2, 1fr); }
  .ch-bars { grid-template-columns: 1fr; }
  .ch-checklist { grid-template-columns: 1fr; }
}
