/* ==============================================================
   GAMEVAULT DASHBOARD - HOME PAGE ONLY
   Load AFTER style.css. Does not change individual game pages.
   ============================================================== */

body.gv-dashboard-home {
  background: #080d16;
  color: #f4f7fc;
}

body.gv-dashboard-home main.container {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.gv-dashboard-home .site-header {
  background: #0c111c;
  border-color: #25364b;
}

body.gv-dashboard-home .site-header .header-content {
  width: 100%;
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
  min-height: 62px;
}

body.gv-dashboard-home .header-search input {
  background: #111a29;
  border: 1px solid #2d4059;
}

body.gv-dashboard-home .header-search input:focus {
  border-color: #93d5ff;
  box-shadow: 0 0 0 2px #75caff22;
}

.gv-dash {
  --dash-line: #3c5772;
  --dash-aqua: #8fddff;
  --dash-pane: #0b1421;
  position: relative;
  isolation: isolate;
  width: min(1470px, calc(100% - 46px));
  margin: 0 auto;
  padding: 16px 0 54px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.gv-dash::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -2px;
  left: min(-90px, -3vw);
  width: calc(100% + 180px);
  height: 228px;
  background:
    linear-gradient(90deg, #080d16 0%, #080d16b8 27%, #08101c28 66%, #080d1608 100%),
    url("gamevault-dashboard-banner.svg") center 42% / cover no-repeat;
  opacity: .96;
  pointer-events: none;
}

.gv-dash-hero {
  min-height: 108px;
  display: flex;
  align-items: flex-start;
  padding: 7px 2px 14px;
}

.gv-dash-eyebrow {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #edf5ff;
}

.gv-dash-hero h1 {
  font-size: clamp(23px, 2.4vw, 31px);
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0;
  color: #f5f7ff;
  line-height: 1.2;
}

.gv-dash-hero p:last-child {
  font-size: 14px;
  color: #c8d7ea;
  margin: 4px 0 0;
}

.gv-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 20px;
}

.gv-dash-stat {
  min-width: 0;
  min-height: 85px;
  padding: 16px 17px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(130deg, #0c1522f4 0%, #0b1019f9 100%);
  border: 1px solid #6483a4;
  border-radius: 13px;
  box-shadow: 0 7px 17px #0004, inset 0 1px 0 #ffffff09;
}

.gv-dash-stat-icon {
  display: grid;
  flex: 0 0 48px;
  height: 48px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 11px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, currentColor 28%, transparent);
}

.gv-dash-stat-icon .gv-dash-icon { width: 30px; height: 30px; }
/* TOTAL GAMES only — match the flat blue icon on the Profile page. */
.gv-dash-blue .gv-dash-stat-icon {
  color: #82caff;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1.5px solid currentColor;
  border-radius: 11px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: none;
  filter: none;
}
.gv-dash-blue .gv-dash-stat-icon .gv-dash-icon {
  width: 26px;
  height: 26px;
}

.gv-dash-green .gv-dash-stat-icon { color: #6ae296; }
.gv-dash-gold .gv-dash-stat-icon { color: #ffd06b; }
.gv-dash-pink .gv-dash-stat-icon { color: #df9ef5; }

.gv-dash-stat-copy { min-width: 0; flex: 1; }
.gv-dash-stat-label {
  display: block;
  color: #d5e1f4;
  letter-spacing: 1.3px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.gv-dash-stat-copy strong {
  display: block;
  font-size: clamp(23px, 2.2vw, 31px);
  line-height: 1.15;
  color: #fff;
  font-weight: 800;
}
.gv-dash-stat-chip {
  flex-shrink: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #1c2a3f;
  color: #a9dfff;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
  max-width: 135px;
}

.gv-dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(310px, 1fr);
  gap: 18px;
  align-items: start;
}
.gv-dash-main, .gv-dash-side { display: grid; gap: 14px; min-width: 0; }
.gv-dash-panel {
  min-width: 0;
  padding: 15px 20px 17px;
  background: linear-gradient(155deg, #091321 0%, #0b111c 65%, #0c1520 100%);
  border: 1px solid var(--dash-line);
  border-radius: 13px;
  box-shadow: 0 5px 14px #0002, inset 0 1px 0 #ffffff08;
}
.gv-dash-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.gv-dash-panel h2 {
  color: #f4f7ff;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.35px;
  font-weight: 800;
  margin: 0 0 4px;
}
.gv-dash-panel-heading p {
  color: #b1c9e3;
  margin: 0;
  font-size: 12px;
}
.gv-dash-text-action {
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: #94daff;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-weight: 700;
}
.gv-dash-text-action:hover, .gv-dash-text-action:focus-visible { color: #fff; text-decoration: underline; }
.gv-dash-icon { display: inline-block; width: 19px; height: 19px; flex-shrink: 0; }
.gv-dash-text-action .gv-dash-icon { width: 15px; height: 15px; }

.gv-dash-cover-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.gv-dash-recent-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gv-dash-game {
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid #475e79;
  border-radius: 12px;
  background: #111a29;
  display: flex;
  flex-direction: column;
  color: #fff;
  transition: transform .18s ease, border-color .18s ease;
}
.gv-dash-game:hover { transform: translateY(-4px); border-color: #92d9ff; }
.gv-dash-game:focus-visible, .gv-dash-action:focus-visible, .gv-dash-genre:focus-visible {
  outline: 2px solid #b4e6ff;
  outline-offset: 3px;
}
.gv-dash-game-art {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #16304f, #111623 55%, #293a45);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.gv-dash-cover-placeholder {
  font-size: 31px;
  font-weight: 900;
  color: #dceaff35;
}
.gv-dash-game-art img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: top center;
}
.gv-dash-game-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 31px;
  padding: 7px 9px;
  color: #9fe2ff;
  background: linear-gradient(180deg, #111e2e, #0e1725);
  font-size: 11px;
  font-weight: 700;
}
.gv-dash-game-footer .gv-dash-icon { width: 13px; height: 13px; color: #e8eefa; }
.gv-dash-progress-label { color: #f3f7fc; margin-left: auto; }
.gv-dash-progress-track {
  height: 7px;
  background: #344a66;
  border-radius: 5px;
  display: block;
  width: 100%;
  margin-top: 2px;
  overflow: hidden;
}
.gv-dash-progress-track > span {
  height: 100%; display: block; background: #96ddff; border-radius: inherit;
}
.gv-dash-continue { min-height: 325px; }
.gv-dash-recent { min-height: 275px; }
.gv-dash-quick { min-height: 225px; }
.gv-dash-genres { min-height: 340px; }
.gv-dash-cover-row > .gv-dash-empty { grid-column: 1 / -1; }
.gv-dash-empty {
  min-height: 145px;
  padding: 24px;
  border-radius: 9px;
  border: 1px dashed #354a64;
  background: #121d2bb0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 12px;
}
.gv-dash-empty p { margin: 0; color: #acc7de; font-size: 13px; }
.gv-dash-empty-button {
  padding: 8px 14px;
  background: #1d364d;
  border: 1px solid #5b8bae;
  color: #dcf4ff;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12px;
}
.gv-dash-empty-button:hover { background: #244b68; }

.gv-dash-action-list { display: grid; gap: 8px; }
.gv-dash-action {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 40px;
  border: 1px solid #405874;
  border-radius: 9px;
  color: #f1f4fa;
  background: linear-gradient(100deg, #111f31, #1a2537 70%);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  box-shadow: inset 0 1px 0 #ffffff0d;
}
.gv-dash-action:hover { background: #253953; border-color: #80c7f2; }
.gv-dash-action-icon { display: flex; color: #8ad7ff; }
.gv-dash-action-label { flex: 1; }
.gv-dash-action-arrow { width: 14px; height: 14px; color: #cfe8fa; }
html:not(.gv-admin) .gv-dash-admin-only { display: none !important; }

.gv-dash-genre-list { display: grid; gap: 7px; }
.gv-dash-genre {
  width: 100%;
  height: 52px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #314b68;
  border-radius: 9px;
  background: linear-gradient(100deg,#112033,#172336);
  color: #fff;
  text-align: left;
}
.gv-dash-genre:hover { border-color: #86cbef; background: #21354c; }
.gv-dash-genre-icon { display: grid; place-items: center; width: 26px; }
.gv-dash-genre-icon svg { width: 24px; height: 24px; }
.gv-dash-genre-middle { display: grid; flex: 1; min-width: 0; gap: 5px; }
.gv-dash-genre-middle strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-dash-genre-track { height: 6px; width: 100%; border-radius: 999px; background: #31445e; overflow: hidden; }
.gv-dash-genre-fill { height: 100%; display: block; background: linear-gradient(90deg, #6dbee7, #98dcfa); border-radius: inherit; }
.gv-dash-genre-count { flex: 0 0 40px; text-align: center; padding: 5px 0; background: #263a53; border-radius: 999px; font-size: 13px; font-weight: 800; }
.gv-dash-genres .gv-dash-empty { min-height: 235px; }

/* The original collection is permanently housed inside the former
   Continue Playing panel. Preserve its existing search/filter/card logic. */
body.gv-dashboard-home .gv-dash-collection-mount { min-width: 0; }
body.gv-dashboard-home #collection {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  position: static !important;
  left: auto !important;
  transform: none !important;
  scroll-margin-top: 95px;
}
body.gv-dashboard-home #collection > .section-heading { display: none !important; }
body.gv-dashboard-home #collection .toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 14px;
  padding: 0;
  gap: 12px;
}
body.gv-dashboard-home #collection .toolbar select {
  min-width: 150px;
  max-width: 100%;
  background: #111d2d;
  color: #f1f7ff;
  border: 1px solid #405b78;
  padding: 8px 12px;
}
body.gv-dashboard-home #collection .game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
body.gv-dashboard-home #collection .game-card { min-width: 0; }

/* Four-cover carousel. The existing game cards are never duplicated. */
body.gv-dashboard-home .gv-dash-collection-slider {
  position: relative;
  min-width: 0;
}
body.gv-dashboard-home .gv-dash-collection-slider.gv-dash-carousel-active {
  padding: 0 33px;
}
body.gv-dashboard-home #collection .game-grid > .gv-dash-card-outside {
  display: none !important;
}
body.gv-dashboard-home .gv-dash-carousel-arrow {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 60px;
  border: 1px solid #557492;
  border-radius: 9px;
  background: #14263c;
  color: #ffffff;
  z-index: 2;
  padding: 0;
  cursor: pointer;
}
body.gv-dashboard-home .gv-dash-carousel-prev { left: 0; }
body.gv-dashboard-home .gv-dash-carousel-next { right: 0; }
body.gv-dashboard-home .gv-dash-carousel-prev svg { transform: rotate(180deg); }
body.gv-dashboard-home .gv-dash-carousel-arrow svg { width: 21px; height: 21px; }
body.gv-dashboard-home .gv-dash-carousel-arrow:hover:not(:disabled) {
  color: #fff;
  background: #233e59;
  border-color: #a3dcff;
}
body.gv-dashboard-home .gv-dash-carousel-arrow:focus-visible {
  outline: 2px solid #b4e6ff;
  outline-offset: 2px;
}
body.gv-dashboard-home .gv-dash-carousel-arrow:disabled {
  opacity: .3;
  cursor: default;
}
body.gv-dashboard-home .gv-dash-carousel-arrow[hidden],
body.gv-dashboard-home .gv-dash-view-all[hidden] {
  display: none !important;
}
body.gv-dashboard-home .gv-dash-view-all {
  margin-left: auto;
  align-self: start;
  text-transform: none;
}
body.gv-dashboard-home #collection .game-card .game-cover { aspect-ratio: 2 / 3; }
body.gv-dashboard-home .gv-dash-continue { scroll-margin-top: 90px; }
body.gv-dashboard-home .backup-panel { display: none !important; }
html.gv-admin body.gv-dashboard-home.gv-dashboard-backups-open .backup-panel:not([hidden]) {
  display: block !important;
}

@media (max-width: 1280px) {
  .gv-dash-stats { gap: 11px; }
  .gv-dash-stat { gap: 10px; padding: 12px; }
  .gv-dash-stat-chip { font-size: 10px; max-width: 110px; }
  .gv-dash-layout { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .gv-dash-cover-row { gap: 8px; }
  .gv-dash-panel { padding: 14px; }
}
@media (max-width: 1050px) {
  .gv-dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gv-dash-layout { grid-template-columns: 1fr; }
  .gv-dash-side { grid-template-columns: 1fr 1fr; }
  .gv-dash-continue, .gv-dash-recent, .gv-dash-quick, .gv-dash-genres { min-height: 0; }
  .gv-dash::before { width: 100%; left: 0; }
}
@media (max-width: 720px) {
  .gv-dash { width: calc(100% - 26px); padding-top: 12px; }
  .gv-dash-hero { min-height: 130px; }
  .gv-dash-hero h1 { font-size: 25px; }
  .gv-dash-stats { gap: 9px; }
  .gv-dash-stat { min-height: 74px; gap: 9px; padding: 10px; }
  .gv-dash-stat-icon { flex-basis: 36px; height: 36px; }
  .gv-dash-blue .gv-dash-stat-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .gv-dash-stat-icon svg { width: 22px !important; height: 22px !important; }
  .gv-dash-stat-label { font-size: 9px; letter-spacing: .65px; }
  .gv-dash-stat-copy strong { font-size: 21px; }
  .gv-dash-stat-chip { display: none; }
  .gv-dash-panel { padding: 13px; }
  .gv-dash-panel h2 { font-size: 18px; }
  .gv-dash-cover-row, .gv-dash-recent-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .gv-dash-side { grid-template-columns: 1fr; }
  body.gv-dashboard-home #collection .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  body.gv-dashboard-home .gv-dash-collection-slider.gv-dash-carousel-active {
    padding: 0 24px;
  }
  body.gv-dashboard-home .gv-dash-carousel-arrow {
    width: 22px;
    height: 48px;
    border-radius: 7px;
  }
  body.gv-dashboard-home .gv-dash-carousel-arrow svg { width: 17px; height: 17px; }
  body.gv-dashboard-home #collection .toolbar { justify-content: stretch; }
  body.gv-dashboard-home #collection .toolbar select { width: 100%; }
}
@media (max-width: 390px) {
  .gv-dash-stat-icon { display: none; }
  .gv-dash-panel-heading { align-items: flex-start; }
  .gv-dash-panel h2 { font-size: 17px; }
  .gv-dash-text-action { font-size: 11px; }
  .gv-dash-cover-row, .gv-dash-recent-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.gv-dashboard-home #collection .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .gv-dash-game, .gv-dash-action { transition: none; }
}

/* Responsive navigation: keep long account names and admin controls from
   making the entire mobile page horizontally scroll. */
@media (max-width: 720px) {
  body.gv-dashboard-home .site-header .header-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    min-height: 0;
  }
  body.gv-dashboard-home .site-header .logo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 18px;
  }
  body.gv-dashboard-home .site-header .header-search {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
  body.gv-dashboard-home .site-header .header-search input {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }
  body.gv-dashboard-home .site-header .header-actions {
    flex: 1 1 100%;
    order: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
    min-width: 0;
  }
  body.gv-dashboard-home .site-header .gv-users-actions {
    flex: 1 1 auto;
    margin-left: 0;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  body.gv-dashboard-home .site-header .gv-users-button,
  body.gv-dashboard-home .site-header .gv-auth-button {
    max-width: min(190px, 85vw);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body.gv-dashboard-home .site-header .header-actions > button {
    white-space: normal;
    max-width: 100%;
  }
  .gv-dash::before { background-position: 60% 40%; }
}

/* Keep four visible covers in the desktop dashboard panel. */
@media (min-width: 1051px) and (max-width: 1280px) {
  body.gv-dashboard-home #collection .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Keep the decorative moonlit banner from widening mid-sized viewports. */
@media (max-width: 1540px) {
  body.gv-dashboard-home .gv-dash::before { left: 0; width: 100%; }
}

/* Dashboard collection preview: filter is available on full archive pages only.
   The #statusFilter element stays mounted for the legacy collection JS. */
body.gv-dashboard-home #collection .toolbar {
  display: none !important;
}
body.gv-dashboard-home #collection .game-grid {
  margin-top: 0;
}
