* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #9ad7ff 0%, #eaf7ff 55%, #b8f2d8 100%);
  color: #17324d;
  min-height: 100vh;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  text-align: center;
}

.site-header h1 {
  margin: 6px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  color: #0f172a;
}

.content-block {
  max-width: 480px;
  margin: 0 auto 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(20, 29, 50, 0.08);
}

.content-block--compact {
  padding: 10px 14px;
}

.content-block__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
}

.content-block p {
  margin: 0 0 8px;
}

.content-block p:last-child {
  margin-bottom: 0;
}

.content-list {
  margin: 0 0 8px;
  padding-left: 1.2rem;
}

.content-list li {
  margin-bottom: 6px;
}

.age-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(20, 29, 50, 0.2);
  font-weight: 900;
  font-size: 0.9rem;
}

.reward-banner {
  max-width: 480px;
  margin: 0 auto 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(20, 29, 50, 0.08);
}

.reward-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

#gameWrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: min(72vh, 640px);
  border-radius: 16px;
  background: transparent;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 768px) {
  .page-game .site-outside-game {
    display: none;
  }

  .page-game #gameWrap {
    max-width: none;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .page-game #gameCanvas {
    height: min(100dvh, 100vh);
    border-radius: 0;
  }

  .page-game .legal-footer.site-outside-game {
    display: none;
  }
}

.in-game-legal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.in-game-legal[hidden] {
  display: none !important;
}

.in-game-legal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 50, 0.45);
}

.in-game-legal__sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 16px 16px 24px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(20, 29, 50, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.in-game-legal__sheet h2 {
  margin: 0 28px 8px 0;
  font-size: 1.1rem;
  color: #17324d;
}

.in-game-legal__sheet h3 {
  margin: 12px 0 4px;
  font-size: 0.92rem;
  color: #17324d;
}

.in-game-legal__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #17324d;
  flex: 1;
}

.in-game-legal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(20, 50, 79, 0.08);
  font-size: 1.4rem;
  line-height: 1;
  color: #17324d;
  cursor: pointer;
}

.legal-footer {
  max-width: 480px;
  margin: 16px auto 24px;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 14px;
}

.legal-footer a {
  display: inline-block;
  margin: 4px 8px;
}

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  background: rgba(255, 255, 255, 0.92);
  min-height: 100vh;
  line-height: 1.55;
}

.legal-nav {
  margin-bottom: 20px;
  font-size: 0.85rem;
}
