/* ==========================================================================
   GUCCI Rankings — complete standalone stylesheet
   This file intentionally contains BOTH layout and theme rules.
   /rankings no longer depends on style.css.
   ========================================================================== */

:root,
[data-theme="amoled"] {
  --bg-deep: #000000;
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-elevated: #111111;
  --bg-hover: #1a1a1a;
  --bg-glass: rgba(0, 0, 0, 0.94);
  --border: #1a1a1a;
  --border-light: #222222;
  --text: #f0f0f5;
  --text-secondary: #b0b0c0;
  --text-muted: #606075;

  --primary: #22d3ee;
  --primary-light: #67e8f9;
  --secondary: #34d399;
  --secondary-light: #6ee7b7;
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --amber: #fbbf24;
  --rose: #fb7185;
  --orange: #fb923c;

  --glow-primary: rgba(34, 211, 238, 0.40);
  --glow-secondary: rgba(52, 211, 153, 0.40);
  --glow-purple: rgba(139, 92, 246, 0.40);

  --gradient-main: linear-gradient(135deg, #22d3ee 0%, #34d399 100%);
  --gradient-alt: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #fb7185 100%);

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-deep: #06060a;
  --bg: #0a0a10;
  --bg-card: #0f0f18;
  --bg-elevated: #151520;
  --bg-hover: #1c1c2a;
  --bg-glass: rgba(15, 15, 24, 0.88);
  --border: #1e1e2e;
  --border-light: #2a2a3d;
  --text: #f0f0f5;
  --text-secondary: #b0b0c0;
  --text-muted: #606075;
}

[data-theme="light"] {
  --bg-deep: #f5f5f7;
  --bg: #ffffff;
  --bg-card: #f8f8fa;
  --bg-elevated: #ffffff;
  --bg-hover: #f0f0f5;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --border: #e0e0e8;
  --border-light: #d0d0d8;
  --text: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8c;
}

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

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

html[data-theme="light"] { color-scheme: light; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

body.settings-open { overflow: hidden; }

button,
input,
select {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button { color: inherit; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover { color: var(--secondary); }

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(34, 211, 238, .28);
  color: var(--text);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--bg);
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border: 2px solid var(--bg);
  border-radius: 999px;
}

/* ---------- Homepage-matching ambient background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .12;
  animation: gucciFloat 25s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  background: var(--primary);
}

.orb-2 {
  width: 500px;
  height: 500px;
  top: 60%;
  right: -150px;
  background: var(--secondary);
  animation-delay: -8s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: 40%;
  background: var(--purple);
  animation-delay: -16s;
}

@keyframes gucciFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(.95); }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

header.scrolled {
  box-shadow: 0 10px 32px rgba(0, 0, 0, .18);
}

.header-inner {
  max-width: 1400px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 201px;
  color: inherit;
}

.logo:hover { color: inherit; }

.logo-icon {
  position: relative;
  overflow: hidden;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gradient-main);
  box-shadow: 0 4px 20px var(--glow-primary);
  font-size: 22px;
}

.logo-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.20), transparent 50%);
  pointer-events: none;
}

.logo-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}

.logo-text {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Rankings badge = homepage server-tag language, including the green live dot. */
.logo-context {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}

.logo-context::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 9px var(--secondary);
  animation: rankingsPulse 2s ease-in-out infinite;
}

@keyframes rankingsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .48; transform: scale(.92); }
}

/* Global character search */
.search-container {
  position: relative;
  flex: 1 1 260px;
  min-width: 190px;
  max-width: 310px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 39px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

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

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .10);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font: 600 11px/1.4 var(--font-mono);
  text-align: center;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1200;
  display: none;
  max-height: 430px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 18px 50px rgba(0,0,0,.34);
}

.search-results.active { display: block; }

.search-result-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}

.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover,
.search-result-item.highlighted { background: var(--bg-hover); }

.search-result-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.search-result-meta {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.search-no-results {
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.nav-links {
  flex: 0 1 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.nav-links a {
  position: relative;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: color .2s ease, background .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 24px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--gradient-main);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.settings-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--bg-hover);
}

/* ---------- Main layout ---------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  background: transparent;
}

#main-content { flex: 1 0 auto; }

.page-header {
  margin: 2px 0 22px;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.gradient,
.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.num-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cards / KPIs ---------- */
.card,
.kpi-card,
.hero-banner,
.table-wrapper,
.compare-card,
.class-card,
.rank-mini-card,
.exp-summary-card,
.eta-card,
.fashion-item {
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: none;
}

.card {
  border-radius: 18px;
  overflow: hidden;
}

.card + .card { margin-top: 20px; }

.card-header {
  min-height: 60px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 20px;
  border-radius: 16px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity .2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.kpi-card:hover::before { opacity: 1; }

.kpi-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 8px;
  color: var(--text);
  font: 800 25px/1.1 var(--font-mono);
  letter-spacing: -.04em;
}

.kpi-animate { animation: kpiEnter .34s ease both; }
@keyframes kpiEnter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Filters / form controls ---------- */
.filters-bar,
.filter-bar,
.filters,
.compare-search-area {
  width: 100%;
  margin-bottom: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
}

.filter-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 150px;
}

