/* Data grid helpers: lay out sets of items without per-view grid maths.
   .grid-auto     auto-fill columns, each at least --min wide (default 15rem)
   .grid-2/.grid-3  fixed columns once the container has room, one column before that
   .item-icon     the square box a game item icon sits in (category mark when the icon fails)
   .item-row      icon + name + one line of detail (drops, rewards, exchange inputs)
   .tile          (V2-SHELL) a 3:4 framed painting with a bottom veil, a Cormorant title and one line. Hover lifts
                  the art. <li class="tile"><img ...><div class="tile-body"><h3 class="tile-title"><a href="..">Title</a></h3>
                  <p>One line.</p></div></li>  The link covers the whole tile.
   .ornament      (V2-SHELL) rule, lattice gem, rule: <div class="ornament" aria-hidden="true"><svg>..</svg></div>,
                  or empty for the gem alone. Only where a break needs more than space. */

.grid-auto { display: grid; gap: var(--gap, var(--s-4)); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 15rem)), 1fr)); }
.grid-2, .grid-3 { display: grid; gap: var(--gap, var(--s-4)); grid-template-columns: 1fr; }
@container (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-auto > li:only-child:not([class]), .grid-2 > li:only-child:not([class]) { grid-column: 1 / -1; }

.item-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  color: var(--accent);
  background: radial-gradient(circle at 50% 30%, var(--ink-3) 0%, var(--ink-0) 80%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.6);
  overflow: hidden;
}
.item-icon img { width: 40px; height: 40px; image-rendering: pixelated; }
.item-icon .icon { width: 26px; height: 26px; stroke-width: 1.4; }

.item-list { display: grid; gap: var(--s-2); margin-top: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.item-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-2);
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.item-row .item-icon { width: 44px; height: 44px; }
.item-row .item-icon .icon { width: 22px; height: 22px; }
.item-name { font-weight: 600; }
.item-use { display: block; font-size: 0.8rem; color: var(--text-2); }

/* ---------- Framed art tile ---------- */
.tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--frame);
  border-radius: var(--r-3);
  box-shadow: var(--bevel), var(--e-1);
  background: var(--ink-1);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.tile > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-4) var(--ease-out), filter var(--dur-4) var(--ease-out); }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, color-mix(in srgb, var(--ink-00) 95%, transparent) 0%, color-mix(in srgb, var(--ink-00) 70%, transparent) 32%, transparent 65%); }
.tile-body { padding: var(--s-4); }
.tile-title { font-size: var(--fs-xl); color: var(--text); text-shadow: 0 2px 10px rgb(var(--shadow-rgb) / 0.9); }
.tile-title a { color: inherit; text-decoration: none; }
.tile-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tile-body p { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--text-2); text-shadow: 0 1px 8px rgb(var(--shadow-rgb) / 0.95); }
.tile:hover, .tile:focus-within { border-color: var(--frame-hi); box-shadow: var(--bevel), var(--e-2); }
.tile:hover > img, .tile:focus-within > img { transform: scale(1.045); filter: brightness(1.08); }
.tile:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile a:focus-visible { outline: none; box-shadow: 0 3px 0 var(--focus); } /* the frame carries the ring; the link keeps its own mark */

/* ---------- Ornament ---------- */
.ornament { display: flex; align-items: center; gap: var(--s-3); color: var(--gold); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-lo) 40%, var(--gold)); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 44px; height: 16px; flex: none; }
