.dot-runner-game {
  --dr-ink: #142033;
  --dr-muted: #5f6f84;
  --dr-line: rgba(100, 116, 139, 0.28);
  --dr-panel: rgba(255, 255, 255, 0.8);
  --dr-panel-strong: rgba(255, 255, 255, 0.94);
  --dr-cyan: #16b8d9;
  --dr-violet: #7566e8;
  --dr-gold: #f2b84b;
  color: var(--dr-ink);
  display: grid;
  gap: 18px;
  isolation: isolate;
  position: relative;
}

.dark .dot-runner-game {
  --dr-ink: #edf8ff;
  --dr-muted: #a7b8cc;
  --dr-line: rgba(177, 220, 241, 0.2);
  --dr-panel: rgba(9, 20, 40, 0.78);
  --dr-panel-strong: rgba(10, 22, 43, 0.94);
}

.dot-runner-game .dr-hero,
.dot-runner-game .dr-play-panel,
.dot-runner-game .dr-side-panel,
.dot-runner-game .dr-hud article {
  backdrop-filter: blur(22px);
  background: var(--dr-panel);
  border: 1px solid var(--dr-line);
  box-shadow: 0 20px 65px rgba(15, 23, 42, 0.16);
}

.dot-runner-game .dr-hero {
  align-items: center;
  background:
    radial-gradient(
      circle at 84% 20%,
      rgba(117, 102, 232, 0.3),
      transparent 17rem
    ),
    radial-gradient(
      circle at 8% 85%,
      rgba(22, 184, 217, 0.28),
      transparent 19rem
    ),
    var(--dr-panel);
  border-radius: 30px;
  display: flex;
  justify-content: space-between;
  min-height: 178px;
  overflow: hidden;
  padding: 30px 34px;
  position: relative;
}

.dot-runner-game .dr-hero::after {
  color: rgba(255, 255, 255, 0.5);
  content: "◆ · ◇ · ◆";
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.28;
  pointer-events: none;
  position: absolute;
  right: 210px;
  top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  white-space: nowrap;
  z-index: -1;
}

.dot-runner-game .dr-hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.35rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.98;
  margin: 8px 0 12px;
}

.dot-runner-game .dr-hero p {
  color: var(--dr-muted);
  font-size: clamp(0.98rem, 2vw, 1.14rem);
  font-weight: 650;
  line-height: 1.55;
  margin: 0;
  max-width: 670px;
}

.dot-runner-game .dr-hero-controls {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  max-width: 270px;
  position: relative;
  z-index: 1;
}

.dot-runner-game .dr-hero-controls button {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  min-height: 44px;
}

.dot-runner-game .dr-hud {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dot-runner-game .dr-hud article {
  border-radius: 19px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 15px 17px;
}

.dot-runner-game .dr-hud span {
  color: var(--dr-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dot-runner-game .dr-hud strong {
  font-size: clamp(1.16rem, 2.2vw, 1.65rem);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot-runner-game .dr-hud article:first-child strong,
.dot-runner-game .dr-hud article:nth-child(2) strong {
  color: #067f9b;
}

.dark .dot-runner-game .dr-hud article:first-child strong,
.dark .dot-runner-game .dr-hud article:nth-child(2) strong {
  color: #71e9ff;
}

.dot-runner-game .dr-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.72fr) minmax(260px, 0.72fr);
}

.dot-runner-game .dr-play-panel,
.dot-runner-game .dr-side-panel {
  border-radius: 26px;
  min-width: 0;
  padding: 22px;
}

.dot-runner-game .dr-play-panel {
  display: grid;
  gap: 16px;
}

.dot-runner-game .dr-side-panel {
  display: grid;
  gap: 21px;
}

.dot-runner-game .dr-panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dot-runner-game .dr-panel-heading h2,
.dot-runner-game .dr-side-panel h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
}

.dot-runner-game .dr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.dot-runner-game .dr-canvas-shell {
  align-items: center;
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(42, 192, 226, 0.13),
      transparent 43%
    ),
    #030611;
  border: 1px solid rgba(91, 223, 255, 0.28);
  border-radius: 22px;
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(5px, 1.4vw, 12px);
  position: relative;
}

.dot-runner-game .dr-canvas-shell::before {
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.018) 0 1px,
    transparent 1px 4px
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.dot-runner-game .dr-canvas {
  aspect-ratio: 25 / 29;
  display: block;
  height: auto;
  max-height: min(74vh, 770px);
  max-width: 600px;
  outline: 0;
  touch-action: none;
  width: min(100%, calc(74vh * 25 / 29));
}

