:root {
  --bg: #0a0b10;
  --bg-elevated: #14161f;
  --bg-elevated-2: #191c28;
  --bg-input: #0e1018;
  --border: #262a3c;
  --border-soft: rgba(255, 255, 255, 0.07);
  --text: #edeff6;
  --text-dim: #9195ab;
  --text-faint: #5c6079;
  --gold: #e3bb7a;
  --gold-bright: #f3d29c;
  --gold-dim: #a9895c;
  --cyan: #6fe0da;
  --green: #7fdc9c;
  --red: #f08a8a;
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(227, 187, 122, 0.25);
  color: var(--gold-bright);
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Ambient background ---------- */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 500px at 12% -10%, rgba(227, 187, 122, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 600px at 110% 15%, rgba(111, 224, 218, 0.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at 50% 120%, rgba(122, 100, 227, 0.08), transparent 60%),
    linear-gradient(180deg, #08090d 0%, #0a0b10 100%);
}

.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 75%);
}

/* ---------- Header ---------- */

.topbar {
  padding: 34px 32px 20px;
  border-bottom: 1px solid var(--border-soft);
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(227, 187, 122, 0.25));
}

.topbar h1 {
  margin: 0 0 4px;
  font-weight: 650;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.accent {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-soft);
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 15px 18px;
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--gold-bright);
}

.tab-btn.active svg {
  opacity: 1;
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(227, 187, 122, 0.5);
  transition: left 0.28s cubic-bezier(0.65, 0, 0.35, 1), width 0.28s cubic-bezier(0.65, 0, 0.35, 1);
}

main {
  padding: 28px 32px 70px;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 50vh;
}

.tab-panel {
  display: none;
  animation: fadeUp 0.35s ease both;
}

.tab-panel.active {
  display: block;
}

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

/* ---------- Dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 20px 36px;
  text-align: center;
  color: var(--text-dim);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.dropzone.dragover {
  border-color: var(--gold);
  background: rgba(227, 187, 122, 0.06);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--gold-dim);
  margin-bottom: 14px;
}

.dropzone-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 500;
  max-width: 480px;
  margin-inline: auto;
}

.dropzone-or {
  margin: 10px 0;
  font-size: 12.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dropzone .hint {
  font-size: 13px;
  margin: 14px 0 0;
  color: var(--text-faint);
}

kbd {
  font-family: inherit;
  font-size: 11.5px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-dim);
}

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

.btn {
  border: none;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1a1408;
  box-shadow: 0 8px 20px -8px rgba(227, 187, 122, 0.5);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-elevated-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  padding: 8px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

.history-icon {
  width: 15px;
  height: 15px;
}

/* ---------- Tab toolbar / history panel ---------- */

.tab-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.history-control {
  position: relative;
}

.history-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  padding: 10px;
}

.history-panel-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 4px 8px 10px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.history-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.history-item:disabled {
  opacity: 0.5;
  cursor: default;
}

.history-item-date {
  color: var(--text-dim);
}

.history-item-count {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-empty {
  padding: 14px 10px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Staging (uploaded-but-not-calculated screenshots) ---------- */

.staging-area {
  margin-top: 16px;
}

.thumbs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb--sent {
  opacity: 0.55;
}

.thumb-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(127, 220, 156, 0.9);
  color: #0a1a0f;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 11, 16, 0.75);
  color: var(--text);
  border: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.thumb-remove:hover {
  background: var(--red);
  color: #200;
}

.staging-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Status / messages ---------- */

.status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

.status.status--static::before {
  display: none;
}

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

.hidden {
  display: none !important;
}

.unmatched {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(240, 138, 138, 0.06);
  border: 1px solid rgba(240, 138, 138, 0.25);
  color: var(--red);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- Trending panel (top sellers, shown before first scan) ---------- */

.trending-panel {
  margin-top: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.trending-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.trending-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
}

.trending-updated {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
}

.trending-row {
  display: grid;
  grid-template-columns: 22px 26px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s ease;
}

.trending-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.trending-rank {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trending-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.trending-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-stat {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.trending-stat.dim {
  color: var(--text-faint);
  font-weight: 500;
}

/* ---------- Stat tiles ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-tile--gold {
  border-color: rgba(227, 187, 122, 0.3);
  background: linear-gradient(160deg, rgba(227, 187, 122, 0.08), var(--bg-elevated) 60%);
}

.stat-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 24px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-tile--gold .stat-value {
  color: var(--gold-bright);
}

.stat-value i {
  font-style: normal;
  font-size: 14px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ---------- Table ---------- */

.table-wrap {
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.items-table th,
.items-table td {
  padding: 7px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  line-height: 1.3;
}

.items-table thead th {
  padding: 9px 12px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  background: var(--bg-elevated-2);
  white-space: nowrap;
}

.items-table thead th:hover {
  color: var(--gold);
}

.items-table tbody tr {
  transition: background 0.12s ease;
}

.items-table tbody tr:last-child td {
  border-bottom: none;
}

.items-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.item-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.price-cell {
  color: var(--gold-bright);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-cell.buy {
  color: var(--cyan);
}

.price-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-faint);
  margin-top: 1px;
}

.dim {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.need-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(227, 187, 122, 0.14);
  color: var(--gold);
  font-weight: 700;
  vertical-align: middle;
}

.market-link {
  color: var(--text-faint);
  text-decoration: none;
  display: inline-flex;
  padding: 6px;
  border-radius: 7px;
  transition: color 0.15s ease, background 0.15s ease;
}

.market-link svg {
  width: 15px;
  height: 15px;
}

.market-link:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
}

.ingame-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 5px;
  box-shadow: 0 0 6px rgba(127, 220, 156, 0.8);
  vertical-align: middle;
}

/* ---------- Quantity stepper ---------- */

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-input);
  width: fit-content;
}

.qty-stepper button {
  background: none;
  border: none;
  color: var(--text-dim);
  width: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}

.qty-stepper button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
}

