:root {
  --bg-deep: #0a0a0c;
  --bg-primary: #121218;
  --bg-secondary: #1a1a24;
  --bg-elevated: #222230;
  --bg-hover: #2a2a3a;
  --border: #2e2e40;
  --border-light: #3d3d52;
  --text-primary: #e8e4dc;
  --text-secondary: #a09a8e;
  --text-muted: #6b665c;
  --accent: #c9a227;
  --accent-hover: #ddb82e;
  --accent-dim: rgba(201, 162, 39, 0.15);
  --danger: #c44;
  --success: #5a8;
  --info: #5ac;

  --rarity-normal: #c8c8c8;
  --rarity-magic: #8888ff;
  --rarity-rare: #ffff77;
  --rarity-unique: #af6025;
  --rarity-currency: #aa9e82;
  --rarity-gem: #1ba29b;

  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--accent); }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

.rarity-normal { color: var(--rarity-normal); }
.rarity-magic { color: var(--rarity-magic); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-unique { color: var(--rarity-unique); }
.rarity-currency { color: var(--rarity-currency); }
.rarity-gem { color: var(--rarity-gem); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.badge-tier {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--accent);
}

.card-visual {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.card-visual:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(13, 13, 15, 0.65) 100%);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.card-visual:hover .card-image::after {
  opacity: 0.35;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card-visual:hover .card-image img {
  transform: scale(1.04);
}

.card-image-portrait {
  aspect-ratio: 4 / 5;
}

.card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.card-visual .card-title {
  color: var(--text-primary);
}

.card-visual:hover .card-title {
  color: var(--accent);
}

.detail-hero {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 320px;
}

.detail-hero img {
  width: 100%;
  display: block;
}

.feature-tags {
  margin: 1rem 0 1.5rem;
}

.badge-planned {
  background: rgba(90, 136, 170, 0.15);
  border-color: var(--info);
  color: var(--info);
  font-size: 0.65rem;
  margin-left: 0.4rem;
}

.hero-banner {
  position: relative;
  padding: 4rem 1.5rem;
  margin: -2rem -1.5rem 2rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0.5;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 13, 15, 0.15) 0%, var(--bg-deep) 92%),
    radial-gradient(ellipse at 50% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.tag-mod {
  background: var(--accent-dim);
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--accent);
  font-size: 0.7rem;
}

.craft-item-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
  max-width: 640px;
}

.craft-item-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.craft-mod {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.mod-tier {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 2rem;
}

.mod-prefix .mod-text { color: var(--rarity-magic); }
.mod-suffix .mod-text { color: var(--text-primary); }

.mod-tags {
  flex: 1 1 100%;
  margin-left: 2.5rem;
}

.callout {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
}

.callout-info {
  border-left-color: var(--info);
  background: rgba(85, 170, 204, 0.08);
}

.callout-accent p,
.callout-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.mod-mechanics {
  margin: 1rem 0 1.5rem 1.25rem;
  color: var(--text-secondary);
}

.mod-mechanics li {
  margin-bottom: 0.5rem;
}

.craft-tip {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.tool-links {
  list-style: none;
  padding: 0;
}

.tool-links li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.card-desc.card-source {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.35rem;
  opacity: 0.85;
}

.stat-line {
  font-size: 0.9rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.stat-line:last-child {
  border-bottom: none;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.error-msg {
  background: rgba(204, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 1rem;
  border-radius: var(--radius);
}
