.catalog-maze-art {
  width: 55px;
  height: 46px;
  border: 4px solid #554084;
  border-radius: 6px;
  background:
    radial-gradient(circle at 18% 24%, #5546d4 0 4px, transparent 4.5px),
    radial-gradient(circle at 83% 75%, #e9ae37 0 4px, transparent 4.5px),
    linear-gradient(90deg, transparent 68%, #554084 69% 77%, transparent 78%) top / 100% 60% no-repeat,
    linear-gradient(90deg, transparent 35%, #554084 36% 44%, transparent 45%) bottom / 100% 62% no-repeat,
    #fff;
}

.maze-page { max-width: 1050px; }
.maze-stage { --maze-ink: #32265e; --maze-track: #f3effc; }
.maze-options, .maze-levels, .maze-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.maze-options { justify-content: space-between; }
.maze-options .button { min-height: 43px; padding-inline: 12px; font-size: 14px; }
.maze-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
  align-items: center;
  gap: clamp(12px, 5vw, 60px);
}
.maze-board {
  position: relative;
  width: min(100%, 470px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 12px;
  background: #faf9ff;
  overflow: hidden;
}
.maze-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(var(--maze-size), 1fr) / repeat(var(--maze-size), 1fr);
}
.maze-wall { background: var(--maze-ink); }
.maze-ball, .maze-goal {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.maze-ball {
  width: calc(61% / var(--maze-size));
  aspect-ratio: 1;
  background: radial-gradient(circle at 30% 26%, #adbaff, #4c59df 55%, #3420a2);
  border: 1px solid #3d33a3;
  box-shadow: 0 2px 5px #32265e52;
}
.maze-goal {
  width: calc(75% / var(--maze-size));
  aspect-ratio: 1;
  border: 3px solid #a87316;
  background: #ffeab2;
  box-shadow: inset 0 0 0 2px #fff6dc;
}
.maze-ropes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 9px;
  background: var(--maze-track);
  border: 1px solid #e5dcf5;
  border-radius: 14px;
}
.maze-end {
  min-width: 0;
  padding: 12px 6px 8px;
  background: #fff;
  border: 1px solid #e5dcf5;
  border-radius: 10px;
  text-align: center;
  touch-action: none;
  user-select: none;
}
.maze-end[data-held="true"] { border-color: #8b6ee9; background: #fbf8ff; }
.maze-end-name, .maze-axis-label { display: block; }
.maze-end-name { font-weight: 740; line-height: 1.15; }
.maze-axis-label { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.2; }
.maze-rail { position: relative; height: 108px; margin-top: 5px; }
.maze-rail::before {
  content: "";
  position: absolute;
  inset: 8% calc(50% - 3px);
  border-radius: 6px;
  background: repeating-linear-gradient(150deg, #b18055 0 3px, #e1b68a 3px 7px);
}
.maze-end[data-axis="horizontal"] .maze-rail::before { inset: calc(50% - 3px) 7%; }
.maze-grip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 31px;
  height: 32px;
  transform: translate(-50%, -50%);
  border: 4px solid #fff;
  border-radius: 45%;
  background: #6646c7;
  box-shadow: 0 0 0 1px #5e409e, 0 2px 5px #2a22404d;
  pointer-events: none;
}
.maze-end[data-held="true"] .maze-grip { background: #4230a7; }
.maze-status { min-height: 2.1em; padding: 8px 10px; border-radius: 8px; color: #483480; background: #f5f0ff; font-size: 15px; line-height: 1.42; }
.maze-stage[data-won="true"] .maze-status { color: #25553b; background: #e5f5e9; font-weight: 700; }
.maze-keyboard { color: var(--muted); font-size: 14px; }

.maze-stage:is(:fullscreen, .color-expanded) .maze-board {
  width: min(100%, max(190px, calc(100dvh - 200px)));
}
@media (max-width: 650px) and (orientation: portrait) {
  .maze-layout { grid-template-columns: 1fr; }
  .maze-board { width: min(100%, 360px); }
  .maze-ropes { width: min(100%, 360px); justify-self: center; }
  .maze-rail { height: 80px; }
  .maze-stage:is(:fullscreen, .color-expanded) .maze-board {
    width: min(100%, max(170px, calc(100dvh - 390px)));
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  .maze-stage:is(:fullscreen, .color-expanded) .maze-layout {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
    gap: 10px;
  }
  .maze-stage:is(:fullscreen, .color-expanded) .maze-rail { height: 77px; }
}
@media (pointer: coarse) { .maze-keyboard { display: none; } }
