/* Tab nav scrolls horizontally on narrow screens; hide the scrollbar itself
   (matches the .scrollbar-none convention used elsewhere in this codebase,
   e.g. plugins/auction's gallery — but that copy is only enqueued on gallery
   pages, so it never reaches winners.php's own tab bar without this). */
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Grid / list layout shell ──────────────────────────────────────────────
   Grid and list share the same card markup; the parent's modifier class
   decides layout, so AJAX-appended cards (no JS re-render) pick up whichever
   view is currently active automatically. */
.wn-grid { display: grid; gap: 1.1rem; }
.wn-grid.wn-view-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px)  { .wn-grid.wn-view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }
@media (min-width: 1024px) { .wn-grid.wn-view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .wn-grid.wn-view-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.wn-grid.wn-view-list { display: flex; flex-direction: column; gap: 0.65rem; }

/* ── Card shell — editorial flat, bolder depth on hover ───────────────────── */
.wn-card {
  display: flex; flex-direction: column; text-decoration: none; position: relative;
  border-radius: 6px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease;
}
/* Source-type accent stripe (design-system top-accent signature) */
.wn-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--src-grad, var(--src-color, var(--theme-500))); z-index: 10;
}
.wn-card:hover {
  transform: translateY(-4px);
  border-color: var(--src-color, var(--ink));
  box-shadow: 0 16px 44px -10px var(--src-color, rgba(0,0,0,0.2)), 0 2px 8px rgba(0,0,0,0.06);
}
.dark .wn-card:hover {
  box-shadow: 0 18px 52px -10px color-mix(in srgb, var(--src-color, #000) 45%, transparent), 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Image area ─────────────────────────────────────────────────────────── */
@keyframes wn-shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.wn-img-wrap {
  position: relative; aspect-ratio: 1/1; overflow: hidden;
  background: var(--paper-2); flex-shrink: 0;
}
.wn-coin-ico { width: 17px; height: 17px; vertical-align: middle; display: inline-block; margin-right: 1px; }
.wn-img-wrap::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: wn-shimmer 1.6s ease-in-out infinite; transition: opacity .3s;
}
.wn-img-wrap.wn-img-done::before { opacity: 0; animation: none; }
.wn-img-bg   { position: absolute; inset: 0; z-index: 2; }
.wn-img-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0; transition: opacity .4s ease, transform .5s ease; z-index: 3;
}
.wn-img-photo.wn-loaded { opacity: 1; }
.wn-card:hover .wn-img-photo.wn-loaded { transform: scale(1.05); }

/* Bottom fade so badges read on any image */
.wn-img-fade {
  position: absolute; inset-x: 0; bottom: 0; height: 52%;
  background: linear-gradient(to top, rgba(0,0,0,0.68) 0%, transparent 100%);
  z-index: 4; pointer-events: none;
}

/* Source badge — flat pill, bottom-left */
.wn-src-pill {
  position: absolute; bottom: 10px; left: 10px; z-index: 5;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: 'Inter', system-ui, sans-serif;
  max-width: calc(100% - 20px); overflow-wrap: break-word;
}
.wn-src-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--src-color, var(--theme-500));
  box-shadow: 0 0 5px var(--src-color, var(--theme-500));
}
/* Timestamp — mono, top-right */
.wn-time-pill {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  font-size: 9.5px; color: rgba(255,255,255,0.72);
  background: rgba(0,0,0,0.42); padding: 2px 7px;
  border-radius: 3px; backdrop-filter: blur(4px);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Body ───────────────────────────────────────────────────────────────── */
.wn-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 0; }
.wn-body-main { min-width: 0; }

/* Prize label — small-caps eyebrow. Wraps instead of truncating so a long
   prize name stays fully legible on narrow cards (see CLAUDE.md's
   responsive rule against ellipsis-hiding content). */
.wn-item-name {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft);
  overflow-wrap: break-word; margin-bottom: 4px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Prize value — Fraunces display, dominant */
