/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b27;
  --bg-card: #1a2035;
  --bg-card-hover: #1f2740;
  --border: #242f4a;
  --green: #4ade80;
  --green-dark: #22c55e;
  --green-glow: rgba(74, 222, 128, 0.18);
  --text-primary: #f0f4ff;
  --text-secondary: #8b97b8;
  --text-muted: #4f5c7a;
  --ongeki: #f050b0;
  --ongeki-dark: #d4409a;
  --ongeki-glow: rgba(240, 80, 176, 0.2);
  --chunithm: #f5c200;
  --chunithm-dark: #d4a800;
  --chunithm-glow: rgba(245, 194, 0, 0.2);
  --maimai: #3b7fff;
  --maimai-dark: #2563eb;
  --maimai-glow: rgba(59, 127, 255, 0.22);
}

body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2.5rem;
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--green);
  text-transform: uppercase;
  margin-right: auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  transition:
    color 0.2s,
    background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
  color: var(--green);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ===== GAME CARD ===== */
.game-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  background-color: var(--bg-card-hover);
}

.card-accent {
  height: 4px;
  width: 100%;
}

.ongeki-accent {
  background: var(--ongeki);
}
.chunithm-accent {
  background: var(--chunithm);
}
.maimai-accent {
  background: var(--maimai);
}

.card-inner {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* ===== CARD HEADER ===== */
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.game-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.ongeki-icon {
  background: rgba(240, 80, 176, 0.12);
  color: var(--ongeki);
}
.chunithm-icon {
  background: rgba(245, 194, 0, 0.12);
  color: var(--chunithm);
}
.maimai-icon {
  background: rgba(59, 127, 255, 0.14);
  color: var(--maimai);
}

.game-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.game-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.game-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  width: fit-content;
}

/* ===== GAME BADGES ===== */
.game-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.version-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.ongeki-badge {
  background: rgba(240, 80, 176, 0.14);
  color: var(--ongeki);
}
.chunithm-badge {
  background: rgba(245, 194, 0, 0.14);
  color: var(--chunithm);
}
.maimai-badge {
  background: rgba(59, 127, 255, 0.18);
  color: var(--maimai);
}

/* ===== FILE SECTIONS ===== */
.file-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* keep Base sections the same height across cards (tallest = 2 files) */
.card-inner > .file-section:nth-child(2) {
  min-height: 100px;
}

.file-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.5rem 0.75rem;
  transition: background 0.15s;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.file-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.file-item span {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.76rem;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.3;
}

.file-item.app svg {
  color: #818cf8;
}
.file-item.opt svg {
  color: #fb923c;
}

/* ===== DOWNLOAD BUTTON ===== */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.8rem 1.5rem;
  border-radius: 9px;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  letter-spacing: 0.3px;
  margin-top: auto;
}

.download-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.ongeki-btn {
  background-color: var(--ongeki);
  color: #fff;
}

.ongeki-btn:hover {
  background-color: var(--ongeki-dark);
  box-shadow: 0 0 22px var(--ongeki-glow);
  transform: translateY(-1px);
}

.chunithm-btn {
  background-color: var(--chunithm);
  color: #0d1117;
}

.chunithm-btn:hover {
  background-color: var(--chunithm-dark);
  box-shadow: 0 0 22px var(--chunithm-glow);
  transform: translateY(-1px);
}

.maimai-btn {
  background-color: var(--maimai);
  color: #fff;
}

.maimai-btn:hover {
  background-color: var(--maimai-dark);
  box-shadow: 0 0 22px var(--maimai-glow);
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(0);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #1a2035;
  border: 1px solid #2d3a56;
  border-radius: 18px;
  padding: 2.25rem 2rem 1.75rem;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  transform: scale(0.88) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.modal-overlay.is-open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.modal-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4ade80, #16a34a);
  box-shadow:
    0 0 0 12px rgba(74, 222, 128, 0.12),
    0 0 32px rgba(74, 222, 128, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-overlay.is-open .modal-icon {
  animation: iconPop 0.4s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes iconPop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-icon svg {
  width: 36px;
  height: 36px;
  color: #fff;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-game-name {
  color: var(--green);
  font-weight: 700;
}

.modal-continue {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.25rem;
}

.modal-continue:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .navbar {
    padding: 0 1.25rem;
  }

  .main-content {
    padding: 2rem 1.25rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}
