:root {
  color: #243b45;
  background: #dff5e8;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #243b45;
  --ink-soft: #4d6870;
  --cream: #fff9dc;
  --paper: #fffdf1;
  --sky: #8ed7d1;
  --leaf: #5f9c68;
  --leaf-dark: #376b51;
  --sun: #f4c75d;
  --coral: #e9876d;
  --water: #5eb9bf;
  --outline: #31535a;
  --gutter: clamp(10px, 2vw, 24px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--gutter);
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 16%, rgba(255, 252, 205, .92) 0 5%, transparent 5.2%),
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .68) 0 7%, transparent 7.2%),
    linear-gradient(180deg, #a6e3dd 0%, #dff5e8 58%, #b9d991 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
canvas {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border: 3px solid var(--outline);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

#moru-shell {
  display: grid;
  gap: clamp(7px, 1.2vh, 13px);
  width: min(1180px, calc(100vw - (2 * var(--gutter))), calc(177.778svh - 206px));
  min-width: 0;
}

.moru-header,
.moru-footer {
  display: flex;
  align-items: center;
  color: var(--ink);
}

.moru-header {
  justify-content: space-between;
  min-height: 46px;
}

.moru-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.moru-brand__mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 3px solid var(--outline);
  border-radius: 48% 48% 34% 34%;
  background: var(--sun);
  box-shadow: 0 4px 0 rgba(49, 83, 90, .2);
  color: var(--outline);
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-3deg);
}

.moru-brand span:last-child {
  display: grid;
  line-height: 1.2;
}

.moru-brand small {
  color: var(--leaf-dark);
  font-family: Georgia, serif;
  font-size: clamp(8px, 1vw, 10px);
  font-weight: 800;
  letter-spacing: .14em;
}

.moru-brand strong {
  overflow: hidden;
  padding-block: 2px;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.3;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#moru-fullscreen,
#moru-retry {
  min-height: 42px;
  border: 3px solid var(--outline);
  border-radius: 12px;
  background: var(--cream);
  box-shadow: 0 4px 0 rgba(49, 83, 90, .23);
  font-weight: 800;
  cursor: pointer;
}

#moru-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font-size: 13px;
}

#moru-fullscreen:disabled {
  cursor: wait;
  opacity: .48;
}

#moru-fullscreen:not(:disabled):hover,
#moru-retry:hover {
  background: #fff2a9;
  transform: translateY(-1px);
}

#moru-fullscreen:focus-visible,
#moru-retry:focus-visible,
#unity-canvas:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--coral);
}

#moru-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: clamp(4px, .6vw, 7px) solid var(--outline);
  border-radius: clamp(14px, 2vw, 24px);
  background: var(--sky);
  box-shadow:
    0 18px 42px rgba(35, 75, 76, .24),
    0 5px 0 rgba(49, 83, 90, .2),
    inset 0 0 0 2px rgba(255, 255, 255, .45);
  isolation: isolate;
}

#moru-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

#unity-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #8ed7d1;
  outline: none;
}

#moru-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(10px, 2.2vw, 28px);
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 249, 194, .9) 0 5.5%, transparent 5.8%),
    linear-gradient(180deg, #9bddda 0%, #dff5e8 68%, #a9d37f 68.2%, #79b470 100%);
  transition: opacity .32s ease, visibility .32s ease;
}

#moru-loading.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.storybook-cloud,
.storybook-cloud::before,
.storybook-cloud::after {
  position: absolute;
  border: 2px solid rgba(49, 83, 90, .16);
  border-radius: 999px;
  background: rgba(255, 253, 235, .84);
  content: "";
}

.storybook-cloud {
  width: 13%;
  height: 5%;
  border-width: 0 0 2px;
}

.storybook-cloud::before {
  bottom: 0;
  left: 13%;
  width: 40%;
  height: 150%;
  border-width: 2px 0 0 2px;
}

.storybook-cloud::after {
  right: 10%;
  bottom: 0;
  width: 49%;
  height: 205%;
  border-width: 2px 2px 0 0;
}

.storybook-cloud--one {
  top: 15%;
  left: 5%;
  transform: rotate(-3deg);
}

