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

:root {
  --bg: #fff8fb;
  --pink: #d44b82;
  --pink-light: #f4a0c6;
  --pink-baby: #ffe4f0;
  --text: #3d1828;
  --text-muted: #a06080;
  --glass-bg: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.75);
  --serif: 'Cormorant Garamond', serif;
  --sans: 'DM Sans', sans-serif;
  --card-r: 1.5rem;
  --pill-r: 9999px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-user-select: none;
  user-select: none;
}

#petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#petals::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #fff4f9 0%, #ffe8f3 50%, #fff0fb 100%);
}

.petal {
  position: absolute;
  top: -5%;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 35% 35%, #fff, #ffb3d9);
  box-shadow: 0 0 8px rgba(255,179,217,0.45);
  filter: blur(1px);
  animation: petalFall linear infinite;
}

@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  8%   { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { transform: translateY(115vh) rotate(400deg) scale(1.1); opacity: 0; }
}

.section {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 28px rgba(212,75,130,0.09), 0 1px 4px rgba(212,75,130,0.04);
  border-radius: var(--card-r);
}

.glass-sm {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,220,235,0.8);
  box-shadow: 0 2px 14px rgba(212,75,130,0.06);
  border-radius: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.9rem;
  background: var(--pink-baby);
  color: var(--pink);
  border: 1px solid rgba(212,75,130,0.18);
  border-radius: var(--pill-r);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.7rem;
  border-radius: var(--pill-r);
  border: none;
  outline: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(212,75,130,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(212,75,130,0.38); }
.btn:active { transform: scale(0.96); }
.btn:disabled {
  background: #e8d0dc;
  color: #b08098;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.hdivider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 14rem;
}
.hdivider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(212,75,130,0.3));
}
.hdivider span:last-child {
  background: linear-gradient(to left, transparent, rgba(212,75,130,0.3));
}
.hdivider svg { width: 14px; height: 14px; flex-shrink: 0; }

#hero .card {
  max-width: 28rem;
  width: 100%;
  padding: 2.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  text-align: center;
}
@media (min-width: 600px) { #hero .card { padding: 3.5rem; } }

#hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.1;
}
#hero h1 .big  { font-size: clamp(2.8rem, 10vw, 4.5rem); display: block; }
#hero h1 .pink { font-size: clamp(2.8rem, 10vw, 4.5rem); display: block; color: var(--pink); font-style: italic; }

#hero p {
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.7;
  max-width: 22rem;
}

.bobbing { display: inline-block; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

#setup .card {
  max-width: 36rem;
  width: 100%;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
@media (min-width: 600px) { #setup .card { padding: 3rem; } }

.sec-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 300;
}
.sec-head p { font-size: 0.9rem; color: var(--text-muted); }

.icon-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--pink-baby);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-circle svg { width: 18px; height: 18px; }

.players-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}
@media (min-width: 520px) {
  .players-row { flex-direction: row; justify-content: center; gap: 1.5rem; }
}

