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

:root {
    --gold: #c5a059;
    --bg: #fffdfc;
    --text: #2c2c2c;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* --- REGUŁY OGÓLNE --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* --- WIDOK GOŚCIA (index.php) --- */
.guest-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.guest-header {
    text-align: center;
    padding: 2rem 1rem;
}

.guest-subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--gold);
    margin: 0;
}

.guest-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-style: italic;
    margin: 0.5rem 0;
}

.login-box {
    background: var(--white);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
}

.input-elegant {
    width: 100%;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-family: inherit;
}

.btn-login {
    background: var(--gold);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

/* Zakładki (Tabs) */
.tabs-nav {
    display: flex;
    justify-content: center;
    background: white;
    margin: 15px 0 25px 0;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 5px 15px var(--shadow);
    position: sticky;
    top: 10px;
    z-index: 1000;
}

.tab-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 5px;
    border-radius: 40px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn.active {
    background: var(--gold);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Przyciski Aparat/Galeria */
.menu-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.circle-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.3);
}

.circle-btn-outline {
    background: white !important;
    color: var(--gold) !important;
    border: 2px solid var(--gold);
}

.menu-label {
    margin-top: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #777;
}

/* Siatka zdjęć */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.grid-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 8px;
    text-align: center;
    padding: 4px;
    font-weight: bold;
}

.status-live {
    background: rgba(46, 204, 113, 0.9) !important;
}

/* --- QUIZ I RANKING (Gość) --- */
.ranking-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 20px var(--shadow);
    margin-bottom: 20px;
}

.ranking-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.ranking-actions {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 50px;
    background: #f0f2f5;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    gap: 8px;
}

.vote-btn.voted {
    background: #ff4757;
    color: white;
}

.quiz-score-board {
    background: var(--gold);
    color: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.quiz-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 15px;
}

