:root {
  --rn-v: #5b44e7;
  --rn-v2: #7b68ee;
  --rn-v-soft: rgba(91, 68, 231, .12);
  --rn-v-faint: rgba(91, 68, 231, .055);
  --rn-bg: #f2f1fa;
  --rn-card: #ffffff;
  --rn-bd: #e3e0f5;
  --rn-bd2: #c9c3f0;
  --rn-t1: #18162e;
  --rn-t2: #5a567c;
  --rn-t3: #9b97bc;
  --rn-cell: #f4f2ff;
  --rn-cell2: #eeeafd;
  --rn-block: #dcd8ef;
  --rn-block2: #cdc7e6;
  --rn-line: #5b44e7;
  --rn-line-soft: rgba(91, 68, 231, .15);
  --rn-r1: 8px;
  --rn-r2: 13px;
  --rn-r4: 24px;
  --rn-shadow: 0 4px 32px rgba(91, 68, 231, .07), 0 1px 6px rgba(0, 0, 0, .04);
  --rn-fd: "Crimson Pro", Georgia, "Times New Roman", serif;
  --rn-fb: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --rn-fm: "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
  --rn-tr: 160ms cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --rn-bg: #0d0c1a;
  --rn-card: #161428;
  --rn-bd: #252240;
  --rn-bd2: #393462;
  --rn-t1: #ece8ff;
  --rn-t2: #9e99c4;
  --rn-t3: #67628c;
  --rn-cell: #1b1831;
  --rn-cell2: #211d3a;
  --rn-block: #25213a;
  --rn-block2: #302b4c;
  --rn-line: #7b68ee;
  --rn-line-soft: rgba(123, 104, 238, .19);
  --rn-v-soft: rgba(123, 104, 238, .18);
  --rn-v-faint: rgba(123, 104, 238, .08);
  --rn-shadow: 0 4px 40px rgba(0, 0, 0, .45);
}

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

body.ruta-numerada-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--rn-bg);
  color: var(--rn-t1);
  font-family: var(--rn-fb);
  -webkit-font-smoothing: antialiased;
}

.rn-page {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 92px 0 36px;
}

.game-page-head {
  max-width: 620px;
  margin: 0 auto 28px;
  text-align: center;
}

.game-page-kicker {
  margin: 0 0 7px;
  color: var(--rn-v);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.game-page-head h1 {
  margin: 0;
  color: var(--rn-t1);
  font-family: var(--rn-fd);
  font-size: 36px;
  font-weight: 560;
  line-height: 1.05;
}

.game-page-head p:not(.game-page-kicker) {
  max-width: 34rem;
  margin: 12px auto 0;
  color: var(--rn-t2);
  font-size: 14px;
  line-height: 1.62;
}

.game-page-head span {
  display: inline-flex;
  margin-top: 13px;
  padding: 6px 10px;
  color: var(--rn-t2);
  background: var(--rn-card);
  border: 1px solid var(--rn-bd);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.rn-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.rn-card {
  width: 100%;
  max-width: 540px;
  background: var(--rn-card);
  border: 1px solid var(--rn-bd);
  border-radius: var(--rn-r4);
  box-shadow: var(--rn-shadow);
  padding: 28px 24px 24px;
}

.rn-card > .rn-ey,
.rn-card > .rn-title,
.rn-card > .rn-sub {
  display: none;
}

.rn-ey {
  margin: 0 0 5px;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--rn-t3);
  font-weight: 700;
}

.rn-title {
  margin: 0 0 4px;
  font-family: var(--rn-fd);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--rn-t1);
}

.rn-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--rn-t2);
  line-height: 1.55;
}

.rn-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--rn-cell);
  border: 1px solid var(--rn-bd);
  border-radius: var(--rn-r2);
  font-size: 11.5px;
  color: var(--rn-t3);
  margin-bottom: 16px;
}

.rn-info b {
  color: var(--rn-v);
  font-weight: 700;
}

.rn-info span:last-child {
  text-align: right;
}

.rn-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 11.5px;
  color: var(--rn-t3);
}

.rn-meta b {
  color: var(--rn-t2);
  font-weight: 700;
}

.rn-time {
  font-family: var(--rn-fm);
  font-size: 11px;
  letter-spacing: .04em;
}

.rn-board-shell {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.rn-board-wrap {
  position: relative;
  width: min(100%, var(--rn-board-max));
  padding: 8px;
  border: 1px solid var(--rn-bd);
  background: linear-gradient(180deg, var(--rn-v-faint), transparent);
  border-radius: 18px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.rn-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--rn-cols), 1fr);
  gap: 6px;
  width: 100%;
}

