/*
 * Molly Flynn — Nana's Yarns
 *
 * V2026.09.22
 * Build: 1
 *
 * Styles Nana's interactive story game with parrot-green ectoplasm, warm gold visitor answers and controls, materialization effects, and Nana-specific responsive and motion treatments. The finished Yarn uses an irregular, wispy ectoplasmic silhouette.
 */

/* ---------- 16. Nana's Yarns story game ---------- */
/*
 * DLC owns the story-game structure and state. Molly supplies this skin.
 * Nana's atmosphere is parrot-green ectoplasm; visitor-supplied words are gold.
 */

.dlc-story-game {
  --mf-yarn-green: #9aefad;
  --mf-yarn-green-bright: #c8ffd3;
  --mf-yarn-green-deep: #4fa969;
  --mf-yarn-green-soft: rgba(154, 239, 173, 0.14);
  --mf-yarn-green-faint: rgba(154, 239, 173, 0.07);
  --mf-yarn-gold: #f2c879;
  --mf-yarn-gold-soft: rgba(242, 200, 121, 0.16);
  position: relative;
  width: min(100%, 48rem);
  margin: 1.35rem auto 2rem;
}

.dlc-story-source,
.dlc-story-interface {
  position: relative;
  z-index: 1;
}

.dlc-story-source > :first-child,
.dlc-story-library > :first-child,
.dlc-story-form > :first-child,
.dlc-story-result > :first-child {
  margin-top: 0;
}

.dlc-story-source > :last-child,
.dlc-story-library > :last-child,
.dlc-story-form > :last-child,
.dlc-story-result > :last-child {
  margin-bottom: 0;
}

.dlc-story-library,
.dlc-story-form,
.dlc-story-result {
  position: relative;
  border: 1px solid rgba(154, 239, 173, 0.26);
  border-radius: 1rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(154, 239, 173, 0.11), transparent 58%),
    linear-gradient(180deg, rgba(15, 42, 45, 0.52), rgba(5, 20, 31, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.06),
    0 0 1.4rem rgba(79, 169, 105, 0.08);
}

.dlc-story-library,
.dlc-story-form {
  overflow: hidden;
}

.dlc-story-library {
  margin-top: 1.15rem;
  padding: 1.2rem 1.25rem 1.3rem;
}

.dlc-story-form {
  padding: 1.3rem 1.5rem 1.5rem;
  border-color: rgba(154, 239, 173, 0.30);
  background:
    radial-gradient(ellipse at 24% 0%, rgba(154, 239, 173, 0.12), transparent 42%),
    radial-gradient(ellipse at 82% 24%, rgba(79, 169, 105, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(15, 42, 45, 0.48), rgba(5, 20, 31, 0.70));
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.06),
    0 0 1.6rem rgba(79, 169, 105, 0.10);
}

/* The finished Yarn is a materialized ectoplasmic cloud rather than a card. */
.dlc-story-result {
  isolation: isolate;
  overflow: visible;
  margin: 1.25rem 0.45rem 1.75rem;
  padding: 1.55rem 1.65rem 1.65rem;
  border-color: rgba(154, 239, 173, 0.34);
  border-radius: 1.15rem 1.75rem 1.25rem 1.6rem / 1.45rem 1.05rem 1.7rem 1.15rem;
  background:
    radial-gradient(ellipse at 12% 16%, rgba(200, 255, 211, 0.17), transparent 30%),
    radial-gradient(ellipse at 88% 26%, rgba(154, 239, 173, 0.14), transparent 35%),
    radial-gradient(ellipse at 68% 92%, rgba(79, 169, 105, 0.15), transparent 38%),
    radial-gradient(ellipse at 24% 78%, rgba(154, 239, 173, 0.09), transparent 34%),
    linear-gradient(165deg, rgba(16, 52, 46, 0.70), rgba(5, 20, 31, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.09),
    0 0 1.9rem rgba(79, 169, 105, 0.16),
    0 0 4rem rgba(79, 169, 105, 0.07);
}

.dlc-story-result::before,
.dlc-story-result::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  filter: blur(0.2rem);
}

.dlc-story-result::before {
  inset: -0.7rem -0.55rem -0.45rem -0.75rem;
  border-radius: 42% 58% 46% 54% / 55% 43% 57% 45%;
  background:
    radial-gradient(ellipse at 16% 30%, rgba(154, 239, 173, 0.11), transparent 31%),
    radial-gradient(ellipse at 78% 18%, rgba(200, 255, 211, 0.08), transparent 28%),
    radial-gradient(ellipse at 86% 78%, rgba(79, 169, 105, 0.10), transparent 34%),
    radial-gradient(ellipse at 28% 92%, rgba(154, 239, 173, 0.08), transparent 32%);
}

