/* decks screen styles (v3-design "Arena" restyle, T-010; v3.1 focus pass, T4-004).

   .card/.chip/.btn/.meter/.art/.num/.tag come from components.css; this file
   only adds the deck-grid-specific layout on top of those shared primitives -
   no shared class is redefined here.

   v3.1: the deck card is ONE link (an <a>) to the deck detail. Art grid on the
   left, the stats block in the middle, a chevron on the right; no inner divider,
   no nested border, no "Analyze" button. */

.sort-row {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sort-row::-webkit-scrollbar { display: none; }

.deck-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
/* Three columns only once each card can be ~340px wide. A deck card spends a
   fixed 172px art grid + 24px of gaps + 24px of padding + the 20px chevron
   before the stats column gets a single pixel, and the 30px win-rate figure
   alone needs ~90px of it. From 1024px the sidebar and page padding leave a
   728-804px content column, so a 3-column grid there made ~233-259px cards
   with a 0-17px stats column: the figure ran out of its card (the page
   scrolled sideways at 1024-1100px) and, up to ~1280px, under the chevron.
   3 x 340 + 2 x 14 of gap + the 240px sidebar + 56px of content padding =
   1344px; 1360px leaves room for a scrollbar. Below it the grid stays at 2
   columns (357-525px cards). */
@media (min-width: 1360px) {
  .deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The whole card is the target. `a.card` needs the link resets (colour,
   underline) plus a hover/pressed surface so it reads as tappable; the global
   :focus-visible ring (components.css) already draws the gold keyboard ring. */
a.deck-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px 14px 14px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease, border-color .12s ease;
}
a.deck-card:hover { background: var(--s2); border-color: var(--line-2); }
a.deck-card:active { background: var(--s3); }
a.deck-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.deck-art-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 172px;
  flex: none;
}

.deck-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.deck-winrate { display: flex; flex-direction: column; gap: 4px; }
.deck-winrate .num { font-size: 30px; line-height: 1.05; }

/* Below 360px a card is ~256px inside its padding: the fixed 172px art grid
   left the 30px win-rate figure (~90px) a ~50-76px column, so it ran under the
   chevron and 0.7px past the card at 320px (integration D1b). Narrow phones get
   a smaller grid and figure; nothing is hidden. */
@media (max-width: 359px) {
  .deck-art-grid { width: 144px; gap: 3px; }
  .deck-winrate .num { font-size: 24px; }
}

.deck-nums { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.deck-games { font-weight: 700; }

.deck-elixir { display: inline-flex; align-items: center; gap: 3px; }
.deck-elixir .i { color: var(--elixir); }

/* The chevron is the "opens" cue that replaced the Analyze button. Quiet at
   rest, gold on hover/focus (gold = the selection/brand signal). */
.deck-go { color: var(--ink-3); flex: none; }
a.deck-card:hover .deck-go,
a.deck-card:focus-visible .deck-go { color: var(--gold); }

.deck-grid .empty-state {
  text-align: center;
  color: var(--ink-3);
  padding: 48px 16px;
}

.deck-grid .deck-error { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.deck-grid .deck-error .error-text { margin-top: 0; }

/* ---------- the answer row (T4-014) ----------
   "Best this range · 58.9% · 1,478 games" over the deck's 8 cards, one link to
   the deck detail. The same one-line-over-art-row shape as Home's best-deck
   takeaway; from 768px the label line and the art sit side by side. */

.deck-best-slot { margin-bottom: 12px; }
a.deck-best {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease, border-color .12s ease;
}
a.deck-best:hover { background: var(--s2); border-color: var(--line-2); }
a.deck-best:active { background: var(--s3); }
a.deck-best:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
a.deck-best:hover .deck-go,
a.deck-best:focus-visible .deck-go { color: var(--gold); }
a.deck-best .deck-go { margin-left: auto; }

.deck-best-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deck-best-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 13px; }
.deck-best-label { font-weight: 700; }
.deck-best-pct { font-size: 18px; line-height: 1.1; }
.deck-best-pct.good { color: var(--good); }
.deck-best-pct.bad { color: var(--bad); }

@media (min-width: 768px) {
  .deck-best-text { flex-direction: row; align-items: center; gap: 16px; }
}

/* The "Best" eyebrow beside the big win% of the matching deck card. On a 390px
   phone the stats column is 116px: the 30px number (~90px) + this 32px tag only
   fit by borrowing the 12px gap before the chevron, so the line takes a
   -12px right margin and a 6px gap. Narrower than that the tag WRAPS under the
   number (the card grows a line) instead of overflowing the card and giving the
   page a horizontal scroll. */
.deck-win-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  margin-right: -12px;
}
.deck-best-tag { color: var(--gold); letter-spacing: .08em; white-space: nowrap; }

/* ---------- loading state (G3 R1-04) ----------
   Three card-shaped shimmer blocks in the grid - the height of a real deck card
   (art grid + padding) - and no figure of any player or window. */
.deck-grid .deck-skel { height: 150px; border-radius: 16px; }