.wn-val-currency,
.wn-val-coins,
.wn-val-free {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-variation-settings: 'opsz' 72, 'SOFT' 0;
  display: block; font-size: 23px; font-weight: 800;
  line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: break-word;
}
.wn-val-currency { color: #c2750a; }
.dark .wn-val-currency { color: #fbbf24; }
.wn-val-coins    { color: #6d28d9; }
.dark .wn-val-coins    { color: #c4b5fd; }
.wn-val-free     { color: #047857; }
.dark .wn-val-free     { color: #6ee7b7; }

/* Hairline divider */
.wn-divider { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* Winner row */
.wn-winner-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.wn-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--rule);
}
.wn-avatar-init {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
  background: var(--src-grad, linear-gradient(135deg,#fde68a,#d97706)); color: #000;
  font-family: 'Inter', system-ui, sans-serif;
}
.wn-winner-text { min-width: 0; flex: 1; }
.wn-winner-name {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  overflow-wrap: break-word;
  font-family: 'Inter', system-ui, sans-serif;
}
.wn-winner-sub { font-size: 9.5px; color: var(--ink-soft); margin-top: 1px; }
.wn-view-link {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 700; color: var(--src-color, var(--theme-500));
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── List view ──────────────────────────────────────────────────────────── */
.wn-view-list .wn-card {
  flex-direction: row; align-items: stretch; border-radius: 8px;
}
.wn-view-list .wn-card::before { top: 0; bottom: 0; left: 0; right: auto; width: 3px; height: auto; }
.wn-view-list .wn-card:hover { transform: translateX(3px); }
.wn-view-list .wn-img-wrap { width: 84px; aspect-ratio: 1/1; }
@media (min-width: 480px) { .wn-view-list .wn-img-wrap { width: 108px; } }
.wn-view-list .wn-time-pill,
.wn-view-list .wn-src-pill { display: none; }
.wn-view-list .wn-body {
  flex: 1; flex-direction: row; align-items: center; flex-wrap: wrap;
  gap: 6px 20px; padding: 10px 16px;
}
.wn-view-list .wn-body-main { flex: 1 1 160px; }
.wn-view-list .wn-divider { display: none; }
.wn-view-list .wn-winner-row { flex: 1 1 200px; }
.wn-view-list .wn-val-currency,
.wn-view-list .wn-val-coins,
.wn-view-list .wn-val-free { font-size: 18px; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.wn-tab-bar {
  background: rgba(251,249,244,0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}
.dark .wn-tab-bar { background: rgba(10,10,12,0.95); }

.wn-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .18s ease; white-space: nowrap; flex-shrink: 0;
  border: none; background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
}
.wn-tab-active {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
/* Beat dynamic-theme.css `.dark button { color: var(--text-primary) }` (0-1-1),
   which otherwise forces the active pill's text light-on-light in dark mode. */
.dark .wn-tab-active { color: var(--paper); }
.wn-tab-inactive {
  color: var(--ink-soft);
}
.wn-tab-inactive:hover {
  color: var(--ink); background: var(--paper-2);
}
.wn-tab-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 999px; line-height: 1.5;
}
.wn-tab-badge-active  { background: rgba(255,255,255,0.18); color: inherit; }
.wn-tab-badge-inactive { background: var(--paper-2); color: var(--ink-soft); }
.dark .wn-tab-badge-inactive { background: var(--rule-soft); }

/* Grid/list toggle */
.wn-view-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--paper);
}
.wn-view-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px; border: none;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.wn-view-btn:hover { color: var(--ink); background: var(--paper-2); }
.wn-view-btn-active { background: var(--ink); color: var(--paper); }
.dark .wn-view-btn-active { color: var(--paper); }

/* Empty state now rendered via theme_component('cards/empty-state.php') */

/* ── Load More — ed-btn-secondary style ──────────────────────────────────── */
.wn-load-more {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 40px; padding: 11px 36px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--rule);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s;
  font-family: 'Inter', system-ui, sans-serif;
}
.wn-load-more:hover:not(:disabled) {
  background: var(--paper-2); border-color: var(--ink); color: var(--ink);
  transform: translateY(-1px);
}
.wn-load-more:disabled { opacity: .45; cursor: not-allowed; }
