/* Wedding shell — visual style matches the game's OPEN INVITE screen.
   Cream background, red panel card with orange trim, corner flowers &
   diyas, VT323 pixel font, pixel-corners + pixel-shadow. */

/* ---------------- Phone-frame viewport ---------------- */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b0410;
}
body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #1a0a24 0%, #0b0410 70%),
    #0b0410;
}
#root {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff7ed;
}
@media (min-width: 640px) {
  #root {
    height: min(100dvh, 800px);
    margin: auto 0;
    box-shadow:
      0 24px 60px rgba(0,0,0,.6),
      0 0 80px rgba(234,179,8,.06);
  }
}

/* ---------------- Overlay ---------------- */
.ws-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 68px;   /* leave room for corner decorations */
  background: #fff7ed;
  color: #7f1d1d;
  font-family: VT323, monospace;
  text-align: center;
  overflow-y: auto;
  animation: ws-fade-in 300ms ease-out;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* keep inputs selectable */
.ws-overlay .ws-input, .ws-overlay .ws-textarea {
  user-select: text;
  -webkit-user-select: text;
}
.ws-overlay ::selection { background: transparent; }
.ws-overlay.ws-active { display: flex; }
@keyframes ws-fade-in { from { opacity: 0 } to { opacity: 1 } }
@media (min-width: 640px) {
  .ws-overlay {
    top: 50%;
    bottom: auto;
    height: min(100dvh, 800px);
    transform: translate(-50%, -50%);
  }
}

/* Subtle dotted paper texture (matches the game's noisy cream bg) */
.ws-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(234,88,12,.08) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
  z-index: 0;
}

/* ---------------- Corner ornaments ---------------- */
.ws-deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-size: 22px;
  line-height: 1;
}
.ws-deco-top    { top: 8px;  left: 0; right: 0; text-align: center; font-size: 24px; letter-spacing: 4px; }
.ws-deco-bot    { bottom: 12px; left: 0; right: 0; text-align: center; font-size: 24px; letter-spacing: 24px; padding-left: 24px; }
.ws-deco-flower-tl { top: 44px;    left: 10px; }
.ws-deco-flower-tr { top: 44px;    right: 10px; }
.ws-deco-flower-bl { bottom: 52px; left: 10px; }
.ws-deco-flower-br { bottom: 52px; right: 10px; }
.ws-bar-left, .ws-bar-right {
  position: absolute;
  top: 40px; bottom: 40px;
  width: 6px;
  background: #b91c1c;
  z-index: 0;
}
.ws-bar-left  { left: 0;  }
.ws-bar-right { right: 0; }
.ws-bar-left::before, .ws-bar-right::before,
.ws-bar-left::after,  .ws-bar-right::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  background: #b91c1c;
}
.ws-bar-left::before, .ws-bar-right::before { top: -8px; }
.ws-bar-left::after,  .ws-bar-right::after  { bottom: -8px; }

/* ---------------- Card ---------------- */
.ws-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 320px;
  padding: 18px 16px;
  background: #b91c1c;
  border: 4px solid #7f1d1d;
  color: #fef08a;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 4px 4px 0 #0000004d;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
/* Orange trim strips at top and bottom of the red panel */
.ws-card::before, .ws-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 8px;
  background: #f97316;
}
.ws-card::before { top: 0; }
.ws-card::after  { bottom: 0; }

/* ---------------- Typography ---------------- */
.ws-title {
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1;
  color: #fef08a;
  text-shadow: 2px 2px 0px rgba(0,0,0,.25);
  letter-spacing: 1px;
  margin: 4px 0 0;
}
.ws-title.ws-couple {
  font-size: clamp(26px, 7vw, 34px);
  color: #fde047;
  letter-spacing: 2px;
}
.ws-sub {
  font-size: clamp(16px, 4.2vw, 20px);
  color: #fef3c7;
  margin: 0;
}
.ws-muted {
  font-size: clamp(14px, 3.6vw, 17px);
  color: #fde68a;
  margin: 0;
}
.ws-tiny {
  font-size: clamp(11px, 3vw, 13px);
  color: #fde68acc;
  letter-spacing: 2px;
  margin: 0;
}
.ws-badge {
  align-self: center;
  font-size: 12px;
  padding: 3px 10px;
  border: 2px solid #fef08a;
  color: #fef08a;
  letter-spacing: 2px;
}
.ws-flourish {
  color: #fde047;
  letter-spacing: 6px;
  font-size: 16px;
  margin: 0;
}
.ws-mission-line {
  font-size: clamp(15px, 4.2vw, 18px);
  color: #fef3c7;
  padding: 2px 0;
  margin: 0;
}
.ws-mission-final {
  font-size: clamp(18px, 5vw, 22px);
  color: #fde047;
  text-shadow: 2px 2px 0px rgba(0,0,0,.25);
  margin: 4px 0 0;
}

/* ---------------- Buttons ---------------- */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  font-family: VT323, monospace;
  font-size: clamp(16px, 4.5vw, 20px);
  letter-spacing: 1px;
  background: #eab308;
  color: #7f1d1d;
  border: 3px solid #a16207;
  cursor: pointer;
  box-shadow: 3px 3px 0 #0000004d;
  text-align: center;
  text-decoration: none;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.ws-btn:hover  { filter: brightness(1.06); }
.ws-btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #0000004d; }

.ws-btn.ws-btn-primary {
  background: #dc2626;
  color: #fef9c3;
  border-color: #7f1d1d;
}
.ws-btn.ws-btn-secondary {
  background: #7f1d1d;
  color: #fde68a;
  border-color: #450a0a;
}
.ws-btn.ws-btn-ghost {
  background: transparent;
  color: #fde68a;
  border-color: #7f1d1d;
  box-shadow: none;
}

