@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/IBMPlexMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1e1f22;
  --graphite: #18181a;
  --bone: #eae6df;
  --muted: #8a8882;
  --orange: #ff4d1c;
  --lines: #383a40;
  --display: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  transform: translateZ(0);
  will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.menu-shell {
  width: 100%;
  max-width: 1380px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 36px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-header {
  min-height: 84px;
  padding-left: 40px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.logo-img {
  display: block;
  width: 340px;
  max-width: 64vw;
  height: auto;
  object-fit: contain;
}

.version {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 6px;
  white-space: nowrap;
}

.menu-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 28px;
  min-height: 460px;
}

.left-col {
  width: 430px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.menu-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 48px;
  text-align: left;
  outline: none;
}

.btn-base,
.btn-mask-text {
  position: absolute;
  inset: 0;
  padding-left: 60px;
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.btn-base {
  color: var(--bone);
}

.btn-mask {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: var(--orange);
  overflow: hidden;
  transition: width 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-mask-text {
  width: 430px;
  color: var(--graphite);
}

.menu-btn:hover .btn-mask,
.menu-btn:focus-visible .btn-mask,
.menu-btn.is-active .btn-mask {
  width: 100%;
  transition-duration: 0.16s;
}

.right-panel {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  background: var(--lines);
}

.corner.tl { top: 0; left: 0; }
.corner.tl::before { top: 0; left: 0; width: 44px; height: 2px; }
.corner.tl::after { top: 0; left: 0; width: 2px; height: 44px; }

.corner.tr { top: 0; right: 0; }
.corner.tr::before { top: 0; right: 0; width: 44px; height: 2px; }
.corner.tr::after { top: 0; right: 0; width: 2px; height: 44px; }

.corner.bl { bottom: 0; left: 0; }
.corner.bl::before { bottom: 0; left: 0; width: 44px; height: 2px; }
.corner.bl::after { bottom: 0; left: 0; width: 2px; height: 44px; }

.corner.br { bottom: 0; right: 0; }
.corner.br::before { bottom: 0; right: 0; width: 44px; height: 2px; }
.corner.br::after { bottom: 0; right: 0; width: 2px; height: 44px; }

.preview-inner {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.preview-header {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rule {
  width: 100%;
  height: 1px;
  background: var(--lines);
  flex-shrink: 0;
}

.states {
  position: relative;
  flex: 1;
  display: flex;
}

.state {
  display: none;
  flex-direction: column;
  flex: 1;
  gap: 14px;
}

.state.active {
  display: flex;
  animation: panel-in 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.graphic-wrap {
  flex: 1;
  min-height: 260px;
  position: relative;
}

#overview-graphic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-col.right {
  text-align: right;
}

.lbl {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.val {
  font-size: 15px;
  font-weight: 600;
  color: var(--bone);
}

.val.accent {
  color: var(--orange);
}

.state-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.big-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  color: var(--bone);
}

.desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 54ch;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.kv-k {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.kv-v {
  font-size: 14px;
  font-weight: 600;
  color: var(--bone);
  text-align: right;
}

.spacer {
  flex: 1;
}

.steam-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.steam-cta {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  background: var(--orange);
  border: 1px solid var(--orange);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.steam-cta:hover {
  background: #ff6236;
  border-color: var(--bone);
}

.hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.menu-footer {
  min-height: 36px;
  padding-left: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.key-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.keycap {
  padding: 4px 8px;
  border: 1px solid var(--lines);
  font-size: 12px;
  font-weight: 600;
  color: var(--bone);
  line-height: 1;
}

.key-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}

.copyright {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.12s ease;
}

.footer-link:hover,
.footer-link:focus-visible,
.footer-link.is-current {
  color: var(--orange);
  outline: none;
}

.footer-sep {
  font-size: 11px;
  color: var(--lines);
  user-select: none;
}

.legal-shell {
  padding: 20px 36px 28px 36px;
}

.legal-header {
  padding-left: 0;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

.legal-top-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.legal-nav-link {
  padding: 7px 14px;
  border: 1px solid var(--lines);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.legal-nav-link:hover,
.legal-nav-link:focus-visible {
  color: var(--bone);
  border-color: var(--orange);
  outline: none;
}

.legal-nav-link.is-current {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--graphite);
  font-weight: 700;
}

.legal-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding-top: 8px;
}

.legal-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--orange);
}

.legal-toc {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--lines);
}

.legal-toc a {
  padding: 7px 0 7px 14px;
  font-size: 11px;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.legal-toc a:hover,
.legal-toc a:focus-visible,
.legal-toc a.is-active {
  color: var(--bone);
  border-left-color: var(--orange);
  outline: none;
}

.legal-toc a.is-active {
  font-weight: 600;
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(56, 58, 64, 0.45);
  z-index: 120;
  pointer-events: none;
}

.read-progress-fill {
  width: 100%;
  height: 100%;
  background: var(--orange);
  transform-origin: left center;
  transform: scaleX(0);
}

.legal-top-btn {
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid var(--lines);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.legal-top-btn:hover,
.legal-top-btn:focus-visible {
  color: var(--bone);
  border-color: var(--orange);
  outline: none;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.game-modal[hidden] {
  display: none !important;
}

.game-modal-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.game-modal.is-open .game-modal-dim {
  opacity: 1;
}

.game-modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border: 1px solid var(--lines);
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.16s cubic-bezier(0.22, 1, 0.36, 1), transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-modal.is-open .game-modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.game-modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
}

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-modal-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--orange);
}

.game-modal-esc {
  font-size: 10px;
  color: var(--muted);
}

.game-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-modal-title {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--bone);
}

.game-modal-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: #cfcbc4;
}

.game-modal-kv {
  margin-top: 4px;
  gap: 9px;
}

.game-modal-kv .kv-v {
  font-size: 12px;
}

.kv-v.accent {
  color: var(--orange);
}

.game-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn-secondary {
  padding: 11px 18px;
  border: 1px solid var(--lines);
  background: rgba(24, 24, 26, 0.65);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.modal-btn-secondary:hover,
.modal-btn-secondary:focus-visible {
  border-color: var(--orange);
  background: rgba(255, 77, 28, 0.12);
  outline: none;
}

.legal-panel {
  flex: 1;
  min-width: 0;
}

.legal-inner {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.legal-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-date {
  font-size: 11px;
  color: var(--muted);
}

.legal-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--bone);
  max-width: 74ch;
}

.legal-callout {
  background: rgba(24, 24, 26, 0.72);
  border: 1px solid var(--lines);
  border-left: 2px solid var(--orange);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-callout-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--orange);
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 24px;
}

.legal-section h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--bone);
}

