:root {
  --blue: #130de9;
  --blue-deep: #0c08b8;
  --blue-soft: #ecebff;
  --blue-mid: #3b36f0;
  --orange: #fc7031;
  --orange-deep: #e55a1a;
  --orange-soft: #fff1ea;
  --white: #ffffff;
  --ink: #12104a;
  --muted: #5b5878;
  --line: #e4e2f5;
  --bg: #f5f4ff;
  --bg-2: #eeedfb;
  --shadow: 0 18px 50px rgba(19, 13, 233, 0.12);
  --shadow-sm: 0 8px 24px rgba(19, 13, 233, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --header: 72px;
  --max: 1180px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 12px);
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: var(--orange);
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--blue);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 1000;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  padding-inline: 16px;
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav {
  z-index: 60;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  min-width: 0;
  white-space: nowrap;
}

.brand span {
  color: var(--blue);
}

.brand img,
.brand svg {
  width: 36px;
  height: 36px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tools {
  display: none;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a.current {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav a:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-drop {
  position: relative;
}

.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-drop-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.nav-drop-btn:hover,
.nav-drop.open .nav-drop-btn,
.nav-drop-btn.current {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 90;
}

.nav-drop.open .nav-drop-menu,
.nav-drop:hover .nav-drop-menu {
  display: block;
}

.nav-drop-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.nav-drop-menu a.current {
  background: var(--blue-soft);
  color: var(--blue);
}

.route-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.place {
  position: relative;
  min-width: 0;
}

.place label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.place input {
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.place input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(19, 13, 233, 0.12);
  outline: none;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 30;
  max-height: 240px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  box-shadow: var(--shadow);
}

.suggest button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
}

.suggest button:hover,
.suggest button[aria-selected="true"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.suggest small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.swap-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--blue);
  margin-bottom: 2px;
}

.swap-btn:hover {
  background: var(--blue-soft);
}

.map-box {
  height: 380px;
  min-height: 280px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-top: 14px;
  overflow: hidden;
  z-index: 1;
  background: #dbe4f0;
  position: relative;
}

.map-fallback {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.compare-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.compare-card b {
  display: block;
  font-size: 1.35rem;
  color: var(--blue);
  letter-spacing: -0.03em;
}

.compare-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field .btn-blue {
  height: 54px;
  width: 100%;
}

.map-box.leaflet-container {
  font-family: inherit;
}

@media (max-width: 760px) {
  .route-pair {
    grid-template-columns: 1fr;
  }

  .swap-btn {
    width: 100%;
    height: 42px;
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .map-box {
    height: 260px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: 0.18s ease;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  padding: 11px 18px;
  box-shadow: 0 8px 20px rgba(252, 112, 49, 0.28);
}

.btn-primary:hover {
  background: var(--orange-deep);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

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

.btn-blue {
  background: var(--blue);
  color: var(--white);
  padding: 14px 22px;
}

.btn-blue:hover {
  background: var(--blue-deep);
  color: var(--white);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  margin: 0 auto;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

/* Hero */
.hero {
  position: relative;
  overflow: visible;
  padding: 28px 0 20px;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(19, 13, 233, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(252, 112, 49, 0.2), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 80%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  max-width: 820px;
  margin: 0 auto 20px;
  text-align: center;
  padding-inline: 4px;
}

.hero-copy h1 {
  margin-top: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

h1 {
  font-size: clamp(1.45rem, 6.2vw, 3.15rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
  margin: 14px 0 0;
  overflow-wrap: anywhere;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
  max-width: none;
  overflow-wrap: anywhere;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
}

/* Calculator */
.tool {
  position: relative;
  padding-bottom: 12px;
  max-width: 100%;
}

.related-tools {
  position: relative;
  margin: 22px 0 8px;
}

.related-tools h2 {
  margin: 0 0 12px;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.related-tool {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
}

.related-tool:hover {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow);
}

.related-tool strong {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.related-tool span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.games-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 8px 0 28px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  min-height: 160px;
}

.game-card:hover {
  border-color: var(--blue);
  color: var(--ink);
  transform: translateY(-2px);
}

.game-card em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
}

.game-card strong {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.game-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

.games-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.tool-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
}

.tool-tabs {
  display: flex;
  gap: 6px;
  padding: 12px;
  overflow-x: auto;
  background: linear-gradient(180deg, #fafaff, #f3f2ff);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tool-tabs button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.tool-tabs button[aria-selected="true"] {
  background: var(--blue);
  color: var(--white);
}

.panel {
  display: none;
  padding: 22px;
}

.panel.active {
  display: block;
}

.seek {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.seek-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 16px;
  padding: 14px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.seek-btn strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.seek-btn span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.seek-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.seek-btn.active strong,
.seek-btn.active span {
  color: var(--white);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field label {
  font-weight: 700;
  font-size: 0.88rem;
}

.field-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.field-row input {
  min-width: 0;
  flex: 1;
}

.field-row select {
  flex: 0 0 auto;
  max-width: 120px;
}

.field input,
.field select {
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(19, 13, 233, 0.12);
  outline: none;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.time-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.presets button,
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.presets button.active,
.chip.active,
.mode-chip.active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange-deep);
}

.result {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--blue) 0%, #3a1ee8 100%);
  color: var(--white);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 10px;
}

.result.idle {
  background: var(--bg-2);
  color: var(--muted);
}

.result.idle .result-value {
  color: var(--muted);
}

.result-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.result-value {
  font-size: clamp(1.7rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--white);
  overflow-wrap: anywhere;
}

.result-value em {
  font-style: normal;
  color: #ffd2bc;
  font-size: 0.48em;
  margin-left: 10px;
  font-weight: 750;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-meta span {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 650;
}

.panel,
.fields,
.seek,
.result,
.formula-bar {
  min-width: 0;
  max-width: 100%;
}

.formula-bar {
  overflow-wrap: anywhere;
}

.triangle-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 8px;
}

.triangle {
  width: 180px;
  height: 150px;
}

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg);
  padding: 5px;
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.subtabs button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}

.subtabs button.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
}

.stat b {
  display: block;
  font-size: 1.15rem;
}

.stat small {
  opacity: 0.8;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

th {
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #fafaff;
}

.steps-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.step-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.step-row button {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
}

.add-step {
  background: var(--orange-soft);
  color: var(--orange-deep);
  border: 1px dashed var(--orange);
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.warn {
  background: var(--orange-soft);
  color: #9a3d12;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Layout after tool */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  padding: 36px 0 80px;
  align-items: start;
  min-width: 0;
}

.content {
  min-width: 0;
  max-width: 100%;
}

.toc {
  position: sticky;
  top: calc(var(--header) + 16px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.toc h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin: 0 0 10px;
}

.toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
}

.toc a:hover,
.toc a.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.content > section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 22px 8px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
}

.content h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  letter-spacing: -0.035em;
  line-height: 1.25;
  margin: 0 0 12px;
  scroll-margin-top: calc(var(--header) + 16px);
}

.content h2:first-child {
  margin-top: 0;
}

.content h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 26px 0 8px;
}

.content p,
.content li {
  color: #2b2958;
}

.content .card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin: 16px 0;
}

.formula {
  display: inline-block;
  font-family: var(--mono);
  background: var(--blue);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.formula.orange {
  background: var(--orange);
}

.olist {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.olist li {
  counter-increment: step;
  position: relative;
  padding: 12px 12px 12px 58px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
}

.olist li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}

.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 8px;
}

.faq summary {
  cursor: pointer;
  font-weight: 750;
  padding: 14px 0;
}

.faq details p {
  margin-top: 0;
}

.conclusion {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.back-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: none;
  place-items: center;
  text-decoration: none;
  box-shadow: var(--shadow);
  z-index: 20;
}

.back-top.visible {
  display: grid;
}

/* Footer */
.site-footer {
  background: #0b0838;
  color: #d7d5f3;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer h2 {
  color: var(--white);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.site-footer a {
  color: #d7d5f3;
  text-decoration: none;
  display: block;
  margin: 6px 0;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: var(--orange);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  margin-bottom: 10px;
}

.foot-brand img,
.foot-brand svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  font-size: 0.82rem;
  color: #9b98c4;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.legal-links a {
  display: inline;
  margin: 0;
  font-size: 0.82rem;
  color: #c8c5ea;
}

.legal-page {
  padding: 8px 0 72px;
}

.legal-page .content {
  max-width: 820px;
  margin: 0 auto;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.legal-nav a {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
}

.legal-nav a:hover,
.legal-nav a.current {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.legal-meta {
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 8px;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 16px 0 8px;
}

.contact-card a {
  font-weight: 800;
}

.sitemap-page {
  padding: 0 0 72px;
}

.sitemap-top {
  background:
    radial-gradient(700px 280px at 8% 0%, rgba(252, 112, 49, 0.22), transparent 55%),
    radial-gradient(640px 260px at 92% 10%, rgba(19, 13, 233, 0.45), transparent 50%),
    #0b0838;
  color: #fff;
}

.sitemap-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #c8c5ea;
}

.sitemap-crumb a {
  color: #c8c5ea;
  text-decoration: none;
}

.sitemap-crumb a:hover {
  color: #fff;
}

.sitemap-crumb span {
  opacity: 0.55;
}

.sitemap-hero {
  padding: 28px 0 48px;
}

.sitemap-hero-inner {
  max-width: 760px;
}

.sitemap-eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sitemap-hero h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: normal;
}

.sitemap-desc {
  margin: 0;
  max-width: 640px;
  color: #c8c5ea;
  font-size: 1.05rem;
}

.sitemap-body {
  padding-top: 28px;
}

.sitemap-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 0 0 22px;
}

.sitemap-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.sitemap-stat-num {
  display: block;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.sitemap-stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sitemap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.sitemap-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.sitemap-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.sitemap-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  padding: 12px 14px 12px 42px;
}

.sitemap-search input:focus {
  outline: 2px solid rgba(19, 13, 233, 0.25);
  border-color: var(--blue);
}

.sitemap-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sitemap-jump {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.sitemap-jump:hover,
.sitemap-jump.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.sitemap-xml {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sitemap-xml a {
  font-weight: 800;
}

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.sitemap-grid:has(.sitemap-col[hidden]) {
  grid-template-columns: minmax(260px, 560px);
}

.sitemap-col {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}

.sitemap-col-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sitemap-col-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.sitemap-col-icon svg {
  width: 20px;
  height: 20px;
}

.sitemap-col-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.sitemap-count {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

.sitemap-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sitemap-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.sitemap-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.sitemap-link span:last-child {
  color: var(--orange);
  font-weight: 800;
}

.sitemap-empty {
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sitemap-cta {
  margin-top: 36px;
  background: #0b0838;
  color: #fff;
  border-radius: 20px;
  padding: 28px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sitemap-cta h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.35rem;
}

.sitemap-cta p {
  margin: 0;
  color: #c8c5ea;
}

.sitemap-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sitemap-cta .btn {
  text-decoration: none;
}

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

@media (max-width: 860px) {
  .sitemap-stats,
  .sitemap-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-drop {
    width: 100%;
  }

  .nav-drop-btn {
    width: 100%;
    justify-content: center;
  }

  .nav-drop-menu {
    position: static;
    display: none;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 4px 0 8px;
    background: transparent;
  }

  .nav-drop.open .nav-drop-menu,
  .nav-drop:hover .nav-drop-menu {
    display: block;
  }

  .nav-drop-menu a {
    text-align: center;
  }

  .triangle-row {
    grid-template-columns: 1fr;
  }

  .triangle {
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding-inline: 14px;
  }

  .site-header {
    height: 64px;
  }

  :root {
    --header: 64px;
  }

  .brand {
    font-size: 0.92rem;
    gap: 8px;
  }

  .brand img,
  .brand svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .nav-legal {
    display: none !important;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    gap: 4px;
    z-index: 80;
    box-shadow: 0 18px 40px rgba(19, 13, 233, 0.12);
  }

  .nav-tools.open {
    display: flex;
  }

  .nav a,
  .nav .btn {
    width: 100%;
    justify-content: center;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }

  .hero {
    padding: 18px 0 12px;
  }

  .eyebrow {
    font-size: 0.68rem;
    padding: 5px 10px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .fields,
  .seek,
  .mini-grid,
  .step-row {
    grid-template-columns: 1fr;
  }

  .step-row button {
    width: 100%;
  }

  .panel {
    padding: 14px;
  }

  .tool-card {
    border-radius: 18px;
  }

  .related-tools-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tool-tabs {
    padding: 10px;
  }

  .content > section {
    padding: 16px 14px 6px;
    border-radius: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 420px;
  }
}

@media (max-width: 420px) {
  .related-tools-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.32rem;
  }

  .brand {
    font-size: 0.82rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.result table th {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.result table td,
.result table th {
  color: var(--ink);
  border-color: var(--line);
}

.result .table-wrap {
  border-color: var(--line);
  background: var(--white);
  max-width: 100%;
}

.result table,
.split-wrap table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.result table th,
.result table td,
.split-wrap table th,
.split-wrap table td {
  padding: 10px 8px;
  word-break: break-word;
}

.result table small,
.split-wrap table small {
  display: block;
  margin-top: 2px;
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}

.time-hms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.time-hms .field input {
  text-align: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.dur-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 12px;
}

.dur-row {
  display: grid;
  grid-template-columns: 28px repeat(3, 1fr) 40px;
  gap: 8px;
  align-items: end;
}

.dur-idx {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.82rem;
  padding-bottom: 16px;
}

.dur-row .icon-btn {
  height: 54px;
  width: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
  color: var(--orange);
  font-size: 1.2rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  font-weight: 600;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.kpi {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px;
}

.kpi span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

.kpi strong {
  display: block;
  font-size: 1.15rem;
  margin: 4px 0 2px;
  letter-spacing: -0.03em;
}

.split-wrap {
  min-width: 0;
  max-width: 100%;
}

.split-wrap .table-wrap {
  margin-top: 4px;
}

.conv-fields {
  max-width: 420px;
}

.conv-swap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.conv-swap a {
  font-weight: 800;
}

@media (max-width: 760px) {
  .result {
    padding: 16px 12px;
  }

  .result table th,
  .result table td,
  .split-wrap table th,
  .split-wrap table td {
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1400px) {
  .nav-legal {
    display: none !important;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    gap: 4px;
    z-index: 80;
    box-shadow: 0 18px 40px rgba(19, 13, 233, 0.12);
  }

  .nav-tools.open {
    display: flex;
  }

  .nav a,
  .nav .btn {
    width: 100%;
    justify-content: center;
  }

  .nav-drop {
    width: 100%;
  }

  .nav-drop-btn {
    width: 100%;
    justify-content: center;
  }

  .nav-drop-menu {
    position: static;
    display: none;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 4px 0 8px;
    background: transparent;
  }

  .nav-drop:hover .nav-drop-menu {
    display: none;
  }

  .nav-drop.open .nav-drop-menu {
    display: block;
  }

  .nav-drop-menu a {
    text-align: center;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
}

@media (max-width: 760px) {
  .time-hms,
  .dur-row {
    grid-template-columns: 1fr;
  }

  .dur-idx {
    padding-bottom: 0;
  }
}

/* Reaction time test */
.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.rt-toolbar .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.rt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 16px;
}

.rt-board {
  position: relative;
  min-height: 320px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px 56px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
  color: var(--white);
  transition: background 0.18s ease, color 0.18s ease;
}

.rt-board:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.rt-board.wait {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%);
}

.rt-board.ready {
  background: linear-gradient(160deg, #c2410c 0%, var(--orange-deep) 100%);
}

.rt-board.go {
  background: linear-gradient(160deg, #059669 0%, #047857 100%);
}

.rt-board.lock {
  background: linear-gradient(160deg, #b91c1c 0%, #991b1b 100%);
}

.rt-board-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.rt-board-hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0.92;
}

.rt-kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.rt-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.rt-kpi {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.rt-kpi span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.rt-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  font-family: var(--mono);
  letter-spacing: -0.03em;
}

.rt-progress {
  height: 8px;
  margin-top: 14px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}

.rt-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: inherit;
  transition: width 0.25s ease;
}

.rt-comment {
  display: inline-flex;
  margin-top: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.rt-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.rt-side {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  min-width: 0;
}

.rt-side h2,
.rt-side h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.rt-side h3 {
  margin-top: 16px;
}

.rt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.rt-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rt-table-wrap th,
.rt-table-wrap td {
  padding: 8px 10px;
  text-align: left;
}

.rt-table-wrap th {
  background: #f7f6ff;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rt-table-wrap td {
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.rt-table-wrap td:last-child {
  white-space: normal;
}

.rt-table-wrap .good {
  color: #047857;
}

.rt-table-wrap .warn {
  color: #c2410c;
}

.rt-table-wrap .bad {
  color: #b91c1c;
}

.rt-legend {
  margin: 0;
  padding-left: 18px;
  color: #2b2958;
  font-size: 0.86rem;
  line-height: 1.55;
}

.rt-chart-card {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.rt-chart-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.rt-chart-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.rt-chart-wrap {
  position: relative;
  height: 220px;
}

.rt-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.rt-compare {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.rt-compare div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.rt-compare span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rt-compare strong {
  font-family: var(--mono);
  font-size: 1.1rem;
}

.rt-export {
  margin-top: 12px;
}

.rt-tests {
  margin-top: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
}

.rt-tests summary {
  cursor: pointer;
  font-weight: 700;
}

.rt-tests-out {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.content details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 10px 0;
}

.content details summary {
  cursor: pointer;
  font-weight: 700;
}

.content details p {
  margin: 10px 0 0;
}

.cps-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cps-durs {
  margin-bottom: 14px;
}

.cps-durs .subtabs {
  flex-wrap: wrap;
  margin-bottom: 0;
}

#cps-root .rt-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cps-dur,
.cps-durs .subtabs button {
  min-width: 64px;
}

.cps-arena {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

#cps-root[data-mode="challenge"] .cps-arena {
  grid-template-columns: 140px minmax(0, 1fr) minmax(220px, 0.8fr);
}

.cps-stats {
  display: grid;
  gap: 10px;
  align-content: center;
}

.cps-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
}

.cps-stat strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.cps-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cps-board {
  position: relative;
  min-height: 320px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
  color: var(--white);
  transition: background 0.18s ease, transform 0.08s ease;
}

.cps-board:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.cps-board.wait {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%);
}

.cps-board.running {
  background: linear-gradient(160deg, #c2410c 0%, var(--orange-deep) 100%);
}

.cps-board.done {
  background: linear-gradient(160deg, #059669 0%, #047857 100%);
}

.cps-board.hit {
  transform: scale(0.985);
}

.cps-board-inner {
  width: 100%;
}

.cps-board-hint {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.92;
}

.cps-result {
  display: grid;
  gap: 4px;
  pointer-events: none;
}

.cps-result .rt-board-title {
  color: var(--white);
  text-shadow: 0 8px 18px rgba(19, 13, 233, 0.35);
}
  margin: 0;
  font-weight: 700;
}

.cps-result-cps {
  margin: 8px 0;
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: -0.05em;
}

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

.cps-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cps-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 8, 72, 0.62);
  backdrop-filter: blur(8px);
}

.cps-modal-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--white);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(19, 13, 233, 0.28);
  padding: 32px 24px 24px;
  text-align: center;
  animation: cps-modal-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes cps-modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cps-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cps-modal-close:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.cps-modal-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 10px 18px rgba(19, 13, 233, 0.28));
}

.cps-modal-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}

.cps-modal-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 5vw, 2.15rem);
  letter-spacing: -0.04em;
}

.cps-modal-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 600;
}

.cps-modal-cta {
  width: 100%;
  font-size: 1.05rem;
  padding: 16px 22px;
  box-shadow: 0 12px 28px rgba(252, 112, 49, 0.35);
}

.cps-modal-cps {
  margin: 8px 0 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.cps-modal-cps strong {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 10vw, 4rem);
  letter-spacing: -0.06em;
  color: var(--blue);
  line-height: 1;
}

.cps-modal-cps span {
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 0.08em;
}

.cps-modal-detail {
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--ink);
}

.cps-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.cps-modal-stats div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 8px;
}

.cps-modal-stats span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cps-modal-stats strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 1.05rem;
}

.cps-modal-note {
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--blue);
}

.cps-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.cps-modal-actions .btn {
  flex: 1 1 140px;
}

.tool-card:fullscreen .cps-modal,
.tool-card:-webkit-full-screen .cps-modal {
  position: absolute;
}

.cps-levels {
  display: grid;
  gap: 8px;
}

.cps-level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.cps-level[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.cps-level.current {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.cps-level.done {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
}

.cps-level strong {
  font-family: var(--mono);
  font-size: 0.92rem;
}

.tool-card:fullscreen,
.tool-card:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: var(--white);
}

body.cps-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .rt-layout {
    grid-template-columns: 1fr;
  }

  .rt-board,
  .cps-board {
    min-height: 240px;
  }

  .rt-compare {
    grid-template-columns: 1fr 1fr;
  }

  .cps-arena,
  #cps-root[data-mode="challenge"] .cps-arena {
    grid-template-columns: 1fr;
  }

  .cps-stats {
    grid-template-columns: 1fr 1fr;
  }

  #cps-root .rt-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
