/* ── Bunny Direction Maze – style ─────────────────────────────────────────── */

/* fix: CSS display overrides HTML hidden attribute */
[hidden] { display: none !important; }

/* ── toolbar start button accent ─────────────────────────────────────────── */
.maze-start-toolbar-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
  color: #fff !important;
  border-color: #f97316 !important;
}

.clio-shell-tools a.clio-shell-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ── HUD row ──────────────────────────────────────────────────────────────── */
.maze-hud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.maze-chip {
  background: rgba(255,255,255,0.88);
  border: 1.5px solid #fde68a;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
}

/* ── two-column play area ─────────────────────────────────────────────────── */
.maze-play-area {
  display: -webkit-box;
  display: -webkit-flex;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}
@media (max-width: 660px) {
  .maze-play-area { grid-template-columns: 1fr; }
}

/* ── maze canvas card ─────────────────────────────────────────────────────── */
.maze-canvas-card {
  position: relative;
  background: rgba(255,255,255,0.75);
  border: 1.5px solid #dbe4f2;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(15,23,42,0.10);
  padding: 14px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
}
#mazeCanvas {
  border-radius: 10px;
  display: block;
  touch-action: none;
}

/* ── start overlay on canvas ─────────────────────────────────────────────── */
.maze-start-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(255,255,255,0.12);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  border-radius: 18px;
}
.maze-start-big-btn {
  padding: 16px 40px;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(249,115,22,0.42);
  transition: transform 80ms;
  touch-action: manipulation;
}
.maze-start-big-btn:active { transform: scale(0.93); }

/* ── D-pad panel ──────────────────────────────────────────────────────────── */
.maze-dpad-panel {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid #dbe4f2;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(15,23,42,0.10);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.maze-dpad-title {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* 3×3 grid for D-pad */
.maze-dpad {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 7px;
  width: 176px;
}

/* ── direction buttons ────────────────────────────────────────────────────── */
.dir-btn {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  font-size: 0;          /* hide default text */
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
  transition: transform 80ms ease, box-shadow 80ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dir-btn.pressed,
.dir-btn:active { transform: scale(0.88); box-shadow: 0 2px 6px rgba(0,0,0,0.10); }

.dir-btn-emoji { font-size: 22px; line-height: 1; }
.dir-btn-arrow { font-size: 17px; line-height: 1; color: #1e293b; font-weight: 900; }

/* coloured variants */
.dir-up    { background: linear-gradient(150deg, #7dd3fc, #0ea5e9); }
.dir-left  { background: linear-gradient(150deg, #86efac, #22c55e); }
.dir-right { background: linear-gradient(150deg, #fde68a, #f59e0b); }
.dir-down  { background: linear-gradient(150deg, #fda4af, #f43f5e); }

/* centre label */
.dir-center {
  background: rgba(255,255,255,0.9);
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  line-height: 1.4;
  padding: 4px;
}

/* ── feedback + hint ──────────────────────────────────────────────────────── */
.maze-feedback-area { min-height: 52px; }

.maze-feedback {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
}
.maze-feedback.maze-blocked {
  color: #dc2626;
  animation: mazeshake 300ms ease;
}
@keyframes mazeshake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-7px); }
  55%  { transform: translateX(7px); }
  80%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.maze-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

/* ── win overlay ──────────────────────────────────────────────────────────── */
.maze-win-layer {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.52);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  z-index: 200;
}
.maze-win-card {
  background: #fff;
  border-radius: 28px;
  padding: 36px 44px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.24);
  max-width: 380px;
  width: 92%;
  animation: mazePopIn 260ms cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes mazePopIn {
  from { transform: scale(0.65); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.maze-win-emoji  { font-size: 56px; margin-bottom: 14px; }
.maze-win-title  { margin: 0 0 8px; font-size: 26px; font-weight: 900; color: #0f172a; }
.maze-win-sub    { margin: 0 0 22px; font-size: 14px; color: #64748b; font-weight: 600; }
.maze-win-btns   { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.maze-btn {
  padding: 11px 22px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 80ms;
}
.maze-btn:active { transform: scale(0.93); }
.maze-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  box-shadow: 0 6px 18px rgba(249,115,22,0.32);
}
.maze-btn-ghost {
  background: transparent;
  border: 2px solid #e2e8f0;
  color: #475569;
}

/* ── responsive: D-pad below maze on narrow screens ──────────────────────── */
@media (max-width: 660px) {
  .maze-dpad-panel {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
  .maze-dpad { width: 200px; }
  .maze-win-card { padding: 28px 24px; }
}

