﻿/* ============================================================
   Idle MMO v3 â€” Item tile system (Astral Codex)
   ============================================================ */

:root {
  /* Rarity color (glow) â€” each tier has a luminous accent */
  --r-common-c:    #c0c5d1;      /* dust / pale */
  --r-common-g:    rgba(192, 197, 209, 0.30);

  --r-uncommon-c:  #92e0ad;      /* moss */
  --r-uncommon-g:  rgba(146, 224, 173, 0.45);

  /* Blue, not the old mystic teal (#7fd5cb): at a glance teal and the uncommon moss were the same
     colour, and the tier ladder needs each rung distinct. */
  --r-rare-c:      #5fa8ff;      /* arcane blue */
  --r-rare-g:      rgba(95, 168, 255, 0.45);

  --r-epic-c:      #b89bff;      /* arcane violet */
  --r-epic-g:      rgba(184, 155, 255, 0.55);

  --r-legendary-c: #ffc564;      /* solar gold */
  --r-legendary-g: rgba(255, 197, 100, 0.55);

  --r-cursed-c:    #ff7591;      /* blood */
  --r-cursed-g:    rgba(255, 117, 145, 0.50);
}

/* ============================================================
   .item â€” frosted card with rarity aura
   ============================================================ */
.item {
  --accent: var(--r-common-c);
  --aura:   var(--r-common-g);

  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%),
    rgba(13, 17, 48, 0.65);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 8px 22px -8px rgba(0,0,0,0.45);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 28px var(--aura),
    0 14px 30px -10px rgba(0,0,0,0.55);
}
/* top luminous accent line */
.item::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, var(--accent) 60%, transparent);
  opacity: 0.7;
  pointer-events: none;
}
.item > * { position: relative; z-index: 1; }

/* Rarity variants */
.item--uncommon  { --accent: var(--r-uncommon-c);  --aura: var(--r-uncommon-g); }
.item--rare      { --accent: var(--r-rare-c);      --aura: var(--r-rare-g); border-color: rgba(95,168,255,0.35); }
.item--epic      { --accent: var(--r-epic-c);      --aura: var(--r-epic-g);   border-color: rgba(184,155,255,0.45); box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 0 20px var(--r-epic-g), 0 8px 22px -8px rgba(0,0,0,0.45); }
.item--legendary { --accent: var(--r-legendary-c); --aura: var(--r-legendary-g); border-color: rgba(255,197,100,0.5); box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 0 26px var(--r-legendary-g), 0 8px 22px -8px rgba(0,0,0,0.45); }
.item--cursed    { --accent: var(--r-cursed-c);    --aura: var(--r-cursed-g);   border-color: rgba(255,117,145,0.45); }

/* Header row */
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  line-height: 1;
}
.item-tier {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  filter: drop-shadow(0 0 3px var(--aura));
}
.item-tier::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.item-type { color: var(--ink-mute); }

/* Icon plate â€” orb instead of paper */
.item-icon {
  position: relative;
  height: 86px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 25%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%),
    var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  margin: var(--sp-2) 0;
  box-shadow:
    inset 0 -10px 18px rgba(0,0,0,0.4),
    inset 0 6px 12px rgba(255,255,255,0.05),
    0 0 18px var(--aura);
  overflow: hidden;
}
.item-icon::before {
  /* radial glow behind icon */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 60%, var(--aura) 0%, transparent 50%);
  pointer-events: none;
}
.item-icon svg {
  width: 40px;
  height: 40px;
  color: var(--ink);
  filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  position: relative;
}
.item--legendary .item-icon svg { color: var(--gold-hi); }
.item--epic .item-icon svg      { color: var(--violet-hi); }
.item--rare .item-icon svg      { color: var(--violet-hi); }
.item--uncommon .item-icon svg  { color: #c6f0d3; }
.item--cursed .item-icon svg    { color: #ffb3c0; }

/* tiny corner pin on the icon â€” like a fixed gem inlay */
.item-icon::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

/* Name */
.item-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.05;
  color: var(--ink);
  margin: 2px 0;
  text-wrap: balance;
  letter-spacing: -0.005em;
}
.item--legendary .item-name { color: var(--gold-hi); text-shadow: 0 0 12px var(--gold-glow); }
.item--epic .item-name      { color: var(--violet-hi); text-shadow: 0 0 10px var(--violet-glow); }
.item--rare .item-name      { color: var(--violet-hi); }

/* Stats */
.item-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: 13.5px;
}
.item-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  flex-wrap: wrap;
}
.item-stat svg {
  width: 12px;
  height: 12px;
  color: var(--gold);
  flex: 0 0 auto;
  transform: translateY(2px);
  opacity: 0.75;
}
.item-stat .v       { font-weight: 600; }
.item-stat .v.plus  { color: var(--sage); }
.item-stat .v.minus { color: var(--ember); }
.item-stat-name {
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-left: 4px;
}

