/* Maze Craze — 30×30 line maze */
.mc-app {
  --mc-ink: #14202c;
  --mc-wall: #1b3a4b;
  --mc-path: #f7fbf9;
  --mc-player: #e85d04;
  --mc-goal: #f4d35e;
  --mc-start: #2a9d8f;
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--mc-ink);
}

.mc-app__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.mc-app__logo-wrap {
  margin: 0;
  line-height: 0;
}

.mc-app__logo {
  display: block;
  width: auto;
  max-width: min(100%, 14rem);
  max-height: 4.6rem;
  height: auto;
  object-fit: contain;
}

.mc-app__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.mc-app__meta {
  margin: 0;
  font-weight: 700;
  color: var(--text-muted);
}

.mc-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 4.5rem;
}

.mc-timer__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mc-start);
}

.mc-timer__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.mc-help {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mc-stage {
  display: flex;
  justify-content: center;
}

.mc-board {
  display: grid;
  gap: 0;
  width: min(100%, 34rem);
  aspect-ratio: 1;
  background: var(--mc-path);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mc-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: var(--mc-path);
}

.mc-cell.is-start {
  background: var(--mc-start);
}

.mc-cell.is-goal {
  background: var(--mc-goal);
}

.mc-player {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--mc-player);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
}

.mc-pad {
  display: grid;
  grid-template-columns: repeat(3, 3.2rem);
  grid-template-rows: repeat(3, 3.2rem);
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
}

.mc-pad button {
  appearance: none;
  border: 2px solid var(--mc-wall);
  border-radius: 10px;
  background: var(--mc-path);
  color: var(--mc-ink);
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  height: 100%;
}

.mc-pad button:nth-child(1) { grid-column: 2; grid-row: 1; }
.mc-pad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.mc-pad button:nth-child(3) { grid-column: 3; grid-row: 2; }
.mc-pad button:nth-child(4) { grid-column: 2; grid-row: 3; }

.mc-status {
  min-height: 1.35em;
  text-align: center;
  font-weight: 800;
}

.mc-status.is-error { color: #b42318; }
.mc-status.is-win { color: var(--mc-start); font-size: 1.1rem; }

.mc-fail,
.mc-result {
  padding: 0.85rem 1rem;
  border-radius: 12px;
}

.mc-fail {
  border: 2px solid rgba(180, 35, 24, 0.35);
  background: #fff6f5;
}

.mc-fail__title,
.mc-result__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.mc-fail__copy {
  margin: 0;
  font-weight: 600;
}

.mc-result {
  border: 2px solid rgba(42, 157, 143, 0.35);
  background: #f3fbf8;
}

.mc-result__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.mc-result__stats div {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(20, 32, 44, 0.12);
}

.mc-result__stats dt {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mc-result__stats dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.mc-result__summary,
.mc-result__link { margin: 0.7rem 0 0; font-size: 0.92rem; font-weight: 700; }
.mc-result__actions { margin: 1rem 0 0; }
.mc-result__link a { color: var(--mc-start); }

.mc-app__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

body.play-fullscreen:has(.play-game-shell--mazecraze),
body.play-fullscreen:has(.play-game-shell--mazecraze) .play-stage {
  background: var(--bg-deep);
}
body.play-fullscreen .play-game-shell--mazecraze {
  background: transparent;
  overflow: visible;
  padding: 1.25rem 1rem 4.5rem;
}
