:root {
  --bg-top: #ffe6f3;
  --bg-bottom: #fff8d9;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(255, 214, 234, 0.9);
  --text-main: #684f66;
  --text-soft: #9c7891;
  --pink: #ff7ab5;
  --pink-deep: #ff549d;
  --peach: #ffb97f;
  --cream: #fff9f3;
  --mint: #c6f5da;
  --mint-deep: #61c98f;
  --gold: #ffd769;
  --wall-top: #ffcf90;
  --wall-bottom: #f2a96f;
  --shadow: 0 28px 50px rgba(225, 129, 174, 0.18);
  --cell-size: min(62px, 11vw);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.62), transparent 16%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

.page-sparkles span {
  position: fixed;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  filter: blur(3px);
  pointer-events: none;
  animation: float 5s ease-in-out infinite;
}

.page-sparkles span:nth-child(1) {
  top: 32px;
  left: -24px;
}

.page-sparkles span:nth-child(2) {
  top: 120px;
  right: 42px;
  width: 80px;
  height: 80px;
  animation-delay: 0.9s;
}

.page-sparkles span:nth-child(3) {
  bottom: 60px;
  left: 8%;
  width: 72px;
  height: 72px;
  animation-delay: 0.4s;
}

.page-sparkles span:nth-child(4) {
  right: -30px;
  bottom: 120px;
  animation-delay: 1.1s;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.page-nav a,
.page-footer a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
}

.page-nav a {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 214, 234, 0.88);
  box-shadow: 0 10px 18px rgba(225, 129, 174, 0.1);
}

.language-switch {
  display: inline-flex;
  margin-left: auto;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 214, 234, 0.88);
}

.lang-button {
  min-width: 72px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.lang-button:hover {
  transform: translateY(-1px);
}

.lang-button:active {
  transform: scale(0.97);
}

.lang-button.active {
  color: white;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
}

.hero-card,
.play-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 18px;
}

.eyebrow,
.mini-label {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--text-soft);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 0.95;
}

.subtitle {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 520px;
}

.hero-stickers {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.7),
    0 12px 20px rgba(236, 144, 183, 0.14);
  animation: float 3.5s ease-in-out infinite;
}

.sticker:nth-child(2) {
  animation-delay: 0.3s;
}

.sticker:nth-child(3) {
  animation-delay: 0.7s;
}

.play-panel {
  padding: 22px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stat-strip,
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  min-width: 132px;
  padding: 13px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 252, 0.96));
  border: 2px solid rgba(255, 213, 232, 0.95);
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.stat-pill strong {
  font-size: 1.35rem;
}

#difficulty-badge {
  font-size: 1.05rem;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0) scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.primary-button,
.secondary-button,
.control-button {
  border-radius: 18px;
  font-weight: 700;
}

.primary-button {
  padding: 14px 18px;
  color: white;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  box-shadow: 0 14px 24px rgba(255, 84, 157, 0.24);
}

.secondary-button {
  padding: 14px 18px;
  color: var(--text-main);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 248, 0.96));
  border: 2px solid rgba(255, 214, 234, 0.9);
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 320px;
  gap: 18px;
  align-items: start;
}

.board-card,
.side-card {
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 250, 244, 0.8));
  border: 2px solid rgba(255, 229, 188, 0.86);
}

.board-card {
  padding: 18px;
}

.board-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(74vw, 660px);
  padding: 22px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 255, 0.94), rgba(255, 247, 228, 0.94)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.6), transparent 44%);
  overflow: hidden;
}

.board {
  display: grid;
  gap: 8px;
  justify-content: center;
  align-content: center;
  width: fit-content;
}

.cell {
  position: relative;
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 18px;
}

.cell.void {
  visibility: hidden;
}

.cell.floor {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, #fffef7, #fff2d7);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.84),
    0 10px 18px rgba(237, 187, 135, 0.12);
}

.cell.wall {
  background:
    linear-gradient(180deg, var(--wall-top), var(--wall-bottom));
  box-shadow:
    inset 0 -6px 0 rgba(196, 120, 67, 0.22),
    inset 0 0 0 2px rgba(255, 239, 221, 0.64),
    0 10px 18px rgba(198, 128, 71, 0.18);
}

