:root {
  --white: #ffffff;
  --blue: #0087bd;
  --yellow: #ffd300;
  --black: #000000;
  --green: #009f6b;
  --red: #c40233;

  --bg: var(--white);
  --surface: rgba(255, 255, 255, 0.96);
  --surface-blue: rgba(0, 135, 189, 0.1);
  --surface-yellow: rgba(255, 211, 0, 0.18);
  --surface-green: rgba(0, 159, 107, 0.12);
  --surface-red: rgba(196, 2, 51, 0.08);
  --text: var(--black);
  --muted: rgba(0, 0, 0, 0.7);
  --line: rgba(0, 0, 0, 0.16);
  --line-strong: rgba(0, 0, 0, 0.3);
  --shadow: 10px 10px 0 rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(0, 135, 189, 0.18), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(255, 211, 0, 0.28), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 56%, #f7fbfd 72%, #fffdf4 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 92%);
}

body::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(36vw, 440px);
  height: min(44vh, 360px);
  background:
    linear-gradient(
      135deg,
      var(--blue) 0 44%,
      var(--yellow) 44% 72%,
      var(--black) 72% 84%,
      var(--green) 84% 94%,
      var(--red) 94% 100%
    );
  clip-path: polygon(35% 0, 100% 0, 100% 100%, 0 100%, 0 38%);
  opacity: 0.16;
  pointer-events: none;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
  position: relative;
}

.page-shell::before {
  content: "";
  display: block;
  height: 16px;
  margin-bottom: 18px;
  border-radius: 999px;
  border: 2px solid var(--black);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(
      90deg,
      var(--white) 0 30%,
      var(--blue) 30% 54%,
      var(--yellow) 54% 72%,
      var(--black) 72% 86%,
      var(--green) 86% 95%,
      var(--red) 95% 100%
    );
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 36px;
  border: 2px solid var(--black);
  border-radius: 34px;
  background: var(--white);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(34%, 340px);
  background:
    linear-gradient(
      145deg,
      var(--blue) 0 48%,
      var(--yellow) 48% 75%,
      var(--black) 75% 86%,
      var(--green) 86% 95%,
      var(--red) 95% 100%
    );
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%, 12% 48%);
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.compact-hero {
  align-items: center;
}

.hero h1,
.post-card h2,
.post-card h3,
.sidebar-card h2,
.sidebar-card h3,
.chat-card h2,
.toy-card h2,
.toy-card h3,
.composer-card h2,
.game-stage h2,
.analysis-card h3 {
  margin: 0;
  font-family: "Prata", serif;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.hero h1 {
  font-size: clamp(2.8rem, 4.5vw, 4.8rem);
  max-width: 10ch;
  line-height: 0.94;
}

.hero-copy {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--red);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 2px solid var(--black);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button:hover,
.sidebar-link:hover,
.dialog-item:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.12);
}

.button-primary:hover {
  background: var(--blue);
}

.button-secondary {
  background: var(--white);
  color: var(--black);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.06);
}

.button-secondary:hover,
.button-ghost:hover {
  background: var(--yellow);
}

.button-ghost {
  background: transparent;
  color: var(--black);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.9fr);
  gap: 24px;
  margin-top: 26px;
  align-items: start;
}

.feed-column,
.sidebar,
.chat-layout,
.toys-grid,
.sprouts-page,
.sprouts-main,
.sprouts-sidebar {
  position: relative;
  z-index: 1;
}

.feed-column,
.sidebar,
.sprouts-main,
.sprouts-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.composer-card,
.post-card,
.sidebar-card,
.chat-card,
.toy-card,
.game-stage,
.analysis-card {
  border: 2px solid var(--black);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.composer-card,
.post-card,
.chat-card,
.toy-card,
.game-stage,
.analysis-card {
  padding: 26px;
}

.composer-card {
  background: linear-gradient(180deg, var(--surface-yellow), rgba(255, 255, 255, 0.98) 36%);
}

.post-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(0, 135, 189, 0.03));
}

.featured-post {
  background:
    linear-gradient(145deg, rgba(0, 135, 189, 0.2) 0 42%, rgba(255, 211, 0, 0.25) 42% 76%, rgba(255, 255, 255, 0.98) 76% 100%);
}

.sidebar-card {
  padding: 24px;
  position: sticky;
  top: 22px;
}

.sidebar-card + .sidebar-card {
  position: relative;
  top: auto;
}

.nav-card {
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.16), rgba(255, 255, 255, 0.98) 28%);
}

.accent-card {
  background: linear-gradient(180deg, rgba(0, 159, 107, 0.18), rgba(255, 255, 255, 0.98) 40%);
}

.composer-head,
.post-topline,
.chat-head,
.game-stage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.composer-box {
  margin: 18px 0;
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.08), rgba(255, 255, 255, 0.96));
  color: var(--muted);
  line-height: 1.75;
}

.composer-actions,
.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.metric {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  font-size: 0.85rem;
  font-weight: 800;
}

.chip-accent {
  background: var(--red);
  color: var(--white);
}

.chip-dark {
  background: var(--black);
  color: var(--white);
}

.chip-soft {
  background: var(--yellow);
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-card p,
.sidebar-card p,
.chat-card p,
.toy-card p,
.analysis-card p,
.game-stage p {
  color: var(--muted);
  line-height: 1.75;
}

.post-card h2,
.sidebar-card h2,
.game-stage h2 {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  margin-bottom: 10px;
}

.post-card h3,
.sidebar-card h3,
.toy-card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.post-meta {
  color: rgba(0, 0, 0, 0.62);
  font-size: 0.95rem;
}

.sidebar-link,
.dialog-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 2px solid var(--black);
  background: var(--white);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.06);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.sidebar-link {
  margin-top: 12px;
}