.rn-svg {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.rn-path-shadow {
  fill: none;
  stroke: rgba(91, 68, 231, .10);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rn-path {
  fill: none;
  stroke: var(--rn-line);
  stroke-width: 6.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(91, 68, 231, .16));
}

.rn-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  background: var(--rn-cell);
  border: 1.5px solid var(--rn-bd2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background var(--rn-tr), border-color var(--rn-tr), box-shadow var(--rn-tr);
  -webkit-tap-highlight-color: transparent;
}

.rn-cell:not(.blocked) {
  cursor: pointer;
}

.rn-cell:not(.blocked):hover {
  border-color: var(--rn-v2);
  background: var(--rn-cell2);
}

.rn-cell.path {
  background: var(--rn-line-soft);
  border-color: rgba(91, 68, 231, .28);
}

.rn-cell.head {
  box-shadow: 0 0 0 3px var(--rn-v-soft);
}

.rn-cell.blocked {
  background: var(--rn-block);
  border-color: var(--rn-block2);
  overflow: hidden;
}

.rn-cell.blocked::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--rn-block2);
  transform: rotate(45deg);
  opacity: .72;
}

.rn-node {
  position: relative;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1.5px solid rgba(91, 68, 231, .28);
  background: var(--rn-card);
  color: var(--rn-v);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rn-fm);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(91, 68, 231, .10);
}

.rn-cell.path .rn-node {
  background: var(--rn-v);
  border-color: var(--rn-v);
  color: #fff;
  box-shadow: 0 3px 10px rgba(91, 68, 231, .22);
}

.rn-cell.next .rn-node {
  box-shadow: 0 0 0 4px var(--rn-v-soft), 0 2px 8px rgba(91, 68, 231, .10);
}

.rn-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.rn-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--rn-bd);
  border-radius: var(--rn-r2);
  padding: 11px 12px;
  font-family: var(--rn-fb);
  font-size: 13px;
  font-weight: 650;
  color: var(--rn-t2);
  cursor: pointer;
  transition: all var(--rn-tr);
}

.rn-btn:hover:not(:disabled) {
  background: var(--rn-cell);
  border-color: var(--rn-bd2);
  color: var(--rn-t1);
}

.rn-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.rn-btn.primary {
  background: var(--rn-v);
  border-color: var(--rn-v);
  color: #fff;
}

.rn-btn.primary:hover:not(:disabled) {
  background: #4a35c9;
  border-color: #4a35c9;
  color: #fff;
}

.rn-btn:focus-visible,
.rn-help-btn:focus-visible,
.rn-board-wrap:focus-visible {
  outline: 2px solid var(--rn-v);
  outline-offset: 2px;
}

.rn-status {
  margin: 0;
  text-align: center;
  min-height: 22px;
  font-size: 13px;
  color: var(--rn-t2);
  line-height: 1.5;
}

.rn-status.ok {
  color: var(--rn-v);
  font-weight: 700;
}

.rn-status.err {
  color: #b8762a;
}

.rn-div {
  height: 1px;
  background: var(--rn-bd);
  margin: 18px 0 0;
}

.rn-help {
  width: 100%;
  max-width: 540px;
  margin: 18px auto 0;
  background: var(--rn-card);
  border: 1px solid var(--rn-bd);
  border-radius: var(--rn-r2);
  padding: 15px 16px;
}

.rn-help-btn {
  background: none;
  border: none;
  color: var(--rn-v);
  font-family: var(--rn-fb);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rn-help-btn:hover {
  color: var(--rn-t2);
}

.rn-help-btn::after {
  content: "⌄";
  font-size: 12px;
  transform: translateY(-1px);
  transition: transform var(--rn-tr);
}

.rn-help-btn[aria-expanded="true"]::after {
  transform: rotate(180deg) translateY(1px);
}

.rn-help-body {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--rn-t2);
  line-height: 1.7;
}

.rn-help-body p {
  margin: 0 0 5px;
}

.rn-help-body strong {
  color: var(--rn-t1);
  font-weight: 700;
}

.rn-back {
  width: 100%;
  max-width: 540px;
  margin: 20px auto 0;
  text-align: center;
  font-size: 13px;
}

.rn-back a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--rn-t2);
  text-decoration: none;
  font-weight: 650;
}

.rn-back a:hover {
  color: var(--rn-v);
}

.site-footer-std {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 0 0 36px;
  color: var(--rn-t3);
  font-size: 12px;
}

.site-footer-std p {
  margin: 0;
}

@media (max-width: 520px) {
  .rn-page {
    width: min(100% - 16px, 760px);
    padding: 52px 0 34px;
  }

  .game-page-head h1 {
    font-size: 30px;
  }

  .rn-card {
    padding: 22px 13px 18px;
    border-radius: 20px;
  }

  .rn-title {
    font-size: 23px;
  }

  .rn-sub {
    font-size: 12.5px;
  }

  .rn-info {
    font-size: 11px;
  }

  .rn-board-wrap {
    padding: 6px;
    border-radius: 16px;
  }

  .rn-board {
    gap: 5px;
  }

  .rn-svg {
    inset: 6px;
  }

  .rn-path {
    stroke-width: 5.8;
  }

  .rn-path-shadow {
    stroke-width: 12;
  }

  .rn-node {
    width: 27px;
    height: 27px;
    font-size: 12px;
  }

  .rn-cell {
    border-radius: 11px;
  }
}

@media (max-width: 360px) {
  .rn-node {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .rn-cell {
    border-radius: 10px;
  }

  .rn-board {
    gap: 4px;
  }

  .rn-path {
    stroke-width: 5.2;
  }

  .rn-path-shadow {
    stroke-width: 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
