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

:root {
    --background: hsl(280, 15%, 4%);
    --foreground: hsl(280, 10%, 95%);
    --primary: hsl(280, 85%, 60%);
    --primary-foreground: hsl(280, 5%, 10%);
    --muted-foreground: hsl(280, 10%, 70%);
    --card: hsl(280, 20%, 6%);
    --card-foreground: hsl(280, 10%, 95%);
    --card-border: hsl(280, 65%, 40%);
    
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Cormorant Garamond', serif;
    --font-display: 'Playfair Display', serif;
    --font-elegant: 'Marcellus', serif;
    --font-handwriting: 'Satisfy', cursive;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#galaxy-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#explosion-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    display: none;
}

#floating-letter {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#open-letter-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    outline: none;
}

#open-letter-btn:focus {
    outline: none;
}

.letter-container {
    position: relative;
    animation: float 6s ease-in-out infinite;
    transition: transform 0.7s ease-out;
}

#open-letter-btn:hover .letter-container {
    transform: scale(1.05);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(0px) translateX(-5px);
    }
    75% {
        transform: translateY(10px) translateX(5px);
    }
}

.letter-box {
    position: relative;
    width: 256px;
    height: 160px;
    background: linear-gradient(135deg, #000 0%, #111 50%, #000 100%);
    border-radius: 6px;
    overflow: hidden;
}

.letter-glow {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    box-shadow: 0 0 20px 2px rgba(138, 43, 226, 0.4),
                0 0 40px 4px rgba(138, 43, 226, 0.2),
                inset 0 0 30px rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.6);
}

.letter-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, transparent 50%, rgba(147, 51, 234, 0.1) 100%);
}

.letter-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
}

.letter-icon-glow {
    position: absolute;
    inset: 0;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    filter: blur(40px);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.letter-icon {
    width: 100%;
    height: 100%;
    color: rgba(196, 181, 253, 0.8);
    stroke-width: 1.5;
}

.letter-hover-gradient {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(138, 43, 226, 0.15) 0%, transparent 70%);
    transition: opacity 0.5s;
}

#open-letter-btn:hover .letter-hover-gradient {
    opacity: 1;
}

.letter-blur {
    position: absolute;
    inset: -16px;
    background: rgba(168, 85, 247, 0.05);
    border-radius: 8px;
    filter: blur(80px);
    opacity: 0.5;
    transition: opacity 0.5s;
}

#open-letter-btn:hover .letter-blur {
    opacity: 0.75;
}

section[data-page] {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 48px 0;
    z-index: 10;
}

.content-container {
    width: 100%;
    max-width: 672px;
    padding: 32px 24px;
    margin: 0 auto;
}

.header-section {
    text-align: center;
    padding-top: 20px;
}

@media (min-width: 640px) {
    .header-section {
        padding-top: 8px;
    }
}

.event-type {
    font-family: var(--font-elegant);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: 0.1em;
    text-shadow: 0 0 25px rgba(138, 43, 226, 0.6), 0 0 50px rgba(138, 43, 226, 0.4);
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .event-type {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .event-type {
        font-size: 3.75rem;
    }
}

.name-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 300;
    color: var(--foreground);
    letter-spacing: 0.025em;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.5), 0 0 40px rgba(138, 43, 226, 0.3);
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .name-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 768px) {
    .name-title {
        font-size: 4.5rem;
    }
}

@media (min-width: 1024px) {
    .name-title {
        font-size: 6rem;
    }
}

.divider-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.divider-line {
    height: 1px;
    width: 64px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
}

.star-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.poetic-text {
    max-width: 768px;
    margin: 0 auto 32px;
    padding: 0 16px;
    opacity: 0;
    transform: translateY(32px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poetic-text p {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--muted-foreground);
    line-height: 1.75;
    text-align: center;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.2);
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .poetic-text p {
        font-size: 1.25rem;
    }
}

.nome-handwriting {
    font-family: var(--font-handwriting);
    font-size: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    display: inline-block;
}

@media (min-width: 768px) {
    .nome-handwriting {
        font-size: 1.875rem;
    }
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 672px;
    margin: 0 auto 24px;
    opacity: 0;
    transform: translateY(32px);
    animation: fadeInUp 1s ease-out 0.7s forwards;
}

@media (min-width: 640px) {
    .info-cards {
        gap: 24px;
    }
}

.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(138, 43, 226, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    transition: background-color 0.3s;
}

@media (min-width: 640px) {
    .info-card {
        gap: 12px;
        padding: 16px;
    }
}

