.app {
  max-width: 980px;
  margin: 0 auto;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-home .app {
  max-width: 1180px;
}

.page-difference-game .app {
  max-width: 1180px;
}

.screen {
  display: block;
  animation: rise 220ms ease;
}

.panel {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.hero {
  position: relative;
  padding: 30px 24px 26px;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.98), rgba(12, 20, 36, 0.96));
  color: var(--navy);
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}

.hero h1,
.game-header h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero p,
.mini-text {
  margin: 10px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.5;
  max-width: 38rem;
}

.hero-logo {
  display: block;
  width: min(100%, 460px);
  max-height: 180px;
  margin: 0 auto 6px;
  object-fit: contain;
}

.hero p {
  margin-left: auto;
  margin-right: auto;
}

.sun {
  position: absolute;
  pointer-events: none;
  top: 22px;
  right: 26px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7a8 0%, var(--sun) 60%, #ffbf1c 100%);
  box-shadow: 0 0 0 10px rgba(255, 216, 77, 0.12);
}

.content {
  padding: 22px;
}
.play-btn,
.back-btn,
.shuffle-btn,
.restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.06rem;
  color: #f6fbff;
  background: linear-gradient(180deg, #1b2a45 0%, #132038 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(138, 180, 255, 0.16);
}

.play-btn {
  background: linear-gradient(180deg, #24395f 0%, #192947 100%);
  margin-top: 18px;
}

.footer-note {
  text-align: center;
  padding: 4px 8px 18px;
  font-weight: 700;
  color: rgba(232, 242, 255, 0.72);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes twinkle {
  from {
    transform: translateY(0) scale(0.9);
    opacity: 0.75;
  }
  to {
    transform: translateY(-3px) scale(1.08);
    opacity: 1;
  }
}
@media (max-width: 860px) {
    .hub-actions,
    .menu-grid,
    .game-layout,
    .puzzle-area,
    .art-puzzle-area,
    .connect-layout,
    .bubble-layout,
    .maze-layout,
    .count-layout,
    .trace-layout {
      grid-template-columns: 1fr;
    }

  .game-card {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  body {
    padding: 10px;
  }

  .app {
    min-height: calc(100vh - 20px);
  }

  .hero,
  .content,
  .canvas-wrap,
  .side-card,
  .puzzle-board-card,
  .game-header {
    padding: 16px;
  }

  .sun {
    width: 68px;
    height: 68px;
    top: 20px;
    right: 16px;
  }

  .top-bar {
    align-items: stretch;
  }

  .back-btn {
    width: 100%;
  }

  .stat-pill {
      min-width: 100%;
  }
}