.sidebar-link small {
  color: var(--muted);
  font-size: 0.85rem;
}

.primary-link {
  background: linear-gradient(135deg, var(--blue), #19a1d5);
  color: var(--white);
}

.primary-link small {
  color: rgba(255, 255, 255, 0.84);
}

.simple-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.82;
}

.simple-list li::marker,
.rule-list li::marker {
  color: var(--red);
  font-weight: 800;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 26px;
}

.dialog-list {
  display: flex;
}

.dialog-list .sidebar-card {
  width: 100%;
  position: relative;
  top: auto;
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.14), rgba(255, 255, 255, 0.98) 28%);
}

.dialog-item {
  margin-top: 12px;
  color: var(--muted);
}

.dialog-item strong {
  color: var(--text);
}

.dialog-item-active {
  background: linear-gradient(135deg, rgba(0, 159, 107, 0.18), rgba(255, 255, 255, 0.98));
}

.chat-card {
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.1), rgba(255, 255, 255, 0.98) 26%);
}

.message-stack {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.message-bubble {
  max-width: min(88%, 580px);
  padding: 18px 20px;
  border-radius: 24px;
  border: 2px solid var(--black);
  background: var(--white);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.05);
}

.incoming {
  background: linear-gradient(135deg, rgba(0, 135, 189, 0.08), rgba(255, 255, 255, 0.98));
}

.outgoing {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(0, 159, 107, 0.16), rgba(255, 255, 255, 0.98));
}

.message-bubble strong {
  display: block;
  margin-bottom: 8px;
}

.message-bubble p {
  margin: 0;
}

.chat-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 2px dashed var(--black);
  background: linear-gradient(135deg, rgba(255, 211, 0, 0.18), rgba(255, 255, 255, 0.98));
  color: var(--muted);
}

.toys-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 26px;
}

.toy-directory {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.16), rgba(255, 255, 255, 0.98) 32%);
}

.toy-card-featured {
  grid-column: 1 / -1;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background:
    linear-gradient(
      180deg,
      var(--blue) 0 15%,
      var(--yellow) 15% 27%,
      var(--black) 27% 35%,
      var(--green) 35% 42%,
      var(--red) 42% 48%,
      rgba(255, 255, 255, 0.98) 48% 100%
    );
}

.toy-card-featured h2,
.toy-card-featured p {
  color: var(--black);
}

.toy-card-game {
  gap: 18px;
}

.toy-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.sprouts-page {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 24px;
  margin-top: 26px;
  align-items: start;
}

.game-stage {
  background: linear-gradient(180deg, rgba(255, 211, 0, 0.22), rgba(255, 255, 255, 0.98) 32%);
}

.short-rules-card h2 {
  margin: 0 0 14px;
}

.rule-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.82;
  font-weight: 700;
}

.rule-list li + li {
  margin-top: 6px;
}

.short-note {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.sprouts-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.analysis-card {
  padding: 22px;
}

.analysis-card:nth-child(1) {
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.14), rgba(255, 255, 255, 0.98) 28%);
}

.analysis-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(0, 159, 107, 0.14), rgba(255, 255, 255, 0.98) 28%);
}

.analysis-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(196, 2, 51, 0.08), rgba(255, 255, 255, 0.98) 28%);
}

.analysis-card h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.sprouts-figure {
  display: flex;
  flex-direction: column;
}

.control-card {
  position: sticky;
  top: 22px;
  background: linear-gradient(180deg, rgba(0, 135, 189, 0.16), rgba(255, 255, 255, 0.98) 32%);
}

.status-copy {
  color: var(--muted);
  line-height: 1.72;
}

.sprouts-image {
  width: 100%;
  display: block;
  margin: 8px 0 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid var(--black);
}

.sprouts-image-compact {
  max-width: 247px;
  align-self: center;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 800;
}

.source-link:hover {
  color: var(--red);
}

@media (max-width: 980px) {
  body::after {
    width: 100%;
    height: 140px;
    right: 0;
    bottom: 0;
    clip-path: polygon(0 28%, 100% 0, 100% 100%, 0 100%);
  }

  .layout,
  .chat-layout,
  .toys-grid,
  .sprouts-page,
  .sprouts-figure-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .compact-hero {
    flex-direction: column;
    align-items: start;
    padding: 28px;
  }

  .hero::after {
    inset: auto 0 0 0;
    width: auto;
    height: 22px;
    clip-path: none;
    background:
      linear-gradient(
        90deg,
        var(--white) 0 26%,
        var(--blue) 26% 53%,
        var(--yellow) 53% 73%,
        var(--black) 73% 86%,
        var(--green) 86% 95%,
        var(--red) 95% 100%
      );
  }

  .hero h1 {
    max-width: 100%;
  }

  .sidebar-card,
  .dialog-list .sidebar-card,
  .control-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 16px;
  }

  .page-shell::before {
    height: 14px;
    margin-bottom: 14px;
  }

  .hero,
  .composer-card,
  .post-card,
  .sidebar-card,
  .chat-card,
  .toy-card,
  .game-stage,
  .analysis-card {
    padding: 20px;
    border-radius: 24px;
  }

  .chat-input,
  .toy-card-actions,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .message-bubble {
    max-width: 100%;
  }

  .button {
    width: 100%;
  }
}