.storybook-cloud--two {
  top: 11%;
  right: 7%;
  width: 10%;
  transform: rotate(4deg) scale(.8);
}

.storybook-hill {
  position: absolute;
  right: -12%;
  bottom: -35%;
  left: -12%;
  height: 54%;
  border: 3px solid rgba(49, 83, 90, .18);
  border-radius: 50% 50% 0 0;
  background: #8bc676;
  transform: rotate(-2deg);
}

.storybook-hill--back {
  right: 36%;
  bottom: -27%;
  left: -18%;
  height: 48%;
  background: #afd883;
  transform: rotate(6deg);
}

.storybook-hill--front {
  background-image:
    radial-gradient(ellipse at 12% 21%, #fff5c5 0 1.3%, transparent 1.5%),
    radial-gradient(ellipse at 80% 16%, #f9b59b 0 1.1%, transparent 1.3%);
}

.loading-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(680px, 88%);
  padding: clamp(14px, 2vw, 25px) clamp(16px, 3vw, 36px);
  border: clamp(3px, .4vw, 5px) solid var(--outline);
  border-radius: clamp(16px, 2vw, 26px) clamp(24px, 3vw, 42px) clamp(18px, 2vw, 30px) clamp(25px, 3vw, 38px);
  background: rgba(255, 253, 237, .96);
  box-shadow: 0 10px 0 rgba(49, 83, 90, .17), 0 22px 50px rgba(38, 86, 76, .2);
  text-align: center;
  transform: rotate(-.25deg);
}

.loading-card::before,
.loading-card::after {
  position: absolute;
  top: -12px;
  width: 54px;
  height: 22px;
  background: rgba(244, 199, 93, .82);
  content: "";
  transform: rotate(-8deg);
}

.loading-card::before {
  left: 8%;
}

.loading-card::after {
  right: 8%;
  transform: rotate(9deg);
}

.loading-card__eyebrow,
.loading-card__lead,
.loading-card__note {
  margin: 0;
}

.loading-card__eyebrow {
  color: var(--leaf-dark);
  font-size: clamp(10px, 1.3vw, 13px);
  font-weight: 900;
  letter-spacing: .08em;
}

#moru-loading-title {
  margin: clamp(3px, .7vh, 8px) 0;
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: clamp(25px, 4.2vw, 49px);
  line-height: .98;
  letter-spacing: -.055em;
  text-shadow: 0 2px 0 #fff;
}

.loading-card__lead {
  max-width: 520px;
  color: var(--ink-soft);
  font-size: clamp(10px, 1.35vw, 14px);
  line-height: 1.5;
}

.craft-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.3vw, 13px);
  width: 100%;
  margin: clamp(8px, 1.5vh, 16px) 0;
}

.craft-preview__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  justify-content: center;
  gap: 3px 8px;
  min-width: 0;
  padding: clamp(8px, 1.2vw, 13px);
  border: 2px solid var(--outline);
  border-radius: 16px 12px 18px 11px;
  box-shadow: 0 4px 0 rgba(49, 83, 90, .13);
  color: var(--ink);
  transform: rotate(.6deg);
}

.craft-preview__item--heavy {
  background: #d5e7de;
}

.craft-preview__item--spring {
  background: #fde1bf;
  transform: rotate(-.7deg);
}

.craft-preview__item--echo {
  background: #d7eafa;
  transform: rotate(.35deg);
}

.craft-preview__number {
  grid-column: 1 / -1;
  color: var(--leaf-dark);
  font-size: clamp(8px, 1vw, 10px);
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.craft-preview__item strong,
.craft-preview__item b {
  overflow: hidden;
  font-size: clamp(10px, 1.35vw, 14px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.craft-preview__item strong {
  grid-column: 1 / -1;
}

.craft-preview__item b {
  color: #a44e3f;
}

.craft-preview__item small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: clamp(8px, 1vw, 10px);
}

#unity-loading-bar {
  display: grid;
  gap: 7px;
  width: min(510px, 100%);
}

.loading-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: clamp(9px, 1.2vw, 12px);
  font-weight: 800;
}

