body[data-game="maze"] .mini-layout {
  grid-template-areas: "play stats" "play actions" "play side";
  grid-template-rows: auto auto 1fr;
  row-gap: 14px;
}

body[data-game="maze"] .mini-play {
  grid-area: play;
}

body[data-game="maze"] .mini-side {
  grid-area: side;
  padding-top: 0;
  border-top: 0;
}

body[data-game="maze"] #mini-stage {
  aspect-ratio:auto;
  padding:6px;
  border:1px solid var(--solo-metal);
  border-radius:6px;
  box-shadow:inset 0 0 0 2px #e2c29054,0 4px 10px #15202124;
  background:var(--solo-wood);
}

body[data-game="maze"] #maze-board {
  width: 100%;
  height: auto;
  aspect-ratio: 17 / 11;
  border-radius:2px;
}

body[data-game="maze"] #maze-board:focus-visible {
  outline: 3px solid #f8d487;
  outline-offset: -5px;
}

body[data-game="maze"] #mini-stage[data-state="won"] {
  border-color:#efce87;
  box-shadow:inset 0 0 0 2px #efce87;
}

body[data-game="maze"] #mini-stats {
  grid-area: stats;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px 16px;
  padding:12px 0;
  border-block:1px solid var(--solo-rule);
}

body[data-game="maze"] .maze-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: start;
}

body[data-game="maze"] .maze-stat:last-child {
  grid-column: 1 / -1;
  border-top:1px solid var(--line);
  padding-top:9px;
}
body[data-game="maze"] .maze-stat:first-child .maze-stat-label::before {
  content:""; display:inline-block; width:15px; height:15px; vertical-align:-3px; margin-inline-end:4px;
  background:url('/prize-lantern.webp') center / contain no-repeat;
}

body[data-game="maze"] .maze-stat-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

body[data-game="maze"] .maze-stat-value {
  color:var(--solo-paper);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body[data-game="maze"] .maze-stat[data-low="true"] .maze-stat-value {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

body[data-game="maze"] #mini-actions {
  grid-area: actions;
  margin: 0;
  gap: 10px;
  min-width: 0;
}

body[data-game="maze"] #mini-actions :is(select, button) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

body[data-game="maze"] #mini-actions select {
  font-size: 14px;
}

body[data-game="maze"] #mini-actions button[aria-busy="true"] {
  cursor: progress;
}

body[data-game="maze"] :is(#mini-actions select, #mini-actions button, #touch-controls button):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

body[data-game="maze"] #mini-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  text-align: center;
  overflow-wrap: anywhere;
}

body[data-game="maze"] #mini-stage[data-state="won"] + #mini-status {
  color: var(--gold);
  font-weight: 700;
}

body[data-game="maze"] #touch-controls.direction-pad:not([hidden]) {
  grid-template-columns: repeat(3, 48px);
  grid-auto-rows: 48px;
  gap: 7px;
  padding-top: 10px;
}

body[data-game="maze"] #touch-controls button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
  background:var(--button);
}

body[data-game="maze"] #touch-controls button svg {
  width: 22px;
  height: 22px;
}

body[data-game="maze"] #touch-controls button[data-heading="true"] {
  color: var(--gold);
  border-color: var(--gold);
}

body[data-game="maze"] #touch-controls button[data-queued="true"],
body[data-game="maze"] #touch-controls button:active:not(:disabled) {
  color: #291a20;
  background: #ffc97f;
  border-color: transparent;
}

body[data-game="maze"] #touch-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body[data-game="maze"] #mini-help:empty {
  display: none;
}

body[data-game="maze"] .mini-records {
  margin-top: 4px;
  padding-top: 14px;
}

body[data-game="maze"] .mini-records ol {
  margin-block: 8px;
}

body[data-game="maze"] .mini-records > p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 720px) {
  body[data-game="maze"] .mini-layout {
    grid-template-areas: "stats" "actions" "play" "side";
    grid-template-rows: auto;
    row-gap: 14px;
  }

  body[data-game="maze"] #mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: 12px;
  }

  body[data-game="maze"] .maze-stat:last-child {
    grid-column: auto;
    border-top:0;
    padding-top:0;
  }
  body[data-game="maze"] .maze-stat + .maze-stat { padding-inline-start:10px; border-inline-start:1px solid var(--solo-rule); }

  body[data-game="maze"] #mini-actions {
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  }

  body[data-game="maze"] #mini-actions select {
    font-size: 16px;
  }

  body[data-game="maze"] .mini-records {
    margin-top: 6px;
  }
}

@media (max-width: 380px) {
  body[data-game="maze"] #mini-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-game="maze"] .maze-stat-value {
    font-size: 20px;
  }
}
