/* ==========================================================================
   1001 VIDEO GAMES YOU MUST PLAY BEFORE YOU DIE - DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-dark: #07090e;
  --bg-card: rgba(16, 22, 34, 0.85);
  --bg-card-hover: rgba(23, 31, 48, 0.95);
  --bg-surface: #0e131f;
  --bg-elevated: #161e30;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.25);
  --border-hover: rgba(255, 255, 255, 0.2);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Colors */
  --neon-cyan: #00f0ff;
  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --neon-blue: #38bdf8;
  --gold: #fbbf24;

  /* Status Tokens */
  --status-playing: #38bdf8;
  --status-playing-bg: rgba(56, 189, 248, 0.12);
  --status-playing-border: rgba(56, 189, 248, 0.35);

  --status-completed: #10b981;
  --status-completed-bg: rgba(16, 185, 129, 0.12);
  --status-completed-border: rgba(16, 185, 129, 0.35);

  --status-quit: #f43f5e;
  --status-quit-bg: rgba(244, 63, 94, 0.12);
  --status-quit-border: rgba(244, 63, 94, 0.35);

  --status-backlog: #f59e0b;
  --status-backlog-bg: rgba(245, 158, 11, 0.12);
  --status-backlog-border: rgba(245, 158, 11, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-neon: 0 0 25px rgba(0, 240, 255, 0.25);
  --shadow-purple: 0 0 25px rgba(168, 85, 247, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric Background Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(140px);
  opacity: 0.35;
}

.bg-glow-1 {
  top: -150px;
  left: 10%;
  width: 600px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, transparent 70%);
}

.bg-glow-2 {
  top: 100px;
  right: -100px;
  width: 700px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.35) 0%, transparent 70%);
}

.bg-glow-3 {
  bottom: 50px;
  left: 20%;
  width: 800px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
}

/* Typography Helpers */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 50%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   HEADER & HERO
   ========================================================================== */
.app-header {
  position: relative;
  z-index: 10;
  padding: 2.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(13, 17, 26, 0.8) 0%, rgba(7, 9, 14, 0.95) 100%);
  backdrop-filter: blur(20px);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.header-brand {
  max-width: 700px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  user-select: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.825rem;
}

.btn-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #3b82f6 50%, #8b5cf6 100%);
  color: #07090e;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.btn-glow:hover::after {
  opacity: 1;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-danger:hover {
  background: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.2rem 0.4rem;
}

.btn-text-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   PROGRESS DASHBOARD
   ========================================================================== */
