/* --- Root Variables & Styling --- */

    :root {
      --primary: #ff5e7e;
      --secondary: #8854d0;
      --bg: #0f172a;
      --card-bg: #1e293b;
      --text: #f8fafc;
      --accent: #ffd166;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    body {
      background: radial-gradient(circle at center, #1e1b4b, var(--bg));
      color: var(--text);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      overflow-x: hidden;
      padding: 20px;
    }

    /* Container */
    .wrapper {
      position: relative;
      width: 100%;
      max-width: 450px;
      perspective: 1000px;
    }

    /* Envelope / Cover Overlay */
    .cover {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      border-radius: 20px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 30px;
      z-index: 10;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
      transition: transform 0.8s ease-in-out, opacity 0.6s ease-in-out;
      cursor: pointer;
    }

    .cover.opened {
      transform: translateY(-100%) rotateX(30deg);
      opacity: 0;
      pointer-events: none;
    }

    .cover-icon {
      font-size: 4rem;
      margin-bottom: 10px;
      animation: bounce 2s infinite;
    }

    /* Personalized Badge on Cover */
    .guest-name-badge {
      background: rgba(255, 255, 255, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.4);
      padding: 6px 18px;
      border-radius: 30px;
      font-size: 0.95rem;
      font-weight: 600;
      letter-spacing: 0.5px;
      color: #fff;
      margin-bottom: 12px;
      backdrop-filter: blur(4px);
    }

    .cover h1 {
      font-size: 2.1rem;
      color: #fff;
      margin-bottom: 10px;
    }

    .cover p {
      font-size: 0.95rem;
      color: rgba(255, 255, 255, 0.9);
      margin-bottom: 25px;
    }

    .open-btn {
      background: var(--accent);
      color: #0f172a;
      border: none;
      padding: 14px 32px;
      font-size: 1.1rem;
      font-weight: bold;
      border-radius: 50px;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(255, 209, 102, 0.4);
      transition: transform 0.2s, background 0.2s;
    }

    .open-btn:hover {
      transform: scale(1.05);
      background: #ffdb80;
    }

    /* Main Invitation Card */
    .card {
      background: var(--card-bg);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 20px;
      padding: 40px 30px;
      text-align: center;
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
      transform: scale(0.95);
      opacity: 0;
      transition: transform 0.6s ease 0.3s, opacity 0.6s ease 0.3s;
    }

    .card.visible {
      transform: scale(1);
      opacity: 1;
    }

    .badge {
      background: rgba(255, 94, 126, 0.2);
      color: var(--primary);
      padding: 6px 16px;
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 600;
      letter-spacing: 1px;
      text-transform: uppercase;
      display: inline-block;
      margin-bottom: 15px;
    }

    .guest-welcome {
      font-size: 1.15rem;
      color: var(--accent);
      font-weight: 500;
      margin-bottom: 6px;
    }

    .card h2 {
      font-size: 2.3rem;
      background: linear-gradient(45deg, #ff5e7e, #ffd166);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 8px;
    }

    .card .subtitle {
      font-size: 1rem;
      color: #94a3b8;
      margin-bottom: 20px;
    }

    /* Countdown Timer Styles */
    .countdown-container {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-bottom: 25px;
    }

    .countdown-box {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      padding: 8px 12px;
      min-width: 65px;
    }

    .countdown-box .number {
      display: block;
      font-size: 1.3rem;
      font-weight: bold;
      color: var(--accent);
    }

    .countdown-box .label {
      font-size: 0.7rem;
      text-transform: uppercase;
      color: #94a3b8;
    }

    /* Event Info Box */
    .info-grid {
      display: flex;
      flex-direction: column;
      gap: 15px;
      background: rgba(255, 255, 255, 0.03);
      padding: 20px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.05);
      margin-bottom: 25px;
      text-align: left;
    }

    .info-item {
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .info-item span {
      font-size: 1.5rem;
    }

    .info-text strong {
      display: block;
      color: #fff;
      font-size: 1rem;
    }

    .info-text small {
      color: #94a3b8;
      font-size: 0.85rem;
    }

    /* Actions */
    .rsvp-btn {
      display: block;
      width: 100%;
      background: linear-gradient(45deg, var(--primary), var(--secondary));
      color: #fff;
      text-decoration: none;
      padding: 15px;
      border-radius: 12px;
      font-weight: bold;
      font-size: 1rem;
      transition: opacity 0.2s, transform 0.2s;
    }

    .rsvp-btn:hover {
      opacity: 0.9;
      transform: translateY(-2px);
    }

    /* Confetti Canvas */
    #canvas {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      pointer-events: none;
      z-index: 100;
    }

    @keyframes bounce {
      0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
      40% { transform: translateY(-15px); }
      60% { transform: translateY(-7px); }
    }