/* The map and questions are temporary overlays; the playfield keeps only one goal. */
.story-dialog {
  --ink: #294c42;
  --paper: #fcf8ee;
  --line: #dce3d4;
  width: min(620px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 24px;
  margin: auto;
  border: 1px solid #e0dccd;
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 100px #152f3155;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: left;
  font-family: "Pretendard", "Malgun Gothic", sans-serif;
}
.story-dialog::backdrop {
  background: #102c3166;
  backdrop-filter: blur(3px);
}
.story-dialog *,
.story-dialog *::before,
.story-dialog *::after {
  box-sizing: border-box;
}
.story-dialog button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
  font-weight: 700;
  line-height: 1.4;
  touch-action: manipulation;
}
.story-dialog button:hover:not(:disabled) {
  background: #e9efdf;
}
.story-dialog button:focus-visible {
  outline: 3px solid #d49c42;
  outline-offset: 3px;
}
.story-dialog button:disabled {
  opacity: 0.6;
  cursor: default;
}
.story-dialog .story-primary {
  display: block;
  width: 100%;
  background: #315f4a;
  color: #fff8e7;
  border-color: #315f4a;
  box-shadow: 0 4px 0 #224633;
  margin-top: 18px;
}
.story-dialog .story-primary:hover:not(:disabled) {
  background: #244d3b;
}
.story-secondary {
  width: 100%;
  margin-top: 12px;
}
.story-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.story-dialog-head small {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #7a876a;
}
.story-dialog h2 {
  font-size: clamp(21px, 2.5vw, 30px);
  letter-spacing: -0.05em;
  line-height: 1.3;
  margin: 6px 0 0;
}
.story-dialog-head > button {
  flex: 0 0 auto;
  padding: 8px 12px;
}
.story-map-dialog {
  width: min(1080px, calc(100vw - 32px));
  background: #fcf9ef;
}
.story-atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  gap: 22px;
}
.story-atlas {
  position: relative;
  min-height: 480px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #cadbcf;
  background:
    radial-gradient(ellipse at 45% 40%, #f7f6dc88, transparent 65%),
    repeating-linear-gradient(0deg, transparent 0 47px, #6d998e12 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, #6d998e12 48px),
    #dcebe2;
}
.story-atlas > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.story-atlas > svg path {
  stroke: #91ad9c;
  stroke-width: 0.5;
  stroke-dasharray: 1.3 1.5;
  fill: none;
}
.story-dialog .story-island {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 99px;
  padding: 8px 3px;
  border-radius: 42% 48% 44% 38%;
  border: 2px solid #fff8e7aa;
  background: color-mix(in srgb, var(--island) 30%, #f3f2d9);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--island) 60%, #a6b99c);
  z-index: 1;
  transition:
    box-shadow 0.2s,
    background 0.2s;
}
.story-dialog .story-island.selected {
  outline: 3px solid #ab7e37;
  outline-offset: 4px;
  background: #f6e7b9;
}
.story-island > b {
  font-family: "Noto Serif KR", "Batang", serif;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.1;
}
.story-island > span {
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
}
.story-island > small {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 3px;
}
.story-atlas-hub {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.story-atlas-hub > b {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 45% 45% 35% 35%;
  font:
    36px "Batang",
    serif;
  color: #f7edca;
  background: #466b4c;
  box-shadow:
    0 6px 0 #795b3b,
    -10px -10px 0 -5px #709a67,
    12px -13px 0 -5px #729b6f;
}
.story-atlas-hub > span {
  font-size: 11px;
  font-weight: 800;
  margin-top: 13px;
}
.story-compass {
  position: absolute;
  top: 14px;
  left: 20px;
  font:
    14px Georgia,
    serif;
  text-align: center;
  color: #7e998a;
}
.story-sea-label {
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: #77968d;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.story-map-legend {
  position: absolute;
  bottom: 18px;
  left: 18px;
  font-size: 10px;
  color: #587868;
}
.story-region {
  min-width: 0;
}
.story-region-heading > span {
  font-size: 12px;
  color: #89936f;
  font-weight: 800;
}
.story-region-heading h3 {
  margin: 4px 0 14px;
  font-size: 23px;
}
.story-chapter {
  padding: 18px;
  border-radius: 15px;
  background: #fffdfa;
  border: 1px solid #e4e5d8;
  margin-bottom: 12px;
}
.story-chapter.ready {
  border-color: #d6bf87;
  background: linear-gradient(120deg, #fff9e5, #fffdfa);
}
.story-chapter > small {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #9a7a42;
  font-weight: 800;
}
.story-chapter h4 {
  font-size: 19px;
  margin: 7px 0;
}
.story-chapter p {
  font-size: 13px;
  line-height: 1.7;
  color: #758274;
  margin: 4px 0 12px;
}
.story-chapter.soon button {
  width: 100%;
  min-height: 40px;
}
.story-chapter-rewards {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.story-chapter-rewards > span {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #ebe9d6;
  border-radius: 6px;
  font:
    20px "Batang",
    serif;
}
.story-chapter-rewards small {
  font-size: 11px;
  color: #8b7957;
  margin-left: 4px;
}
.story-map-footer {
  border-top: 1px solid #e5e5d7;
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.story-map-footer > span {
  font-size: 12px;
  color: #7d8978;
}
.story-map-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.story-map-footer button {
  font-size: 12px;
}
.story-quest-copy p {
  font-size: 17px;
  line-height: 1.85;
  word-break: keep-all;
  margin: 12px 0 20px;
}
.story-step {
  font-size: 12px;
  color: #9c814a;
  font-weight: 800;
}
.story-choices {
  display: grid;
  gap: 10px;
}
.story-choices > button {
  min-height: 58px;
  font-size: 18px;
  text-align: left;
  padding-left: 20px;
}
.story-feedback {
  min-height: 24px;
  font-size: 14px;
  color: #96723b;
  line-height: 1.7;
  margin: 12px 0 0;
}
.story-success {
  text-align: center;
  padding: 14px 8px;
}
.story-success-glyph {
  font-family: "Batang", serif;
  font-size: 64px;
  color: #718746;
  margin: 12px 0 22px;
  overflow-wrap: anywhere;
}
.story-success p {
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
}
.story-success small {
  color: #7f8979;
  font-size: 12px;
  display: block;
  line-height: 1.7;
}
.story-warning {
  color: #a34c31;
  background: #ffebdd;
  border-radius: 9px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.story-workshop-art {
  height: 140px;
  display: grid;
  place-items: center;
  position: relative;
  margin: 20px auto;
  background: radial-gradient(ellipse, #dfe7ce, transparent 70%);
}
.story-workshop-art > span {
  display: grid;
  place-items: center;
  width: 130px;
  height: 90px;
  font:
    48px "Batang",
    serif;
  background: #c5a273;
  border: 8px solid #8a6e49;
  border-top: 16px solid #74906c;
  color: #5c4931;
  transform: skewY(-3deg);
  box-shadow: 10px 10px 0 #6f7c4e33;
}
.story-observatory-art {
  background: radial-gradient(ellipse, #d8e8e5, transparent 70%);
}
.story-observatory-art > span {
  width: 150px;
  color: #426c76;
  background: #eee1ae;
  border-color: #75999d;
  border-top-color: #a8c7c8;
  transform: none;
}
.story-garden-art {
  background: radial-gradient(ellipse, #e6e7c4, transparent 70%);
}
.story-garden-art > span {
  width: 150px;
  background: #efdfaf;
  border-color: #ac905e;
  border-top-color: #82a464;
  transform: none;
}
.story-persimmon-art {
  background: radial-gradient(ellipse, #f0dfbb, transparent 70%);
}
.story-persimmon-art > span {
  width: 150px;
  background: #f1d3a0;
  border-color: #ad8755;
  border-top-color: #c08d59;
  color: #755336;
  transform: none;
}
.story-flower-art {
  background: radial-gradient(ellipse, #f0dfd5, transparent 70%);
}
.story-flower-art > span {
  width: 150px;
  background: #f1dfc8;
  border-color: #b19679;
  border-top-color: #9cb286;
  color: #8d655d;
  transform: none;
}
.story-song-art {
  background: radial-gradient(ellipse, #dce9df, transparent 70%);
}
.story-song-art > span {
  width: 150px;
  background: #ebdfb8;
  border-color: #a28e66;
  border-top-color: #8da895;
  color: #587776;
  transform: none;
}
.story-porridge-art {
  background: radial-gradient(ellipse, #e9ddcb, transparent 70%);
}
.story-starlight-art {
  background: linear-gradient(145deg, #dce8e6, #b9cddc);
}
.story-cloud-art {
  background: linear-gradient(145deg, #e4ecdc, #bbd4cd);
}
.story-snail-art {
  background: linear-gradient(145deg, #e8e6c9, #bdd0ae);
}
.story-mill-art {
  background: linear-gradient(145deg, #e1e9dc, #b9d2d1);
}
.story-breeze-art {
  background: linear-gradient(145deg, #e9e5c3, #c1d6ad);
}
.story-magpie-art { background: linear-gradient(145deg, #e4e6cf, #bbd0d0); }
.story-magpie-art > span { color: #607f83; }
.story-frog-art { background: linear-gradient(145deg, #dce8ce, #b8d4d2); }
.story-frog-art > span { color: #598b7d; }
.story-breeze-art > span {
  color: #748754;
}
.story-mill-art > span {
  color: #567c7d;
}
.story-snail-art > span {
  color: #677b4c;
}
.story-cloud-art > span {
  color: #517f75;
}
.story-starlight-art > span {
  color: #476d87;
}
.story-porridge-art > span {
  width: 150px;
  background: #ead7b4;
  border-color: #9a815a;
  border-top-color: #b09c78;
  color: #926f58;
  transform: none;
}
.story-active .tree-dash {
  display: none !important;
}
@media (max-width: 760px) {
  .story-atlas-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .story-atlas {
    min-height: 380px;
  }
  .story-dialog .story-island {
    width: 89px;
    min-height: 78px;
  }
  .story-island > span {
    font-size: 10px;
  }
  .story-island > b {
    font-size: 23px;
  }
  .story-island > small {
    font-size: 9px;
  }
  .story-atlas-hub > b {
    width: 50px;
    height: 50px;
    font-size: 29px;
  }
  .story-map-dialog {
    padding: 18px;
  }
  .story-dialog {
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 16px;
  }
  .story-dialog h2 {
    font-size: 22px;
  }
  .story-quest-copy p {
    font-size: 16px;
  }
  .story-choices > button {
    font-size: 17px;
    min-height: 52px;
  }
}
@media (max-width: 370px) {
  .story-atlas {
    min-height: 355px;
  }
  .story-dialog .story-island {
    width: 72px;
    min-height: 70px;
  }
  .story-island > span {
    font-size: 9px;
  }
  .story-atlas-hub > span {
    font-size: 9px;
  }
  .story-sea-label {
    font-size: 10px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .story-map-dialog {
    width: calc(100vw - 24px);
  }
  .story-atlas-layout {
    grid-template-columns: minmax(290px, 1.3fr) minmax(200px, 1fr);
  }
  .story-atlas {
    min-height: 355px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-dialog .story-island {
    transition: none;
  }
}
/* Original floating-island illustrations replace the flat region badges. */
.story-map-quick {
  display: none;
}
.story-atlas {
  min-height: 550px;
  background-color: #cfe2db;
}
.story-dialog .story-island {
  width: 132px;
  min-height: 126px;
  padding: 0 0 6px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  gap: 0;
}
.story-dialog .story-island:hover:not(:disabled) {
  background: #fff7d855;
}
.story-dialog .story-island.selected {
  background: #fff3c777;
  outline: 2px solid #b19357;
  outline-offset: 0;
  box-shadow: 0 8px 16px #69877b22;
}
.story-island .story-island-art {
  position: static;
  width: 122px;
  height: 86px;
  filter: drop-shadow(0 5px 4px #5c857622);
}
.story-island > span {
  font-size: 12px;
  margin-top: -2px;
  text-shadow: 0 1px #f4f4de;
}
.story-island > small {
  font-size: 10px;
  margin-top: 2px;
  color: #476c5c;
}
.story-atlas-hub > b {
  width: 100px;
  height: 92px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.story-atlas-hub > b svg {
  position: static;
  width: 112px;
  height: 92px;
  pointer-events: none;
}
.story-atlas-hub > span {
  margin-top: 0;
}
@media (max-width: 760px) {
  .story-map-quick {
    display: grid;
    gap: 6px;
    margin: -4px 0 18px;
  }
  .story-map-quick > button {
    background: #315f4a;
    color: #fff8e7;
    border-color: #315f4a;
  }
  .story-map-quick > small {
    font-size: 11px;
    text-align: center;
    color: #788669;
  }
  .story-atlas {
    min-height: 410px;
  }
  .story-dialog .story-island {
    width: 91px;
    min-height: 102px;
    border-radius: 14px;
  }
  .story-island .story-island-art {
    width: 92px;
    height: 67px;
  }
  .story-island > span {
    font-size: 10px;
  }
  .story-island > small {
    font-size: 9px;
  }
  .story-atlas-hub > b {
    width: 70px;
    height: 72px;
  }
  .story-atlas-hub > b svg {
    width: 83px;
    height: 72px;
  }
}
@media (max-width: 370px) {
  .story-atlas {
    min-height: 390px;
  }
  .story-dialog .story-island {
    width: 75px;
    min-height: 94px;
  }
  .story-island .story-island-art {
    width: 79px;
    height: 59px;
  }
  .story-island > span {
    font-size: 9px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .story-atlas {
    min-height: 410px;
  }
}
.story-brothers-art {
  background: linear-gradient(145deg, #f0dfac, #c7cf9b);
}
.story-brothers-art > span {
  color: #9d7e40;
}
.story-king-art {
  background: linear-gradient(145deg, #e6e8bd, #b3d0bb);
}
.story-king-art > span {
  color: #618b70;
}
.story-friends-art {
  background: linear-gradient(145deg, #e8ddba, #bbcdb8);
}
.story-friends-art > span {
  color: #98805b;
}
.story-rabbit-art {
  background: linear-gradient(145deg, #e7e3c8, #b9d0c2);
}
.story-rabbit-art > span {
  color: #77958c;
}
.story-ong-art {
  background: linear-gradient(145deg, #e8dfbd, #bfd0b8);
}
.story-ong-art > span {
  color: #8f8c62;
}
.story-club-art {
  background: linear-gradient(145deg, #f0dfaa, #abcbbd);
}
.story-club-art > span {
  color: #91804d;
}
