/* =============================================================
   GameVault — app.css
   Fonts: Syne (display) + Figtree (body) + JetBrains Mono (numbers)
   Aesthetic: dark industrial — deep charcoal, electric blue accent
============================================================= */

/* --- Reset & base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0b0e15;
  --bg-2:         #111520;
  --bg-3:         #171c2a;
  --bg-4:         #1e2539;
  --border:       #1f2d45;
  --border-2:     #293652;

  --accent:       #2d6be4;
  --accent-hover: #4480f5;
  --accent-dim:   rgba(45,107,228,0.15);
  --accent-glow:  rgba(45,107,228,0.35);

  --text-1:  #eef0f6;
  --text-2:  #8b96b0;
  --text-3:  #4a5568;

  --playing:    #8b5cf6;
  --installed:  #2d6be4;
  --finished:   #10b981;
  --owned:      #4a5568;

  --verified:    #10b981;
  --playable:    #f59e0b;
  --unsupported: #ef4444;
  --unknown:     #4a5568;

  --gold:   #f59e0b;
  --danger: #ef4444;

  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 18px;

  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);

  --font-display: 'Syne', sans-serif;
  --font-body:    'Figtree', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --navbar-h: 58px;
  --filter-h: 52px;
  --tabs-h:   44px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  /* subtle noise texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* --- Scrollbar ------------------------------------------------ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* =============================================================
   NAVBAR
============================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(11,14,21,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-left { display: flex; align-items: baseline; gap: 12px; }

.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #eef0f6 0%, #2d6be4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.navbar-center {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
}

.nav-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 18px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.nav-tab:hover { color: var(--text-1); }
.nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-add:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

/* =============================================================
   VIEWS
============================================================= */
.view { padding-bottom: 64px; }

