/* /characters/style.css */

/* ------------------- Base & Theme Tokens ------------------- */

:root {
  --rpc-red: #de232e;
  --raven-orange: #f97316;     /* tweak to match your exact Raven orange */
  --bg-deep: #020617;
  --bg-mid: #0b1120;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-soft: rgba(148,163,184,0.35);
  --grad-promo-raven: linear-gradient(135deg, var(--rpc-red), var(--raven-orange));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.bg-dark {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #111827 0, #020617 40%, #000 100%);
  color: var(--text-main);
}

/* ------------------- Layout ------------------- */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 2.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media (min-width: 1280px) {
  .page {
    max-width: 1320px;
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(15,23,42,0.9);
  padding-bottom: 0.75rem;
  position: relative;
}

.page-header::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(223, 71, 89, 0.1),
    var(--rpc-red),
    var(--raven-orange),
    rgba(249, 115, 22, 0.1)
  );
  opacity: 0.85;
}

.page-title-block h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Icon at top – simple orange icon, no background blob */
.page-title-block h1 i {
  font-size: 1.3rem;
  color: var(--raven-orange);
}

.page-title-block p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-footer {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

/* ------------------- Text helpers ------------------- */

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.8rem;
}

/* ------------------- Cards ------------------- */

.card {
  background:
    radial-gradient(circle at top left,
      rgba(248,250,252,0.04),
      rgba(15,23,42,0.92));
  border-radius: 1.5rem;
  border: 1px solid var(--border-soft);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow:
    0 22px 50px rgba(0,0,0,0.9),
    0 0 0 1px rgba(15,23,42,0.9);
  backdrop-filter: blur(20px);
}

.card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-search {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* ------------------- Buttons ------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: #f9fafb;
  background: #374151;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease,
    border-color 0.12s ease,
    background-position 0.15s ease;
  background-size: 200% 200%;
}

.btn i {
  font-size: 0.85rem;
}

.btn-primary {
  background-image: linear-gradient(135deg,
    var(--raven-orange),
    var(--rpc-red) 45%,
    #7f1d1d);
  border-color: rgba(248,250,252,0.18);
  box-shadow:
    0 0 25px rgba(222,35,46,0.5),
    0 0 35px rgba(249,115,22,0.45);
}

.btn-secondary {
  background-image: linear-gradient(135deg, #4b5563, #020617);
  border-color: rgba(148,163,184,0.7);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  background-position: 100% 0;
  box-shadow:
    0 0 30px rgba(15,23,42,0.9),
    0 0 0 1px rgba(15,23,42,0.95);
}

/* ------------------- Top actions ------------------- */

.top-actions {
  display: flex;
  justify-content: flex-start;
}

/* ------------------- Search ------------------- */

.search-form {
  margin-top: 1.2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
}

.search-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.search-input {
  flex: 1 1 auto;
  max-width: 520px;
  min-width: min(320px, 100%);
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.8);
  background: radial-gradient(circle at top left,
              rgba(15,23,42,0.9),
              #020617);
  color: #f9fafb;
  font-size: 0.98rem;
}

.search-input::placeholder {
  color: rgba(148,163,184,0.8);
}

.search-input:focus {
  outline: none;
  border-color: rgba(249,115,22,0.9);
  box-shadow:
    0 0 0 1px rgba(249,115,22,0.85),
    0 0 24px rgba(249,115,22,0.4);
}

/* ------------------- Search results ------------------- */

.results-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.result-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(31,41,55,0.9);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.15s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249,115,22,0.85);
  box-shadow:
    0 18px 35px rgba(0,0,0,0.9),
    0 0 0 1px rgba(15,23,42,0.9);
  background: radial-gradient(circle at top left,
              rgba(249,115,22,0.12),
              rgba(15,23,42,0.98));
}

.result-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(249,250,251,0.7);
}

