/* ==========================================================================
   Game ID — Home / Dashboard Page
   ========================================================================== */

.home-page { }

/* ---- KPI grid ------------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* ---- Widget grid --------------------------------------------------------- */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.widget {
  background: var(--bg-layer);
  border: 1px solid var(--stroke-divider);
  border-radius: var(--r-lg);
  padding: 20px;
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Distribution bar chart ---------------------------------------------- */
.distribution-list { list-style: none; }

.distribution-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.distribution-label {
  font-size: 12px;
  color: var(--fg-secondary);
  width: 100px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-circular);
  overflow: hidden;
  min-width: 0;
}

.distribution-bar-fill {
  height: 100%;
  background: var(--brand-rest);
  border-radius: var(--r-circular);
  transition: width var(--t-normal) var(--ease-decelerate);
}

.distribution-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-tertiary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.distribution-pct {
  font-size: 11px;
  color: var(--fg-quaternary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ---- Data list ----------------------------------------------------------- */
.data-list { list-style: none; }

.data-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-divider);
  font-size: 13px;
}

.data-list li:last-child { border-bottom: none; }
.data-list li > span:first-child { color: var(--fg-secondary); }
.data-list li > span:last-child { color: var(--fg-primary); font-weight: 500; }

/* ---- Health -------------------------------------------------------------- */
.health-score-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.health-ring {
  width: 88px;
  height: 88px;
  border-radius: var(--r-circular);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--brand-rest) var(--health-pct, 0%), var(--bg-subtle) 0%);
  position: relative;
  flex-shrink: 0;
}

.health-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--bg-layer);
  border-radius: var(--r-circular);
}

.health-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.health-ring-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1;
}

.health-ring-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.health-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.health-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-stat-label {
  font-size: 12px;
  color: var(--fg-tertiary);
}

.health-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
}

/* ---- Timeline chart ------------------------------------------------------ */
.timeline-chart { display: flex; align-items: flex-end; gap: 3px; height: 100px; padding-top: 8px; }

.timeline-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.timeline-bar {
  width: 100%;
  background: var(--brand-rest);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
  transition: opacity var(--t-fast);
  min-height: 2px;
}

.timeline-bar:hover { opacity: 1; }

.timeline-year {
  font-size: 9px;
  color: var(--fg-quaternary);
  white-space: nowrap;
}

/* ---- Value stats --------------------------------------------------------- */
.value-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-divider);
  font-size: 13px;
}

.value-row:last-child { border-bottom: none; }
.value-row .v-label { color: var(--fg-secondary); }
.value-row .v-value { color: var(--fg-primary); font-weight: 600; }
.value-row .v-value.accent { color: var(--brand-hover); }
.value-row .v-value.faint { color: var(--fg-quaternary); font-weight: 400; font-size: 11px; }

/* ---- Playtime ------------------------------------------------------------ */
.playtime-hero {
  text-align: center;
  margin-bottom: 16px;
}

.playtime-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--fg-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.playtime-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-tertiary);
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .widget-grid { grid-template-columns: 1fr; }
}