.dlc-story-result::after {
  left: 7%;
  right: 5%;
  bottom: -0.8rem;
  height: 2rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(79, 169, 105, 0.16), transparent 68%);
  filter: blur(0.55rem);
}

.dlc-story-library-heading,
.dlc-story-form-heading,
.dlc-story-result-heading {
  width: fit-content;
  max-width: 92%;
  margin: 0 auto 0.9rem;
  padding: 0 0.35rem 0.22rem;
  color: var(--mf-yarn-green-bright);
  text-align: center;
  line-height: 1.18;
  text-shadow:
    0 0 0.35rem rgba(154, 239, 173, 0.42),
    0 0 0.95rem rgba(79, 169, 105, 0.20);
}

.dlc-story-library-heading::after,
.dlc-story-form-heading::after,
.dlc-story-result-heading::after {
  content: "";
  display: block;
  width: min(9rem, 70%);
  height: 1px;
  margin: 0.38rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(154, 239, 173, 0.62), transparent);
  box-shadow: 0 0 0.45rem rgba(154, 239, 173, 0.20);
}

.dlc-story-instructions {
  max-width: 38rem;
  margin: 0 auto 1.35rem;
  color: var(--mf-text-muted);
  text-align: center;
  line-height: 1.55;
}

.dlc-story-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.9rem 0 0.85rem;
}

.dlc-story-choice,
.dlc-story-random,
.dlc-story-submit,
.dlc-story-again {
  appearance: none;
  -webkit-appearance: none;
  min-height: 2.7rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid rgba(154, 239, 173, 0.48);
  border-radius: 0.65rem;
  color: var(--mf-text);
  background:
    linear-gradient(180deg, rgba(154, 239, 173, 0.13), rgba(79, 169, 105, 0.07)),
    rgba(4, 18, 31, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.08),
    0 0 0.7rem rgba(79, 169, 105, 0.08);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}

.dlc-story-choice:hover,
.dlc-story-random:hover,
.dlc-story-submit:hover,
.dlc-story-again:hover {
  color: var(--mf-yarn-green-bright);
  border-color: rgba(154, 239, 173, 0.78);
  background:
    linear-gradient(180deg, rgba(154, 239, 173, 0.19), rgba(79, 169, 105, 0.10)),
    rgba(4, 18, 31, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.12),
    0 0 1rem rgba(79, 169, 105, 0.18);
}

.dlc-story-choice:focus-visible,
.dlc-story-random:focus-visible,
.dlc-story-submit:focus-visible,
.dlc-story-again:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.dlc-story-random {
  display: block;
  margin: 0.2rem auto 0;
  border-color: rgba(242, 200, 121, 0.58);
  color: var(--mf-yarn-gold);
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 200, 121, 0.12), transparent 75%),
    rgba(4, 18, 31, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 190, 0.08),
    0 0 0.8rem rgba(242, 200, 121, 0.08);
}

.dlc-story-random:hover {
  color: #ffe3a6;
  border-color: rgba(242, 200, 121, 0.82);
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 200, 121, 0.18), transparent 75%),
    rgba(4, 18, 31, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 190, 0.12),
    0 0 1rem rgba(242, 200, 121, 0.15);
}

.dlc-story-fields {
  width: min(100%, 31rem);
  margin: 0 auto;
}

.dlc-story-field {
  margin: 0 0 1.2rem;
}

.dlc-story-field label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--mf-text);
  font-weight: 700;
  line-height: 1.35;
}

.dlc-story-field input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.62rem 0.55rem 0.48rem;
  border: 0;
  border-bottom: 2px solid rgba(242, 200, 121, 0.76);
  border-radius: 0.3rem 0.3rem 0 0;
  color: #fff4dc;
  caret-color: var(--mf-yarn-gold);
  background:
    linear-gradient(180deg, rgba(242, 200, 121, 0.045), rgba(242, 200, 121, 0.018));
  box-shadow:
    inset 0 -0.15rem 0.55rem rgba(242, 200, 121, 0.025),
    0 0.3rem 0.75rem rgba(0, 0, 0, 0.10);
  font: inherit;
}

.dlc-story-field input[type="text"]:hover {
  border-bottom-color: var(--mf-yarn-gold);
  background: linear-gradient(180deg, rgba(242, 200, 121, 0.065), rgba(242, 200, 121, 0.025));
}

.dlc-story-field input[type="text"]:focus,
.dlc-story-field input[type="text"]:focus-visible {
  border-bottom-color: #ffe3a6;
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  background: linear-gradient(180deg, rgba(242, 200, 121, 0.085), rgba(242, 200, 121, 0.035));
  box-shadow:
    0 0 0.9rem rgba(242, 200, 121, 0.09),
    inset 0 -0.15rem 0.6rem rgba(242, 200, 121, 0.04);
}

