:root {
  --pixie-sky: #eef8ff;
  --pixie-mint: #dff7ee;
  --pixie-wall: #24435f;
  --pixie-wall-edge: #183047;
  --pixie-floor: #fbfdff;
  --pixie-star: #d9a52f;
  --pixie-danger: #b94b61;
}

.pixie-hero {
  padding: 56px 0 42px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.pixie-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}

.pixie-copy h1 {
  margin: 0 0 16px;
  color: #13233a;
  font-size: clamp(2.25rem, 5vw, 4.2rem);
  line-height: 1.08;
}

.pixie-copy p {
  margin: 0 0 22px;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.85;
}

.pixie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.game-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(24, 35, 50, 0.08);
}

.game-topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.game-topbar div {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(215, 225, 235, 0.95);
  border-radius: 14px;
  background: #f8fbff;
}

.game-topbar span,
.game-topbar strong {
  display: block;
}

.game-topbar span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.game-topbar strong {
  color: #13233a;
  font-size: 1.05rem;
}

.game-objective {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 225, 235, 0.95);
  border-radius: 14px;
  background: #fbfdff;
  color: #405066;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.55;
}

.maze-wrap {
  position: relative;
}

.maze {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  width: min(100%, 612px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid #d7e4ef;
  border-radius: 16px;
  background: var(--pixie-floor);
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(215, 225, 235, 0.52);
  background: var(--pixie-floor);
}

.cell.wall {
  border-color: rgba(24, 48, 71, 0.48);
  background: linear-gradient(135deg, var(--pixie-wall), var(--pixie-wall-edge));
}

.cell.exit {
  background: linear-gradient(135deg, var(--pixie-mint), #f7fffb);
}

.cell.exit.locked {
  background: repeating-linear-gradient(135deg, #eef3f7 0 8px, #e4ebf1 8px 16px);
}

.cell.exit.locked::before,
.cell.exit.open::before {
  display: grid;
  place-items: center;
  width: 58%;
  height: 58%;
  border-radius: 12px;
  color: #17655d;
  font-size: clamp(0.7rem, 1.8vw, 1rem);
  font-weight: 900;
  content: "門";
}

.cell.exit.locked::before {
  color: #6b7280;
  background: #ffffff;
  border: 1px solid rgba(107, 114, 128, 0.28);
}

.cell.exit.open::before {
  background: #ffffff;
  border: 1px solid rgba(40, 122, 113, 0.28);
  box-shadow: 0 8px 14px rgba(40, 122, 113, 0.14);
}

.cell.hint {
  background: #fff9e8;
  box-shadow: inset 0 0 0 3px rgba(217, 165, 47, 0.34);
}

.cell.danger-zone {
  background: #fff4f6;
}

.cell.enemy-next {
  box-shadow: inset 0 0 0 3px rgba(185, 75, 97, 0.22);
}

.cell.enemy-next::after {
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(185, 75, 97, 0.45);
  content: "";
}

.cell.exit.open.hint,
.cell.exit.locked.hint {
  box-shadow: inset 0 0 0 3px rgba(217, 165, 47, 0.42);
}

.star {
  width: 44%;
  height: 44%;
  background: var(--pixie-star);
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 38% 34%);
  filter: drop-shadow(0 3px 4px rgba(150, 105, 20, 0.22));
}

.pixie {
  position: relative;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #ffffff 0 12%, #82d6c4 13% 44%, #278a7f 45% 100%);
  box-shadow: 0 6px 12px rgba(24, 35, 50, 0.18);
}

.pixie::before,
.pixie::after {
  position: absolute;
  top: 14%;
  width: 40%;
  height: 42%;
  border-radius: 70% 30% 70% 30%;
  background: rgba(223, 247, 238, 0.92);
  border: 1px solid rgba(40, 122, 113, 0.26);
  content: "";
}

.pixie::before {
  left: -26%;
  transform: rotate(-28deg);
}

.pixie::after {
  right: -26%;
  transform: rotate(28deg) scaleX(-1);
}

.enemy {
  position: relative;
  width: 58%;
  height: 58%;
  border-radius: 42% 42% 48% 48%;
  background: linear-gradient(180deg, #d86a7d, var(--pixie-danger));
  box-shadow: inset 0 8px 12px rgba(255, 255, 255, 0.16), 0 6px 12px rgba(24, 35, 50, 0.16);
}

.enemy::before,
.enemy::after {
  position: absolute;
  top: 38%;
  width: 8%;
  height: 8%;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.enemy::before {
  left: 38%;
}

.enemy::after {
  right: 38%;
}

.game-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(8px);
}

.game-message[hidden] {
  display: none;
}

.game-message > * {
  grid-column: 1;
}

.game-message h2 {
  align-self: end;
  margin: 0 0 8px;
  color: #13233a;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.game-message p {
  align-self: start;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.game-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.game-progress span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(215, 225, 235, 0.95);
  border-radius: 999px;
  background: #ffffff;
  color: #405066;
  font-size: 0.88rem;
  font-weight: 800;
}

.game-progress span.is-warning {
  border-color: rgba(185, 75, 97, 0.24);
  background: #fff4f6;
  color: #93384b;
}

.game-progress span.is-ready {
  border-color: rgba(40, 122, 113, 0.24);
  background: #f3fbf8;
  color: #17655d;
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-areas:
    ". up ."
    "left down right";
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.touch-controls button {
  width: 64px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: #13233a;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(24, 35, 50, 0.08);
}

.touch-controls button:active {
  transform: translateY(1px);
}

.touch-controls [data-move="up"] { grid-area: up; }
.touch-controls [data-move="left"] { grid-area: left; }
.touch-controls [data-move="down"] { grid-area: down; }
.touch-controls [data-move="right"] { grid-area: right; }

.lesson-strip article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(24, 35, 50, 0.07);
}

.lesson-strip span {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-strip h2 {
  margin: 12px 0 8px;
  color: #13233a;
}

.lesson-strip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 920px) {
  .pixie-layout {
    grid-template-columns: 1fr;
  }

  .pixie-copy {
    max-width: 46rem;
  }
}

@media (max-width: 560px) {
  .pixie-hero {
    padding-top: 38px;
  }

  .game-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .game-topbar {
    grid-template-columns: 1fr;
  }

  .game-progress {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-progress span {
    border-radius: 14px;
  }

  .game-topbar div {
    min-height: 54px;
  }

  .maze {
    border-radius: 12px;
  }

  .cell {
    border-width: 0.5px;
  }

  .touch-controls {
    grid-template-columns: repeat(3, minmax(56px, 68px));
  }

  .touch-controls button {
    width: auto;
    height: 52px;
  }
}