#unity-progress-track {
  appearance: none;
  width: 100%;
  height: clamp(11px, 1.5vw, 16px);
  overflow: hidden;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: #d9dfc9;
  box-shadow: inset 0 2px 3px rgba(49, 83, 90, .17);
}

#unity-progress-track::-webkit-progress-bar {
  background: #d9dfc9;
}

#unity-progress-track::-webkit-progress-value,
#unity-progress-track::-moz-progress-bar {
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, .28) 8px 13px),
    linear-gradient(90deg, var(--leaf), var(--sun), var(--coral));
}

.loading-card__note {
  margin-top: clamp(6px, 1vh, 10px);
  color: var(--leaf-dark);
  font-size: clamp(8px, 1.05vw, 11px);
  font-weight: 800;
}

#moru-failure,
noscript {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(57, 91, 80, .78);
  backdrop-filter: blur(7px);
}

#moru-failure[hidden] {
  display: none;
}

.failure-card,
.noscript-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(430px, 92%);
  padding: clamp(20px, 3vw, 34px);
  border: 4px solid var(--outline);
  border-radius: 23px 31px 19px 27px;
  background: var(--paper);
  box-shadow: 0 10px 0 rgba(36, 59, 69, .24);
  text-align: center;
}

.failure-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 900;
}

.failure-card h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 29px);
  letter-spacing: -.035em;
}

.failure-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

#moru-retry {
  margin-top: 4px;
  padding: 8px 18px;
}

.noscript-card strong {
  font-size: 22px;
}

.noscript-card span {
  color: var(--ink-soft);
  line-height: 1.5;
}

#unity-warning {
  position: absolute;
  z-index: 7;
  top: 12px;
  right: 12px;
  left: 12px;
  display: grid;
  justify-items: center;
  gap: 7px;
  pointer-events: none;
}

.warning-item {
  max-width: 680px;
  padding: 9px 13px;
  border: 2px solid #74551d;
  border-radius: 10px;
  background: #fff1a9;
  box-shadow: 0 4px 12px rgba(36, 59, 69, .22);
  color: #5e4518;
  font-size: 12px;
  font-weight: 700;
}

.warning-item--error {
  border-color: #7e3a32;
  background: #ffd5c8;
  color: #6e302b;
}

.moru-footer {
  justify-content: center;
  gap: clamp(8px, 1.7vw, 20px);
  min-height: 28px;
  color: var(--ink-soft);
  font-size: clamp(9px, 1.1vw, 12px);
  font-weight: 700;
  white-space: nowrap;
}

.moru-footer kbd {
  padding: 2px 5px;
  border: 1px solid rgba(49, 83, 90, .52);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 253, 237, .7);
  color: var(--ink);
  font-family: inherit;
  font-size: .9em;
}

.moru-footer__promise {
  color: var(--leaf-dark);
}

@media (max-height: 650px) {
  #moru-shell {
    gap: 6px;
    width: min(1180px, calc(100vw - (2 * var(--gutter))), calc(177.778svh - 128px));
  }

  .moru-header {
    min-height: 34px;
  }

  .moru-brand__mark {
    width: 35px;
    height: 29px;
    border-width: 2px;
    font-size: 16px;
  }

  #moru-fullscreen {
    min-height: 34px;
    padding: 4px 10px;
  }

  .moru-footer {
    min-height: 20px;
  }
}

@media (max-width: 720px), (max-height: 510px) {
  .moru-brand small,
  .moru-footer__promise,
  .loading-card__lead,
  .craft-preview__item small {
    display: none;
  }

  .loading-card {
    width: min(650px, 92%);
    padding-block: 10px;
  }

  .craft-preview {
    margin-block: 7px;
  }

  .craft-preview__item {
    padding-block: 6px;
  }
}

@media (max-width: 520px) {
  #moru-fullscreen {
    width: 42px;
    padding: 5px;
    justify-content: center;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  #moru-fullscreen span {
    color: var(--ink);
  }

  .moru-footer {
    gap: 7px;
  }

  .moru-footer span:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --outline: #142d33;
    --ink: #142d33;
    --ink-soft: #243f46;
  }

  .loading-card,
  .craft-preview__item,
  #unity-progress-track {
    border-width: 4px;
  }
}
