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

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: #090706;
}

body { overflow: hidden; }
button,
input { font: inherit; }

.info-screen {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100svh;
  min-height: 590px;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
  background: #0b0806;
  box-shadow: 0 0 80px rgb(0 0 0 / 50%);
}

.info-screen__film {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.info-screen__veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgb(5 4 3 / 16%) 0%, rgb(5 4 3 / 45%) 31%, rgb(5 4 3 / 88%) 100%),
    radial-gradient(circle at 50% 22%, transparent 20%, rgb(0 0 0 / 28%) 72%);
  backdrop-filter: saturate(.82);
}

.saju-form {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  padding: 24px 22px max(18px, calc(env(safe-area-inset-bottom) + 12px));
  animation: form-rise .8s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes form-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.saju-form__header {
  margin-bottom: 18px;
  text-align: center;
  text-shadow: 0 3px 16px #000;
}

.saju-form__header p {
  margin: 0 0 7px;
  color: #d9b871;
  font-size: 10px;
  letter-spacing: .3em;
  text-indent: .3em;
}

.saju-form__header h1 {
  margin: 0 0 6px;
  color: #fff8e8;
  font-size: clamp(21px, 6vw, 27px);
  font-weight: 600;
  letter-spacing: -.035em;
}

.saju-form__fields {
  display: grid;
  gap: 19px;
  padding: 0 4px;
}

.field {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  color: #fffaf0;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-shadow: 0 2px 10px #000;
}

.field input[type="text"] {
  width: 100%;
  height: 39px;
  padding: 0 6px 8px;
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 42%);
  border-radius: 0;
  outline: 0;
  color: #fff9ec;
  background: transparent;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  transition: border-color .2s ease;
}

.field input[type="text"]:focus {
  border-bottom-color: #efd59f;
}

.field input::placeholder { color: rgb(255 255 255 / 49%); }

.field--with-options > span:first-child {
  padding-right: 150px;
}

.inline-options,
.unknown-time {
  position: absolute;
  top: -3px;
  right: 2px;
  display: flex !important;
  align-items: center;
  gap: 14px;
  margin: 0 !important;
}

.inline-options button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  color: rgb(255 255 255 / 48%);
  background: transparent;
  cursor: pointer;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.inline-options i,
.unknown-time__box {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 52%);
  border-radius: 50%;
  font-style: normal;
}

.inline-options button.is-selected {
  color: #fff8e9;
}

.inline-options button.is-selected i {
  border: 5px solid #fffaf0;
  background: #72512c;
}

.unknown-time {
  gap: 6px;
  height: auto;
  color: rgb(255 255 255 / 54%);
  cursor: pointer;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  font-weight: 500 !important;
  white-space: nowrap;
}

.unknown-time input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.unknown-time__box {
  color: transparent;
  background: transparent;
}

.unknown-time input:checked + .unknown-time__box {
  border-color: #fffaf0;
  color: #6b4925;
  background: #fffaf0;
}

.time-field.is-unknown > input[type="text"] {
  opacity: .35;
}

.gender-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gender-buttons button {
  height: 48px;
  border: 1px solid rgb(255 255 255 / 66%);
  border-radius: 10px;
  color: rgb(255 255 255 / 72%);
  background: rgb(5 4 3 / 20%);
  backdrop-filter: blur(5px);
  cursor: pointer;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.gender-buttons button.is-selected {
  border-color: #dfbd7a;
  color: #fff9ed;
  background: linear-gradient(110deg, rgb(125 84 36 / 68%), rgb(71 46 22 / 66%));
}

.saju-form__status {
  min-height: 16px;
  margin: 7px 0 3px;
  color: #f0c6a5;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  font-size: 11px;
  text-align: center;
}

.next-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid #e1c28a;
  border-radius: 4px;
  color: #fff9ed;
  background:
    linear-gradient(110deg, rgb(137 91 36 / 96%), rgb(79 48 19 / 98%)),
    #6d471f;
  box-shadow: 0 14px 36px rgb(0 0 0 / 42%), inset 0 1px rgb(255 255 255 / 16%);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .12em;
  text-indent: .12em;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.next-button span:first-child { justify-self: center; transform: translateX(10px); }
.next-button span:last-child { font-family: system-ui, sans-serif; font-weight: 300; }

.next-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 18px 44px rgb(0 0 0 / 48%), 0 0 28px rgb(222 183 110 / 13%);
}

.next-button:active { transform: translateY(1px) scale(.995); }

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

@media (max-height: 680px) {
  .saju-form { padding-top: 12px; }
  .saju-form__header { margin-bottom: 10px; }
  .saju-form__header p { margin-bottom: 4px; }
  .saju-form__header h1 { margin-bottom: 3px; font-size: 20px; }
  .saju-form__fields { gap: 12px; }
  .field > span, .field legend { margin-bottom: 4px; font-size: 13px; }
  .field input[type="text"] { height: 34px; padding-bottom: 6px; }
  .gender-buttons button { height: 42px; }
  .next-button { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .saju-form,
  .next-button { animation: none; transition: none; }
}
