/* Ruby Maze delight layer: playful reactions without adding pressure or clutter. */
.ruby-maze-dash {
  min-width: 72px !important;
  padding: 0 12px;
  border-color: rgba(176, 53, 121, 0.22) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: rgba(107, 34, 71, 0.58) !important;
  font: 900 13px/1 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif !important;
}

.ruby-maze-dash.ready {
  border-color: rgba(255, 216, 107, 0.96) !important;
  background: linear-gradient(180deg, #fffbd6, #ffcae8) !important;
  color: #7a2a60 !important;
  box-shadow:
    0 5px 0 rgba(107, 34, 71, 0.14),
    0 0 0 5px rgba(255, 255, 255, 0.42),
    0 0 22px rgba(255, 216, 107, 0.86) !important;
}

.ruby-maze-player.dashing {
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 0 16px rgba(255, 216, 107, 0.92);
}

.ruby-maze-trail-sparkle {
  position: absolute;
  z-index: 3;
  left: calc(var(--trail-x) * var(--cell, 52px) - 6px);
  top: calc(var(--trail-y) * var(--cell, 52px) - 6px);
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: #ffd86b;
  box-shadow: 0 0 13px rgba(255, 77, 109, 0.9);
  pointer-events: none;
}

.ruby-maze-burst {
  position: absolute;
  z-index: 12;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ruby-maze-burst i {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 3px;
  background: #ff4d6d;
  box-shadow: 0 0 9px rgba(255, 77, 109, 0.88);
  transform: translate(var(--burst-x), var(--burst-y)) rotate(45deg);
}

.ruby-maze-burst.word i {
  border-radius: 50%;
  background: #7be0c8;
  box-shadow: 0 0 9px rgba(123, 224, 200, 0.92);
}

.ruby-maze-burst.gate i,
.ruby-maze-burst.tag i {
  background: #ffd86b;
  box-shadow: 0 0 12px rgba(255, 216, 107, 0.98);
}

.ruby-maze-reaction {
  --maze-x: 13.5;
  --maze-y: 1.5;
  position: absolute;
  z-index: 14;
  left: calc(var(--maze-x) * var(--cell, 52px));
  top: calc(var(--maze-y) * var(--cell, 52px));
  max-width: min(150px, 44vw);
  padding: 7px 10px;
  border: 2px solid rgba(107, 34, 71, 0.24);
  border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #6b2247;
  font: 900 11px/1.15 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  box-shadow: 0 8px 18px rgba(57, 28, 74, 0.18);
  opacity: 0;
  transform: translate(-50%, -135%) scale(0.72);
  transform-origin: 70% 100%;
  pointer-events: none;
}

.ruby-maze-reaction.show {
  opacity: 1;
  transform: translate(-50%, -135%) scale(1);
}

.ruby-maze-reaction.surprised {
  background: #fff7cf;
}

.ruby-maze-reaction.thinking {
  background: #e9fff8;
}

.ruby-maze-reaction.matched {
  background: #ffe2f1;
}

.ruby-maze-grid.gate-ready .ruby-maze-cell.gate {
  animation: none;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.72),
    0 0 26px rgba(255, 216, 107, 0.94);
}

@media (max-width: 820px) {
  .ruby-maze-controls {
    gap: 6px;
    padding-inline: 8px;
  }

  .ruby-maze-dash {
    min-width: 66px !important;
    padding-inline: 8px;
  }

  .ruby-maze-reaction {
    max-width: 128px;
    padding: 6px 8px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ruby-maze-trail-sparkle,
  .ruby-maze-burst {
    display: none;
  }

  .ruby-maze-reaction.show {
    opacity: 1;
    transform: translate(-50%, -135%) scale(1);
  }
}