.info-card:hover {
    background: rgba(138, 43, 226, 0.08);
}

.info-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    stroke-width: 2;
}

@media (min-width: 640px) {
    .info-icon {
        width: 24px;
        height: 24px;
    }
}

.info-card > div {
    text-align: center;
}

.info-label {
    font-size: 10px;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

@media (min-width: 640px) {
    .info-label {
        font-size: 12px;
    }
}

.info-value {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--card-foreground);
}

@media (min-width: 640px) {
    .info-value {
        font-size: 14px;
    }
}

.interaction-hint {
    text-align: center;
    padding-top: 24px;
    opacity: 0;
    transform: translateY(32px);
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

.interaction-hint p {
    font-size: 12px;
    color: var(--muted-foreground);
}

@media (min-width: 640px) {
    .interaction-hint p {
        font-size: 14px;
    }
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding-top: 16px;
    opacity: 0;
    transform: translateY(32px);
    animation: fadeInUp 1s ease-out 1s forwards;
}

.action-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.6), 0 0 40px rgba(138, 43, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.8), 0 0 60px rgba(138, 43, 226, 0.4);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.action-label {
    font-size: 12px;
    color: var(--muted-foreground);
    text-align: center;
}

.page-container {
    width: 100%;
    max-width: 768px;
    padding: 48px 24px 32px;
    margin: 0 auto;
}

.back-button-wrapper {
    margin-bottom: 32px;
}

.back-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(138, 43, 226, 0.6);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.back-btn:hover {
    background: rgba(138, 43, 226, 0.08);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-elegant);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: 0.1em;
    text-shadow: 0 0 25px rgba(138, 43, 226, 0.6), 0 0 50px rgba(138, 43, 226, 0.4);
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .page-title {
        font-size: 3.75rem;
    }
}

.page-subtitle {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 672px;
    margin: 0 auto;
}

.gift-list, .rules-list {
    display: grid;
    gap: 16px;
    margin-top: 48px;
}

.gift-item, .rule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-radius: 6px;
    background: rgba(138, 43, 226, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    transition: all 0.3s;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-32px);
    animation: slideInFromLeft 0.7s ease-out forwards;
}

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gift-item:nth-child(1) { animation-delay: 0s; }
.gift-item:nth-child(2), .rule-item:nth-child(2) { animation-delay: 0.1s; }
.gift-item:nth-child(3), .rule-item:nth-child(3) { animation-delay: 0.2s; }
.gift-item:nth-child(4), .rule-item:nth-child(4) { animation-delay: 0.3s; }
.gift-item:nth-child(5), .rule-item:nth-child(5) { animation-delay: 0.4s; }
.gift-item:nth-child(6), .rule-item:nth-child(6) { animation-delay: 0.5s; }
.gift-item:nth-child(7), .rule-item:nth-child(7) { animation-delay: 0.6s; }
.gift-item:nth-child(8), .rule-item:nth-child(8) { animation-delay: 0.7s; }
.gift-item:nth-child(9), .rule-item:nth-child(9) { animation-delay: 0.8s; }

.gift-item:hover, .rule-item:hover {
    background: rgba(138, 43, 226, 0.1);
}

.gift-item:active, .rule-item:active {
    background: rgba(138, 43, 226, 0.15);
}

.gift-icon-wrapper, .rule-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.gift-icon, .rule-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    stroke-width: 2;
}

.gift-content {
    flex: 1;
    text-align: left;
}

.gift-name, .rule-text {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    color: var(--foreground);
    font-weight: 500;
    margin-bottom: 4px;
}

@media (min-width: 640px) {
    .gift-name, .rule-text {
        font-size: 1.25rem;
    }
}

.gift-description {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--muted-foreground);
}

.gift-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.copy-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.copy-text {
    font-size: 12px;
    display: none;
}

@media (min-width: 640px) {
    .copy-text {
        display: inline;
    }
}

#audio-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
}

.audio-btn-collapsed {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(138, 43, 226, 0.6);
    background: rgba(138, 43, 226, 0.1);
    backdrop-filter: blur(16px);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.audio-btn-collapsed:hover {
    background: rgba(138, 43, 226, 0.15);
}

.audio-btn-collapsed svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.audio-panel {
    background: rgba(138, 43, 226, 0.1);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.audio-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.audio-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-control-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

#volume-slider {
    width: 96px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: rgba(138, 43, 226, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: slideInFromBottom 0.3s ease-out;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast p {
    font-size: 14px;
    opacity: 0.9;
}

.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
