html, body {\r\n  max-width: 100%;\r\n  overflow-x: hidden;\r\n}\r\n\r\n:root {
  --bg: #0f0f0f;
  --panel: #1a1a1a;
  --soft: #2a2a2a;
  --border: #3a3a3a;
  --fg: #e5e5e5;
  --muted: #a0a0a0;
  --accent: #f08b6b;
  --accent-2: #489a92;
  --shadow: rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --font-size-sm: 13px;

  /* Rarity colors */
  --rarity-common: #9ca3af;
  --rarity-uncommon: #84cc16;
  --rarity-rare: #3b82f6;
  --rarity-legendary: #f59e0b;
  --rarity-mythical: #a855f7;
  --rarity-divine: #ec4899;
  --rarity-celestial: #06b6d4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

header {
  margin-bottom: 24px;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.status-label {
  color: var(--accent-2);
  font-weight: 600;
}

.status-right {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.expand-btn:hover {
  color: var(--fg);
}

.card.expanded .expand-btn {
  transform: rotate(180deg);
}

.card:not(.expanded) .card-content {
  display: none;
}

.card-content {
  padding: var(--spacing-md);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  opacity: 0.6;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.empty-state .main-text {
  margin-bottom: 8px;
}

.empty-state .hint-text {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.shop-filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 6px 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--border);
  color: var(--fg);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.search-bar {
  flex: 1;
  min-width: 200px;
  padding: 6px 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--font-size-sm);
}

.search-bar:focus {
  outline: none;
  border-color: var(--accent);
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.history-row:hover {
  transform: scale(1.01);
  background: var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}

.history-row.tracked {
  border: 1px solid var(--accent);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--panel);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.item-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.shop-seed { background: #84cc16; color: #000; }
.shop-egg { background: #f59e0b; color: #000; }
.shop-decor { background: #ec4899; color: #fff; }

.item-metrics {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-shrink: 0;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 60px;
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pred-row:hover {
  transform: scale(1.01);
  background: var(--border);
}

.pred-metrics {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-shrink: 0;
}

.eta-now { color: #10b981; }
.eta-imminent { color: #22c55e; }
.eta-soon { color: #84cc16; }
.eta-today { color: #eab308; }
.eta-week { color: #f97316; }
.eta-far { color: #ef4444; }

.rate-high { color: #4ade80; }
.rate-mid { color: #fbbf24; }
.rate-low { color: #f87171; }

.hint-bottom {
  padding: 8px 12px;
  font-size: 11px;
  opacity: 0.5;
  text-align: left;
}

footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .item-metrics {
    gap: 12px;
  }

  .metric {
    min-width: 50px;
  }

  .metric-value {
    font-size: 14px;
  }

  .pred-metrics {
    gap: 16px;
  }
}
