/* Game page shell — header, SEO chrome, play area */

.game-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  font-family: var(--font-body, 'Nunito', sans-serif);
  color: var(--color-text, #1E293B);
  overflow-x: hidden;
}

.game-chrome {
  background: linear-gradient(180deg, #EDE9FE 0%, #F8FAFC 100%);
  border-bottom: 1px solid #E2E8F0;
  padding: 0.5rem 1rem;
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
}

.game-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 0;
}

.game-breadcrumb li + li::before {
  content: '›';
  margin-right: 0.35rem;
  color: #94A3B8;
}

.game-breadcrumb a {
  color: #7C3AED;
  text-decoration: none;
}

.game-breadcrumb a:hover,
.game-breadcrumb a:focus-visible {
  text-decoration: underline;
}

.game-breadcrumb [aria-current='page'] {
  color: #334155;
}

.game-seo-intro {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #CBD5E1;
}

.game-seo-intro h1 {
  font-family: var(--font-display, 'Fredoka', sans-serif);
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: #4C1D95;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.game-seo-intro p {
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  line-height: 1.55;
  color: #64748B;
  max-width: 70ch;
}

.game-page .game-hud {
  position: fixed;
  top: calc(var(--header-height, 64px) + var(--safe-top, env(safe-area-inset-top, 0px)) + 8px);
  right: calc(10px + env(safe-area-inset-right, 0px));
  left: auto;
  z-index: 40;
}

.game-chrome--with-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
}

.game-chrome--with-hud .game-breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
}

.game-chrome--with-hud .game-hud {
  position: static;
  flex: 0 0 auto;
  max-width: 100%;
}

.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
  position: relative;
  width: 100%;
  min-height: 50vh;
}

.game-seo-footer {
  background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
  border-top: 1px solid #CBD5E1;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
}

.game-seo-footer__inner {
  max-width: 720px;
  margin: 0 auto;
}

.game-seo-footer .ad-slot {
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.65);
}

.game-seo-footer h2 {
  font-family: var(--font-display, 'Fredoka', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #4C1D95;
  margin-bottom: 0.6rem;
}

.game-seo-footer__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.75rem;
}

.game-seo-footer__links a {
  font-size: 0.85rem;
  font-weight: 700;
  color: #7C3AED;
  text-decoration: none;
}

.game-seo-footer__links a:hover,
.game-seo-footer__links a:focus-visible {
  text-decoration: underline;
}

.game-seo-footer__hub a {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0891B2;
  text-decoration: none;
}

.game-seo-footer__hub a:hover,
.game-seo-footer__hub a:focus-visible {
  text-decoration: underline;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  pointer-events: none;
}

.game-hud > * {
  pointer-events: auto;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.92);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: clamp(0.68rem, 2.5vw, 0.78rem);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: #1E293B;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.8vw, 0.95rem);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: scale(1.04);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
  background: #F1F5F9;
  color: #1E293B;
}

.btn-accent {
  background: linear-gradient(135deg, #06B6D4, #0891B2);
  color: #fff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.97);
  z-index: 20;
  padding: 1.5rem;
  padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
  text-align: center;
  gap: 1rem;
  overflow-y: auto;
}

.game-overlay.hidden {
  display: none;
}

.game-overlay h2 {
  font-family: var(--font-display, 'Fredoka', sans-serif);
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  color: #7C3AED;
}

.game-overlay p {
  color: #64748B;
  max-width: min(320px, 100%);
}

.game-overlay .win-bounce {
  animation: winBounce 0.6s ease;
}

@keyframes winBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
  70% { transform: scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .win-bounce { animation: none; }
  .btn:hover { transform: none; }
}

.game-board {
  width: 100%;
  max-width: min(480px, 100%);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
  max-width: 360px;
}

.game-actions .btn {
  flex: 1 1 auto;
  min-width: min(140px, 100%);
}

@media (max-width: 640px) {
  .game-page .site-header__logo {
    padding: 4px 0;
  }
}

@media (max-width: 480px) {
  .game-chrome {
    padding: 0.45rem 0.75rem;
  }

  .game-seo-intro p {
    display: block;
    overflow: visible;
  }

  .game-hud {
    gap: 4px;
  }

  .stat-pill {
    padding: 0.3rem 0.5rem;
  }

  .game-overlay {
    padding: 1rem;
  }

  .game-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .game-actions .btn {
    width: 100%;
  }
}

@media (hover: none) {
  .btn:hover {
    transform: none;
  }
}
