@charset "UTF-8";

:root {
  --space-0: #030711;
  --space-1: #07101f;
  --space-2: #0b1730;
  --paper: #f8f4eb;
  --paper-soft: rgba(248, 244, 235, 0.72);
  --paper-faint: rgba(248, 244, 235, 0.44);
  --gold: #f1cd72;
  --orange: #f0785f;
  --mint: #cfe7dc;
  --content: 760px;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--space-0);
  color-scheme: dark;
}

body {
  width: 100%;
  min-height: 100%;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 13%, rgba(86, 112, 188, 0.16), transparent 24%),
    radial-gradient(circle at 80% 18%, rgba(236, 202, 112, 0.06), transparent 15%),
    radial-gradient(circle at 50% 72%, rgba(78, 98, 180, 0.11), transparent 27%),
    linear-gradient(180deg, #091226 0%, #060e1d 42%, #030711 100%);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.space {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.3;
  animation: nebula-drift 20s ease-in-out infinite;
}

.nebula-a {
  width: 260px;
  height: 260px;
  left: -80px;
  top: 8%;
  background: radial-gradient(circle, rgba(91, 116, 196, 0.35), transparent 70%);
}

.nebula-b {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: 5%;
  background: radial-gradient(circle, rgba(83, 70, 164, 0.2), transparent 72%);
  animation-delay: 5s;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 250, 234, 0.88);
  box-shadow: 0 0 9px rgba(255, 250, 234, 0.4);
  animation: twinkle 4.2s ease-in-out infinite;
}

.s1 { left: 8%; top: 13%; }
.s2 { left: 27%; top: 8%; width: 2px; height: 2px; animation-delay: .8s; }
.s3 { right: 14%; top: 18%; width: 4px; height: 4px; animation-delay: 1.6s; }
.s4 { left: 14%; top: 43%; animation-delay: 2.4s; }
.s5 { right: 8%; top: 48%; width: 2px; height: 2px; animation-delay: 3.1s; }
.s6 { left: 40%; top: 30%; width: 2px; height: 2px; animation-delay: 1.2s; }
.s7 { left: 20%; bottom: 17%; width: 4px; height: 4px; animation-delay: 2.1s; }
.s8 { right: 22%; bottom: 13%; animation-delay: 3.4s; }
.s9 { left: 57%; bottom: 24%; width: 2px; height: 2px; animation-delay: .4s; }
.s10 { right: 36%; top: 9%; width: 2px; height: 2px; animation-delay: 2.8s; }
.s11 { left: 4%; bottom: 41%; width: 2px; height: 2px; animation-delay: 1.7s; }
.s12 { right: 4%; bottom: 36%; animation-delay: 3.7s; }

