.doodle-dash-backdrop-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #fff7fb;
}

.doodle-dash-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.015);
}

.doodle-dash-atmosphere {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 247, 251, 0.05) 0%,
      rgba(255, 255, 255, 0.16) 44%,
      rgba(255, 247, 251, 0.54) 100%
    ),
    linear-gradient(
      180deg,
      rgba(20, 8, 18, 0.14) 0%,
      rgba(20, 8, 18, 0.03) 34%,
      rgba(255, 255, 255, 0.18) 100%
    );
}

.doodle-dash-stage-surface {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-overlay) + 5);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(5.5rem, 8vh, 7rem) clamp(1.25rem, 4vw, 4rem) clamp(6rem, 12vh, 8rem);
  pointer-events: none;
}

.doodle-dash-panel {
  width: min(620px, calc(var(--rally-stage-width) - 1.5rem));
  max-height: min(86vh, 860px);
  padding: clamp(0.75rem, 1.2vw, 1rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 28px 80px rgba(26, 12, 22, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  pointer-events: auto;
}

.doodle-dash-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(78vh, 760px);
  min-height: 420px;
  gap: 12px;
  color: #1f2937;
}

.doodle-dash-overlay__header {
  text-align: center;
  flex-shrink: 0;
}

.doodle-dash-overlay__prompt {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  color: #111827;
}

.doodle-dash-overlay__timer {
  margin: 0;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: rgba(31, 41, 55, 0.72);
}

.doodle-dash-overlay__canvas-host {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(17, 9, 19, 0.1);
  background: #ffffff;
}

.doodle-dash-overlay__canvas-host:not(.is-active) {
  opacity: 0.35;
  pointer-events: none;
}

.doodle-dash__canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}

.doodle-dash-overlay__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-align: center;
}

.doodle-dash-overlay__prediction {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.doodle-dash-overlay__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.doodle-dash-countdown,
.doodle-dash-ended {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
}

.doodle-dash-countdown__value,
.doodle-dash-ended__card {
  padding: 24px 28px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(17, 9, 19, 0.1);
  text-align: center;
  color: #111827;
  box-shadow: 0 12px 40px rgba(17, 9, 19, 0.08);
}

.doodle-dash-countdown__value {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.doodle-dash-ended__card h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.doodle-dash-ended__score {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.doodle-dash-ended__gallery {
  display: flex;
  gap: 12px;
  max-width: min(520px, 100%);
  overflow-x: auto;
  padding: 8px 4px 12px;
  margin-bottom: 8px;
}

.doodle-dash-ended__round {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 7.5rem;
}

.doodle-dash-ended__round p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.doodle-dash-ended__thumb {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 10px;
  border: 1px solid rgba(17, 9, 19, 0.1);
  object-fit: contain;
  background: #fff;
}

.doodle-dash-ended__thumb--empty {
  background: rgba(17, 9, 19, 0.04);
}

.doodle-dash-ended__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

@media (max-width: 768px) {
  .doodle-dash-stage-surface {
    align-items: flex-end;
    justify-content: center;
    padding: 5.5rem 0.75rem 1rem;
  }

  .doodle-dash-panel {
    width: min(96vw, 520px);
    max-height: 62vh;
    border-radius: 18px;
  }

  .doodle-dash-overlay {
    min-height: 360px;
    height: 58vh;
  }
}