/* =============================================================
   FILTER BAR
============================================================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.search-input { padding-left: 32px !important; width: 200px; }

.filter-input,
.filter-select {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s;
  height: 34px;
}
.filter-input:focus,
.filter-select:focus { border-color: var(--accent); }

.filter-select { cursor: pointer; }
.filter-select option { background: var(--bg-3); }

.filter-select--deck {
  border-color: var(--accent);
  color: #7aadff;
  font-weight: 500;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.filter-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* =============================================================
   STATUS TABS
============================================================= */
.status-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.status-tab {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.status-tab:hover { color: var(--text-1); border-color: var(--border-2); }
.status-tab.active { border-color: transparent; color: #fff; }

.status-tab--playing.active   { background: var(--playing);    box-shadow: 0 0 10px rgba(139,92,246,0.4); }
.status-tab--installed.active { background: var(--installed);  box-shadow: 0 0 10px rgba(45,107,228,0.4); }
.status-tab--finished.active  { background: var(--finished);   box-shadow: 0 0 10px rgba(16,185,129,0.4); }
.status-tab--owned.active     { background: var(--owned); }
.status-tab:first-child.active { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* =============================================================
   GAME GRID
============================================================= */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

/* --- Game Card --------------------------------------------- */
.game-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}
.game-card:hover .card-cover-overlay { opacity: 1; }

.card-cover {
  position: relative;
  height: 120px;
  background: var(--bg-3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-cover-fallback {
  font-size: 40px;
  opacity: 0.4;
}
.card-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,14,21,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.card-status {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.card-status--playing   { background: var(--playing);   color: #fff; }
.card-status--installed { background: var(--installed); color: #fff; }
.card-status--finished  { background: var(--finished);  color: #fff; }
.card-status--owned     { background: var(--owned);     color: #fff; }

.card-hu {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 10px 12px 12px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  color: var(--text-1);
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.card-rating {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--gold);
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-store {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.card-myrating {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.card-myrating span { color: var(--gold); }

/* =============================================================
   EMPTY & LOADING
============================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 10px;
}
.empty-icon { font-size: 48px; opacity: 0.3; }
.empty-title { font-family: var(--font-display); font-size: 18px; color: var(--text-2); }
.empty-sub   { font-size: 13px; color: var(--text-3); }

.loading-state {
  display: flex;
  justify-content: center;
  padding: 80px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--sm { width: 18px; height: 18px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================
   DETAIL PANEL
============================================================= */
.panel-scrim {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 17, 0.7);
  backdrop-filter: blur(2px);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: slideIn 0.25s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.panel-cover {
  position: relative;
  height: 180px;
  background: var(--bg-3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg-2), transparent);
}
.panel-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.panel-cover-fallback {
  font-size: 64px;
  opacity: 0.25;
  position: absolute;
}

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.panel-close:hover { background: rgba(0,0,0,0.8); }

.panel-status-badge {
  position: absolute;
  bottom: 18px;
  left: 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 10px;
  z-index: 2;
}

.panel-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
  line-height: 1.2;
}
.panel-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.panel-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--text-3); }
.meta-val   { color: var(--text-1); font-weight: 500; text-align: right; max-width: 200px; }
.meta-val--rating {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 14px;
}
.meta-row--deck { background: rgba(45,107,228,0.07); }
.deck-label { color: #7aadff; font-weight: 500; }

.panel-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-label--deck { color: #7aadff; }

.field-select,
.field-input {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s;
}
.field-select:focus,
.field-input:focus { border-color: var(--accent); }
.field-select { cursor: pointer; }
.field-select option { background: var(--bg-3); }

.field-group--deck .field-select { border-color: var(--accent); }

.rating-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.rating-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px var(--accent-dim);
}
.rating-display {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--gold);
  float: right;
}
.rating-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-save {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-save:hover { background: var(--accent-hover); }

.btn-delete {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 14px;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-delete:hover { background: rgba(239,68,68,0.1); }

/* =============================================================
   MODAL
============================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,10,17,0.8);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.16,1,0.3,1);
}

@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--bg-4); color: var(--text-1); }

.modal-step { padding: 20px 22px; }

.modal-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.modal-search-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s;
}
.modal-search-input:focus { border-color: var(--accent); }

.btn-search {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-search:hover { background: var(--accent-hover); }
.btn-search:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-results { display: flex; flex-direction: column; gap: 6px; }

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s;
  background: var(--bg-3);
}
.result-row:hover { border-color: var(--border-2); background: var(--bg-4); }
.result-row.selected { border-color: var(--accent); background: var(--accent-dim); }

.result-cover {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.result-cover img { width: 100%; height: 100%; object-fit: cover; }

.result-info { flex: 1; min-width: 0; }
.result-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.result-row.selected .result-name { color: var(--accent-hover); }
.result-sub { font-size: 11px; color: var(--text-3); }

.result-score {
  text-align: right;
  flex-shrink: 0;
}
.result-score-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--gold);
}
.result-score-lbl { font-size: 10px; color: var(--text-3); }

.modal-searching {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--text-2);
  font-size: 13px;
}
.modal-no-results { font-size: 13px; color: var(--text-3); padding: 16px 0; }

.btn-back {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--text-2); }

.modal-game-confirm {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
}
.confirm-label { color: var(--text-3); }
.confirm-val   { color: var(--text-1); font-weight: 500; }
.confirm-val--hu { color: var(--finished); }
.confirm-val--nohu { color: var(--text-3); }

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.field-group--deck {
  background: rgba(45,107,228,0.08);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-2);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--border-2); color: var(--text-1); }

.btn-add-confirm {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-confirm:hover { background: var(--accent-hover); }
.btn-add-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* =============================================================
   STATS VIEW
============================================================= */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px 24px 0;
}

.summary-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.summary-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 24px;
}

.chart-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.chart-card--wide { /* default is half width */ }
.chart-card--full { grid-column: 1 / -1; }

.chart-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* Bar chart rows */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}
.bar-row-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  font-weight: 500;
}
.bar-track {
  height: 6px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}

/* Stacked status bar */
.status-stacked {
  height: 20px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin-bottom: 12px;
}
.status-segment { height: 100%; transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Histogram */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 16px;
}
.hist-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.hist-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
.hist-bar:hover { background: var(--accent-hover); }
.hist-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}
.hist-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
}

/* =============================================================
   DECK BADGE
============================================================= */
.deck-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.deck-badge--verified    { background: rgba(16,185,129,0.15); color: var(--verified); }
.deck-badge--playable    { background: rgba(245,158,11,0.15); color: var(--playable); }
.deck-badge--unsupported { background: rgba(239,68,68,0.15);  color: var(--unsupported); }
.deck-badge--unknown     { background: var(--bg-4);           color: var(--text-3); }

.hu-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.hu-badge--yes { background: rgba(16,185,129,0.15); color: var(--verified); }
.hu-badge--no  { background: var(--bg-4);           color: var(--text-3);  }

/* =============================================================
   TOAST
============================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 20px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s cubic-bezier(0.16,1,0.3,1);
}
.toast--success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: var(--finished); }
.toast--error   { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3);  color: var(--danger);   }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0);    }
}

/* =============================================================
   RESPONSIVE
============================================================= */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card--wide,
  .chart-card--full { grid-column: auto; }
}

@media (max-width: 640px) {
  .navbar { padding: 0 14px; }
  .navbar-center { display: none; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 14px; }
  .filter-bar { padding: 8px 14px; }
  .detail-panel { width: 100%; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
  .modal { margin: 10px; }
  .modal-form-grid { grid-template-columns: 1fr; }
}
