/* Math Maze */

.maze-game { background: #B5E08F; }

.hud { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--ink);
}
.pill svg { width: 28px; height: 28px; }
.bar-right { display: flex; gap: 10px; }
#music .slash { display: none; }
#music.off .slash { display: inline; }
#music.off svg circle { fill: #CFCFCF; }

.panel {
  flex: none;
  height: clamp(78px, 12vh, 112px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}
.panel-msg {
  margin: 0;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 8px 22px;
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  font-weight: 800;
  text-align: center;
}

.eq {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 16px);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 4px clamp(16px, 3vw, 28px);
  font-weight: 900;
  font-size: clamp(2.4rem, 7.5vmin, 4rem);
  line-height: 1.15;
  animation: popIn .35s cubic-bezier(.3,1.6,.5,1) both;
}
.eq .num:first-child { color: var(--tangerine); }
.eq #qb { color: var(--sky); }
.eq .op { color: var(--ink); }
.eq .qmark {
  min-width: 1.3em;
  text-align: center;
  color: var(--grape);
  animation: bob 1.6s ease-in-out infinite;
}

.qdots {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  gap: 4px 4px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 3px dashed #D8D2C2;
}
.qdots .grp { display: grid; grid-template-columns: repeat(5, auto); gap: 4px; align-content: center; }
.qdots i {
  width: clamp(12px, 2.2vmin, 18px);
  height: clamp(12px, 2.2vmin, 18px);
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--tangerine);
}
.qdots .grp.b i { background: var(--sky); }
.qdots i.gone { background: #fff; opacity: .5; position: relative; }
.qdots i.gone::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: 50%;
  border-top: 2px solid var(--berry);
  transform: rotate(-45deg);
}

.board {
  flex: 1;
  min-height: 0;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
}
.board canvas {
  position: absolute;
  inset: 0;
  display: block;
  touch-action: none;
}

.modes {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode {
  width: clamp(170px, 26vw, 220px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px 14px;
  border: 4px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--ink);
  color: #fff;
  transition: transform .08s, box-shadow .08s;
}
.mode:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.mode-little { background: var(--leaf); }
.mode-busy { background: var(--sky); }
.mode-super { background: var(--grape); }
.mode-eq {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 900;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0 .4em;
  margin-bottom: 6px;
}
.mode-name { font-size: 1.5rem; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.mode-level { font-size: 1.05rem; font-weight: 800; opacity: .95; }

@media (max-height: 560px) {
  .panel { height: 70px; }
  .eq { font-size: 2rem; }
}
