:is(.onboarding-preview, .onboarding-active) {
  --tour-night: #142823;
  --tour-ink: #fff3da;
  --tour-paper: #ffdfa3;
  --tour-dim: rgba(0, 0, 0, .66);
  --tour-bar: 2.4rem;
  --tour-title: Georgia, 'Times New Roman', serif;
}

.tour-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: var(--tour-bar);
  padding: .2rem clamp(.8rem, 3vw, 2rem);
  background: #101f1c;
  border-bottom: 1px solid #d3a66d40;
  color: #e6d5b5;
  font-size: .79rem;
}

.tour-preview-bar button {
  border: 0;
  padding: .36rem .1rem;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.onboarding-preview #elka-radio-tools,
.onboarding-preview a[href='#social'],
.onboarding-preview .ec-yard-offers,
.onboarding-preview:has(.elka-claw.is-at-cabinet) > .tour-preview-bar {
  display: none;
}

.onboarding-preview .ec-scene {
  height: max(calc(100svh - var(--tour-bar)), 37rem);
}

.onboarding-preview .ec-scene[data-editing='true'] {
  height: max(calc(100svh - var(--tour-bar)), 45rem);
}

.tour-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  pointer-events: none;
}

body:has(dialog:modal) > .tour-overlay,
body:has(dialog:modal) .claw-coach-overlay { visibility: hidden; }

.tour-shade, .tour-cues {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tour-shade > rect { fill: var(--tour-dim); }

.tour-cue {
  position: absolute;
  width: 1.65rem;
  height: 1.65rem;
  translate: -50% -50%;
  color: var(--tour-paper);
  pointer-events: none;
}

.tour-cue svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px #160f09e0);
  stroke: currentColor;
}

