* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Nunito', Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,0.85) 0 8%, transparent 9%),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,0.65) 0 7%, transparent 8%),
    radial-gradient(circle at 50% 4%, rgba(255,255,255,0.45) 0 10%, transparent 11%),
    linear-gradient(180deg, #dff3ff 0%, #cde9ff 46%, #c1ebff 100%);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page-shell {
  display: flex;
  justify-content: center;
}

.storybook-card {
  width: 100%;
  max-width: 1060px;
  padding: 20px;
  border-radius: 36px;
  background: rgba(255,255,255,0.24);
  box-shadow:
    0 24px 70px rgba(71, 110, 166, 0.20),
    inset 0 1px 0 rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
}

.storybook-stage {
  width: 1000px;
  height: 600px;
  max-width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #cdeeff 0%, #eefaff 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.38);
}

.game-container,
.story-overlay {
  position: absolute;
  inset: 0;
}

.story-overlay {
  pointer-events: none;
}

.story-text-wrap {
  position: absolute;
  left: 34px;
  top: 28px;
  max-width: 470px;
}

.story-title-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 16px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  color: #5f6f8e;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(80, 113, 168, 0.16);
}

.story-text-box {
  display: none;
  padding: 18px 20px;
  border-radius: 26px;
  background: rgba(255,255,255,0.96);
  box-shadow:
    0 16px 40px rgba(93, 119, 159, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.story-text-box.is-visible {
  display: block;
}

.story-title {
  margin: 0 0 8px;
  font-family: 'Baloo 2', cursive;
  font-size: 2rem;
  line-height: 1;
  color: #425474;
}

.story-text {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.45;
  color: #1f2630;
  font-weight: 700;
}

.story-nav {
  position: absolute;
  right: 26px;
  bottom: 22px;
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.story-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(72, 88, 120, 0.16);
}

.story-btn-primary {
  background: linear-gradient(180deg, #ffcc73 0%, #ffb84f 100%);
  color: #704209;
}

.story-btn-secondary {
  background: rgba(255,255,255,0.93);
  color: #586b91;
}

.story-btn[disabled] {
  opacity: 0.45;
}

.story-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.32);
  filter: blur(5px);
}

.cloud-a { width: 150px; height: 60px; right: 130px; top: 30px; }
.cloud-b { width: 90px; height: 38px; left: 220px; top: 80px; opacity: .7; }
.cloud-c { width: 120px; height: 44px; right: 290px; top: 76px; opacity: .55; }

@media (max-width: 1060px) {
  body { padding: 14px; }
  .storybook-card { padding: 12px; border-radius: 24px; }
  .storybook-stage { width: 100%; aspect-ratio: 5 / 3; height: auto; }
  .story-text-wrap { left: 18px; top: 16px; max-width: calc(100% - 36px); }
  .story-title { font-size: 1.5rem; }
  .story-text { font-size: 1rem; }
  .story-nav { right: 14px; bottom: 14px; gap: 8px; }
  .story-btn { padding: 10px 16px; font-size: 1rem; }
}
