/* Ragnarok Online xClassic — Pure Classic 2003 (Episode 5: Juno) Portal Theme */
:root {
  --accent: #f5b942;
  --accent-bright: #fcd34d;
  --accent-dim: rgba(245, 185, 66, 0.16);
  --accent-2: #38bdf8;
  --accent-2-dim: rgba(56, 189, 248, 0.15);
  --crimson: #f43f5e;
  --emerald: #22c55e;
  --violet: #a855f7;
  --hero-font: var(--font-display);
  --glow-1: rgba(245, 185, 66, 0.14);
  --glow-2: rgba(56, 189, 248, 0.15);
  --glow-3: rgba(168, 85, 247, 0.1);
  --panel: rgba(12, 19, 36, 0.86);
  --panel-solid: #0c1324;
  --panel-soft: rgba(17, 26, 48, 0.72);
  --line: rgba(148, 163, 184, 0.16);
  --line-gold: rgba(245, 185, 66, 0.34);
}

/* Sticky Sub-Navigation */
.x-subnav {
  position: sticky;
  top: 44px;
  z-index: 40;
  background: rgba(7, 11, 21, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.x-subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.x-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent);
  font-size: 1rem;
  white-space: nowrap;
}
.x-brand small {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-2-dim);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 2px 8px;
  border-radius: 999px;
}
.x-navlinks {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.x-navlinks a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 11px;
  border-radius: 9px;
  transition: all 0.16s ease;
}
.x-navlinks a:hover,
.x-navlinks a.active {
  color: var(--accent-bright);
  background: rgba(245, 185, 66, 0.12);
}
.x-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.x-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.16s ease;
}
.x-dropdown:hover .x-dropdown-toggle,
.x-dropdown.open .x-dropdown-toggle {
  color: var(--accent-bright);
  background: rgba(245, 185, 66, 0.12);
}
.x-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: rgba(9, 14, 28, 0.98);
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 80;
}
.x-dropdown::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}
.x-dropdown:hover .x-dropdown-menu,
.x-dropdown.open .x-dropdown-menu {
  display: flex;
}
.x-dropdown-menu a {
  display: block;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}
.x-dropdown-menu a:hover {
  background: rgba(245, 185, 66, 0.14);
  color: var(--accent-bright);
}

/* Live Telemetry Strip */
.telemetry-bar {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(20, 29, 52, 0.95), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid var(--line-gold);
  font-size: 0.8rem;
}
.telemetry-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tele-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tele-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-weight: 600;
}
.tele-pill strong {
  color: var(--text);
  font-weight: 700;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25);
}
.dot.up {
  background: var(--emerald);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.75);
}
.dot.down {
  background: var(--crimson);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.75);
}
.tz-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--accent-bright);
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.tz-btn:hover {
  border-color: var(--accent);
}

/* Hero Section */
.x-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.x-hero-bg {
  position: absolute;
  inset: 0;
  background: url('/ro/img/hero-juno.jpg') center 28% / cover no-repeat;
  filter: saturate(1.06) brightness(0.45);
  transform: scale(1.02);
}
.x-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 9, 18, 0.94) 0%, rgba(6, 9, 18, 0.74) 55%, rgba(6, 9, 18, 0.45) 100%),
    linear-gradient(180deg, rgba(6, 9, 18, 0.2) 0%, rgba(6, 9, 18, 0.96) 100%);
}
.x-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 58px 20px 46px;
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 32px;
  align-items: center;
}
.x-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.14);
  border: 1px solid var(--line-gold);
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.x-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}
.x-hero h1 span {
  background: linear-gradient(135deg, #fde68a 0%, #f5b942 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.x-hero-lead {
  color: #cbd5e1;
  font-size: 1.02rem;
  max-width: 600px;
  margin-bottom: 22px;
}
.x-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.x-pill {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}
.x-pill b { color: var(--accent); }
.x-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.x-btn:hover { transform: translateY(-1px); }
.x-btn-gold {
  background: linear-gradient(135deg, #f5b942, #d97706);
  color: #090d16;
  box-shadow: 0 10px 26px rgba(245, 185, 66, 0.28);
}
.x-btn-gold:hover { box-shadow: 0 14px 30px rgba(245, 185, 66, 0.42); }
.x-btn-sky {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #06101d;
  box-shadow: 0 10px 26px rgba(56, 189, 248, 0.24);
}
.x-btn-ghost {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.3);
  color: #f8fafc;
}
.x-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.x-btn-sm {
  padding: 7px 13px;
  font-size: 0.8rem;
  border-radius: 9px;
}
.x-btn-danger {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.42);
  color: #fda4af;
}