.dot-runner-game .dr-canvas:focus-visible {
  border-radius: 8px;
  box-shadow:
    0 0 0 4px #ffd45d,
    0 0 0 7px rgba(35, 210, 244, 0.55);
}

.dot-runner-game .dr-status {
  align-items: center;
  background: color-mix(in srgb, var(--dr-panel-strong) 92%, transparent);
  border: 1px solid var(--dr-line);
  border-left: 4px solid var(--dr-cyan);
  border-radius: 17px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 70px;
  padding: 12px 15px;
}

.dot-runner-game .dr-status[data-state="frightened"] {
  border-left-color: var(--dr-violet);
}

.dot-runner-game .dr-status[data-state="game-over"],
.dot-runner-game .dr-status[data-state="life-lost"] {
  border-left-color: #e8556d;
}

.dot-runner-game .dr-status-icon {
  align-items: center;
  background: linear-gradient(
    145deg,
    rgba(22, 184, 217, 0.2),
    rgba(117, 102, 232, 0.2)
  );
  border-radius: 50%;
  display: flex;
  font-size: 1.25rem;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.dot-runner-game .dr-status strong {
  display: block;
  font-size: 1rem;
}

.dot-runner-game .dr-status p {
  color: var(--dr-muted);
  font-size: 0.9rem;
  line-height: 1.42;
  margin: 2px 0 0;
}

.dot-runner-game .dr-primary-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dot-runner-game .dr-primary-controls button {
  min-height: 48px;
}

.dot-runner-game .dr-touch-controls {
  display: flex;
  justify-content: center;
  padding: 3px 0 0;
}

.dot-runner-game .dr-dpad {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(68px, 82px));
  grid-template-rows: repeat(3, 52px);
}

.dot-runner-game .dr-direction {
  background: var(--dr-panel-strong);
  border: 1px solid var(--dr-line);
  border-radius: 15px;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.12);
  color: var(--dr-ink);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 850;
  min-height: 48px;
  touch-action: manipulation;
}

.dot-runner-game .dr-direction:hover,
.dot-runner-game .dr-direction:focus-visible,
.dot-runner-game .dr-direction:active {
  border-color: var(--dr-cyan);
  box-shadow: 0 0 0 4px rgba(22, 184, 217, 0.2);
  transform: translateY(-1px);
}

.dot-runner-game .dr-direction-up {
  grid-column: 2;
  grid-row: 1;
}

.dot-runner-game .dr-direction-left {
  grid-column: 1;
  grid-row: 2;
}

.dot-runner-game .dr-direction-right {
  grid-column: 3;
  grid-row: 2;
}

.dot-runner-game .dr-direction-down {
  grid-column: 2;
  grid-row: 3;
}

.dot-runner-game .dr-dpad-core {
  align-items: center;
  background: linear-gradient(
    145deg,
    rgba(22, 184, 217, 0.2),
    rgba(117, 102, 232, 0.2)
  );
  border: 1px solid var(--dr-line);
  border-radius: 17px;
  display: flex;
  grid-column: 2;
  grid-row: 2;
  justify-content: center;
}

.dot-runner-game .dr-field {
  display: grid;
  gap: 7px;
}

.dot-runner-game .dr-field > span {
  font-size: 0.86rem;
  font-weight: 850;
}

.dot-runner-game .dr-field small {
  color: var(--dr-muted);
  line-height: 1.45;
}