.item-compare {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  margin-left: auto;
  background: var(--glass);
  border: 1px solid var(--glass-stroke);
  white-space: nowrap;
}
.item-compare.is-better { color: var(--sage); border-color: rgba(146, 224, 173, 0.3); background: rgba(146, 224, 173, 0.08); }
.item-compare.is-worse  { color: var(--ember); border-color: rgba(255, 122, 82, 0.3); background: rgba(255, 122, 82, 0.08); }

/* Flavor */
.item-flavor {
  font-family: var(--font-quill);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-quill);
  margin: var(--sp-1) 0 var(--sp-2);
  text-wrap: pretty;
  min-height: 1em;
  opacity: 0.9;
}

/* Footer */
.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--glass-stroke);
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.item-req           { color: var(--ink-soft); white-space: nowrap; }
.item-req.is-locked { color: var(--ember); }
.item-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0;
  text-transform: none;
}
.item-price svg { width: 12px; height: 12px; color: var(--gold); opacity: 0.85; }

/* Equipped state â€” sage rim + glow */
.item.is-equipped {
  border-color: var(--sage);
  box-shadow:
    0 0 0 1px var(--sage) inset,
    0 0 22px rgba(146, 224, 173, 0.30),
    0 8px 22px -8px rgba(0,0,0,0.45);
}
.item.is-equipped .item-type { color: var(--sage); }
.item.is-equipped .item-price-worn {
  color: var(--sage);
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.item.is-equipped .item-price-worn svg { width: 12px; height: 12px; color: var(--sage); }


/* ============================================================
   Grids
   ============================================================ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.items-grid.is-three { grid-template-columns: repeat(3, 1fr); }
.items-grid.is-five  { grid-template-columns: repeat(5, 1fr); }

/* Category banner */
.items-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-7) 0 var(--sp-4);
}
.items-banner-mark {
  width: 28px; height: 28px;
  flex: 0 0 auto;
  color: var(--gold);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.items-banner-mark svg { width: 100%; height: 100%; }
.items-banner-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}
.items-banner-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-glow), transparent);
}
.items-banner-count {
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--violet);
}

/* ============================================================
   Rarity legend
   ============================================================ */
.rarity-legend {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
}
.rarity-chip {
  --accent: var(--r-common-c);
  --aura:   var(--r-common-g);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--sp-4) var(--sp-3);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%),
    rgba(13, 17, 48, 0.55);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-3);
}
.rarity-chip-swatch {
  width: 100%;
  height: 36px;
  border-radius: var(--r-2);
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 70%),
    var(--space-3);
  border: 1px solid var(--accent);
  box-shadow: 0 0 18px var(--aura), inset 0 -8px 14px rgba(0,0,0,0.35);
}
.rarity-chip-label {
  font-family: var(--font-banner);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  filter: drop-shadow(0 0 4px var(--aura));
}
.rarity-chip--common    { --accent: var(--r-common-c);    --aura: var(--r-common-g); }
.rarity-chip--uncommon  { --accent: var(--r-uncommon-c);  --aura: var(--r-uncommon-g); }
.rarity-chip--rare      { --accent: var(--r-rare-c);      --aura: var(--r-rare-g); }
.rarity-chip--epic      { --accent: var(--r-epic-c);      --aura: var(--r-epic-g); }
.rarity-chip--legendary { --accent: var(--r-legendary-c); --aura: var(--r-legendary-g); }