/* Hero Right Panel (Live Snapshot Card) */
.hero-card {
  background: rgba(10, 16, 32, 0.86);
  border: 1px solid var(--line-gold);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
}
.hero-card-art {
  width: 100%;
  height: 290px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.kpi-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}
.kpi-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.kpi-val {
  font-family: var(--font-tech);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-top: 2px;
}
.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Main Container & Sections */
.x-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
.x-section {
  padding: 54px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.x-subpage-sec {
  padding: 36px 0 60px;
  min-height: 68vh;
}
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.sec-eyebrow {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  margin-bottom: 5px;
}
.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
}
.sec-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 680px;
  margin-top: 4px;
}

/* Glass Cards & Grids */
.x-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.x-card-gold {
  border-color: var(--line-gold);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Tab Bars */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.tab-btn {
  padding: 8px 15px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: var(--text);
  border-color: rgba(245, 185, 66, 0.4);
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.22), rgba(56, 189, 248, 0.14));
  border-color: var(--accent);
  color: var(--accent-bright);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* News & Spec List */
.news-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag-gold { background: rgba(245, 185, 66, 0.18); color: var(--accent-bright); border: 1px solid rgba(245, 185, 66, 0.35); }
.tag-sky { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.tag-green { background: rgba(34, 197, 94, 0.16); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
.tag-rose { background: rgba(244, 63, 94, 0.18); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.38); }
.tag-violet { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.38); }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.spec-table tr { border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.spec-table td { padding: 9px 6px; }
.spec-table td:first-child { color: var(--text-dim); font-weight: 600; width: 44%; }
.spec-table td:last-child { color: var(--text); font-weight: 600; text-align: right; }

/* Forms & Inputs */
.x-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.x-field {
  margin-bottom: 13px;
}
.x-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.x-input,
.x-select {
  width: 100%;
  background: rgba(6, 10, 22, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.x-input:focus,
.x-select:focus {
  border-color: var(--accent);
}
.alert-box {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 12px;
  display: none;
}
.alert-box.show { display: block; }
.alert-ok { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.alert-err { background: rgba(244, 63, 94, 0.16); border: 1px solid rgba(244, 63, 94, 0.42); color: #fda4af; }

/* Filter Bar & Data Tables */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.filter-bar .x-input { flex: 1 1 220px; }
.filter-bar .x-select { width: auto; min-width: 140px; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 10, 22, 0.65);
}
.x-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.x-table th {
  text-align: left;
  padding: 11px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: var(--accent-bright);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.x-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: middle;
}
.x-table tbody tr:hover {
  background: rgba(245, 185, 66, 0.06);
}
.x-table tr.clickable { cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Town Strip Cards */
.town-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.town-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  height: 112px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.town-card:hover,
.town-card.active {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.town-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.68);
  transition: transform 0.25s ease;
}
.town-card:hover img { transform: scale(1.06); }
.town-card-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, transparent, rgba(6, 9, 18, 0.92));
}
.town-card-cap strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #fff;
}
.town-card-cap span {
  font-size: 0.7rem;
  color: #cbd5e1;
}

/* MVP Cards */
.mvp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mvp-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mvp-card.mvp-open { border-color: rgba(34, 197, 94, 0.55); box-shadow: 0 0 18px rgba(34, 197, 94, 0.12); }
.mvp-card.mvp-wait { border-color: rgba(245, 185, 66, 0.45); }
.mvp-timer {
  font-family: var(--font-tech);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-bright);
}