.dashboard-banner {
  max-width: 1400px;
  margin: 1.75rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.dashboard-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.progress-box {
  flex: 1;
  min-width: 320px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.progress-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.progress-percent {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff 0%, #10b981 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.progress-counts {
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.35rem;
}

.stat-pills {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.stat-pill:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill-label {
  color: var(--text-muted);
  font-weight: 500;
}

.pill-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.pill-playing .pill-dot { background-color: var(--status-playing); box-shadow: 0 0 8px var(--status-playing); }
.pill-completed .pill-dot { background-color: var(--status-completed); box-shadow: 0 0 8px var(--status-completed); }
.pill-quit .pill-dot { background-color: var(--status-quit); box-shadow: 0 0 8px var(--status-quit); }
.pill-backlog .pill-dot { background-color: var(--status-backlog); box-shadow: 0 0 8px var(--status-backlog); }
.pill-rated .pill-dot { background-color: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ==========================================================================
   MAIN CONTENT & FILTER CONTROLS
   ========================================================================== */
.app-main {
  position: relative;
  z-index: 5;
  padding: 1.75rem 1.5rem 4rem;
}

.main-container {
  max-width: 1400px;
  margin: 0 auto;
}

.controls-panel {
  background: rgba(16, 22, 34, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.controls-row-top {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  font-size: 1rem;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
}

#search-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  background: var(--bg-elevated);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
}

.clear-btn:hover {
  color: var(--text-main);
}

.select-group {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.select-wrapper label {
  font-size: 0.725rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  padding-left: 0.2rem;
}

.select-wrapper select {
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: var(--font-main);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem;
  transition: all var(--transition-fast);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--neon-cyan);
}

.controls-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 1rem;
}

.results-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.results-badge {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-btn {
  padding: 0.4rem 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.view-btn.active {
  background: var(--bg-elevated);
  color: var(--neon-cyan);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   GAMES GRID & CARD PRESENTATION
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Status-specific card borders */
.game-card.status-playing {
  border-color: var(--status-playing-border);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.game-card.status-completed {
  border-color: var(--status-completed-border);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.game-card.status-quit {
  border-color: var(--status-quit-border);
  opacity: 0.8;
}

.game-card.status-backlog {
  border-color: var(--status-backlog-border);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rank-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.card-top-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.card-title a:hover {
  color: var(--neon-cyan);
}

/* Card Badges (Platform, Genre) */
.card-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.badge-platform {
  font-size: 0.725rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-genre {
  font-size: 0.725rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

/* Card Interactive Footer (Status, Rating, Note) */
.card-actions-bar {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.status-button-row {
  display: flex;
  gap: 0.35rem;
  width: 100%;
}

.status-btn {
  flex: 1;
  padding: 0.35rem 0.2rem;
  font-size: 0.725rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.status-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.status-btn.active.status-playing {
  background: var(--status-playing-bg);
  border-color: var(--status-playing);
  color: var(--status-playing);
  font-weight: 700;
}

.status-btn.active.status-completed {
  background: var(--status-completed-bg);
  border-color: var(--status-completed);
  color: var(--status-completed);
  font-weight: 700;
}

.status-btn.active.status-quit {
  background: var(--status-quit-bg);
  border-color: var(--status-quit);
  color: var(--status-quit);
  font-weight: 700;
}

.status-btn.active.status-backlog {
  background: var(--status-backlog-bg);
  border-color: var(--status-backlog);
  color: var(--status-backlog);
  font-weight: 700;
}

.rating-and-notes-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Interactive Star Rating */
.star-rating {
  display: inline-flex;
  gap: 2px;
}

.star-rating .star {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

.star-rating .star:hover {
  transform: scale(1.25);
}

.star-rating .star.filled {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.note-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.note-btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.note-btn.has-note {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
}

/* ==========================================================================
   COMPACT LIST VIEW STYLES
   ========================================================================== */
.games-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.games-grid.list-view .game-card {
  padding: 0.75rem 1rem;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
}

.games-grid.list-view .card-header {
  margin: 0;
  min-width: 90px;
}

.games-grid.list-view .card-main-col {
  flex: 1;
  min-width: 200px;
}

.games-grid.list-view .card-title {
  font-size: 1rem;
  margin: 0;
}

.games-grid.list-view .card-meta-tags {
  margin: 0.2rem 0 0;
}

.games-grid.list-view .card-desc {
  display: none;
}

.games-grid.list-view .card-actions-bar {
  margin: 0;
  padding: 0;
  border: none;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.games-grid.list-view .status-button-row {
  width: auto;
}

/* ==========================================================================
   PAGINATION BAR
   ========================================================================== */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-num-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-num-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.page-num-btn.active {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.page-ellipsis {
  padding: 0 0.3rem;
  color: var(--text-dim);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

/* ==========================================================================
   MODAL WINDOWS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #0d121c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 240, 255, 0.15);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  transform: rotate(90deg);
}

/* Random Modal Special Styling */
.modal-random {
  max-width: 580px;
  border-color: rgba(0, 240, 255, 0.4);
}

.random-modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
}

.random-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--neon-cyan);
  display: block;
  margin-bottom: 0.4rem;
}

.random-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.random-roulette {
  padding: 3rem 2rem;
  text-align: center;
}

.roulette-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner-icon {
  font-size: 2.5rem;
  animation: pulseSpin 0.6s infinite alternate ease-in-out;
}

@keyframes pulseSpin {
  from { transform: scale(0.9) rotate(-10deg); color: var(--neon-cyan); }
  to { transform: scale(1.2) rotate(10deg); color: var(--neon-purple); }
}

.roulette-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-main);
  min-height: 2rem;
}

.random-result-box {
  padding: 0 2rem 1.5rem;
}

.random-modal-footer {
  padding: 1.25rem 2rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Note Modal */
.note-modal-header {
  padding: 2rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.note-modal-rank {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 0.25rem;
}

.note-modal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.note-modal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.note-modal-body {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.status-btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-toggle-btn {
  padding: 0.5rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-toggle-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.status-toggle-btn.active[data-status="playing"] {
  background: var(--status-playing-bg);
  border-color: var(--status-playing);
  color: var(--status-playing);
}

.status-toggle-btn.active[data-status="completed"] {
  background: var(--status-completed-bg);
  border-color: var(--status-completed);
  color: var(--status-completed);
}

.status-toggle-btn.active[data-status="quit"] {
  background: var(--status-quit-bg);
  border-color: var(--status-quit);
  color: var(--status-quit);
}

.status-toggle-btn.active[data-status="backlog"] {
  background: var(--status-backlog-bg);
  border-color: var(--status-backlog);
  color: var(--status-backlog);
}

.modal-star-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-star-rating .star-btn {
  font-size: 1.75rem;
  color: rgba(255, 255, 255, 0.15);
  background: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.modal-star-rating .star-btn:hover {
  transform: scale(1.2);
}

.modal-star-rating .star-btn.filled {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.clear-rating-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.775rem;
  cursor: pointer;
  margin-left: 0.5rem;
  text-decoration: underline;
}

.clear-rating-btn:hover {
  color: var(--text-muted);
}

#note-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

#note-textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.game-synopsis-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.synopsis-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}

.synopsis-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.65rem;
}

.wiki-link {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.wiki-link:hover {
  text-decoration: underline;
}

.note-modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-indicator {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--status-completed);
}

/* Backup Modal */
.modal-backup {
  max-width: 650px;
}

.backup-modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.backup-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.25rem 0 0.5rem;
}

.backup-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.backup-sections {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.backup-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  align-items: flex-start;
}

.backup-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.backup-card-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.backup-card-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.file-label {
  cursor: pointer;
}

.import-status-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.import-status-msg.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.import-status-msg.error {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.card-danger {
  border-color: rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.04);
}

/* Stats Modal */
.modal-stats {
  max-width: 650px;
}

.stats-modal-header {
  padding: 2rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.stats-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.stats-grid {
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-card-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--neon-cyan);
  display: block;
}

.stat-card-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  display: block;
}

.breakdown-section {
  padding: 0 2rem 2rem;
}

.breakdown-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.decade-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.decade-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.decade-name {
  width: 70px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.decade-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.decade-bar-val {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.decade-count {
  width: 60px;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.775rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  padding: 0.85rem 1.25rem;
  background: #161e30;
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s forwards 3s;
}

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

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .brand-title {
    font-size: 2.2rem;
  }
  .controls-row-top {
    flex-direction: column;
    align-items: stretch;
  }
  .select-group {
    width: 100%;
  }
  .select-wrapper {
    flex: 1;
    min-width: 130px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 1.5rem 1rem 1rem;
  }
  .brand-title {
    font-size: 1.85rem;
  }
  .brand-sub {
    font-size: 1rem;
  }
  .header-actions {
    width: 100%;
  }
  .header-actions .btn {
    flex: 1;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    padding: 1rem;
  }
  .note-modal-header,
  .note-modal-body,
  .note-modal-footer,
  .backup-modal-header,
  .backup-sections,
  .random-modal-header,
  .random-result-box,
  .random-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