.filter-label,
.compare-input-group label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
}

.filter-select,
.filter-input,
.compare-input-group input,
.eta-exp-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.filter-select {
  min-width: 175px;
  padding-right: 34px;
  cursor: pointer;
}

.filter-select:focus,
.filter-input:focus,
.compare-input-group input:focus,
.eta-exp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,211,238,.10);
}

.filter-btn,
.chart-toggle,
.page-btn,
.btn-primary {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.filter-btn,
.chart-toggle,
.page-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.filter-btn:hover,
.chart-toggle:hover,
.page-btn:hover:not(:disabled) {
  border-color: var(--border-light);
  background: var(--bg-hover);
  color: var(--text);
}

.filter-btn.active,
.chart-toggle.active,
.page-btn.active,
.btn-primary {
  border: 1px solid transparent;
  background: var(--gradient-main);
  color: #000;
}

.btn-primary {
  min-height: 40px;
  align-self: flex-end;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.time-toggles,
.chart-toggles {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.compare-search-area {
  align-items: flex-end;
}

.compare-input-group {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-input-group input { width: 100%; }

/* ---------- Tables ---------- */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
}

.card > .table-wrapper {
  border: 0;
  border-radius: 0;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--text);
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.data-table td {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--bg-hover); }

.char-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.char-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-elevated);
}

.char-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 16px;
}

.char-link {
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.char-link:hover { color: var(--primary); }

.rank-badge {
  min-width: 34px;
  display: inline-flex;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font: 700 11px/1.2 var(--font-mono);
}

.rank-badge.rank-1 {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
}

.rank-badge.rank-2 {
  color: #171717;
  border-color: transparent;
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
}

.rank-badge.rank-3 {
  color: #171717;
  border-color: transparent;
  background: linear-gradient(135deg, #fdba74, #c2410c);
}

.level-text {
  color: var(--secondary);
  font-family: var(--font-mono);
  font-weight: 700;
}

.exp-text {
  color: var(--text-secondary);
  font-size: 11px;
}

.world-badge,
.tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.world-scania { color: #67e8f9; background: rgba(34,211,238,.09); border-color: rgba(34,211,238,.20); }
.world-bera { color: #fb7185; background: rgba(251,113,133,.09); border-color: rgba(251,113,133,.20); }
.world-kronos { color: #6ee7b7; background: rgba(52,211,153,.09); border-color: rgba(52,211,153,.20); }
.world-hyperion { color: #fbbf24; background: rgba(251,191,36,.09); border-color: rgba(251,191,36,.20); }

/* ---------- Pagination ---------- */
.pagination {
  margin: 18px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.page-info {
  padding: 0 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.page-btn {
  min-width: 38px;
  min-height: 36px;
}

.page-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

/* ---------- Class / compare / stats grids ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.class-card {
  padding: 17px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.class-card:hover,
.class-card.active {
  transform: translateY(-2px);
  border-color: rgba(34,211,238,.44);
  background: var(--bg-hover);
}

.class-card.active {
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.15);
}

.class-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.class-count {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.compare-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compare-card {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
}

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

.chart-container {
  position: relative;
  height: 320px;
  padding: 18px;
}

/* ---------- Character profile ---------- */
.hero-banner {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 20px;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gradient-main);
}

.hero-banner::after {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  right: -170px;
  top: -210px;
  border-radius: 50%;
  background: rgba(34,211,238,.055);
  filter: blur(18px);
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
}

.hero-avatar {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg-elevated);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-info { min-width: 0; }

.hero-name {
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.hero-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 11px;
}

.hero-class { color: var(--text-secondary); font-weight: 600; }
.hero-level { color: var(--primary); font-family: var(--font-mono); font-weight: 700; }

.hero-exp-bar {
  position: relative;
  z-index: 1;
  margin-top: 17px;
}

.hero-exp-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-elevated);
}

.hero-exp-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-main);
}

.hero-exp-labels {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font: 500 10px/1.4 var(--font-mono);
}

.hero-stats {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--border);
  gap: 1px;
}

.hero-stat {
  min-width: 0;
  padding: 13px 11px;
  background: var(--bg-card);
}

.hero-stat-val {
  overflow: hidden;
  color: var(--text);
  font: 700 15px/1.25 var(--font-mono);
  text-overflow: ellipsis;
}

.hero-stat-val.accent,
.accent { color: var(--primary); }

.hero-stat-lbl {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.profile-tabs {
  margin-bottom: 18px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.profile-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.profile-tab:hover,
.profile-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--gradient-main);
}

.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, .8fr);
  gap: 20px;
  align-items: start;
}

.overview-left,
.overview-right {
  min-width: 0;
}

.overview-right {
  display: grid;
  gap: 12px;
}

.exp-summary-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.exp-summary-card {
  padding: 13px;
  border-radius: 12px;
}