/* Element Matrix Heat Colors */
.ele-table th, .ele-table td { text-align: center; padding: 7px 6px; font-size: 0.78rem; }
.ele-table th.col-sel { background: rgba(245, 185, 66, 0.28); color: #fff; }
.ele-table td.col-sel { outline: 1px solid rgba(245, 185, 66, 0.45); }
.e-200 { background: rgba(34, 197, 94, 0.34); color: #dcfce7; font-weight: 800; }
.e-175 { background: rgba(34, 197, 94, 0.24); color: #bbf7d0; font-weight: 700; }
.e-150 { background: rgba(34, 197, 94, 0.16); color: #86efac; font-weight: 700; }
.e-125 { background: rgba(56, 189, 248, 0.14); color: #bae6fd; }
.e-100 { color: #94a3b8; }
.e-low { background: rgba(245, 158, 11, 0.16); color: #fde68a; }
.e-zero { background: rgba(244, 63, 94, 0.22); color: #fecdd3; font-weight: 700; }
.e-heal { background: rgba(168, 85, 247, 0.28); color: #f3e8ff; font-weight: 800; }

/* Stat Calc Layout */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat-box {
  background: rgba(6, 10, 22, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.stat-box label {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 6px;
}
.stat-pair { display: flex; gap: 6px; }
.stat-pair input { padding: 6px 8px; font-size: 0.86rem; }
.calc-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.calc-metric {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  text-align: center;
}
.calc-metric span { display: block; font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }
.calc-metric strong { font-family: var(--font-tech); font-size: 1.12rem; color: var(--accent-bright); }

/* Gear, Refine & Cards Loadout */
.gear-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.gear-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gear-slot {
  background: rgba(6, 10, 22, 0.76);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
}
.gear-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.gear-slot-head label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-bright);
}
.gear-slot-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.gear-slot-row .x-select {
  padding: 7px 9px;
  font-size: 0.82rem;
}
.gear-ref {
  width: 72px !important;
  min-width: 72px !important;
  flex-shrink: 0;
}
.gear-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}
.gear-cards .x-select {
  padding: 5px 8px;
  font-size: 0.76rem;
  border-color: rgba(56, 189, 248, 0.28);
  color: #bae6fd;
}
.gear-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
@media (max-width: 960px) {
  .gear-grid { grid-template-columns: 1fr; }
}

/* Emblem Maker */
.emblem-stage {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px;
  background: rgba(6, 10, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pixel-canvas {
  image-rendering: pixelated;
  border: 2px solid var(--line-gold);
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 16px 16px;
  border-radius: 6px;
}

/* Class Showcase Carousel */
.job-showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.gender-toggle {
  display: inline-flex;
  background: rgba(6, 10, 22, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.gender-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.gender-btn.active {
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.25), rgba(56, 189, 248, 0.18));
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--line-gold);
}
.job-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 16px;
  padding: 20px 10px;
  min-height: 420px;
  border-radius: 14px;
  background-color: #060a16;
  border: 1px solid var(--line-gold);
  margin-bottom: 14px;
}
.job-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.76) saturate(1.12);
  transform: scale(1.03);
  transition: opacity 0.25s ease;
  z-index: 0;
  pointer-events: none;
}
.job-stage-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 56% 70% at 50% 50%, rgba(0, 0, 0, 0.04) 25%, rgba(5, 8, 18, 0.52) 100%),
    linear-gradient(180deg, rgba(5, 8, 18, 0.14) 0%, transparent 45%, rgba(5, 8, 18, 0.56) 100%);
  z-index: 1;
  pointer-events: none;
}
.job-stage > .job-arrow,
.job-stage > .job-figure {
  position: relative;
  z-index: 2;
}
.job-home-tag {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(6, 10, 22, 0.78);
  border: 1px solid var(--line-gold);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.job-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-gold);
  background: rgba(12, 19, 36, 0.9);
  color: var(--accent-bright);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.14s ease;
  justify-self: center;
}
.job-arrow:hover {
  background: rgba(245, 185, 66, 0.2);
  transform: scale(1.07);
}
.job-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 360px;
}
.job-figure img {
  max-height: 340px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.65));
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.job-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.job-dot {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 19, 36, 0.78);
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.job-dot:hover {
  color: #fff;
  border-color: rgba(245, 185, 66, 0.5);
}
.job-dot.active {
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.28), rgba(56, 189, 248, 0.16));
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: 0 0 14px rgba(245, 185, 66, 0.38);
}
@media (max-width: 600px) {
  .job-stage { grid-template-columns: 42px 1fr 42px; gap: 8px; min-height: 320px; }
  .job-arrow { width: 38px; height: 38px; font-size: 1.3rem; }
  .job-figure img { max-height: 260px; }
}

/* Economy Bar Chart */
.dist-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.dist-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  overflow: hidden;
}
.dist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.gal-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  cursor: pointer;
}
.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.gal-item:hover img { transform: scale(1.06); }
.gal-item span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  background: linear-gradient(180deg, transparent, rgba(4, 7, 15, 0.92));
}

/* Modal / Detail Drawer & Lightbox */
.x-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.x-modal-backdrop.open { display: flex; }
.x-modal {
  background: #0c1324;
  border: 1px solid var(--line-gold);
  border-radius: 18px;
  max-width: 780px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75);
}
.x-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.x-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.1rem;
  cursor: pointer;
}
.x-close:hover { border-color: var(--accent); color: var(--accent); }

/* Character UCP Card */
.ucp-char-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hp-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.hp-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #4ade80); }
.sp-fill { height: 100%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

/* Footer */
.x-footer {
  padding: 36px 20px 54px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Toast */
.x-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  background: #0f172a;
  border: 1px solid var(--line-gold);
  color: var(--accent-bright);
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
}
.x-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .x-hero-inner, .grid-2, .grid-3, .grid-4, .mvp-grid, .town-grid {
    grid-template-columns: 1fr;
  }
  .x-form-row, .stat-grid, .calc-readout {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .x-form-row, .stat-grid, .calc-readout { grid-template-columns: 1fr; }
}
