* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0f0f23;
  color: #fff;
  min-height: 100vh;
}

/* ── Wiki Layout ─────────────────────────────────── */
.wiki-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  background: #12122a;
  border-right: 1px solid #2a2a5e;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid #2a2a5e;
  margin: 0 0.5rem 0.5rem;
  background: #1a1a3e;
  border: 2px solid #2a2a5e;
  border-radius: 10px;
  text-align: center;
}

.sidebar-nav { padding: 0 0.5rem; }

.sidebar-section { margin-bottom: 0.3rem; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-toggle:hover {
  background: rgba(76, 255, 114, 0.08);
  color: #4cff72;
}

.sidebar-toggle .arrow {
  font-size: 0.7rem;
  color: #666;
}

.sidebar-sub {
  padding-left: 0.8rem;
}

.sidebar-sub.hidden { display: none; }

.sidebar-sub a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: #999;
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-sub a:hover {
  background: rgba(76, 255, 114, 0.08);
  color: #4cff72;
}

/* ── Main Content ────────────────────────────────── */
.main-content {
  padding: 2rem 2.5rem;
  max-width: 800px;
}

.main-content h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: #888;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #2a2a5e;
}
.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #4cff72, #40c0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tagline {
  font-size: 1.2rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.hero-desc {
  font-size: 0.9rem;
  color: #888;
  max-width: 500px;
  margin: 0 auto 1.2rem;
  line-height: 1.5;
}
.hero-cta {
  display: inline-block;
  padding: 0.6rem 1.8rem;
  background: linear-gradient(135deg, #4cff72, #2ad060);
  color: #0f0f23;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 30px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(76, 255, 114, 0.3);
}

/* Shortcut buttons */
.shortcuts {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.shortcut-btn {
  padding: 0.4rem 1.2rem;
  background: #1a1a3e;
  border: 1px solid #2a2a5e;
  border-radius: 20px;
  color: #aaa;
  text-decoration: none;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}

.shortcut-btn:hover {
  border-color: #4cff72;
  color: #4cff72;
}

/* Game grid - mosaic */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 0.8rem;
}

.game-card {
  background: #1a1a3e;
  border: 2px solid #2a2a5e;
  border-radius: 16px;
  padding: 1.5rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card.big {
  grid-column: span 2;
  padding: 2rem 1rem;
}

.game-card.playable:hover {
  transform: translateY(-4px);
  border-color: #4cff72;
  box-shadow: 0 0 20px rgba(76, 255, 114, 0.2);
  cursor: pointer;
}

.game-icon { font-size: 2.2rem; }
.game-title { font-size: 0.95rem; font-weight: 600; }
.game-status { font-size: 0.72rem; color: #aaa; }
.game-card.big .game-icon { font-size: 3.2rem; }
.game-card.big .game-title { font-size: 1.15rem; }
.game-card.big .game-status { font-size: 0.8rem; }
.game-card.featured { grid-column: span 2; padding: 2rem 1rem; border-color: #4cff72; background: linear-gradient(135deg, #1a1a3e 60%, #0f2a1a); }
.game-card.featured .game-icon { font-size: 4rem; }
.game-card.featured .game-title { font-size: 1.4rem; }
.game-card.featured .game-status { font-size: 0.85rem; }
.game-card.playable .game-status { color: #4cff72; }

/* Shuffle button */
#refresh-btn { cursor: pointer; font-family: inherit; font-size: 0.85rem; transition: border-color 0.2s, color 0.2s, transform 0.2s; }
#refresh-btn:hover { border-color: #f0c040; color: #f0c040; transform: scale(1.05); }
#refresh-btn:active { transform: scale(0.95); }
.game-grid.grid-fade { opacity: 0; transition: opacity 0.25s; }
.game-grid { transition: opacity 0.25s; }

/* Footer */
.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a5e;
  font-size: 0.8rem;
  color: #555;
}
.page-footer a { color: #666; margin-right: 1rem; text-decoration: none; }
.page-footer a:hover { color: #4cff72; }

/* Mobile sidebar button */
.mobile-sidebar-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a3e;
  border: 2px solid #2a2a5e;
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.mobile-sidebar-btn:hover { border-color: #4cff72; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 700px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 240px;
    z-index: 999;
    transition: left 0.3s;
  }
  .sidebar.open { left: 0; }
  .mobile-sidebar-btn { display: block; }
  .main-content { padding: 1.5rem 1rem; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .game-card.big { grid-column: span 2; }
  .game-card.featured { grid-column: span 2; padding: 1.5rem 1rem; }
  .game-card.featured .game-icon { font-size: 3.2rem; }
}