.exp-summary-title {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.exp-summary-row {
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
}

.exp-summary-row:last-child { border-bottom: 0; }
.exp-summary-row .num-mono { color: var(--text); font-weight: 700; }

.eta-exp-input {
  width: 116px;
  height: 34px;
  font-family: var(--font-mono);
  text-align: right;
}

.eta-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.eta-card {
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.eta-level {
  color: var(--secondary);
  font: 700 15px/1.2 var(--font-mono);
}

.eta-days {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 10px;
}

.rank-mini-card {
  overflow: hidden;
  border-radius: 14px;
}

.rank-mini-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.rank-mini-header:hover { background: var(--bg-hover); }
.rank-mini-header .arrow { color: var(--primary); }

.rank-mini-row {
  min-height: 40px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
}

.rank-mini-row:last-child { border-bottom: 0; }
.rank-mini-row:hover { background: var(--bg-hover); }

.rank-mini-row.me {
  background: rgba(34,211,238,.07);
  box-shadow: inset 3px 0 0 var(--primary);
}

.rank-mini-pos {
  color: var(--text-muted);
  font: 600 10px/1.2 var(--font-mono);
}

.rank-mini-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.rank-mini-info {
  color: var(--text-muted);
  font: 500 9px/1.2 var(--font-mono);
  white-space: nowrap;
}

.fashion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.fashion-item {
  padding: 10px;
  border-radius: 13px;
  text-align: center;
}

.fashion-img {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.fashion-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fashion-date {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- Loading / empty / skeleton ---------- */
.page-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  min-height: 180px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon { font-size: 30px; }
.empty-state-text { color: var(--text-muted); font-size: 12px; }

.skeleton {
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-hover) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: skeletonMove 1.35s linear infinite;
}

.skeleton-kpi {
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

@keyframes skeletonMove {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.fade-in { animation: fadeIn .28s ease both; }
.fade-in-d1 { animation-delay: .05s; }
.fade-in-d2 { animation-delay: .10s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: transparent;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 24px;
  text-align: center;
}

.footer-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.footer-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
}

/* ---------- Settings drawer ---------- */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1998;
  visibility: hidden;
  opacity: 0;
  background: rgba(0,0,0,.52);
  transition: opacity .22s ease, visibility .22s ease;
}

.settings-overlay.active {
  visibility: visible;
  opacity: 1;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -390px;
  z-index: 1999;
  width: min(360px, calc(100vw - 24px));
  height: 100dvh;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: -18px 0 50px rgba(0,0,0,.28);
  transition: right .28s ease;
}

.settings-panel.active { right: 0; }

.settings-header {
  min-height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.settings-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}

.settings-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.settings-body { padding: 22px 20px; }

.settings-section h3 {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.theme-options {
  display: grid;
  gap: 10px;
}

.theme-option {
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.theme-option:hover {
  transform: translateY(-1px);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.theme-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34,211,238,.09);
}

.theme-preview {
  width: 42px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
}

.theme-option[data-theme-option="amoled"] .theme-preview { background: #000; }
.theme-option[data-theme-option="dark"] .theme-preview { background: linear-gradient(135deg,#0a0a10,#151520); }
.theme-option[data-theme-option="light"] .theme-preview { background: linear-gradient(135deg,#f5f5f7,#fff); border-color: #d7d7df; }

.theme-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.theme-description {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.theme-check {
  color: var(--primary);
  font-weight: 800;
  opacity: 0;
}

.theme-option.active .theme-check { opacity: 1; }

.settings-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .logo { min-width: auto; }
  .search-container { max-width: none; flex: 1 1 280px; }

  .nav-links {
    order: 5;
    width: 100%;
    margin-left: 0;
    padding-top: 8px;
    overflow-x: auto;
    border-top: 1px solid var(--border);
  }

  .nav-links a { flex: 0 0 auto; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .compare-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .class-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hero-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .container { padding: 22px 16px 30px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-right { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .exp-summary-grid,
  .eta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .class-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .header-inner { gap: 10px; }
  .logo { flex: 1 1 auto; }
  .logo-text { font-size: 22px; }
  .logo-context { font-size: 10px; padding: 5px 8px; }
  .search-container { order: 4; flex-basis: 100%; }
  .header-actions { margin-left: auto; }

  .page-title { font-size: 28px; }
  .page-subtitle { font-size: 12px; }

  .kpi-grid,
  .compare-grid,
  .class-grid,
  .overview-right,
  .exp-summary-grid,
  .eta-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar,
  .filter-bar,
  .filters,
  .compare-search-area {
    align-items: stretch;
    padding: 13px;
  }

  .filter-group,
  .compare-input-group {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-select,
  .filter-input,
  .compare-input-group input {
    width: 100% !important;
    min-width: 0;
  }

  .btn-primary { width: 100%; }

  .hero-banner { padding: 17px; }
  .hero-top { align-items: flex-start; }
  .hero-avatar { flex-basis: 68px; width: 68px; height: 68px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-name { font-size: 25px; }

  .card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .chart-container { height: 270px; padding: 14px; }
  .footer-inner { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
