:root {
  color-scheme: light;
  --page-bg: #f4f4f5;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --link: #1d4ed8;
  --accent: #16a34a;
  --shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

html.dark {
  color-scheme: dark;
  --page-bg: #020617;
  --surface: #07101f;
  --surface-soft: #0f172a;
  --text: #e5e7eb;
  --muted: #cbd5e1;
  --border: #243044;
  --link: #93c5fd;
  --accent: #4ade80;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 62px;
  padding: .7rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.top-bar-left { display: flex; align-items: center; flex: 0 0 auto; color: var(--text); text-decoration: none; }
.game-logo { width: 34px; height: 34px; margin-right: .55rem; }
.game-title { font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em; }
.top-nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.top-nav a { padding: .45rem .62rem; border-radius: 8px; color: var(--muted); font-size: .93rem; font-weight: 650; text-decoration: none; }
.top-nav a:hover { background: var(--surface-soft); color: var(--text); }
.theme-toggle { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--text); cursor: pointer; font-size: 1.15rem; }
.theme-icon { display: none; }
.light .moon, .dark .sun { display: inline; }

.page {
  width: min(920px, calc(100% - 2rem));
  margin: 1.6rem auto;
  padding: clamp(1.15rem, 3vw, 2.15rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.breadcrumb { margin: 0 0 1rem; color: var(--muted); font-size: .86rem; }
.breadcrumb a { text-decoration: none; }
h1 { margin: .2rem 0 .85rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 2rem 0 .55rem; font-size: clamp(1.3rem, 3vw, 1.55rem); line-height: 1.25; letter-spacing: -.015em; }
h3 { margin: 1.35rem 0 .35rem; font-size: 1.08rem; line-height: 1.35; }
p { margin: .6rem 0; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: .35rem; }
code { padding: .12rem .35rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-soft); }
.article-intro, .intro { max-width: 760px; color: var(--muted); font-size: 1.08rem; }

.answer-box, .tip-box, .cta-box, .related-guides, .article-callout, .tip-grid, .keyword-grid, .live-snapshot, .guide-group {
  margin: 1.45rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.article-callout { border-left: 4px solid var(--accent); }
.answer-box > strong, .tip-box > strong, .cta-box > strong { display: block; margin-bottom: .3rem; }
.cta-button {
  display: inline-block;
  margin: .6rem .35rem 0 0;
  padding: .65rem .95rem;
  border-radius: 9px;
  background: var(--text);
  color: var(--surface) !important;
  font-weight: 750;
  text-decoration: none;
}
.related-guides h2, .guide-group h2 { margin-top: 0; }
.related-guides ul { columns: 2; gap: 2rem; }
.tip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.tip-card { padding: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tip-card h3 { margin-top: 0; }
.keyword-grid dl { display: grid; grid-template-columns: minmax(150px, .45fr) 1fr; gap: .75rem 1rem; margin: 0; }
.keyword-grid dt { font-weight: 800; }
.keyword-grid dd { margin: 0; color: var(--muted); }

details { margin: .75rem 0; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
summary { cursor: pointer; font-weight: 750; }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: 1rem; }
.guide-link { display: block; padding: 1rem; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.guide-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.guide-link strong { display: block; margin-bottom: .25rem; }
.guide-link span { color: var(--muted); font-size: .94rem; }

.live-snapshot h2 { margin-top: 0; }
.snapshot-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1rem 0; }
.snapshot-stat { padding: .75rem; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.snapshot-stat strong { display: block; font-size: 1.25rem; }
.snapshot-stat span { color: var(--muted); font-size: .84rem; }
.leaderboard-scroll { overflow-x: auto; }
.article-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.article-table th, .article-table td { padding: .65rem .55rem; border-bottom: 1px solid var(--border); text-align: left; }
.article-table th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.country-flag { width: 22px; height: 16px; object-fit: cover; vertical-align: middle; }

.site-footer { width: min(920px, calc(100% - 2rem)); margin: 1rem auto 2rem; padding: 1rem; color: var(--muted); text-align: center; font-size: .88rem; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem 1rem; margin-bottom: .6rem; }
.site-footer a { color: inherit; }

@media (max-width: 820px) {
  .top-bar { flex-wrap: wrap; gap: .55rem; }
  .top-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: .2rem; }
  .top-nav a { white-space: nowrap; }
}

@media (max-width: 650px) {
  .page { width: min(100% - 1rem, 920px); margin: .5rem auto 1rem; border-radius: 14px; }
  .guide-grid, .tip-grid, .snapshot-stats { grid-template-columns: 1fr; }
  .related-guides ul { columns: 1; }
  .keyword-grid dl { grid-template-columns: 1fr; }
}

