:root {
  --bg: #07131e;
  --surface: #0d2031;
  --surface-alt: #132c42;
  --border: #1f4564;
  --text: #e6f4fa;
  --text-muted: #9ec4d8;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --gold: #fbbf24;
  --danger: #fb7185;
  --radius: 14px;
  --shell: 1060px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(960px 440px at 85% -8%, rgba(34, 211, 238, 0.14), transparent 65%),
    radial-gradient(720px 380px at 10% 4%, rgba(52, 211, 153, 0.08), transparent 60%),
    linear-gradient(180deg, #07131e 0%, #040b12 100%);
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #67e8f9;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.65rem 1rem;
  background: var(--cyan);
  color: #04101a;
  font-weight: 800;
  border-radius: 8px;
  z-index: 100;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 19, 30, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.primary-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--cyan);
}

.lang-nav {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
}

.hero-band,
.page-head {
  padding-block: 24px 16px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.42);
}

.badge-gold {
  background: rgba(251, 191, 36, 0.14);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.36);
}

.badge-emerald {
  background: rgba(52, 211, 153, 0.14);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.38);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3.8vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lead {
  margin: 0;
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.page-meta {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 9px 15px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  min-height: 40px;
}

.btn-primary {
  background: var(--cyan);
  color: #04101a;
  border: 1px solid #67e8f9;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.game-stage-wrap {
  padding-bottom: 14px;
}

.reading {
  padding-block: 14px 44px;
}

.reading > h2,
.reading > h3,
.reading > p,
.reading > ul,
.reading > ol,
.reading > blockquote {
  max-width: 72ch;
}

.reading h2 {
  margin: 2rem 0 0.75rem;
  font-size: clamp(1.28rem, 2.4vw, 1.62rem);
  line-height: 1.25;
  color: var(--cyan);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.reading h3 {
  margin: 1.45rem 0 0.5rem;
  font-size: 1.12rem;
  color: var(--gold);
}

.reading p,
.reading li {
  color: #d6ebf5;
}

.reading ul,
.reading ol {
  padding-left: 1.35rem;
}

.reading li + li {
  margin-top: 6px;
}

.reading code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.reading blockquote {
  margin: 1.2rem 0;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.reading table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
  font-size: 0.94rem;
}

.reading th,
.reading td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.reading th {
  background: var(--surface-alt);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reading tr:last-child td {
  border-bottom: 0;
}

.faq-section {
  margin-top: 2.4rem;
  max-width: 72ch;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.faq-answer p {
  margin: 0;
}

.related-strip {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.related-links a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-links a:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.related-links strong {
  color: var(--cyan);
  font-size: 0.96rem;
}

.related-links span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.not-found {
  padding-block: 56px;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #040b12;
  padding-block: 30px 22px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}

.footer-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--text);
}

.footer-note,
.footer-disclaimer {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 44ch;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.9rem;
}

.footer-heading {
  font-weight: 700;
  color: var(--cyan);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-bottom {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: flex-start;
  }
}

.ad-slot {
  margin-block: 14px;
}

.ad-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ad-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