.dot-runner-game .dr-tutorial {
  align-items: start;
  background: linear-gradient(
    145deg,
    rgba(22, 184, 217, 0.12),
    rgba(117, 102, 232, 0.12)
  );
  border: 1px solid rgba(22, 184, 217, 0.3);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dot-runner-game .dr-tutorial[hidden] {
  display: none;
}

.dot-runner-game .dr-tutorial strong {
  display: block;
  font-size: 0.9rem;
}

.dot-runner-game .dr-tutorial p {
  color: var(--dr-muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 3px 0 0;
}

.dot-runner-game .dr-tutorial button {
  min-height: 40px;
  width: 100%;
}

.dot-runner-game .dr-instructions,
.dot-runner-game .dr-roster,
.dot-runner-game .dr-seed,
.dot-runner-game .dr-debug {
  border-top: 1px solid var(--dr-line);
  padding-top: 18px;
}

.dot-runner-game .dr-instructions h3,
.dot-runner-game .dr-roster h3,
.dot-runner-game .dr-seed h3 {
  font-size: 1rem;
  font-weight: 850;
  margin: 0 0 10px;
}

.dot-runner-game .dr-instructions ul {
  color: var(--dr-muted);
  display: grid;
  font-size: 0.9rem;
  gap: 9px;
  line-height: 1.48;
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}

.dot-runner-game .dr-roster {
  display: grid;
  gap: 9px;
}

.dot-runner-game .dr-roster p {
  align-items: center;
  color: var(--dr-muted);
  display: grid;
  font-size: 0.85rem;
  gap: 7px;
  grid-template-columns: 22px 60px minmax(0, 1fr);
  margin: 0;
}

.dot-runner-game .dr-roster-mark {
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

.dot-runner-game .dr-vector {
  color: #f23863;
}

.dot-runner-game .dr-prism {
  color: #008cac;
}

.dot-runner-game .dr-glitch {
  color: #7d55d9;
}

.dot-runner-game .dr-aegis {
  color: #b66d00;
}

.dark .dot-runner-game .dr-vector {
  color: #ff6a8d;
}

.dark .dot-runner-game .dr-prism {
  color: #71e9ff;
}

.dark .dot-runner-game .dr-glitch {
  color: #c49cff;
}

.dark .dot-runner-game .dr-aegis {
  color: #ffc36b;
}

.dot-runner-game .dr-seed p {
  color: var(--dr-muted);
  margin: 0;
}

.dot-runner-game .dr-seed code {
  color: var(--dr-ink);
  font-weight: 850;
}

.dot-runner-game .dr-debug summary {
  cursor: pointer;
  font-weight: 850;
}

.dot-runner-game .dr-debug pre {
  background: #040814;
  border-radius: 12px;
  color: #abf4ff;
  font-size: 0.72rem;
  line-height: 1.5;
  margin: 10px 0 0;
  max-height: 300px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.dot-runner-game .dr-reset-dialog {
  background: var(--dr-panel-strong);
  border: 1px solid var(--dr-line);
  border-radius: 23px;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.4);
  color: var(--dr-ink);
  margin: auto;
  max-width: min(460px, calc(100vw - 32px));
  padding: 0;
}

.dot-runner-game .dr-reset-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgba(2, 6, 23, 0.64);
}

.dot-runner-game .dr-reset-dialog form {
  display: grid;
  gap: 14px;
  padding: 25px;
}

.dot-runner-game .dr-reset-dialog h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0;
}

.dot-runner-game .dr-reset-dialog p {
  color: var(--dr-muted);
  line-height: 1.5;
  margin: 0;
}

.dot-runner-game .dr-reset-dialog form > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.dot-runner-game button:focus-visible,
.dot-runner-game select:focus-visible,
.dot-runner-game summary:focus-visible {
  outline: 3px solid #ffd45d;
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .dot-runner-game .dr-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dot-runner-game .dr-layout {
    grid-template-columns: 1fr;
  }

  .dot-runner-game .dr-side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dot-runner-game .dr-side-panel > :first-child,
  .dot-runner-game .dr-side-panel > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .dot-runner-game .dr-hero {
    align-items: flex-start;
    display: grid;
    gap: 20px;
    padding: 25px 22px;
  }

  .dot-runner-game .dr-hero::after {
    right: -30px;
  }

  .dot-runner-game .dr-hero-controls {
    justify-content: stretch;
    max-width: none;
    width: 100%;
  }

  .dot-runner-game .dr-hero-controls button {
    flex: 1;
  }

  .dot-runner-game .dr-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dot-runner-game .dr-play-panel,
  .dot-runner-game .dr-side-panel {
    border-radius: 20px;
    padding: 15px;
  }

  .dot-runner-game .dr-side-panel {
    grid-template-columns: 1fr;
  }

  .dot-runner-game .dr-side-panel > :first-child,
  .dot-runner-game .dr-side-panel > :last-child {
    grid-column: auto;
  }

  .dot-runner-game .dr-panel-heading {
    align-items: flex-start;
    display: grid;
  }

  .dot-runner-game .dr-badges {
    justify-content: flex-start;
  }

  .dot-runner-game .dr-canvas {
    max-height: none;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .dot-runner-game .dr-primary-controls {
    grid-template-columns: 1fr;
  }

  .dot-runner-game .dr-dpad {
    grid-template-columns: repeat(3, minmax(62px, 72px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot-runner-game *,
  .dot-runner-game *::before,
  .dot-runner-game *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
