:root {
  --space-deep: #1b1240;
  --space-mid: #362463;
  --panel: #2a1f52;
  --panel-light: #4a3a82;
  --panel-dark: #170f33;
  --grass-light: #8fd14f;
  --grass-dark: #5a9c2f;
  --accent: #ffd76b;
  --danger: #ff9a9a;
}

* { box-sizing: border-box; }

/* Every other page's CSS in this codebase defines this - dashboard.css
   never needed a show/hide toggle before the events modal, so this got
   missed. Without it, ".hidden" on an element does nothing: the events
   modal rendered visible from page load (showing its placeholder "no
   events" text before ever being opened) and its "Close" button's
   classList.add('hidden') had no visual effect at all - both reported as
   one "events aren't showing and I can't close the box" bug, but really
   this single missing rule. */
.hidden { display: none !important; }

body {
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  background:
    radial-gradient(1px 1px at 10% 20%, #fff 100%, transparent),
    radial-gradient(1px 1px at 80% 10%, #fff 100%, transparent),
    radial-gradient(1px 1px at 60% 70%, #fff 100%, transparent),
    radial-gradient(1px 1px at 30% 85%, #fff 100%, transparent),
    radial-gradient(1px 1px at 90% 55%, #fff 100%, transparent),
    linear-gradient(180deg, var(--space-deep), var(--space-mid));
  font-family: 'Comic Sans MS', 'Segoe UI', cursive, sans-serif;
  color: #f0e9ff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-wrap {
  max-width: 480px;
  width: 100%;
  background: var(--panel);
  border: 6px solid;
  border-color: var(--panel-light) var(--panel-dark) var(--panel-dark) var(--panel-light);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dash-header h1 {
  margin: 0;
  font-size: 20px;
}

.link-btn {
  padding: 6px 12px;
  border: 2px solid;
  border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light);
  background: #79c94a;
  color: #23360f;
  font-weight: bold;
  font-family: inherit;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
}

.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.dash-stat {
  background: var(--panel-dark);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  border: 1px solid #000a;
}

.dash-stat-label {
  display: block;
  font-size: 11px;
  color: #cbb8ff;
}

.dash-stat-val {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: var(--accent);
}

.dash-stat-mistake .dash-stat-val {
  color: var(--danger);
}

.dash-current {
  margin-bottom: 18px;
}

.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}

.dash-bar-row span {
  width: 80px;
  flex-shrink: 0;
}

.dash-bar-track {
  flex: 1;
  height: 10px;
  background: var(--panel-dark);
  border-radius: 6px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  border-radius: 6px;
}

.dash-bar-fill.hunger { background: #f0a13f; }
.dash-bar-fill.happiness { background: #ffd76b; }

h2 {
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--accent);
}

.trait-summary {
  font-size: 12px;
  color: #cbb8ff;
  margin: 0 0 10px;
}

.trait-affinities {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.evolution-circle-caption {
  font-size: 13px;
  opacity: 0.85;
  margin: 0 0 10px;
}

.evolution-circle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.evolution-circle-svg {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
}

.trait-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.trait-bar-icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

.trait-bar-label {
  width: 70px;
  flex-shrink: 0;
}

.trait-bar-track {
  flex: 1;
  height: 10px;
  background: var(--panel-dark);
  border-radius: 6px;
  overflow: hidden;
}

.trait-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}

.trait-bar-count {
  width: 24px;
  text-align: right;
  flex-shrink: 0;
  color: var(--accent);
  font-weight: bold;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.activity-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04);
}

.activity-row.mistake {
  color: var(--danger);
}

.activity-when {
  color: #cbb8ff;
  flex-shrink: 0;
}

.activity-empty {
  font-size: 12px;
  color: #cbb8ff;
  text-align: center;
}

.appearance-label {
  font-size: 12px;
  color: #cbb8ff;
  margin: 0 0 6px;
}

.appearance-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.font-btn, .scheme-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid var(--panel-light);
  background: var(--panel-dark);
  color: #cbb8ff;
  border-radius: 6px;
}

.font-btn.active, .scheme-btn.active {
  background: var(--grass-light);
  border-color: var(--grass-dark);
  color: #23360f;
}

.scheme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.scheme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #0006;
  display: inline-block;
}

/* ---------- Live events modal ---------- */

.events-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}

.events-modal-dialog {
  background: var(--panel);
  border: 6px solid;
  border-color: var(--panel-light) var(--panel-dark) var(--panel-dark) var(--panel-light);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}

.events-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.events-modal-title { font-weight: bold; font-size: 18px; }

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  background: var(--panel-dark);
  border: 2px solid var(--panel-light);
  border-radius: 8px;
  padding: 10px 12px;
}

.event-card-name {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 4px;
}

.event-card-blurb {
  font-size: 13px;
  color: #cbb8ff;
  margin-bottom: 6px;
}

.event-card-accessory {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--accent);
}

.event-card-accessory img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.event-card-multipliers {
  font-size: 11px;
  color: #cbb8ff;
}

.event-card-ends {
  font-size: 11px;
  color: #cbb8ff;
  font-style: italic;
  margin-top: 4px;
}

.events-empty-hint {
  text-align: center;
  color: #cbb8ff;
  font-size: 13px;
}

/* ---------- Leaderboards ----------
   Moved here from Battle Arena (2026-07-25, "Unified Leader boards /
   options menu" card - "single point of entry for all leaderboard data
   viewing for players"). .arena-modal-overlay/.arena-modal/
   .arena-modal-header (generic modal chrome) come from nav.css, already
   included on this page - only the leaderboard-specific rules live
   here. */

.dash-leaderboard-btn {
  display: block;
  margin: 0 0 14px 0;
}

.arena-leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.arena-leaderboard-tab {
  flex: 1;
  padding: 8px 10px;
  cursor: pointer;
  border: 2px solid var(--panel-light);
  background: var(--panel-dark);
  color: #cbb8ff;
  font-weight: bold;
  font-family: inherit;
  font-size: 12px;
  border-radius: 6px;
}

.arena-leaderboard-tab.selected {
  background: var(--accent);
  color: #2b1b00;
  border-color: var(--accent);
}

.arena-modal-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.arena-modal-level-row select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 2px solid var(--panel-light);
  background: var(--panel-dark);
  color: #f0e9ff;
  font-family: inherit;
}

.arena-leaderboard-list {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arena-leaderboard-list li {
  background: var(--panel-dark);
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.arena-leaderboard-empty {
  font-size: 13px;
  color: #cbb8ff;
  text-align: center;
}

/* ---------- Desktop wide-screen widening ("Display changes" card, 2026-07-25) ----------
   This page has no per-slot/multi-box concept (that's /play's own much
   bigger change - see pet.css) - just a wider container so the existing
   grid/flex layouts get more comfortable room instead of staying pinned
   to a narrow mobile-width column. */
@media (min-width: 700px) {
  .dash-wrap {
    max-width: 760px;
  }

  .dash-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