.game-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content));
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    clamp(14px, 4vw, 28px)
    max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.game-header {
  height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.home-link {
  color: rgba(248, 244, 235, 0.58);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.home-link:focus-visible,
.result-home:focus-visible,
.result-button:focus-visible,
.tempt-button:focus-visible {
  outline: 3px solid rgba(241, 205, 114, 0.65);
  outline-offset: 4px;
}

.timer-wrap {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--paper-faint);
}

.timer-label { font-size: 0.68rem; }
.timer {
  min-width: 40px;
  color: var(--paper-soft);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.play-screen {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ready-card {
  position: absolute;
  top: 4%;
  left: 50%;
  width: min(92%, 520px);
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}

.ready-card.is-gone {
  opacity: 0;
  transform: translate(-50%, -10px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--paper-faint);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.ready-card h1 {
  margin: 0;
  font-size: clamp(1.55rem, 6vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -0.055em;
}

.ready-card p:last-child {
  margin: 10px 0 0;
  color: var(--paper-faint);
  font-size: clamp(0.78rem, 3vw, 0.92rem);
}

.arena {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 28px;
  isolation: isolate;
}

.progress-track {
  position: absolute;
  top: 8px;
  left: 50%;
  width: min(62%, 360px);
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.08);
  transform: translateX(-50%);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(207, 231, 220, 0.78), rgba(241, 205, 114, 0.86));
  transition: width 80ms linear;
}

.temptation-copy {
  position: absolute;
  top: 14%;
  left: 50%;
  width: min(90%, 480px);
  min-height: 2.8em;
  transform: translateX(-50%);
  text-align: center;
  color: var(--paper-soft);
  font-size: clamp(0.82rem, 3.3vw, 1rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.button-layer,
.floating-layer,
.constellation {
  position: absolute;
  inset: 0;
}

.button-layer { z-index: 5; }
.floating-layer { z-index: 3; pointer-events: none; }
.constellation { z-index: 4; pointer-events: none; }

.tempt-button {
  position: absolute;
  left: 50%;
  top: 53%;
  min-width: 154px;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid rgba(248, 244, 235, 0.82);
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  color: #152039;
  font-size: clamp(0.9rem, 3.4vw, 1.02rem);
  font-weight: 780;
  letter-spacing: -0.025em;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transform: translate(-50%, -50%);
  transition: background 150ms ease, box-shadow 150ms ease;
  will-change: left, top, transform;
}

.tempt-button:hover {
  background: #fffdf6;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.31);
}

.tempt-button.is-wobbling { animation: button-wobble 1.2s ease-in-out infinite; }
.tempt-button.is-urgent { animation: button-urgent .52s ease-in-out infinite; }
.tempt-button.is-silent { animation: none !important; }
.tempt-button.clone {
  min-width: 126px;
  min-height: 50px;
  padding: 11px 15px;
  font-size: clamp(0.76rem, 2.8vw, 0.9rem);
  background: rgba(248, 244, 235, 0.9);
}

.notification-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.float-message {
  position: absolute;
  max-width: 190px;
  color: rgba(248, 244, 235, 0.47);
  font-size: clamp(0.68rem, 2.4vw, 0.8rem);
  line-height: 1.35;
  text-align: center;
  animation: message-float 5s ease-in-out infinite;
}

.chaos-dot {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 50%;
  background: rgba(241, 205, 114, 0.7);
  box-shadow: 0 0 10px rgba(241, 205, 114, 0.35);
  animation: dot-drift 4.4s ease-in-out infinite;
}

.constellation-node {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff4bf;
  box-shadow: 0 0 12px rgba(255, 244, 191, 0.7);
  opacity: 0;
  animation: node-appear 800ms ease forwards;
}

.constellation-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,244,191,0.15), rgba(255,244,191,0.75), rgba(255,244,191,0.15));
  transform-origin: left center;
  opacity: 0;
  animation: line-appear 900ms ease forwards;
}

.result-screen {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 10px 0 4px;
}

.result-card {
  width: min(100%, 470px);
  padding: clamp(22px, 6vw, 34px);
  border: 1px solid rgba(248, 244, 235, 0.14);
  border-radius: 28px;
  background: rgba(7, 15, 30, 0.56);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.result-kicker {
  margin: 0 0 12px;
  color: var(--paper-faint);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.result-card h2 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  letter-spacing: -0.05em;
}

.result-message {
  margin: 13px auto 22px;
  max-width: 330px;
  color: var(--paper-soft);
  font-size: clamp(0.9rem, 3.4vw, 1.05rem);
  line-height: 1.6;
  white-space: pre-line;
}

.result-stats {
  margin: 0;
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(248, 244, 235, 0.1);
  border-radius: 18px;
  background: rgba(248, 244, 235, 0.07);
}

.result-stats div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 14px;
  background: rgba(4, 9, 20, 0.5);
}

.result-stats dt {
  color: var(--paper-faint);
  font-size: 0.78rem;
}

.result-stats dd {
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.8rem;
  font-weight: 720;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.result-button,
.result-home {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(248, 244, 235, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.result-button.primary {
  border-color: rgba(248, 244, 235, 0.86);
  background: var(--paper);
  color: #152039;
}

.result-button:hover,
.result-home:hover { background: rgba(248, 244, 235, 0.08); }
.result-button.primary:hover { background: white; }

.save-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--paper-faint);
  font-size: 0.73rem;
  text-align: center;
}

@keyframes nebula-drift {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(11px,-9px,0) scale(1.05); }
}

@keyframes twinkle {
  0%,100% { opacity: .2; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes button-wobble {
  0%,100% { transform: translate(-50%, -50%) rotate(0); }
  35% { transform: translate(calc(-50% - 2px), calc(-50% + 1px)) rotate(-.7deg); }
  70% { transform: translate(calc(-50% + 2px), calc(-50% - 1px)) rotate(.7deg); }
}

@keyframes button-urgent {
  0%,100% { transform: translate(-50%, -50%) rotate(0) scale(1); }
  25% { transform: translate(calc(-50% - 4px), -50%) rotate(-1deg) scale(1.015); }
  75% { transform: translate(calc(-50% + 4px), -50%) rotate(1deg) scale(1.015); }
}

@keyframes message-float {
  0%,100% { opacity: .22; transform: translateY(2px); }
  50% { opacity: .75; transform: translateY(-5px); }
}

@keyframes dot-drift {
  0%,100% { opacity: .2; transform: translate3d(0,0,0) scale(.8); }
  50% { opacity: .9; transform: translate3d(5px,-9px,0) scale(1.15); }
}

@keyframes node-appear { to { opacity: 1; transform: scale(1.15); } }
@keyframes line-appear { to { opacity: .85; } }

@media (max-width: 480px) {
  .game-shell { padding-inline: 12px; }
  .game-header { padding-inline: 3px; }
  .arena { border-radius: 22px; }
  .ready-card { top: 3%; }
  .temptation-copy { top: 16%; }
  .result-card { border-radius: 22px; padding: 22px 18px; }
  .result-stats div { padding: 10px 12px; }
  .result-actions { gap: 8px; }
  .result-button, .result-home { min-height: 46px; padding: 11px 15px; }
}

@media (max-height: 680px) {
  .game-header { height: 36px; }
  .ready-card { top: 1%; }
  .temptation-copy { top: 12%; }
  .result-card { padding-block: 18px; }
  .result-message { margin-bottom: 15px; }
  .result-stats div { padding-block: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .nebula, .star, .float-message, .chaos-dot { animation: none; }
  .tempt-button.is-wobbling,
  .tempt-button.is-urgent { animation-duration: 2.2s; }
}


/* v18: more game-like chaos, hadogi-ish lure language */
.temptation-copy {
  top: 9%;
  width: min(94%, 540px);
  min-height: 3.4em;
  padding-inline: 14px;
  color: rgba(248, 244, 235, 0.92);
  font-size: clamp(1rem, 4vw, 1.45rem);
  font-weight: 820;
  line-height: 1.34;
  letter-spacing: -0.04em;
  text-shadow: 0 0 18px rgba(7, 16, 31, 0.64), 0 0 34px rgba(7, 16, 31, 0.5);
  z-index: 8;
}

.button-layer { z-index: 7; }
.floating-layer { z-index: 6; pointer-events: none; }

.float-message {
  position: absolute;
  max-width: min(34vw, 210px);
  padding: 11px 12px 10px;
  border: 1px solid rgba(248, 244, 235, 0.18);
  border-radius: 18px;
  background: rgba(10, 18, 36, 0.34);
  color: rgba(248, 244, 235, 0.84);
  font-size: clamp(0.72rem, 2.4vw, 0.88rem);
  font-weight: 700;
  line-height: 1.34;
  text-align: left;
  backdrop-filter: blur(4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  transform: translate(-50%, -50%) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
  animation: message-float var(--float-duration, 4.6s) ease-in-out infinite;
}

.float-message.loud,
.float-message.loud-bubble {
  border-color: rgba(241, 205, 114, 0.48);
  background: rgba(16, 28, 53, 0.48);
  color: #f8e7b0;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(241, 205, 114, 0.08);
}

.float-message.whisper {
  background: rgba(7, 12, 24, 0.14);
  color: rgba(248, 244, 235, 0.5);
}

.float-message.ghost {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: rgba(248, 244, 235, 0.34);
  font-weight: 620;
}

.float-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  min-width: 26px;
  height: 26px;
  padding-inline: 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(248, 244, 235, 0.95);
  background: var(--orange);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.float-message-text {
  display: block;
}

.notif-burst {
  position: absolute;
  min-width: 34px;
  height: 34px;
  padding-inline: 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f05037;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transform: translate(-50%, -50%);
  animation: badge-drift 3.8s ease-in-out infinite;
}

.chaos-dot {
  background: rgba(241, 205, 114, 0.78);
  box-shadow: 0 0 14px rgba(241, 205, 114, 0.42);
}

@keyframes message-float {
  0%, 100% {
    opacity: 0.24;
    transform: translate(-50%, calc(-50% + 2px)) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
  }
  50% {
    opacity: 0.95;
    transform: translate(-50%, calc(-50% - var(--float-offset, 5px))) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
  }
}

@keyframes badge-drift {
  0%, 100% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.92);
  }
  50% {
    opacity: 0.96;
    transform: translate(calc(-50% + var(--drift, 0px)), calc(-50% - 6px)) scale(1.06);
  }
}

@media (max-width: 480px) {
  .temptation-copy {
    top: 10%;
    width: min(95%, 360px);
    min-height: 3.6em;
    font-size: clamp(0.95rem, 4.8vw, 1.18rem);
  }

  .float-message {
    max-width: min(38vw, 145px);
    padding: 9px 10px 8px;
    font-size: clamp(0.66rem, 2.9vw, 0.78rem);
    border-radius: 15px;
  }

  .float-badge {
    min-width: 24px;
    height: 24px;
    font-size: 0.62rem;
  }

  .notif-burst {
    min-width: 30px;
    height: 30px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notif-burst { animation: none; }
}


/* v19: larger play field and cleaner result screen */
:root {
  --content: 1120px;
}

[hidden] {
  display: none !important;
}

.game-shell {
  width: min(100%, var(--content));
  padding-inline: clamp(12px, 2.5vw, 24px);
}

.play-screen {
  width: 100%;
}

.arena {
  width: 100%;
  min-height: calc(100svh - 92px);
  border-radius: 32px;
}

.progress-track {
  width: min(72%, 680px);
}

.result-screen {
  width: 100%;
  min-height: calc(100svh - 72px);
  padding-inline: 12px;
}

.result-card {
  width: min(100%, 620px);
  padding: clamp(24px, 5vw, 42px);
}

.result-card h2 {
  max-width: 540px;
  margin-inline: auto;
  font-size: clamp(1.65rem, 4.7vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: pre-line;
  text-wrap: balance;
}

.result-message {
  max-width: 430px;
  font-size: clamp(0.92rem, 2.8vw, 1.08rem);
}

@media (max-width: 760px) {
  :root {
    --content: 100%;
  }

  .game-shell {
    padding-inline: 10px;
  }

  .arena {
    min-height: calc(100svh - 82px);
    border-radius: 24px;
  }

  .progress-track {
    width: min(78%, 480px);
  }

  .result-card {
    width: min(100%, 520px);
    padding: 24px 18px;
  }

  .result-card h2 {
    max-width: 430px;
    font-size: clamp(1.6rem, 7vw, 2.15rem);
  }
}


/* v20: ticking clock and sound control */
.game-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sound-toggle {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(248, 244, 235, 0.18);
  border-radius: 999px;
  background: rgba(7, 14, 29, 0.34);
  color: rgba(248, 244, 235, 0.58);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  border-color: rgba(241, 205, 114, 0.55);
  background: rgba(241, 205, 114, 0.08);
  color: rgba(248, 244, 235, 0.9);
  transform: translateY(-1px);
}

.sound-toggle:focus-visible {
  outline: 3px solid rgba(241, 205, 114, 0.42);
  outline-offset: 3px;
}

.sound-toggle.is-on {
  border-color: rgba(241, 205, 114, 0.46);
  background: rgba(241, 205, 114, 0.08);
  color: #f6df9b;
}

.sound-icon {
  font-size: 0.78rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .game-controls {
    gap: 8px;
  }

  .sound-toggle {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.64rem;
  }

  .timer-label {
    display: none;
  }
}

@media (max-width: 370px) {
  .sound-toggle span:last-child {
    display: none;
  }

  .sound-toggle {
    width: 34px;
    justify-content: center;
    padding-inline: 0;
  }
}
