@font-face {
  font-family: "DNFForgedBlade-Light";
  src: url("Resources/DNFForgedBlade-Light.woff") format("woff"),
       local("DNFForgedBlade-Light");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

:root {
  --stage-max-width: 540px;
  --text-color: #ffffff;
  --guide-color: rgba(255, 255, 255, 0.68);
  --input-font: "DNFForgedBlade-Light", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background: #06070c;
  color: var(--text-color);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  overflow: hidden;
}

.bg-container {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.bg-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bg-image-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("Resources/bg.png") no-repeat center center;
  background-size: cover;
  filter: blur(36px);
  opacity: 0.78;
  transform: scale(1.08);
  z-index: 0;
}

.bg-wrapper {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16), var(--stage-max-width));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  z-index: 1;
}

.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.msg-image {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 80%;
  transform: translate(-50%, -30%);
  user-select: none;
  pointer-events: none;
  z-index: 2;
}

.bt-image {
  position: absolute;
  left: 51%;
  top: 82.2%;
  width: 80%;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.2s ease;
  user-select: none;
  z-index: 12;
  cursor: pointer;
}

.bt-image:active,
.bt-image.pressed {
  transform: translate(-50%, -50%) scale(0.96);
  filter: brightness(0.92);
}

.thanks-to-input {
  position: absolute;
  top: 41%;
  left: 21%;
  transform: none;
  width: 56%;
  border: none;
  outline: none;
  background: transparent;
  color: #2f2f2f;
  font-family: var(--input-font);
  text-align: left;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.35;
  z-index: 5;
  user-select: text;
}

.thanks-to-input::placeholder {
  color: #4f4f4f;
  font-family: var(--input-font);
}

body.mode-message-only .thanks-to-input {
  display: none;
}

body.mode-message-only .msg-instructions {
  top: 58%;
  height: 34.5%;
}

.msg-instructions {
  position: absolute;
  font-size: clamp(14px, 1.2vw, 18px);
  top: 60.2%;
  left: 20%;
  width: 62%;
  height: 28.2%;
  transform: none;
  z-index: 5;
  display: block;
}

.msg-instructions-korean {
  position: relative;
  left: 2.5%;
  top: -35%;
  color: #4f4f4f;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.35;
  text-align: left;
  margin-bottom: 0.45rem;
  transition: opacity 0.2s ease;
  cursor: text;
}

.msg-input-overlay {
  position: absolute;
  top: -37%;
  left: 2.5%;
  width: 100%;
  height: 84%;
}

.msg-input-field {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: #222;
  font-family: var(--input-font);
  text-align: left;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.45;
  padding: 0.2rem 2.1rem 1.2rem 0;
  overflow-y: auto;
  caret-color: #111;
  user-select: text;
}

.msg-input-field::placeholder {
  font-family: var(--input-font);
}

.msg-char-counter {
  position: absolute;
  top: 85%;
  left: 95%;
  color: #2f2f2f;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.msg-char-counter.limit {
  color: #ff9e9e;
}

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.success-image {
  width: min(82vw, 520px);
  height: auto;
  animation: fadeInDown 0.36s ease-out;
}

.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.show {
  display: flex !important;
}

.disabled,
.loading {
  opacity: 0.55 !important;
  pointer-events: none !important;
}

.pulse {
  animation: counterPulse 0.15s ease-in-out;
}

.cooldown-message {
  animation: blink 1.3s ease-in-out infinite;
  color: #2b2b2b;
  font-weight: 600;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes counterPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (pointer: fine) and (min-width: 768px) {
  .bg-wrapper {
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  }
}