.player-card {
  flex: 0 0 auto;
  width: 100%;
  max-width: 12rem;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.av-wrap {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  border: 2px solid rgba(212,75,130,0.22);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s;
  background: var(--pink-baby);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.av-wrap:hover, .av-wrap:active { border-color: var(--pink); transform: scale(1.04); }
.av-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av-wrap .av-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(212,75,130,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.18s;
}
.av-wrap:hover .av-overlay, .av-wrap:active .av-overlay { opacity: 1; }
.av-wrap .av-overlay svg { width: 22px; height: 22px; }
.av-wrap .av-overlay span { font-size: 0.65rem; color: #fff; font-weight: 500; }
.av-placeholder svg { width: 3rem; height: 3rem; color: rgba(212,75,130,0.3); }

.name-inp {
  width: 100%;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(212,75,130,0.2);
  border-radius: var(--pill-r);
  padding: 0.5rem 1rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-user-select: text;
  user-select: text;
}
.name-inp:focus { border-color: rgba(212,75,130,0.45); box-shadow: 0 0 0 3px rgba(212,75,130,0.1); }
.name-inp::placeholder { color: var(--text-muted); }

.and-div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.and-div .ln { width: 1px; height: 2rem; background: rgba(212,75,130,0.2); }
@media (min-width: 520px) {
  .and-div { flex-direction: column; }
  .and-div .ln { height: 1.5rem; }
}

#game .card {
  max-width: 54rem;
  width: 100%;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.game-head { text-align: center; margin-bottom: 1.25rem; }
.game-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 300;
  margin-bottom: 0.3rem;
}
.game-head p { font-size: 0.85rem; color: var(--text-muted); }

.hud {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212,75,130,0.18);
  border-radius: var(--pill-r);
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pink);
  box-shadow: 0 2px 10px rgba(212,75,130,0.1);
}
.hud-pill svg { width: 14px; height: 14px; }

#gc {
  display: block;
  width: 100%;
  cursor: none;
  touch-action: none;
  user-select: none;
}

.g-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  z-index: 20;
  border-radius: var(--card-r);
}
.g-overlay.off { display: none; }
.g-overlay h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  font-weight: 400;
  color: var(--pink);
  margin-bottom: 0.5rem;
}
.g-overlay p {
  font-size: clamp(0.82rem, 3vw, 0.95rem);
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  max-width: 22rem;
}
.g-overlay .btn { margin-top: 1.25rem; }

.big-e {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275) both;
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#letter .card {
  max-width: 38rem;
  width: 100%;
  padding: 2.75rem 2rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 600px) { #letter .card { padding: 3.5rem 4rem; } }

.corner { position: absolute; width: 1.75rem; height: 1.75rem; pointer-events: none; }
.corner.tl { top:1.1rem; left:1.1rem; border-top:1.5px solid rgba(212,75,130,0.25); border-left:1.5px solid rgba(212,75,130,0.25); border-radius:0.5rem 0 0 0; }
.corner.tr { top:1.1rem; right:1.1rem; border-top:1.5px solid rgba(212,75,130,0.25); border-right:1.5px solid rgba(212,75,130,0.25); border-radius:0 0.5rem 0 0; }
.corner.bl { bottom:1.1rem; left:1.1rem; border-bottom:1.5px solid rgba(212,75,130,0.25); border-left:1.5px solid rgba(212,75,130,0.25); border-radius:0 0 0 0.5rem; }
.corner.br { bottom:1.1rem; right:1.1rem; border-bottom:1.5px solid rgba(212,75,130,0.25); border-right:1.5px solid rgba(212,75,130,0.25); border-radius:0 0 0.5rem 0; }

.letter-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.letter-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
}

.letter-body {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 3vw, 1.05rem);
  line-height: 1.9;
  color: rgba(61,24,40,0.78);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.letter-body .sal { color: var(--text-muted); font-style: italic; }

.pdiv { display: flex; align-items: center; gap: 0.5rem; }
.pdiv .sl { flex: 1; height: 1px; background: rgba(212,75,130,0.1); }
.pdiv svg { width: 13px; height: 13px; }

.letter-sig { text-align: right; padding-top: 1rem; }
.letter-sig .ys { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.letter-sig .nm {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--pink);
  margin-top: 0.15rem;
}

footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1rem;
  display: flex;
  justify-content: center;
}
.ft-card {
  padding: 0.9rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}
.ft-card .r1 { display:flex; align-items:center; gap:0.45rem; font-size:0.78rem; color:var(--text-muted); }
.ft-card .r2 { display:flex; align-items:center; gap:0.3rem; font-size:0.72rem; color:rgba(160,96,128,0.6); }
.ft-card svg { width: 13px; height: 13px; }

.fu {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fu.on { opacity: 1; transform: translateY(0); }
