/* Custom Global CSS Design Architecture Variables */
:root {
  --bg-color: #e4f2f7;
  --panel-bg: rgba(255, 255, 255, 0.75);
  --card-bg: #ffffff;
  --text-main: #121214;
  --text-muted: #5a5a62;
  --border-color: #121214;
  --nintendo-red: #e60012;
  --nintendo-blue: #00c3e3;
  --shadow: 0 8px 0 var(--border-color);
  --transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

[data-theme="dark"] {
  --bg-color: #16171a;
  --panel-bg: rgba(33, 34, 38, 0.85);
  --card-bg: #25262b;
  --text-main: #f8f9fa;
  --text-muted: #a6a7ab;
  --border-color: #f8f9fa;
  --shadow: 0 8px 0 var(--border-color);
}

body { 
  background-color: var(--bg-color); 
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 32px;
  box-sizing: border-box;
  transition: background-color 0.4s ease;
}

.app-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
}

.main-content {
  background-color: var(--panel-bg);
  border: 4px solid var(--border-color);
  border-radius: 32px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.dashboard-page { display: none; }
.dashboard-page.active { display: block; animation: fadeIn 0.3s ease-in-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 40px; }
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; max-width: 90%; }

.nav-btn {
  padding: 10px 16px;
  background-color: var(--card-bg);
  color: var(--text-main);
  text-decoration: none;
  border-radius: 14px;
  border: 4px solid var(--border-color);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: 0 4px 0 var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}
.nav-btn:hover, .nav-btn.active {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--border-color);
  background-color: var(--nintendo-red);
  color: white;
}
.nav-btn.active { background-color: var(--nintendo-blue); }

.theme-toggle {
  background: var(--card-bg); border: 4px solid var(--border-color); width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; box-shadow: 0 4px 0 var(--border-color); display: flex; justify-content: center; align-items: center; font-size: 16px; flex-shrink: 0;
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

.section-header { margin: 24px 0; border-left: 8px solid var(--nintendo-red); padding-left: 16px; }
.section-title { font-size: 24px; font-weight: 900; text-transform: uppercase; }

/* Grid Modules for Layout Components */
.games-grid, .specs-grid, .accessory-grid, .generic-data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.game-card, .spec-box, .accessory-card, .dynamic-data-box { background-color: var(--card-bg); border: 4px solid var(--border-color); border-radius: 24px; padding: 24px; position: relative; box-shadow: var(--shadow); }

.rank-badge { position: absolute; top: -16px; left: 20px; padding: 6px 16px; border-radius: 12px; border: 4px solid var(--border-color); font-weight: 900; }
.number-1 { background-color: #ffd700; color: #121214; }
.number-2 { background-color: #e0e0e0; color: #121214; }
.number-3 { background-color: var(--nintendo-red); color: white; }

.game-img { width: 100%; height: 140px; margin: 16px 0; display: flex; justify-content: center; align-items: center; }
.game-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.game-title, .dynamic-item-title { font-size: 17px; font-weight: 800; text-align: center; min-height: 44px; margin: 4px 0; }
.sales-amount, .dynamic-item-value { font-size: 14px; font-weight: 700; color: var(--text-muted); margin: 0; text-align: center; }

.spec-label { font-size: 11px; text-transform: uppercase; color: var(--nintendo-red); font-weight: 900; margin-bottom: 6px; }
.spec-value { font-size: 15px; font-weight: 700; }

.history-timeline { display: flex; flex-direction: column; gap: 20px; border-left: 4px solid var(--border-color); padding-left: 24px; margin-left: 10px; }
.timeline-item { position: relative; background-color: var(--card-bg); border: 4px solid var(--border-color); padding: 20px; border-radius: 20px; box-shadow: var(--shadow); }
.timeline-item::before { content: ''; position: absolute; left: -36px; top: 24px; width: 16px; height: 16px; background-color: var(--nintendo-blue); border: 4px solid var(--border-color); border-radius: 50%; }
.timeline-meta { font-size: 12px; font-weight: 900; color: var(--nintendo-red); text-transform: uppercase; margin-bottom: 4px; }
.timeline-heading { font-size: 18px; font-weight: 800; margin: 0 0 8px 0; }
.timeline-body { font-size: 14px; line-height: 1.5; color: var(--text-muted); margin: 0; }

.accessory-name { font-size: 18px; font-weight: 800; margin: 0 0 10px 0; color: var(--nintendo-blue); }
.accessory-desc { font-size: 14px; line-height: 1.5; color: var(--text-muted); margin: 0; }

.wishlist-container { max-width: 500px; }
.nintendo-form { display: flex; gap: 12px; margin-bottom: 24px; }
.form-group { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.form-group input { padding: 12px; border: 4px solid var(--border-color); border-radius: 12px; font-weight: 700; background-color: var(--card-bg); color: var(--text-main); }
.submit-btn { align-self: flex-end; padding: 12px 20px; background-color: var(--nintendo-red); color: white; border: 4px solid var(--border-color); border-radius: 12px; font-weight: 800; box-shadow: 0 4px 0 var(--border-color); cursor: pointer; height: 46px; }
.submit-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--border-color); }

.wishlist-output-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.wishlist-output-list li { background: var(--card-bg); padding: 12px 16px; border: 3px solid var(--border-color); border-radius: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.delete-wish-btn { background: none; border: none; color: var(--nintendo-red); font-weight: 900; cursor: pointer; font-size: 16px; }
.empty-notice { color: var(--text-muted); font-style: italic; border-style: dashed !important; justify-content: center !important; }

/* Sidebar Control Layouts */
.console-info { background-color: var(--panel-bg); border: 4px solid var(--border-color); border-radius: 32px; padding: 24px; max-height: 92vh; position: sticky; top: 4vh; box-sizing: border-box; overflow-y: auto; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.sidebar-title { font-size: 22px; font-weight: 900; text-transform: uppercase; margin: 0 0 20px 0; text-align: center; }

.user-avatar-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #1a1a1a 0%, #333 100%); border: 4px solid var(--border-color); border-radius: 20px; padding: 16px; color: white; }
.avatar-ring { width: 44px; height: 44px; background-color: var(--nintendo-red); border: 3px solid white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: 900; font-size: 20px; }
.profile-username { margin: 0 0 4px 0; font-size: 16px; font-weight: 800; }
.friend-code { font-family: monospace; font-size: 11px; color: #aaa; }

.live-status-panel { background: var(--card-bg); border: 4px solid var(--border-color); border-radius: 12px; padding: 10px; margin: 20px 0 16px 0; font-weight: 700; font-size: 13px; }
.status-indicator { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pulse-dot { width: 10px; height: 10px; background-color: #39d353; border-radius: 50%; animation: pulse 1.8s infinite; }

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 211, 83, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(57, 211, 83, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 211, 83, 0); }
}

.description { font-size: 14px; line-height: 1.6; margin: 0; padding: 0 4px; text-align: left; }
.description strong { color: var(--nintendo-red); font-weight: 800; }

@media (max-width: 992px) { .app-container { grid-template-columns: 1fr; } .console-info { position: relative; top: 0; max-height: none; } }