.ws-start-pulse { animation: ws-pulse 1.2s infinite; }
@keyframes ws-pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.04); }
}

/* ---------------- Form controls ---------------- */
.ws-input, .ws-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: VT323, monospace;
  font-size: 18px;
  padding: 10px 12px;
  background: #fef3c7;
  color: #7f1d1d;
  border: 3px solid #7f1d1d;
  outline: none;
}
.ws-textarea { min-height: 84px; resize: vertical; }
.ws-input:focus, .ws-textarea:focus { border-color: #dc2626; }
.ws-label {
  text-align: left;
  color: #fef08a;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.ws-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.ws-chip {
  font-family: VT323, monospace;
  font-size: 14px;
  padding: 6px 10px;
  background: #fef3c7;
  color: #7f1d1d;
  border: 2px solid #7f1d1d;
  cursor: pointer;
}
.ws-chip:hover { background: #fde68a; }

.ws-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 640px) {
  .ws-actions-grid { grid-template-columns: 1fr 1fr; }
}

.ws-final-hero {
  padding: 8px 0;
  border-top: 2px dashed #fef08a55;
  border-bottom: 2px dashed #fef08a55;
  margin: 4px 0;
}
.ws-back { align-self: center; margin-top: 4px; }

.ws-list {
  text-align: left;
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-list li {
  padding: 8px 10px;
  background: rgba(0,0,0,.2);
  border: 2px solid #7f1d1d;
  color: #fef3c7;
  font-size: 15px;
  line-height: 1.3;
}
.ws-list li strong {
  display: block;
  color: #fef08a;
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.ws-heart { color: #f87171; }

/* ============================================================
   FINAL SCREEN — matches the game's original ending aesthetic
   (deep red brick bg, gold trim, gilded inner panel)
   ============================================================ */
.ws-overlay.ws-final {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 6px),
    #7f1d1d;
  color: #fde047;
  padding: 56px 20px 56px;
}
.ws-overlay.ws-final::before { display: none; }

/* gold vertical trim strips */
.ws-overlay.ws-final .ws-bar-left,
.ws-overlay.ws-final .ws-bar-right {
  width: 10px;
  background:
    repeating-linear-gradient(90deg, #eab308 0 3px, #a16207 3px 6px);
  top: 0; bottom: 0;
}
.ws-overlay.ws-final .ws-bar-left::before,
.ws-overlay.ws-final .ws-bar-left::after,
.ws-overlay.ws-final .ws-bar-right::before,
.ws-overlay.ws-final .ws-bar-right::after { display: none; }

/* corner ornaments */
.ws-overlay.ws-final .ws-deco-top { top: 6px; font-size: 30px; letter-spacing: 8px; }
.ws-overlay.ws-final .ws-deco-bot { bottom: 8px; font-size: 22px; letter-spacing: 30px; padding-left: 30px; }
.ws-overlay.ws-final .ws-deco-flower-tl,
.ws-overlay.ws-final .ws-deco-flower-tr,
.ws-overlay.ws-final .ws-deco-flower-bl,
.ws-overlay.ws-final .ws-deco-flower-br { font-size: 22px; }

.ws-final-hearts {
  align-self: center;
  width: 78px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef9c3;
  border: 4px solid #eab308;
  border-radius: 50%;
  font-size: 26px;
  box-shadow: 0 4px 0 #78350f, 4px 4px 0 rgba(0,0,0,.35);
  margin-top: -12px;
  margin-bottom: 4px;
}

.ws-final-title {
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1;
  color: #fde047;
  text-shadow: 2px 2px 0 #000, 4px 4px 0 rgba(0,0,0,.35);
  letter-spacing: 3px;
  text-align: center;
  margin: 4px 0;
}

/* Gilded inner panel */
.ws-final-panel {
  position: relative;
  z-index: 2;
  align-self: stretch;
  max-width: 320px;
  margin: 6px auto 8px;
  padding: 14px 16px;
  color: #fde68a;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 4px),
    #450a0a;
  border: 3px solid #eab308;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-final-panel p { margin: 0; }
.ws-final-panel .ws-final-lead { color: #fde047; font-size: 18px; letter-spacing: 1px; }
.ws-final-panel .ws-final-date { color: #fde68a; font-size: 17px; }
.ws-final-panel .ws-final-place { color: #fde68a; font-size: 16px; }

.ws-final-regards {
  color: #fde68a;
  text-align: center;
  letter-spacing: 1px;
  font-size: 15px;
  margin: 8px 0 10px;
}

.ws-final-cta {
  align-self: stretch;
  max-width: 320px;
  margin: 0 auto;
  min-height: 48px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #facc15 0%, #eab308 55%, #a16207 100%);
  color: #7f1d1d;
  border: 3px solid #713f12;
  font-family: VT323, monospace;
  font-size: 20px;
  letter-spacing: 1px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ws-final-cta:hover  { filter: brightness(1.06); }
.ws-final-cta:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 rgba(0,0,0,.35); }

.ws-final-quick {
  align-self: stretch;
  max-width: 320px;
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.ws-final-quick .ws-final-mini {
  min-height: 40px;
  padding: 8px 8px;
  background: #450a0a;
  color: #fde047;
  border: 2px solid #eab308;
  font-family: VT323, monospace;
  font-size: 16px;
  letter-spacing: 1px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ws-final-quick .ws-final-mini:hover { background: #7f1d1d; }
.ws-final-sparkle {
  position: absolute;
  color: #fde047;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
  opacity: .9;
}
