.dg-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
}

.dg-tools button,
.dg-tools .dg-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--bs-body-color);
  background: transparent;
  border: 2px solid var(--bs-body-color);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

.dg-tools button[aria-pressed="true"] {
  color: var(--bs-body-bg);
  background: var(--bs-body-color);
}

.dg-tools button:focus-visible,
.dg-tools .dg-full:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 3px;
}

.dg-tools .dg-full::before {
  content: "♿";
}

.dg-stage {
  position: relative;
  overflow: hidden;
}

.dg-stage > #runner {
  transform-origin: 0 0;
}

.dg-stage canvas {
  image-rendering: pixelated;
}

.dg-cue {
  display: none;
  justify-content: center;
  min-height: 2.6em;
  margin: 0 0 8px;
}

html.dg-cues-on .dg-cue {
  display: flex;
}

.dg-cue span {
  min-width: 7em;
  padding: 0.15em 0.6em;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #0b4fb3;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}

.dg-cue.is-on span {
  opacity: 1;
}

.dg-cue[data-kind="jump"] span::before {
  content: "▲ ";
}

.dg-cue[data-kind="duck"] span {
  background: #8a3b00;
}

.dg-cue[data-kind="duck"] span::before {
  content: "▼ ";
}

.dg-cue[data-kind="clear"] span {
  background: #3d3d3d;
}

[data-bs-theme=dark] .dg-cue span {
  color: #000;
  background: #8cc2ff;
}

[data-bs-theme=dark] .dg-cue[data-kind="duck"] span {
  background: #ffb37a;
}

[data-bs-theme=dark] .dg-cue[data-kind="clear"] span {
  background: #d6d6d6;
}

html[data-dg-contrast="bw"] #runner {
  background: #fff;
}

html[data-dg-contrast="wb"] #runner,
html[data-dg-contrast="yb"] #runner {
  background: #000;
}

html[data-dg-contrast="bw"] #runner canvas {
  filter: grayscale(1) contrast(4);
}

html[data-dg-contrast="wb"] #runner canvas {
  filter: invert(1) grayscale(1) contrast(4);
}

html[data-dg-contrast="yb"] #runner canvas {
  filter: invert(1) grayscale(1) contrast(4) sepia(1) saturate(30);
}

html[data-bs-theme=dark][data-dg-contrast="bw"] #runner canvas {
  filter: invert(1) grayscale(1) contrast(4);
}

html[data-bs-theme=dark][data-dg-contrast="wb"] #runner canvas {
  filter: grayscale(1) contrast(4);
}

html[data-bs-theme=dark][data-dg-contrast="yb"] #runner canvas {
  filter: grayscale(1) contrast(4) sepia(1) saturate(30);
}

@media (prefers-reduced-motion: reduce) {
  .dg-cue span {
    transition: none;
  }
}

@media (forced-colors: active) {
  .dg-cue span {
    forced-color-adjust: none;
    color: HighlightText;
    background: Highlight;
  }
}

.dg-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 32px;
}

.dg-footer-links a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--bs-body-color);
  text-decoration: underline;
}

.dg-daily-date {
  font-size: 1.05rem;
}

.dg-daily {
  max-width: 560px;
  margin: 0 auto 32px;
}

.dg-daily-submit {
  padding: 16px;
  margin: 0 0 16px;
  text-align: center;
  border: 2px solid var(--bs-body-color);
  border-radius: 12px;
}

.dg-daily-score {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
}

.dg-daily-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.dg-daily-form label {
  width: 100%;
  font-weight: 600;
}

.dg-daily-form input {
  flex: 1 1 180px;
  max-width: 260px;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-body-color);
  border-radius: 10px;
}

.dg-daily-form button {
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--bs-body-bg);
  background: var(--bs-body-color);
  border: 2px solid var(--bs-body-color);
  border-radius: 10px;
  cursor: pointer;
}

.dg-daily-form button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.dg-daily-form input:focus-visible,
.dg-daily-form button:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 3px;
}

.dg-daily-msg {
  min-height: 1.5em;
  font-weight: 600;
  text-align: center;
}

.dg-board {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: none;
}

.dg-board li {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.35);
}

.dg-board li:nth-child(-n+3) {
  font-weight: 700;
}

.dg-board .dg-rank {
  min-width: 2em;
  text-align: right;
}

.dg-board .dg-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dg-board .dg-score {
  font-variant-numeric: tabular-nums;
}

.dg-board .dg-board-empty {
  justify-content: center;
  font-weight: 400;
}

.dg-daily-rules {
  max-width: 720px;
  margin: 0 auto 24px;
}

.dg-embed {
  max-width: 720px;
  margin: 0 auto 32px;
}

.dg-embed-frame {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 180px;
  margin: 0 auto 16px;
  border: 1px solid rgba(127, 127, 127, 0.45);
  border-radius: 8px;
  background: #fff;
}

.dg-embed-size {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 12px;
}

.dg-embed-size legend {
  width: auto;
  margin: 0 12px 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.dg-embed-size label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.dg-embed-label {
  display: block;
  font-weight: 600;
}

.dg-embed-code {
  display: block;
  width: 100%;
  padding: 10px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-body-color);
  border-radius: 10px;
  resize: vertical;
}

.dg-embed-copy {
  min-height: 44px;
  margin: 10px 12px 0 0;
  padding: 8px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--bs-body-bg);
  background: var(--bs-body-color);
  border: 2px solid var(--bs-body-color);
  border-radius: 10px;
  cursor: pointer;
}

.dg-embed-copy:focus-visible,
.dg-embed-code:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 3px;
}

.dg-embed-status {
  font-weight: 600;
}

.dg-guide {
  max-width: 760px;
  margin: 0 auto 24px;
  font-size: 1.05rem;
  line-height: 1.65;
}

.dg-guide h2 {
  margin: 1.8em 0 0.6em;
  font-size: 1.45rem;
}

.dg-guide figure {
  margin: 20px 0 26px;
}

.dg-guide figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 12px;
}

.dg-guide figcaption {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.8;
}

.dg-guide code,
.dg-guide kbd {
  padding: 0.1em 0.4em;
  font-size: 0.92em;
  border-radius: 6px;
}

.dg-guide code {
  color: inherit;
  background: rgba(127, 127, 127, 0.15);
}

.dg-guide kbd {
  color: var(--bs-body-bg);
  background: var(--bs-body-color);
}

.dg-guide a {
  color: inherit;
  text-decoration: underline;
}

.dg-guide-cta {
  margin: 32px 0 0;
  text-align: center;
}

.dg-guide-cta a {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 700;
  color: var(--bs-body-bg);
  text-decoration: none;
  background: var(--bs-body-color);
  border-radius: 12px;
}

.dg-guide-cta a:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 3px;
}

.dg-guide-more {
  max-width: 760px;
  margin: 0 auto 24px;
}

.dg-guide-more ul {
  padding-left: 1.2em;
}

.dg-guide-more a {
  color: inherit;
  text-decoration: underline;
}