.qty-input {
  width: 38px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text);
  text-align: center;
  padding: 4px 0;
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.qty-input:focus {
  outline: none;
  color: var(--gold-bright);
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------- Empty / hint states ---------- */

.hint-box {
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 20px;
  color: var(--text-faint);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  max-width: 380px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- Subtabs (Перекуп) ---------- */

.subtabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 8px;
  flex-wrap: wrap;
}

.subtab-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.subtab-btn:hover {
  color: var(--text);
}

.subtab-btn.active {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
  background: rgba(227, 187, 122, 0.1);
}

.progress-bar {
  margin-top: 14px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ---------- Set / flip cards ---------- */

.sets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.set-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px 18px 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.set-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--border);
}

.set-card:hover {
  border-color: var(--border);
}

.set-card.worth {
  border-color: rgba(127, 220, 156, 0.3);
  background: linear-gradient(150deg, rgba(127, 220, 156, 0.05), var(--bg-elevated) 55%);
}

.set-card.worth::before {
  background: linear-gradient(180deg, var(--green), #4fae72);
  box-shadow: 0 0 10px rgba(127, 220, 156, 0.4);
}

.set-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.set-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.set-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge.worth {
  background: rgba(127, 220, 156, 0.15);
  color: var(--green);
}

.badge.neutral {
  background: rgba(145, 149, 171, 0.14);
  color: var(--text-dim);
}

.set-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0;
}

.part-chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.12s ease, border-color 0.12s ease;
}

.part-chip:hover {
  filter: brightness(1.3);
  border-color: var(--border);
}

.part-chip.owned {
  color: var(--text);
  background: rgba(227, 187, 122, 0.09);
}

.part-chip.missing {
  color: var(--red);
  background: rgba(240, 138, 138, 0.07);
}

.set-math {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.85;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
}

.set-math .num {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.set-math .profit-pos {
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.set-math .profit-neg {
  color: var(--red);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Relics tab ---------- */

.relics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.relic-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px 18px 22px;
  transition: border-color 0.15s ease;
}

.relic-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--border);
}

.relic-card.reco-refine::before {
  background: linear-gradient(180deg, var(--green), #4fae72);
  box-shadow: 0 0 10px rgba(127, 220, 156, 0.4);
}

.relic-card.reco-maybe::before {
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
}

.relic-card.reco-skip::before {
  background: var(--border);
}

.relic-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.relic-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.relic-card-title {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.relic-card-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.relic-reco-badge {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.relic-reco-badge.badge-refine {
  background: rgba(127, 220, 156, 0.15);
  color: var(--green);
}

.relic-reco-badge.badge-maybe {
  background: rgba(227, 187, 122, 0.14);
  color: var(--gold);
}

.relic-reco-badge.badge-skip {
  background: rgba(145, 149, 171, 0.14);
  color: var(--text-dim);
}

.relic-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.reward-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px 5px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.12s ease, border-color 0.12s ease;
}

.reward-chip:hover {
  filter: brightness(1.3);
  border-color: var(--border);
}

.reward-chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.reward-chip-name {
  color: var(--text);
}

.reward-chip-price {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reward-chip.rarity-rare {
  border-color: rgba(227, 187, 122, 0.35);
  background: rgba(227, 187, 122, 0.08);
}

.reward-chip.rarity-uncommon {
  border-color: rgba(200, 205, 224, 0.3);
  background: rgba(200, 205, 224, 0.06);
}

.reward-chip.rarity-common {
  border-color: rgba(169, 137, 92, 0.25);
  background: rgba(169, 137, 92, 0.05);
}

.reward-chip--best {
  border-width: 1.5px;
  box-shadow: 0 0 0 1px rgba(227, 187, 122, 0.2);
}

.reward-chip--best .reward-chip-name {
  color: var(--gold-bright);
  font-weight: 650;
}

.relic-math {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.85;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
}

.relic-math .num {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--border-soft);
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .topbar,
  .tabs,
  main,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .items-table {
    min-width: 720px;
  }

  .tab-btn {
    padding: 13px 12px;
    font-size: 13px;
  }

  .tab-btn span,
  .dropzone-title {
    font-size: 14px;
  }
}
