:root {
  --page: #eef5ef;
  --panel: #fffdf6;
  --panel-border: #cbdcce;
  --text-main: #2d261c;
  --text-soft: #6d604d;
  --accent: #c58d38;
  --accent-dark: #23543a;
  --bubble-blue: #4f83bf;
  --bubble-red: #d85a56;
  --bubble-gold: #e3af3f;
  --shadow-soft: 0 18px 44px rgba(35, 84, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(79, 131, 191, 0.16), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(216, 90, 86, 0.14), transparent 24%),
    radial-gradient(circle at 74% 82%, rgba(227, 175, 63, 0.14), transparent 30%),
    var(--page);
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

a {
  color: var(--accent-dark);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.breadcrumb {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid rgba(102, 88, 69, 0.28);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.game-shell,
.panel,
.faq-panel,
.related-panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 24px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 138px;
  height: 90px;
  background:
    radial-gradient(circle at 20% 50%, var(--bubble-red) 0 13px, transparent 14px),
    radial-gradient(circle at 46% 34%, var(--bubble-blue) 0 17px, transparent 18px),
    radial-gradient(circle at 72% 58%, var(--bubble-gold) 0 15px, transparent 16px),
    radial-gradient(circle at 56% 76%, #4f9b72 0 13px, transparent 14px);
  opacity: 0.2;
  pointer-events: none;
}

.hero-panel {
  padding: 28px;
  border-radius: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

p,
ul,
ol {
  margin-top: 0;
}

.lead {
  max-width: 760px;
  color: var(--text-soft);
  font-size: 1.13rem;
}

.hero-actions,
.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
.game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.button.primary,
.game-button.primary {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fffaf0;
}

.icon-button {
  width: 48px;
  padding: 10px;
}

.button:hover,
.button:focus-visible,
.game-button:hover,
.game-button:focus-visible {
  outline: 3px solid rgba(184, 134, 48, 0.24);
  outline-offset: 2px;
}

.game-shell {
  position: relative;
  margin-bottom: 24px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(247, 251, 246, 0.96)),
    var(--panel);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(35, 84, 58, 0.08);
  border-radius: 18px;
  pointer-events: none;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.status-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(246, 240, 228, 0.68);
  text-align: center;
}

.status-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-item strong {
  display: block;
  min-height: 28px;
  font-size: 1.25rem;
}

#bubble-next {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 2px solid rgba(45, 38, 28, 0.18);
  border-radius: 50%;
}

.canvas-wrap {
  position: relative;
  display: grid;
  justify-content: center;
  margin: 0 auto 14px;
}

.canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 10px 50%;
  width: min(320px, 76vw);
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(79, 131, 191, 0.09);
  filter: blur(18px);
  pointer-events: none;
}

#bubble-canvas {
  position: relative;
  display: block;
  width: min(100%, 420px);
  height: auto;
  border: 1px solid rgba(35, 84, 58, 0.2);
  border-radius: 22px;
  background: #fbf6eb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 -28px 60px rgba(197, 141, 56, 0.12),
    0 18px 38px rgba(35, 84, 58, 0.12);
  touch-action: none;
}

.game-toolbar {
  justify-content: center;
}

.game-note {
  margin: 12px auto 0;
  max-width: 680px;
  color: var(--text-soft);
  text-align: center;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.panel,
.faq-panel,
.related-panel {
  padding: 24px;
  border-radius: 18px;
}

.panel li,
.hero-panel li {
  margin-bottom: 6px;
}

.faq-list {
  display: grid;
  gap: 8px;
}

details {
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-border);
}

details:last-child {
  border-bottom: 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

summary + p {
  margin: 10px 0 0;
  color: var(--text-soft);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(246, 240, 228, 0.66);
  color: inherit;
  text-decoration: none;
}

.related-card span {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: inherit;
  background: rgba(45, 38, 28, 0.55);
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 24px 60px rgba(30, 28, 22, 0.28);
}

@media (max-width: 880px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-panel,
  .game-shell,
  .panel,
  .faq-panel,
  .related-panel {
    border-radius: 16px;
    padding: 18px;
  }

  .status-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  #bubble-canvas {
    border-radius: 14px;
  }
}
