:root {
  color-scheme: dark;
  font-family: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  background: #06080c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #06080c;
}

button,
a {
  font: inherit;
}

.opening {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100svh;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
  background: #06080c;
  box-shadow: 0 0 80px rgb(0 0 0 / 45%);
}

.opening__film {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #06080c;
}

.opening__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(2 4 7 / 14%) 52%, rgb(2 4 7 / 52%) 78%, rgb(2 4 7 / 90%) 100%),
    radial-gradient(circle at 50% 45%, transparent 48%, rgb(0 0 0 / 22%) 100%);
}

.opening__shade--light {
  background: radial-gradient(circle at 50% 45%, transparent 58%, rgb(0 0 0 / 18%) 100%);
}

.opening--second {
  animation: opening-fade-in .65s ease both;
}

@keyframes opening-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.opening__sound {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  z-index: 3;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  color: rgb(255 255 255 / 76%);
  background: rgb(5 7 10 / 32%);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 11px;
  letter-spacing: .04em;
}

.opening__sound:focus-visible,
.opening__play:focus-visible,
.opening__cta:focus-visible {
  outline: 2px solid #f4ddb0;
  outline-offset: 4px;
}

.opening__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 999px;
  color: #fffaf0;
  background: rgb(8 10 14 / 58%);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.opening__play[hidden] {
  display: none;
}

.opening__ending {
  position: absolute;
  right: 0;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
  left: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-inline: 24px;
  opacity: 0;
  transform: translateY(22px);
  pointer-events: none;
  transition: opacity 1s ease, transform 1s cubic-bezier(.22, 1, .36, 1);
}

.opening__ending.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.opening__prompt {
  margin: 0;
  color: rgb(246 231 204 / 76%);
  font-size: 12px;
  letter-spacing: .34em;
  text-indent: .34em;
  text-shadow: 0 2px 12px #000;
}

.opening__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 332px);
  min-height: 58px;
  border: 1px solid rgb(235 210 162 / 72%);
  border-radius: 4px;
  color: #fff8e8;
  background:
    linear-gradient(110deg, rgb(126 87 34 / 76%), rgb(65 43 18 / 88%)),
    #4b3219;
  box-shadow: 0 12px 36px rgb(0 0 0 / 38%), inset 0 1px rgb(255 255 255 / 16%);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .18em;
  text-indent: .18em;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.opening__cta:hover {
  transform: translateY(-2px);
  border-color: #f4ddb0;
  box-shadow: 0 16px 42px rgb(0 0 0 / 44%), 0 0 24px rgb(215 177 107 / 16%);
}

.opening__cta:active {
  transform: translateY(1px);
}

.opening__arrow {
  font-family: system-ui, sans-serif;
  font-weight: 300;
  transition: transform .25s ease;
}

.opening__cta:hover .opening__arrow {
  transform: translateX(4px);
}

.opening__error {
  position: absolute;
  right: 24px;
  bottom: 124px;
  left: 24px;
  margin: 0;
  color: rgb(255 255 255 / 70%);
  text-align: center;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  line-height: 1.6;
}

.choice-panel {
  position: absolute;
  right: 0;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  left: 0;
  z-index: 3;
  padding: 0 22px;
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
  transition: opacity .8s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
}

.choice-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.choice-panel__eyebrow {
  margin: 0 0 7px;
  color: #d9bd84;
  font-size: 11px;
  letter-spacing: .3em;
  text-align: center;
  text-indent: .3em;
  text-shadow: 0 2px 10px #000;
}

.choice-panel__title {
  margin: 0 0 15px;
  color: #fff8e8;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
  text-shadow: 0 3px 15px #000;
}

.choice-panel__grid {
  display: grid;
  gap: 8px;
}

.choice-panel__button {
  display: grid;
  grid-template-columns: 28px 1fr 20px;
  align-items: center;
  min-height: 48px;
  padding: 9px 15px;
  border: 1px solid rgb(229 200 145 / 52%);
  border-radius: 3px;
  color: #fff9ed;
  background: linear-gradient(100deg, rgb(25 20 15 / 78%), rgb(59 39 20 / 68%));
  box-shadow: 0 6px 22px rgb(0 0 0 / 28%), inset 0 1px rgb(255 255 255 / 9%);
  backdrop-filter: blur(9px);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.choice-panel__button:hover {
  transform: translateX(3px);
  border-color: #efd49f;
  background: linear-gradient(100deg, rgb(55 39 21 / 88%), rgb(94 61 27 / 78%));
}

.choice-panel__button:focus-visible {
  outline: 2px solid #f4ddb0;
  outline-offset: 2px;
}

.choice-panel__number {
  color: #d6b36f;
  font-size: 12px;
}

.choice-panel__arrow {
  color: rgb(239 212 159 / 70%);
  font-family: system-ui, sans-serif;
  font-weight: 300;
  text-align: right;
}

@media (max-height: 680px) {
  .choice-panel {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .choice-panel__eyebrow {
    margin-bottom: 4px;
  }

  .choice-panel__title {
    margin-bottom: 9px;
    font-size: 17px;
  }

  .choice-panel__grid {
    gap: 6px;
  }

  .choice-panel__button {
    min-height: 42px;
  }
}

@media (min-width: 700px) {
  body {
    background: radial-gradient(circle at center, #1c1b20, #050609 72%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .opening__ending,
  .opening__cta,
  .opening__arrow,
  .choice-panel,
  .choice-panel__button {
    transition: none;
  }
}