.quiz-btn {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-btn.correct {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.quiz-btn.wrong {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* --- PANEL ADMINA (admin.php) --- */
body.admin-mode {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    overflow: hidden;
}

.admin-nav {
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #ddd;
}

.admin-viewport {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tinder-card {
    position: absolute;
    width: 90%;
    max-width: 350px;
    height: 60vh;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow);
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 100;
}

.tinder-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-footer {
    height: 100px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
}

.action-round {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: white;
    font-size: 1.8rem;
    box-shadow: 0 5px 15px var(--shadow);
    cursor: pointer;
}

/* Sterowanie w adminie */
.zip-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.btn-zip-full {
    display: block;
    padding: 14px;
    text-align: center;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.screen-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.screen-btn {
    border: none;
    padding: 12px 5px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* --- RZUTNIK (slide.php) --- */
body.slideshow-mode {
    background: #000;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(30px) brightness(0.4);
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.slide-bg.active {
    opacity: 1;
    animation: slowZoom 30s linear infinite;
}

.slide-fg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    max-width: 85vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    z-index: 2;
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-out;
}

.slide-fg.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Ramki */
.frame-polaroid {
    border: 15px solid #fff;
    border-bottom: 45px solid #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.frame-gold {
    border: 10px solid #fff;
    outline: 3px solid var(--gold);
    box-shadow: 0 0 0 10px rgba(197, 160, 89, 0.2), 0 30px 60px rgba(0, 0, 0, 0.6);
}

.frame-boho {
    border: 15px solid #fff;
    outline: 2px dashed #ccc;
    outline-offset: -10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.frame-modern {
    border: none;
    border-radius: 25px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

@keyframes slowZoom {
    0% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1.1);
    }
}

/* --- PODIUM QUIZ (RZUTNIK) - NAPRAWIONE SZEROKIE --- */
.podium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #2a2a2a 0%, #000 100%);
    z-index: 200;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.podium-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--gold);
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(197, 160, 89, 0.4);
    text-align: center;
}

#quizPodiumList {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-height: 85vh;
}

.quiz-winner-row {
    background: white;
    width: 95%;
    /* Wykorzystuje prawie całą szerokość ekranu */
    max-width: 1600px;
    /* Zwiększone z ~900px na 1600px (ok. dwukrotnie) */
    padding: 15px 60px;
    /* Większy margines wewnętrzny dla lepszego wyglądu */
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-left: 20px solid #ddd;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInRow 0.5s ease-out forwards;
}

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

/* Podświetlenie Top 3 */
.quiz-winner-row:nth-child(1) {
    animation-delay: 0.1s;
    border-color: #FFD700;
    transform: scale(1.03);
}

.quiz-winner-row:nth-child(2) {
    animation-delay: 0.2s;
    border-color: #C0C0C0;
}

.quiz-winner-row:nth-child(3) {
    animation-delay: 0.3s;
    border-color: #CD7F32;
}

.quiz-winner-row:nth-child(n+4) {
    animation-delay: 0.4s;
    border-color: var(--gold);
}

.q-rank {
    font-size: 2.8rem;
    font-weight: 900;
    min-width: 100px;
    /* Większy margines dla numerka */
    color: #333;
}

.q-name {
    font-size: 3rem;
    /* Zwiększone imię dla lepszej widoczności na szerokim pasku */
    font-weight: 800;
    color: #2c3e50;
    flex: 1;
    text-align: left;
    letter-spacing: 1px;
}

.q-score {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    min-width: 250px;
    text-align: right;
}

.q-row-1 {
    border-color: #FFD700;
    transform: scale(1.1);
    margin-bottom: 40px;
    z-index: 10;
}

.q-row-1 .q-rank {
    color: #FFD700;
}

.q-row-2 {
    border-color: #C0C0C0;
}

.q-row-2 .q-rank {
    color: #C0C0C0;
}

.q-row-3 {
    border-color: #CD7F32;
}

.q-row-3 .q-rank {
    color: #CD7F32;
}

/* Podium Foto (Zwykłe) */
.podium-container {
    display: flex;
    align-items: flex-end;
    gap: 30px;
    height: 50vh;
}

.winner-card {
    position: relative;
    background: white;
    padding: 10px 10px 40px 10px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: translateY(100vh);
    animation: popUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.winner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.winner-rank {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    border: 3px solid white;
}

.place-1 {
    width: 380px;
    height: 480px;
    border: 4px solid #FFD700;
    z-index: 3;
}

.place-1 .winner-rank {
    background: #FFD700;
}

.place-2 {
    width: 300px;
    height: 380px;
    border: 4px solid #C0C0C0;
    z-index: 2;
}

.place-2 .winner-rank {
    background: #C0C0C0;
}

.place-3 {
    width: 300px;
    height: 320px;
    border: 4px solid #CD7F32;
    z-index: 1;
}

.place-3 .winner-rank {
    background: #CD7F32;
}

@keyframes popUp {
    to {
        transform: translateY(0);
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: fall 3s linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
    }
}

/* Poprawiony kontener QR na rzutniku */
.info-overlay {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.95);
    /* Białe, lekko przezroczyste tło */
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    /* Musi być nad slajdami */
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    border-left: 8px solid var(--gold);
    color: #222;
    /* Ciemny tekst dla kontrastu */
}

.qr-code {
    width: 120px;
    height: 120px;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    /* Poprawia ostrość kodu */
}

.info-text h2 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 800;
}

.info-text p {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}


/* --- PRZYCISKI W MODALU PODGLĄDU --- */

/* Przycisk zamykania (X) */
.btn-close-preview {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 5100;
    /* Nad zdjęciem */
    line-height: 1;
    padding: 0;
}

.btn-close-preview:hover {
    background: #fff;
    transform: scale(1.1);
}

.btn-close-preview:active {
    transform: scale(0.9);
}

/* Przycisk usuwania (dla pewności kompletny kod tutaj) */
.btn-delete-photo {
    display: none;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-delete-photo:hover {
    background: #c0392b;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

/* --- MODAL PEŁNOEKRANOWY --- */
.preview-modal {
    position: fixed;
    /* Kluczowe: wyrywa element z przepływu i blokuje go względem ekranu */
    top: 0;
    left: 0;
    width: 100vw;
    /* Szerokość całego okna przeglądarki */
    height: 100vh;
    /* Wysokość całego okna przeglądarki */
    background: rgba(0, 0, 0, 0.95);
    /* Ciemne tło z lekką przezroczystością */
    z-index: 9999;
    /* Bardzo wysoka wartość, aby być nad nawigacją i miniaturkami */

    /* Centrowanie zawartości (zdjęcia i przycisku) */
    display: none;
    /* Domyślnie ukryty, zmieniany na 'flex' przez JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Opcjonalnie: efekt rozmycia tła pod spodem */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.preview-img {
    max-width: 90%;
    /* Zdjęcie nie dotyka krawędzi bocznych */
    max-height: 75vh;
    /* Zostawia miejsce na przycisk "Usuń" na dole */
    object-fit: contain;
    /* Zachowuje proporcje zdjęcia */
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}