:root {
  --bg: #16110e;
  --bg-2: #211914;
  --ink: #f6eee2;
  --ink-dim: rgba(246, 238, 226, 0.62);
  --gold: #e3b973;
  --gold-deep: #c99e57;
  --pink: #f2a3bb;
  --pink-deep: #e2708f;
  --strawberry: #d84a5f;
  --sage: #8aa873;
  --glass: rgba(30, 23, 18, 0.62);
  --glass-brd: rgba(227, 185, 115, 0.22);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --latin: "Playfair Display", "Noto Serif SC", serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(120% 90% at 50% 8%, #2b2019 0%, #1c1511 45%, #120d0a 100%);
}

#sparkles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(115% 100% at 50% 46%, transparent 52%, rgba(8, 5, 3, 0.55) 100%);
}

.grain {
  position: fixed;
  inset: -100px;
  z-index: 40;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-jitter 0.9s steps(4) infinite;
}

@keyframes grain-jitter {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-38px, 22px); }
  50% { transform: translate(24px, -30px); }
  75% { transform: translate(-14px, -18px); }
  100% { transform: translate(0, 0); }
}

#app { position: fixed; inset: 0; z-index: 10; }

#stage {
  position: absolute;
  inset: 0;
  cursor: grab;
}
#stage:active { cursor: grabbing; }
#stage.aiming { cursor: crosshair; }

/* ---------- header ---------- */

.site-head {
  position: absolute;
  top: clamp(18px, 4vh, 44px);
  left: 0;
  right: 0;
  z-index: 12;
  text-align: center;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--gold);
  opacity: 0.9;
}

.eyebrow .rule {
  display: inline-block;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.site-head h1 {
  margin-top: 10px;
  font-family: var(--latin);
  font-weight: 600;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: 0.04em;
  background: linear-gradient(115deg, #f7e3bd 0%, var(--gold) 34%, #f0c9d4 62%, var(--pink-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(227, 185, 115, 0.18);
}

.site-head h1 em {
  display: block;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 900;
  font-size: 0.42em;
  letter-spacing: 0.5em;
  margin-top: 6px;
  margin-left: 0.5em;
}

.site-head .sub {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}

.chips {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: rgba(22, 16, 12, 0.55);
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.chip svg { width: 13px; height: 13px; color: var(--gold); }

/* ---------- buttons ---------- */

.actions {
  position: absolute;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(246, 238, 226, 0.14);
  background: rgba(246, 238, 226, 0.06);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s;
}

.btn svg { width: 16px; height: 16px; }

.btn:hover:not(:disabled) {
  background: rgba(246, 238, 226, 0.12);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(120deg, var(--gold-deep), var(--gold) 55%, #f0d3a0);
  border-color: transparent;
  color: #241a10;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(227, 185, 115, 0.28);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(120deg, #d8ab63, #ecc281 55%, #f7e0b4);
}

.btn.big { padding: 15px 34px; font-size: 15px; }

.ghost-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(246, 238, 226, 0.18);
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.ghost-btn:hover { color: var(--ink); border-color: rgba(246, 238, 226, 0.4); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(246, 238, 226, 0.16);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
}

.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------- aim bar ---------- */

.aim-bar {
  position: absolute;
  left: 50%;
  bottom: calc(max(26px, env(safe-area-inset-bottom)) + 84px);
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(242, 163, 187, 0.35);
  background: rgba(30, 18, 20, 0.72);
  backdrop-filter: blur(12px);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #f8dce6;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 163, 187, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(242, 163, 187, 0); }
}

/* ---------- blessing wall ---------- */

.wall {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 88vw);
  z-index: 20;
  padding: 26px 22px;
  background: rgba(20, 14, 11, 0.86);
  backdrop-filter: blur(18px);
  border-left: 1px solid var(--glass-brd);
  transform: translateX(105%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.wall.open { transform: translateX(0); }

.wall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wall-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.wall-head h2 svg { width: 17px; height: 17px; color: var(--pink); }

.wall-sub {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.bless-list {
  list-style: none;
  margin-top: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 185, 115, 0.35) transparent;
}

.bless-card {
  border: 1px solid rgba(227, 185, 115, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(150deg, rgba(246, 238, 226, 0.05), rgba(242, 163, 187, 0.04));
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.bless-card .who {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.bless-card .when { color: var(--ink-dim); letter-spacing: 0.04em; }

.bless-card .msg {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  word-break: break-word;
}

.bless-empty {
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 40px 0;
}

/* ---------- modal ---------- */

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(10, 7, 5, 0.55);
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s ease;
}

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

.modal {
  width: min(430px, calc(100vw - 40px));
  border-radius: 14px;
  border: 1px solid var(--glass-brd);
  background: linear-gradient(160deg, #241b15, #191210);
  box-shadow: var(--shadow);
  padding: 30px 28px;
  animation: pop-in 0.45s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.modal h2 svg { width: 18px; height: 18px; color: var(--gold); }

.field { display: block; margin-bottom: 16px; }

.field span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
  margin-bottom: 8px;
}

.field input, .field textarea {
  width: 100%;
  border: 1px solid rgba(246, 238, 226, 0.16);
  border-radius: 8px;
  background: rgba(246, 238, 226, 0.05);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.field input:focus, .field textarea:focus { border-color: var(--gold); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- intro ---------- */

.intro-card { text-align: center; padding: 40px 36px; }

.intro-card .eyebrow { letter-spacing: 0.5em; }

.intro-card h2 {
  display: block;
  margin: 14px 0 16px;
  font-family: var(--latin);
  font-size: 46px;
  line-height: 1.25;
  letter-spacing: 0.14em;
  background: linear-gradient(115deg, #f7e3bd, var(--gold) 45%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-sub {
  font-size: 13.5px;
  line-height: 2;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 26px;
}

/* ---------- toast ---------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(max(26px, env(safe-area-inset-bottom)) + 150px);
  transform: translateX(-50%);
  z-index: 35;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: rgba(24, 17, 13, 0.88);
  backdrop-filter: blur(10px);
  font-size: 13px;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden { display: none !important; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .site-head h1 { font-size: clamp(38px, 11vw, 54px); }
  .site-head .sub { font-size: 11.5px; letter-spacing: 0.16em; }
  .actions { gap: 8px; padding: 8px; }
  .btn { padding: 11px 15px; font-size: 12.5px; }
  .btn span { display: none; }
  .btn.primary span { display: inline; }
  .aim-bar { font-size: 12px; padding: 9px 14px; }
  .intro-card h2 { font-size: 36px; }
}
