@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow-x: hidden;
    font-family: 'Playfair Display', serif;
    color: #fff;
    background: radial-gradient(#2c5364, #203a43, #0f2027);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    transition: background 1.5s ease;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Ukrywamy odtwarzacz YouTube */
#youtube-player-container {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Modal dla wyświetlania zdjęć na telefonach */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 90vh;
    max-height: 90vh;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: relative; /* Dodano, żeby pozycjonować X względem zdjęcia */
}

#modalCaption {
    margin-top: 15px;
    font-size: 1.1em;
    padding: 10px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    border-radius: 10px;
}

/* Zmieniony styl dla przycisku zamykania - teraz w prawym górnym rogu zdjęcia */
.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    background-color: rgba(0, 0, 0, 0.5);
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.close-modal:hover {
    background-color: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

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

/* Panel kontrolny */
.control-panel {
    position: fixed;
    top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* Panel lewy (muzyka) */
.left-panel {
    left: 15px;
}

/* Panel prawy (kolory) */
.right-panel {
    right: 15px;
}

.control-item {
    display: flex;
}

/* Style wspólne dla przycisków i selectów */
.control-item button,
.control-item select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    width: 100%;
    text-align: center;
    outline: none;
}

.control-item button:hover,
.control-item button:active,
.control-item select:hover,
.control-item select:focus {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Style specyficzne dla selecta */
.control-item select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.control-item select option {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
}

.container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 5vh 5vw;
}

/* Styl dla animowanych serc */
.hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" opacity="0.3"><path d="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.09C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.04L12,21.35Z"/></svg>');
    background-size: contain;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Styl dla ważnych dat */
.dates-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin: 10px 0;
}

.date-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 15px;
    border-radius: 15px;
    transition: transform 0.3s;
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.date-bubble:hover, .date-bubble:active {
    transform: scale(1.05);
}

.date-title {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.date-value {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 4px;
}

/* Styl dla licznika dni wewnątrz date-bubble */
.days-count {
    margin: 0;
    font-size: 0.9em;
}

#days {
    font-weight: bold;
    color: #fff;
}

/* Karuzela zdjęć - POWIĘKSZONA */
.scope {
    position: relative;
    width: 30vmin; /* Zwiększono rozmiar */
    height: 30vmin;
    transform-style: preserve-3d;
    animation: rotateGallery 30s linear infinite;
    margin: 20px 0;
    z-index: 1;
}

.scope.paused {
    animation-play-state: paused;
}

/* @media (hover: hover) {
    .scope:hover {
        animation-play-state: paused;
    }
} */

.scope span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(42vmin); /* Zwiększona odległość */
}

.scope span img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
    border: 0.1em solid #0f2027;
    box-shadow: 0 0 1em #0f2027;
    cursor: pointer;
}

/* Interakcje z karuzelą - desktopy używają hover, telefony używają modal */
@media (hover: hover) {
    /* Na desktopach - hover powiększa zdjęcie */
    .scope span:hover img {
        transform: scale(1.2);
    }
}

@media (hover: none) {
    /* Na urządzeniach dotykowych - hover nie działa, kliknięcie otwiera modal */
    .scope span img:active {
        transform: scale(1.1);
    }
}

@keyframes rotateGallery {
    0% {
        transform: perspective(100em) rotateY(0deg);
    }
    100% {
        transform: perspective(100em) rotateY(360deg);
    }
}

@keyframes fadeInHeader {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    font-size: clamp(1.2rem, 5vw, 2.5rem);
    animation: fadeInHeader 1.5s linear;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    width: 100%;
}

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

.message {
    text-align: center;
    font-size: clamp(1rem, 4vw, 1.8rem);
    padding: 15px;
    border: 2px solid #fff;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    animation: fadeInMessage 1.5s linear;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    width: 100%;
    max-width: 600px;
}

/* Responsywność dla różnych urządzeń */
@media screen and (max-width: 600px) {
    .container {
        padding: 5vh 4vw;
        justify-content: center;
        gap: 15px;
    }

    .header {
        margin-bottom: 0;
    }
    
    .dates-container {
        flex-direction: column;
        align-items: center;
    }
    
    .date-bubble {
        width: 80%;
        max-width: 300px;
    }
    
    .message {
        padding: 10px;
        margin: 0;
    }
    
    /* Zwiększamy rozmiar karuzeli na telefonach */
    .scope {
        width: 40vmin;
        height: 40vmin;
    }
    
    .scope span {
        transform: rotateY(calc(var(--i) * 45deg)) translateZ(50vmin);
    }
}

@media screen and (max-width: 400px) {
    .control-panel {
        top: 10px;
        max-width: 150px;
    }
    
    .left-panel {
        left: 10px;
    }
    
    .right-panel {
        right: 10px;
    }
    
    .control-item button,
    .control-item select {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* Dodatkowe zwiększenie karuzeli dla bardzo małych ekranów */
    .scope {
        width: 45vmin;
        height: 45vmin;
    }
    
    .scope span {
        transform: rotateY(calc(var(--i) * 45deg)) translateZ(55vmin);
    }
}

@media screen and (max-height: 500px) {
    .dates-container {
        margin: 5px 0;
    }
    
    /* Dla niskich ekranów delikatnie zmniejsz karuzele, aby wszystko się zmieściło */
    .scope {
        margin: 10px 0;
    }
}

@media screen and (min-width: 1200px) {
    .header {
        font-size: 2.5rem;
    }
    
    .message {
        font-size: 1.8rem;
    }
    
    .date-bubble {
        padding: 12px 20px;
    }
    
    .date-title {
        font-size: 1.1em;
    }
    
    .date-value {
        font-size: 1.3em;
    }
    
    /* Dla dużych ekranów również powiększ karuzele */
    .scope {
        width: 32vmin;
        height: 32vmin;
    }
    
    .scope span {
        transform: rotateY(calc(var(--i) * 45deg)) translateZ(45vmin);
    }
}

.prevent-select {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}