.cell.wall::before {
  content: "";
  position: absolute;
  inset: 13px 10px auto;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 243, 226, 0.6);
}

.cell.target::after {
  content: "🌼";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--cell-size) * 0.45);
  animation: pulse 2.1s ease-in-out infinite;
}

.entity {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}

.entity.box::before,
.entity.player::before {
  display: block;
}

.entity.box::before {
  content: "🎁";
  font-size: calc(var(--cell-size) * 0.64);
  filter: drop-shadow(0 6px 7px rgba(211, 112, 141, 0.2));
}

.entity.player::before {
  content: "🐰";
  font-size: calc(var(--cell-size) * 0.62);
  animation: bob 1.6s ease-in-out infinite;
}

.entity.box.on-target::before {
  filter:
    drop-shadow(0 0 10px rgba(255, 220, 104, 0.82))
    drop-shadow(0 8px 8px rgba(211, 112, 141, 0.18));
}

.banner {
  position: absolute;
  width: min(320px, calc(100% - 36px));
  padding: 22px 20px;
  border-radius: 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid rgba(255, 214, 234, 0.92);
  box-shadow: 0 20px 34px rgba(223, 133, 174, 0.22);
  z-index: 3;
}

.banner.hidden {
  display: none;
}

.banner-tag {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.banner h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.banner p {
  margin: 0 0 16px;
  line-height: 1.5;
  color: var(--text-soft);
}

.side-card {
  padding: 20px;
}

.side-card-head h2 {
  margin: 0;
  font-size: 1.75rem;
}

.hint-text {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 247, 216, 0.9);
  color: #927554;
  line-height: 1.55;
}

.legend {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.legend-item,
.instruction-card {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 2px solid rgba(255, 235, 200, 0.88);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.35rem;
}

.legend-icon.bunny {
  background: rgba(255, 236, 243, 0.9);
}

.legend-icon.gift {
  background: rgba(255, 242, 229, 0.9);
}

.legend-icon.flower {
  background: rgba(255, 249, 221, 0.94);
}

.instruction-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.instruction-card p {
  margin: 0;
  line-height: 1.55;
}

.instruction-card p + p {
  margin-top: 6px;
}

.keycaps {
  font-weight: 700;
  letter-spacing: 0.14em;
}

.mobile-controls {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(68px, 84px));
  grid-template-areas:
    ". up ."
    "left down right";
  justify-content: center;
  gap: 12px;
}

.control-button {
  height: 68px;
  font-size: 1.4rem;
  color: var(--text-main);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 238, 246, 0.94));
  border: 2px solid rgba(255, 214, 234, 0.9);
  box-shadow: 0 12px 18px rgba(232, 148, 183, 0.14);
}

.control-button.up {
  grid-area: up;
}

.control-button.left {
  grid-area: left;
}

.control-button.down {
  grid-area: down;
}

.control-button.right {
  grid-area: right;
}

.info-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.info-card {
  padding: 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 232, 198, 0.9);
  box-shadow: var(--shadow);
}

.info-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.info-card h2 {
  margin: 0 0 12px;
}

.info-card p,
.info-card li {
  color: var(--text-soft);
  line-height: 1.6;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
}

.info-card li + li {
  margin-top: 8px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 2px 4px 0;
  color: var(--text-soft);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

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

  .board-frame {
    min-height: 0;
  }

  .side-card {
    order: -1;
  }
}

@media (max-width: 720px) {
  :root {
    --cell-size: min(13vw, 54px);
  }

  .app-shell {
    width: min(100% - 18px, 100%);
    padding: 18px 0 28px;
  }

  .hero-card,
  .play-panel {
    border-radius: 28px;
  }

  .hero-card {
    padding: 22px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stickers {
    justify-content: flex-start;
  }

  .play-panel {
    padding: 18px;
  }

  .board-card,
  .side-card {
    padding: 16px;
  }

  .board-frame {
    padding: 14px;
  }

  .mobile-controls {
    grid-template-columns: repeat(3, minmax(62px, 1fr));
  }

  .control-button {
    height: 62px;
  }

  .page-footer {
    padding-left: 2px;
    padding-right: 2px;
  }
}
