/* ================= CSS VARIABLES & THEMES ================= */
:root {
  --accent: #e63946;
  --accent-glow: rgba(230, 57, 70, 0.22);
  --accent-text: #ffffff;
}

[data-theme="dark"] {
  --bg-main: #0e1014;
  --bg-surface: #15181e;
  --bg-card: #1c2028;
  --bg-card-hover: #242934;
  --border: #282e3a;
  --text-main: #f3f4f6;
  --text-muted: #9aa1b0;
  --canvas-grid: #282e3a;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --tooltip-bg: #1f242d;
}

[data-theme="light"] {
  --bg-main: #f5f6f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f6;
  --border: #e2e5eb;
  --text-main: #191c21;
  --text-muted: #697386;
  --canvas-grid: #e2e5eb;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --tooltip-bg: #2d3340;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.avatar-mini img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}

.nav-btn.active {
  color: var(--accent);
  background-color: var(--accent-glow);
  font-weight: 600;
}

/* Theme Controls */
.theme-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-picker-group {
  display: flex;
  gap: 0.4rem;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border);
  transition: transform 0.15s;
}

.color-dot:hover {
  transform: scale(1.2);
}

.theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container */
.content-container {
  max-width: 1080px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  min-height: 80vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.page-top-bar {
  margin-bottom: 1.5rem;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(-3px);
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.page-header p {
  color: var(--text-muted);
}

/* Hero Card */
.hero-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

.hero-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.hero-info h1 {
  font-size: 1.9rem;
  margin-bottom: 0.4rem;
}

.hero-tagline {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 1.2rem;
}

.hero-quick-links {
  display: flex;
  gap: 0.8rem;
}

.btn {
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Radar & Stats Overview Grid */
.stats-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.radar-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

#radarChart {
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.canvas-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--tooltip-bg);
  color: #ffffff;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  display: none;
  z-index: 10;
  white-space: nowrap;
  transform: translate(-50%, -120%);
}

.radar-hint {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats Cards */
.stats-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.stat-item-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  background: var(--bg-card);
}

.stat-item-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.rank-badge {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  min-width: 42px;
  text-align: center;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px var(--accent-glow);
  position: relative;
}

.has-tooltip {
  position: relative;
}

.has-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  z-index: 50;
  pointer-events: none;
}

.stat-item-info h4 {
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
}

.stat-tier-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-arrow-btn {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
}

/* Zoomable Images */
.zoomable-img {
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.zoomable-img:hover {
  filter: brightness(1.08);
}

/* Grids */
.games-grid, .showcase-grid, .others-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}

.game-card, .showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card-media {
  position: relative;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-card);
}

.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.card-role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.9rem;
  width: fit-content;
}

.card-link {
  display: inline-block;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem;
  border-radius: 7px;
  transition: all 0.2s;
  cursor: pointer;
}

.card-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Optional Showcase Redirect Button */
.showcase-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
}

.showcase-link-btn:hover {
  background: var(--accent);
  color: var(--accent-text);
}

/* Sub-Keywords Bar */
.sub-keywords-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.keyword-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Socials Page */
.socials-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 650px;
}

.social-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-decoration: none;
  color: var(--text-main);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.social-card:hover {
  border-color: var(--accent);
  transform: translateX(6px);
}

.social-icon {
  font-size: 2rem;
}

.social-details h3 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.social-details p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.social-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* ================= 90% SCREEN LIGHTBOX MODAL ================= */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
}

.lightbox-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.lightbox-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background: rgba(20, 24, 32, 0.85);
  border: 1px solid var(--border);
  color: #ffffff;
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: var(--accent);
  transform: rotate(90deg);
}

/* Image wrapper scales to ~76vh to allow captions underneath within 90% screen */
.lightbox-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 76vh;
}

.lightbox-img-wrapper img {
  max-width: 90vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
  display: block;
}

/* Separate Caption Underneath the Main Image */
.lightbox-caption {
  width: 100%;
  max-width: 850px;
  margin-top: 1.1rem;
  text-align: center;
}

.lightbox-caption h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.lightbox-caption p {
  color: #9aa1b0;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Footer & Disclaimer */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer-disclaimer {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.75;
  font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }
  .hero-card {
    flex-direction: column;
    text-align: center;
  }
  .hero-quick-links {
    justify-content: center;
  }
  .stats-overview-grid {
    grid-template-columns: 1fr;
  }
  .lightbox-close {
    top: -10px;
    right: 5px;
  }
}