/* ═══════════════════════════════════════════════════
   MY GAME LIST — style.css
   ═══════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ──────────────────────────────────── */
:root {
  --bg:           #09090b;
  --surface:      #111115;
  --surface-2:    #18181d;
  --border:       #1e1e24;
  --border-light: #2a2a33;
  --text:         #f0eeea;
  --text-2:       #a0a0aa;
  --text-3:       #55555f;
  --accent:       #60a5fa;

  /* Status */
  --ready-bg:   #0d2318;
  --ready-fg:   #4ade80;
  --ready-bdr:  #1a4030;
  --dl-bg:      #0d1a2e;
  --dl-fg:      #60a5fa;
  --dl-bdr:     #1a2f50;
  --soon-bg:    #1a0d24;
  --soon-fg:    #d946ef;
  --soon-bdr:   #301545;

  /* Type */
  --single-bg:  #1e1a08;
  --single-fg:  #fbbf24;
  --single-bdr: #3a3010;
  --multi-bg:   #200d0d;
  --multi-fg:   #f87171;
  --multi-bdr:  #3d1515;
  --both-bg:    #0d1e1a;
  --both-fg:    #34d399;
  --both-bdr:   #1a3a30;

  /* Replayability */
  --replay-bg:  #120d1e;
  --replay-fg:  #a78bfa;
  --replay-bdr: #241545;
  --onerun-bg:  #1e1208;
  --onerun-fg:  #fb923c;
  --onerun-bdr: #3d2510;

  /* HLTB */
  --hltb:       #1a5f8a;
  --hltb-text:  #93c5fd;

  /* Misc */
  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius:       6px;
  --radius-sm:    4px;
  --radius-lg:    10px;
  --transition:   0.15s ease;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -20%, rgba(96, 165, 250, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 80% 120%, rgba(167, 139, 250, 0.03) 0%, transparent 50%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 52px 32px 80px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────── */
header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

header h1 {
  font-family: var(--font-display);
  font-size: 64px;
  letter-spacing: 4px;
  color: #e8e0d0;
  line-height: 0.95;
  margin-bottom: 0;
}

/* ── Controls ────────────────────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 15px;
  pointer-events: none;
  user-select: none;
}

.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
}

.search-wrap input::placeholder { color: var(--text-3); }

.search-wrap input:focus {
  border-color: #3a3a50;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.06);
}

/* Sort buttons */
.sort-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.sort-label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 2px;
  user-select: none;
}

.sort-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sort-btn:hover {
  border-color: #3a3a50;
  color: var(--text);
  background: var(--surface-2);
}

.sort-btn.active {
  border-color: rgba(96, 165, 250, 0.5);
  color: var(--accent);
  background: rgba(96, 165, 250, 0.07);
}

/* ── Results count ───────────────────────────────────── */
.results-count {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  min-height: 18px;
  text-transform: uppercase;
}

/* ── Legend ──────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 36px;
}

/* ── Pills ───────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
  font-family: var(--font-body);
}

.ready  { background: var(--ready-bg);  color: var(--ready-fg);  border-color: var(--ready-bdr); }
.dl     { background: var(--dl-bg);     color: var(--dl-fg);     border-color: var(--dl-bdr); }
.soon   { background: var(--soon-bg);   color: var(--soon-fg);   border-color: var(--soon-bdr); }
.single { background: var(--single-bg); color: var(--single-fg); border-color: var(--single-bdr); }
.multi  { background: var(--multi-bg);  color: var(--multi-fg);  border-color: var(--multi-bdr); }
.both   { background: var(--both-bg);   color: var(--both-fg);   border-color: var(--both-bdr); }
.replay { background: var(--replay-bg); color: var(--replay-fg); border-color: var(--replay-bdr); }
.onerun { background: var(--onerun-bg); color: var(--onerun-fg); border-color: var(--onerun-bdr); }

/* ── Series block ────────────────────────────────────── */
.series-block {
  margin-bottom: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--transition);
}

.series-block:hover {
  border-color: var(--border-light);
}

.series-header {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--text-3);
  padding: 12px 16px 11px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  user-select: none;
}

/* ── Table ───────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

/* Column widths */
col.cn     { width: 32px; }
col.cg     { width: auto; }
col.cgenre { width: 126px; }
col.ct     { width: 100px; }
col.cs     { width: 92px; }
col.cr     { width: 116px; }
col.csize  { width: 76px; }
col.ch     { width: 58px; }

/* Header row */
thead tr {
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: 9px 14px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

th.hltb-head {
  text-align: center;
  background: rgba(26, 95, 138, 0.35);
  color: #7ab8e0;
  font-size: 9px;
}

th.size-head {
  text-align: center;
  color: var(--text-3);
  font-size: 9.5px;
}

/* Data rows */
td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.028);
  vertical-align: middle;
  transition: background var(--transition);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr.hidden {
  display: none;
}

tbody tr.done td {
  opacity: 0.35;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}

/* Checkbox */
.done-cb {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--ready-fg);
  opacity: 0.7;
  transition: opacity var(--transition);
}

.done-cb:hover { opacity: 1; }

/* Game name */
.game-name {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* Genre */
.genre {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 300;
}

/* HLTB cells */
.hltb-cell {
  text-align: center;
  background: rgba(26, 95, 138, 0.1);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hltb-text);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.hltb-cell.na {
  color: var(--text-3);
  font-weight: 300;
  font-style: italic;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0;
}

/* Size cell */
.size-cell { text-align: center; }

.size-input {
  width: 64px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-3);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  outline: none;
  text-align: center;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.size-input::placeholder {
  color: var(--text-3);
  opacity: 0.4;
  font-family: var(--font-body);
  font-size: 10px;
}

.size-input:focus {
  border-color: #3a3a50;
  color: var(--text);
  background: var(--surface-2);
}

.size-input.filled {
  color: #c084fc;
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.04);
}

/* ── No results ──────────────────────────────────────── */
.no-results {
  display: none;
  color: var(--text-3);
  padding: 48px 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ── Dropdowns ───────────────────────────────────────── */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dd-arrow {
  font-size: 9px;
  opacity: 0.6;
  transition: transform var(--transition);
  display: inline-block;
}

.dropdown.open .dd-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: ddFadeIn 0.1s ease;
}

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.dropdown-item.active {
  color: var(--accent);
  background: rgba(96, 165, 250, 0.07);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.dropdown-trigger.active {
  border-color: rgba(96, 165, 250, 0.5);
  color: var(--accent);
  background: rgba(96, 165, 250, 0.07);
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a50; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  body { padding: 28px 16px 60px; }
  header h1 { font-size: 44px; }
  col.cgenre, col.cr { display: none; }
  td:nth-child(3), th:nth-child(3),
  td:nth-child(6), th:nth-child(6) { display: none; }
}