.dlc-story-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.dlc-story-submit,
.dlc-story-again {
  min-width: 10rem;
}

.dlc-story-content {
  position: relative;
  z-index: 1;
  font-size: 1.03em;
  line-height: 1.72;
}

.dlc-story-content > :first-child {
  margin-top: 0;
}

.dlc-story-content > :last-child {
  margin-bottom: 0;
}

.dlc-story-answer {
  color: var(--mf-yarn-gold);
  font-weight: 700;
  text-shadow:
    0 0 0.25rem rgba(242, 200, 121, 0.32),
    0 0 0.7rem rgba(242, 200, 121, 0.14);
}

/* Nana's page uses her parrot-green ghost light instead of the default blue. */
body:has(.dlc-story-game) .dlc-subnav-current,
body:has(.dlc-story-game) .dlc-subnav-link[aria-current="page"] {
  background:
    radial-gradient(circle at 0.58rem 50%, rgba(154, 239, 173, 0.15), transparent 1.8rem);
}

body:has(.dlc-story-game) .dlc-subnav-current::before,
body:has(.dlc-story-game) .dlc-subnav-link[aria-current="page"]::before {
  background: var(--mf-yarn-green, #9aefad);
  box-shadow:
    0 0 0.16rem rgba(200, 255, 211, 0.96),
    0 0 0.42rem rgba(154, 239, 173, 0.72),
    0 0 0.75rem rgba(79, 169, 105, 0.40);
}

/* Materialization keeps its visual atmosphere even when motion is disabled. */
@media (prefers-reduced-motion: no-preference) {
  .dlc-story-form {
    animation: mf-yarn-materialize 520ms ease-out both;
  }

  .dlc-story-result {
    animation: mf-yarn-materialize-result 620ms ease-out both;
  }

  @keyframes mf-yarn-materialize {
    from {
      opacity: 0;
      transform: translateY(0.35rem);
      filter: blur(0.18rem);
    }

    to {
      opacity: 1;
      transform: translateY(0);
      filter: blur(0);
    }
  }

  @keyframes mf-yarn-materialize-result {
    from {
      opacity: 0;
      transform: translateY(0.4rem) scale(0.992);
      filter: blur(0.22rem);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
      filter: blur(0);
    }
  }
}

@media (max-width: 44rem) {
  .dlc-story-game {
    margin-top: 1.1rem;
  }

  .dlc-story-library,
  .dlc-story-form {
    padding: 1.05rem 0.9rem 1.15rem;
    border-radius: 0.8rem;
  }

  .dlc-story-result {
    margin-left: 0.2rem;
    margin-right: 0.2rem;
    padding: 1.15rem 1rem 1.3rem;
  }

  .dlc-story-library-heading,
  .dlc-story-form-heading,
  .dlc-story-result-heading {
    max-width: 100%;
  }

  .dlc-story-choices {
    gap: 0.55rem;
  }

  .dlc-story-choice {
    width: 100%;
  }

  .dlc-story-random,
  .dlc-story-submit,
  .dlc-story-again {
    width: min(100%, 22rem);
  }

  .dlc-story-fields {
    width: 100%;
  }
}

/* ---------- 17. Nana's Yarns v16 polish ---------- */
/*
 * Softens the finished Yarn's remaining card-like edge, strengthens the
 * amber-underlined form fields, and adds restrained feather-like ectoplasmic
 * wisps around the materialized Yarn.
 */

.dlc-story-result {
  border-color: rgba(154, 239, 173, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(200, 255, 211, 0.055),
    0 0 2.2rem rgba(79, 169, 105, 0.18),
    0 0 4.8rem rgba(79, 169, 105, 0.08);
}

.dlc-story-result::before {
  inset: -1rem -1.05rem -1.25rem -1.15rem;
  border-radius: 39% 61% 44% 56% / 58% 40% 60% 42%;
  background:
    radial-gradient(ellipse at 12% 34%, rgba(200, 255, 211, 0.13), transparent 26%),
    radial-gradient(ellipse at 83% 17%, rgba(154, 239, 173, 0.10), transparent 27%),
    radial-gradient(ellipse at 91% 72%, rgba(79, 169, 105, 0.13), transparent 30%),
    radial-gradient(ellipse at 24% 94%, rgba(154, 239, 173, 0.12), transparent 29%),
    radial-gradient(ellipse at 57% 108%, rgba(79, 169, 105, 0.12), transparent 35%);
  filter: blur(0.32rem);
}

.dlc-story-result::after {
  left: -1.15rem;
  right: -0.9rem;
  bottom: -1.55rem;
  height: 4.8rem;
  border-radius: 38% 62% 46% 54% / 70% 58% 42% 30%;
  background:
    linear-gradient(116deg, transparent 0 9%, rgba(154, 239, 173, 0.16) 10% 12%, rgba(200, 255, 211, 0.07) 13%, transparent 18%),
    linear-gradient(104deg, transparent 0 24%, rgba(79, 169, 105, 0.18) 25% 28%, rgba(154, 239, 173, 0.07) 29%, transparent 35%),
    linear-gradient(78deg, transparent 0 48%, rgba(200, 255, 211, 0.10) 49% 51%, rgba(79, 169, 105, 0.12) 52%, transparent 58%),
    linear-gradient(66deg, transparent 0 68%, rgba(154, 239, 173, 0.15) 69% 72%, rgba(200, 255, 211, 0.06) 73%, transparent 79%),
    linear-gradient(54deg, transparent 0 84%, rgba(79, 169, 105, 0.15) 85% 88%, transparent 93%),
    radial-gradient(ellipse at 48% 28%, rgba(79, 169, 105, 0.14), transparent 66%);
  filter: blur(0.38rem);
  opacity: 0.9;
  transform: rotate(-0.8deg);
}

.dlc-story-result-heading {
  text-shadow:
    0 0 0.28rem rgba(200, 255, 211, 0.55),
    0 0 0.7rem rgba(154, 239, 173, 0.38),
    0 0 1.35rem rgba(79, 169, 105, 0.24);
}

.dlc-story-field input[type="text"] {
  padding: 0.64rem 0.38rem 0.48rem;
  border: 0;
  border-bottom: 2px solid rgba(242, 200, 121, 0.82);
  border-radius: 0.18rem 0.18rem 0 0;
  background:
    linear-gradient(180deg, rgba(242, 200, 121, 0.025), rgba(242, 200, 121, 0.008));
  box-shadow:
    inset 0 -0.18rem 0.5rem rgba(242, 200, 121, 0.035),
    0 0.4rem 0.8rem rgba(0, 0, 0, 0.08);
}

.dlc-story-field input[type="text"]:hover {
  border-bottom-color: #f7d692;
  background:
    linear-gradient(180deg, rgba(242, 200, 121, 0.045), rgba(242, 200, 121, 0.012));
}

.dlc-story-field input[type="text"]:focus,
.dlc-story-field input[type="text"]:focus-visible {
  border-bottom-color: #ffe3a6;
  background:
    linear-gradient(180deg, rgba(242, 200, 121, 0.065), rgba(242, 200, 121, 0.018));
}

@media (prefers-reduced-motion: no-preference) {
  .dlc-story-result::after {
    animation: mf-yarn-wisps 8s ease-in-out infinite alternate;
  }

  @keyframes mf-yarn-wisps {
    from {
      opacity: 0.72;
      transform: translate3d(-0.08rem, 0.06rem, 0) rotate(-1.2deg);
    }

    to {
      opacity: 0.94;
      transform: translate3d(0.14rem, -0.08rem, 0) rotate(0.4deg);
    }
  }
}

@media (max-width: 44rem) {
  .dlc-story-result::before {
    inset: -0.75rem -0.55rem -1rem -0.6rem;
  }

  .dlc-story-result::after {
    left: -0.45rem;
    right: -0.35rem;
    bottom: -1.25rem;
    height: 4rem;
  }
}


/* ---------- Finished Yarn refinement ---------- */
.dlc-story-result {
  border-color: transparent;
}

.dlc-story-result::after {
  left: -1.3rem;
  right: -1rem;
  bottom: -1.7rem;
  height: 5.2rem;
  border-radius: 42% 58% 48% 52% / 74% 61% 39% 26%;
  background:
    linear-gradient(119deg, transparent 0 8%, rgba(154, 239, 173, 0.18) 9% 10.5%, rgba(200, 255, 211, 0.075) 11% 12%, transparent 16%),
    linear-gradient(111deg, transparent 0 17%, rgba(79, 169, 105, 0.16) 18% 19.5%, rgba(154, 239, 173, 0.08) 20% 21%, transparent 25%),
    linear-gradient(101deg, transparent 0 29%, rgba(154, 239, 173, 0.17) 30% 32%, rgba(200, 255, 211, 0.065) 33%, transparent 38%),
    linear-gradient(82deg, transparent 0 47%, rgba(200, 255, 211, 0.10) 48% 49.5%, rgba(79, 169, 105, 0.13) 50% 51%, transparent 56%),
    linear-gradient(70deg, transparent 0 64%, rgba(154, 239, 173, 0.17) 65% 67%, rgba(200, 255, 211, 0.065) 68%, transparent 73%),
    linear-gradient(58deg, transparent 0 79%, rgba(79, 169, 105, 0.17) 80% 82%, rgba(154, 239, 173, 0.07) 83%, transparent 88%),
    radial-gradient(ellipse at 49% 24%, rgba(79, 169, 105, 0.11), transparent 64%);
  filter: blur(0.24rem);
  opacity: 0.88;
}
