/* === Font Fallback === */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* === Reset & Variables === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f5f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --border-color: #e2e4e9;
  --text-primary: #1a1f2e;
  --text-secondary: #5a6170;
  --text-muted: #8b919e;
  --accent-blue: #3b82f6;
  --accent-blue-dim: #2563eb;
  --accent-amber: #f59e0b;
  --accent-amber-bright: #fbbf24;
  --accent-green: #22c55e;
  --bar-bg: #e2e4e9;
  --max-width: 1120px;
}

/* === Base === */
body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* === Header === */
header {
  border-bottom: 1px solid #1a2a42;
  background: #0E1A2B;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 40px;
}

.logo { flex-shrink: 0; }
.logo img { height: 38px; display: block; }

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

nav a {
  color: #9FB0C6;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  position: relative;
}

nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

nav a.active { color: #ffffff; }

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: #2F6FED;
  border-radius: 1px;
}

/* === Social === */
.header-social {
  margin-left: auto;
  color: #9FB0C6;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.header-social:hover { color: #ffffff; }

/* === Search === */
.search-box {
  position: relative;
  flex-shrink: 0;
}

.search-box input {
  background: #142235;
  border: 1px solid #1a2a42;
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  color: #C7D2E2;
  font-size: 14px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s, width 0.2s;
  font-family: inherit;
}

.search-box input::placeholder { color: #5c6f87; }
.search-box input:focus { border-color: #2F6FED; width: 240px; }

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5c6f87;
  font-size: 14px;
  pointer-events: none;
}

/* === Ad Slots === */
.ad-leaderboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
}

.ad-slot {
  width: 728px;
  height: 90px;
  max-width: 100%;
  margin: 0 auto;
  border: 1px dashed #e2e4e9;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  background: #edeef1;
}

.ad-slot::before,
.ad-slot::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.ad-slot::before {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 14px,
    #e2e4e9 14px,
    #e2e4e9 15px
  );
  opacity: 0.4;
}

.ad-slot::after {
  display: flex;
  align-items: center;
  justify-content: center;
  content: 'AD';
  font-size: 11px;
  letter-spacing: 2px;
  color: #8b919e;
  opacity: 0.5;
}

/* === Breadcrumbs === */
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs a { color: var(--accent-blue); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--text-muted); }
.breadcrumbs .current { color: var(--text-secondary); }

/* === Footer === */
.site-footer {
  border-top: 1px solid #1a2a42;
  padding: 32px 24px;
  background: #0E1A2B;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-col {
  flex: 1;
}

.footer-col--copyright {
  color: #9FB0C6;
  font-size: 13px;
}

.footer-col--copyright a {
  color: #9FB0C6;
}

.footer-col--igdb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #9FB0C6;
  font-size: 11px;
}

.footer-col--igdb img {
  height: 18px;
  opacity: 0.5;
}

.footer-col--links {
  font-size: 13px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.footer-col--links a {
  color: #9FB0C6;
  text-decoration: none;
  transition: color 0.15s;
}

/* === Score Circle === */
@property --arc-end {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: true;
}

.score-hover-wrap {
  position: relative;
  display: inline-flex;
}

.score-hover-wrap::before {
  content: '';
  position: absolute;
  top: -5px; left: -5px; right: -5px; bottom: -5px;
  border-radius: 50%;
  background: conic-gradient(from var(--arc-start), var(--color-lo) 0deg, var(--color-hi) var(--arc-span));
  --arc-end: 0deg;
  -webkit-mask-image:
    radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)),
    conic-gradient(from var(--arc-start), #000 0deg, #000 var(--arc-end), transparent var(--arc-end));
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)),
    conic-gradient(from var(--arc-start), #000 0deg, #000 var(--arc-end), transparent var(--arc-end));
  mask-composite: intersect;
  transition: --arc-end 0.6s ease-out;
  pointer-events: none;
}

.score-hover-wrap:hover::before { --arc-end: var(--arc-span); }

.sc-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.sc-sm { width: 44px; height: 44px; font-size: 16px; }
.sc-md { width: 56px; height: 56px; font-size: 22px; }
.sc-lg { width: 72px; height: 72px; font-size: 28px; }

.score-avg { transition: opacity 0.25s ease; }
.score-hover-wrap:hover .score-avg { opacity: 0; }

.score-split {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.score-hover-wrap:hover .score-split { opacity: 1; }

.score-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  gap: 2px;
}

.score-half-arrow { font-size: 10px; line-height: 1; opacity: 0.8; }
.score-half-num { font-size: 18px; font-weight: 800; line-height: 1; white-space: nowrap; }
.score-half-lo { border-right: 1px solid rgba(255, 255, 255, 0.25); }

.sc-sm .score-half-arrow { font-size: 6px; }
.sc-sm .score-half-num { font-size: 11px; }
.sc-sm .score-half { gap: 1px; }

.sc-md .score-half-arrow { font-size: 8px; }
.sc-md .score-half-num { font-size: 14px; }
.sc-md .score-half { gap: 1px; }

.sc-bg-90 { background: #2e8b57; }
.sc-bg-80 { background: #3da66a; }
.sc-bg-70 { background: #6ab04c; }
.sc-bg-60 { background: #b8a038; }
.sc-bg-50 { background: #d4911e; }
.sc-bg-40 { background: #d4691e; }
.sc-bg-30 { background: #c94444; }
.sc-bg-muted { background: #c4c7ce; }

/* === Page Container (shared across public pages) === */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* === Hamburger Toggle === */
.nav-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: #9FB0C6;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* === Responsive === */
@media (max-width: 960px) {
  .header-inner { gap: 20px; }
  .search-box input { width: 170px; }
  .search-box input:focus { width: 200px; }
  .page-container { padding: 20px; }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  #main-nav {
    display: none;
    order: 10;
    width: 100%;
    flex-direction: column;
    flex: none;
    gap: 0;
    padding: 10px 0 4px;
    border-top: 1px solid #1a2a42;
    margin-top: 4px;
  }
  #main-nav.open {
    display: flex;
  }
  #main-nav a {
    padding: 12px 14px;
    font-size: 15px;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: #9FB0C6;
  }
  #main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
  }
  #main-nav a.active { color: #fff; }
  #main-nav a.active::after { display: none; }
  .search-box { flex: 1; min-width: 0; margin-left: 0; }
  .search-box input { width: 100%; }
  .search-box input:focus { width: 100%; }
  .page-container { padding: 16px; }
  .ad-slot { width: 100%; height: auto; min-height: 60px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-col--links { justify-content: center; }
  .breadcrumbs { font-size: 12px; padding: 10px 16px 0; }
}

@media (max-width: 480px) {
  .header-inner { padding: 10px 12px; gap: 8px; }
  .page-container { padding: 12px; }
  .breadcrumbs { font-size: 11px; padding: 8px 12px 0; }
  .ad-leaderboard { padding: 10px 12px; }
}

/* === 404 Page === */
.not-found {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.not-found h1 {
  font-size: 48px;
  font-weight: 800;
  color: #0d1117;
  margin-bottom: 12px;
}
.not-found p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.not-found a {
  color: var(--accent-blue);
  font-weight: 600;
}

/* === Legal Pages (Privacy, Terms) === */
.legal-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.legal-heading {
  font-size: 28px;
  font-weight: 800;
  color: #0d1117;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.legal-effective {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d8dae0;
}

.legal-intro {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.legal-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.legal-section ul li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 18px;
  position: relative;
}

.legal-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.legal-section a {
  color: var(--accent-blue);
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

.legal-contact {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}