.sec-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  margin-right: 4px;
}

.legal-section p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: #cfcbc4;
  max-width: 78ch;
}

.legal-section strong {
  color: var(--bone);
  font-weight: 600;
}

.legal-section code {
  padding: 1px 5px;
  background: var(--graphite);
  border: 1px solid var(--lines);
  color: var(--bone);
  font-size: 11.5px;
}

.legal-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #cfcbc4;
  max-width: 78ch;
}

.legal-list li::marker {
  color: var(--orange);
}

.inline-link {
  color: var(--orange);
  border-bottom: 1px solid rgba(255, 77, 28, 0.45);
  transition: border-color 0.12s ease, color 0.12s ease;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: var(--bone);
  border-bottom-color: var(--bone);
  outline: none;
}

.legal-page .menu-footer {
  padding-left: 0;
}

@media (max-width: 900px) {
  .legal-shell {
    padding: 16px 20px 24px 20px;
  }

  .legal-top-nav {
    margin-left: 0;
    width: 100%;
  }

  .legal-body {
    flex-direction: column;
    gap: 18px;
  }

  .legal-sidebar {
    width: 100%;
    position: static;
  }

  .legal-toc {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    gap: 6px;
  }

  .legal-toc a {
    padding: 5px 10px;
    border: 1px solid var(--lines);
    margin-left: 0;
    font-size: 10px;
  }

  .legal-inner {
    padding: 20px 18px;
  }

  .menu-shell {
    padding: 16px 20px 20px 20px;
  }

  .menu-header {
    padding-left: 0;
    flex-wrap: wrap;
    min-height: auto;
  }

  .menu-body {
    flex-direction: column;
    gap: 20px;
  }

  .left-col {
    width: 100%;
    padding-top: 0;
  }

  .btn-base,
  .btn-mask-text {
    padding-left: 16px;
    font-size: 24px;
  }

  .btn-mask-text {
    width: 100vw;
  }

  .right-panel {
    min-height: 360px;
  }

  .kv-row {
    flex-direction: column;
    gap: 2px;
  }

  .kv-v {
    text-align: left;
  }

  .summary-row {
    flex-direction: column;
    gap: 12px;
  }

  .summary-col.right {
    text-align: left;
  }

  .menu-footer {
    padding-left: 0;
    flex-wrap: wrap;
  }
}
