@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@300;400;600&family=Share+Tech+Mono&display=swap');

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #2a2a3a;
  --text: #c8c8d8;
  --text-dim: #5a5a7a;
  --accent: #7b6fff;
  --accent-glow: rgba(123, 111, 255, 0.18);
  --danger: #ff5f7e;
  --gold: #d4af6a;
  --mono: 'Share Tech Mono', monospace;
  --serif: 'Noto Serif KR', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 10;
}

.page {
  max-width: 540px;
  width: 100%;
  padding: 3rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.page::before, .page::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent);
  border-style: solid;
}
.page::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.page::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* 이미지 */
.unit-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  margin-bottom: 2rem;
  opacity: 0.75;
  filter: grayscale(30%);
}

.sys-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.poem {
  line-height: 2;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: pre-line;
  margin-bottom: 2.5rem;
}
.poem em { font-style: normal; color: var(--accent); }
.poem strong { font-weight: 600; color: #e8e8f0; }

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.choice {
  display: block;
  padding: 0.75rem 1.2rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 300;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}
.choice::before {
  content: '▶';
  font-size: 0.65rem;
  margin-right: 0.8rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.choice:hover { border-color: var(--accent); background: var(--accent-glow); color: #fff; }
.choice:hover::before { color: var(--accent); }

.choice.danger { border-color: #3a1a2a; color: #aa7788; }
.choice.danger:hover { border-color: var(--danger); background: rgba(255,95,126,0.1); color: var(--danger); }

.choice.gold { border-color: #3a3020; color: #8a7a4a; }
.choice.gold:hover { border-color: var(--gold); background: rgba(212,175,106,0.08); color: var(--gold); }

.wish-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 300;
  padding: 0.6rem 0;
  outline: none;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
  margin: 1.5rem 0;
}
.wish-input:focus { border-bottom-color: var(--accent); }
.wish-input::placeholder { color: var(--text-dim); }

.notice {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.ending-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; } 93% { opacity: 0.3; }
  94% { opacity: 1; } 96% { opacity: 0.6; } 97% { opacity: 1; }
}
.glitch { animation: flicker 4s infinite; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: fadeIn 0.6s ease forwards; }

@media (max-width: 600px) {
  .page { padding: 2rem 1.5rem; }
  .poem { font-size: 0.97rem; }
  .unit-image { height: 140px; }
}