.result-text .name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.result-text .cid {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ------------------- Character card ------------------- */

.card-character {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.character-header {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.character-avatar {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 999px;
  border: 2px solid #f9fafb;
  object-fit: cover;
  border-color: rgba(249,115,22,0.9);
  box-shadow:
    0 0 22px rgba(249,115,22,0.45),
    0 0 0 1px rgba(15,23,42,0.95);
}

.character-heading h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.character-heading .cid-line {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.character-heading .cid-line .label {
  font-weight: 500;
  color: #e5e7eb;
}

.net-worth {
  margin: 0.05rem 0 0;
  font-size: 0.9rem;
}

.net-worth .label {
  font-weight: 500;
  margin-right: 0.35rem;
}

.net-worth .amount {
  color: #4ade80;
  font-weight: 600;
  text-shadow: 0 0 16px rgba(34,197,94,0.5);
}

.net-worth .hint {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ------------------- Character grid ------------------- */

.character-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

@media (min-width: 900px) {
  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.subcard {
  background: rgba(15,23,42,0.96);
  border-radius: 1rem;
  border: 1px solid rgba(31,41,55,0.95);
  padding: 1rem 1.15rem 0.95rem;
}

.subcard h3 {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(55,65,81,0.95);
  padding-bottom: 0.45rem;
}

.subcard h3 i {
  font-size: 0.85rem;
  color: var(--raven-orange);
}

.subcard.subcard-wide {
  grid-column: 1 / -1;
}

/* ------------------- Definition-style meta list ------------------- */

.meta-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .meta-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.info-field {
  display: flex;
  flex-direction: column;
}

/* ---------------- GLOBAL ORANGE UNDERLINE (now on labels) ---------------- */

.underline-value {
  border-bottom: 1px solid rgba(249,115,22,0.35);
  padding-bottom: 2px;
  display: block;
  color: white;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 2px;
}

.value-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
}

/* ---------------- MONEY CARD ---------------- */

.money-card .money-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-top: 0.25rem;
  flex-wrap: wrap;
}

.money-card .money-item {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.money-card .value {
  font-size: 1rem;
}

/* ------------------- Collapsible sections ------------------- */

.card-collapsible .collapse-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0.9rem;
  border: 1px solid rgba(55,65,81,0.95);
  padding: 0.6rem 0.95rem;
  background: radial-gradient(circle at top left,
              rgba(249,115,22,0.15),
              rgba(15,23,42,0.98));
  color: #e5e7eb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.card-collapsible .collapse-toggle span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-collapsible .collapse-toggle-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-collapsible .collapse-toggle:hover {
  border-color: rgba(249,115,22,0.9);
  box-shadow:
    0 0 22px rgba(249,115,22,0.45),
    0 0 0 1px rgba(15,23,42,0.95);
}

.card-collapsible .collapse-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
  padding-top: 0;
}

.card-collapsible .collapse-panel.is-open {
  max-height: 4000px;
  padding-top: 0.8rem;
}

/* ------------------- Appearance sections ------------------- */

.helper-box {
  background: rgba(15,23,42,0.95);
  border-radius: 0.75rem;
  border: 1px dashed rgba(249,115,22,0.7);
  padding: 0.8rem 0.95rem;
  font-size: 0.8rem;
  margin-bottom: 0.9rem;
}

.helper-title {
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fed7aa;
}

.helper-box ul {
  margin: 0;
  padding-left: 1.1rem;
}

.helper-box li {
  margin-bottom: 0.2rem;
}

.appearance-section {
  margin-top: 0.85rem;
}

.appearance-section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #e5e7eb;
}

.appearance-section h5 {
  margin: 0.6rem 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.section-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ------------------- Tiles ------------------- */

.tiles {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
}

@media (min-width: 700px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tiles-raw {
  font-size: 0.78rem;
}

.tile {
  padding: 0.55rem 0.65rem;
  border-radius: 0.8rem;
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(31,41,55,0.95);
}

.tile-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.tile-label.small {
  font-size: 0.7rem;
}

.tile-value {
  margin: 0;
  font-size: 0.88rem;
}

.tile-value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  word-break: break-all;
}

.tile-hint {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ------------------- Footnote ------------------- */

.footnote {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
}

/* ------------------- Error card ------------------- */

.card-error {
  border-color: rgba(248,113,113,0.8);
  background: radial-gradient(circle at top left,
    rgba(248,113,113,0.12),
    rgba(15,23,42,0.96));
}

.card-error p {
  margin: 0;
  font-size: 0.9rem;
  color: #fecaca;
}

.card-error i {
  margin-right: 0.4rem;
  color: #f97373;
}

.text-promo-raven {
  font-weight: 900;
  background: var(--grad-promo-raven);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}