.tour-cue[data-gesture='tap'] {
  width: clamp(3.55rem, 11vw, 5.25rem);
  height: auto;
  aspect-ratio: 1;
  rotate: var(--cue-angle, 0deg);
}
.tour-cue[data-gesture='tap'] svg {
  overflow: visible;
  stroke: none;
  filter: drop-shadow(0 3px 3px #241204d9) drop-shadow(0 0 5px #ffbd3c4d);
}
.tour-cue[data-gesture='draw'] { translate: -16.667% -83.333%; }

@media (prefers-reduced-motion: no-preference) {
  .tour-cue[data-gesture='tap'] svg { animation: tour-cue-arrow 1.45s ease-in-out 3; }
  .tour-cue[data-gesture='move'] svg { animation: tour-cue-move 1.8s ease-in-out 3; }
  .tour-cue[data-gesture='draw'] svg { animation: tour-cue-draw 1.8s ease-in-out 3; }
}

@keyframes tour-cue-arrow {
  0%, 100% { transform: translateY(-9px); }
  52% { transform: translateY(2px); }
}

@media (max-width: 550px) {
  .tour-cue[data-gesture='tap'] { width: 4.2rem; }
}

@keyframes tour-cue-move {
  0%, 66%, 100% { transform: none; }
  16% { transform: translateX(4px); }
  33% { transform: translate(-4px, -2px); }
  49% { transform: translateY(3px); }
}

@keyframes tour-cue-draw {
  0%, 64%, 100% { transform: none; }
  25% { transform: translate(-4px, 2px); }
  46% { transform: translate(6px, -3px); }
}

.tour-branch-preview {
  position: absolute;
  inset: 48% auto auto 50%;
  width: clamp(2rem, 10cqw, 3.8rem);
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 .2rem .25rem #10241dc9);
}

.tour-branch-preview :is(canvas, img) { display: block; width: 100%; height: auto; }

.ec-room-care :is(.ec-room-prop--water, .ec-tree-power)[data-tour-target] {
  position: relative;
  z-index: 1;
  border-color: #fff0c7;
  background: var(--tour-paper);
  color: #352619;
  box-shadow: 0 0 1.15rem #ffc77ea0;
}

.ec-room-care .ec-room-prop--water[data-tour-target] small { color: #624624; }
.ec-room-care .ec-tree-power[data-tour-target] { border-radius: 50%; }

.ec-room-care .ec-tree-power[data-tour-target]::after {
  position: absolute;
  bottom: calc(100% + .55rem);
  left: 50%;
  translate: -50% 0;
  padding: .3rem .5rem;
  border-radius: .35rem;
  background: var(--tour-paper);
  color: #352619;
  content: attr(aria-label);
  font: 700 .76rem/1.1 system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

[data-tour-step='effect'] .ec-tree-spot[data-tour-target] > .ec-effect-mark {
  --effect-size: 1.5rem;
  --effect-font: 1rem;
  background: var(--tour-paper);
  color: #352619;
  box-shadow: 0 0 .65rem #ffca70a0;
  pointer-events: auto;
}

.ec-scene:is([data-tour-step='effect'], [data-tour-step='watch'], [data-tour-step='effectNext']) > .ec-tree-stage {
  z-index: 16;
}

.tour-gift-motion { z-index: 18; }

@media (max-width: 760px) {
  .onboarding-gift:not(.mobile-layout, .onboarding-active, .onboarding-preview) .ec-scene:has(.ec-tree-stage button[data-item-id='tram-red-tram']):has(.ec-yard-offers) {
    height: max(100svh, calc(var(--yard-arcade-space) + 41rem));
  }
}

.ec-scene[data-tour-glow]::after {
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: '';
  background: radial-gradient(ellipse at 50% 63%, #f8cc6976, #dfa84214 47%, transparent 76%);
  animation: tour-light 1.8s ease-out both;
}

.ec-tree-spot[data-tour-new-toy] .ec-tree-spot__art {
  transform-origin: 50% 7%;
  animation: tour-swing .95s ease-out both;
}

.tour-guide {
  position: absolute;
  width: min(21rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: .55rem .65rem;
  padding: .95rem 1.1rem;
  border: 1px solid #d3a66db3;
  border-radius: .65rem;
  background: linear-gradient(155deg, #293e31fa, var(--tour-night) 83%);
  box-shadow: 0 .65rem 2.4rem #101917a0, inset 0 0 0 3px #152622b8;
  color: var(--tour-ink);
  pointer-events: auto;
}

.tour-guide h2 {
  margin: 0;
  color: var(--tour-ink);
  font: bold clamp(1.33rem, 2.35vw, 1.76rem)/1.1 var(--tour-title);
  text-wrap: balance;
}

.tour-guide h2:focus { outline: none; }

.tour-guide p {
  margin: 0;
  color: #efdec0;
  font-size: .94rem;
  line-height: 1.4;
}

.tour-guide__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .22rem .72rem;
  margin-top: .13rem;
}

.tour-guide :is(.tour-action, .tour-link),
.tour-win .tour-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: .5rem .85rem;
  border: 1px solid #ffdb9a;
  border-radius: .44rem;
  background: linear-gradient(#ffe8b7, #eac184);
  color: #312419;
  font: 700 .9rem/1.14 var(--shell-sans);
  cursor: pointer;
  text-decoration: none;
}

.tour-guide .tour-action:hover { background: #ffeabd; }

.tour-guide .tour-link {
  padding-inline: .12rem;
  border-color: transparent;
  background: transparent;
  color: #ffe0ad;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.tour-guide .tour-guide__dismiss {
  color: #d3c3a5;
  font-size: .8rem;
  font-weight: 500;
}

.tour-guide .tour-action:disabled {
  opacity: .63;
  cursor: default;
}

.tour-gift-art {
  width: 4.7rem;
  height: 4.7rem;
  justify-self: center;
  filter: drop-shadow(0 .25rem .55rem #140c06a8);
}

[data-tour-claw] :is([data-stage-balance], [data-cycle], [data-hall-open], [data-stock-controls]),
[data-tour-claw][data-tour-won] :is([data-grab], [data-stick]) {
  display: none;
}

.claw-console :is([data-stick], [data-grab])[data-tour-target]:focus-visible {
  outline: none;
}

[data-tour-claw-step='catch'] [data-readout] {
  position: absolute;
  clip-path: inset(50%);
}

.tour-win {
  width: min(27rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1.4rem;
  border: 1px solid #e6bd77;
  border-radius: 1rem;
  background: radial-gradient(ellipse at 50% 28%, #57462e, #162e26 72%);
  color: var(--tour-ink);
  text-align: center;
  box-shadow: 0 1rem 5rem #070c0a99;
}

.tour-win[open] { display: grid; justify-items: center; gap: .65rem; }
.tour-win::backdrop, dialog[data-tour-paint-success]::backdrop { background: var(--tour-dim); }
.tour-win h2 { margin: 0; font: bold clamp(1.62rem, 5vw, 2.45rem)/1.08 var(--tour-title); }
.tour-win p { margin: 0; color: #f0dfc0; }
.tour-win canvas { width: min(8.5rem, 24vh); height: auto; filter: drop-shadow(0 .3rem .6rem #190e08b0); }
.tour-win .tour-action { width: min(100%, 16rem); min-height: 2.95rem; justify-content: center; }

[data-tour-paint-success] :is(.game-victory-actions .gift-button--quiet, .game-victory-reward-actions .ec-prize-place),
[data-tour-ball-ready] :is([data-paint='hang'], [data-paint='fresh'], [data-paint='next'], [data-paint='tree']) {
  display: none;
}

@keyframes tour-light {
  0%, 100% { opacity: 0; }
  30% { opacity: 1; }
}

@keyframes tour-swing {
  0% { opacity: .6; rotate: -9deg; }
  36% { opacity: 1; rotate: 5deg; }
  67% { rotate: -2deg; }
  100% { rotate: 0deg; }
}

@media (max-width: 750px) {
  .tour-guide {
    gap: .44rem;
    padding: .82rem 1rem .66rem;
  }
  .tour-guide h2 { font-size: clamp(1.44rem, 5.3vw, 1.78rem); }
  .tour-guide p { font-size: .88rem; }
  .tour-guide__actions { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ec-scene[data-tour-glow]::after { animation: none; opacity: 0; }
  .ec-tree-spot[data-tour-new-toy] .ec-tree-spot__art { animation: none; }
}
