/* ============================================
   RETRO GAME PIXEL-ART STYLING
   ============================================ */

/* CSS Variables for Retro Color Palette */
:root {
    --pixel-pink: #ff6b9d;
    --pixel-purple: #c06c84;
    --pixel-blue: #6c5ce7;
    --pixel-cyan: #74b9ff;
    --pixel-yellow: #ffeaa7;
    --pixel-red: #ff7675;
    --pixel-green: #55efc4;
    --pixel-dark: #2d3436;
    --pixel-light: #ffeef8;
    --pixel-bg: #1a1a2e;
    --pixel-bg-light: #16213e;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--pixel-bg);
    color: var(--pixel-light);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Animated Pixel Hearts Background */
.pixel-hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, var(--pixel-pink) 1px, transparent 1px),
        radial-gradient(2px 2px at 60% 70%, var(--pixel-purple) 1px, transparent 1px),
        radial-gradient(2px 2px at 80% 10%, var(--pixel-cyan) 1px, transparent 1px),
        radial-gradient(2px 2px at 40% 80%, var(--pixel-yellow) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 280px 280px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    opacity: 0.3;
    animation: float-hearts 20s linear infinite;
}

@keyframes float-hearts {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-200px);
    }
}

/* Floating Animals Background */
.floating-animals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-animal {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

/* Different animation paths for variety */
.floating-animal:nth-child(1) {
    left: 10%;
    animation: float-diagonal-1 25s infinite;
}

.floating-animal:nth-child(2) {
    left: 30%;
    animation: float-diagonal-2 30s infinite;
    animation-delay: -5s;
}

.floating-animal:nth-child(3) {
    left: 50%;
    animation: float-diagonal-1 28s infinite;
    animation-delay: -10s;
}

.floating-animal:nth-child(4) {
    left: 70%;
    animation: float-diagonal-2 32s infinite;
    animation-delay: -15s;
}

.floating-animal:nth-child(5) {
    left: 85%;
    animation: float-diagonal-1 26s infinite;
    animation-delay: -20s;
}

.floating-animal:nth-child(6) {
    left: 15%;
    animation: float-diagonal-2 29s infinite;
    animation-delay: -8s;
}

.floating-animal:nth-child(7) {
    left: 45%;
    animation: float-diagonal-1 27s infinite;
    animation-delay: -12s;
}

.floating-animal:nth-child(8) {
    left: 65%;
    animation: float-diagonal-2 31s infinite;
    animation-delay: -18s;
}

.floating-animal:nth-child(9) {
    left: 25%;
    animation: float-diagonal-1 24s infinite;
    animation-delay: -3s;
}

.floating-animal:nth-child(10) {
    left: 55%;
    animation: float-diagonal-2 27s infinite;
    animation-delay: -7s;
}

.floating-animal:nth-child(11) {
    left: 75%;
    animation: float-diagonal-1 29s infinite;
    animation-delay: -11s;
}

.floating-animal:nth-child(12) {
    left: 35%;
    animation: float-diagonal-2 26s infinite;
    animation-delay: -14s;
}

.floating-animal:nth-child(13) {
    left: 90%;
    animation: float-diagonal-1 30s infinite;
    animation-delay: -16s;
}

.floating-animal:nth-child(14) {
    left: 5%;
    animation: float-diagonal-2 28s infinite;
    animation-delay: -22s;
}

.floating-animal:nth-child(15) {
    left: 60%;
    animation: float-diagonal-1 25s infinite;
    animation-delay: -25s;
}

@keyframes float-diagonal-1 {
    0% {
        transform: translate(0, -100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translate(50px, calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

@keyframes float-diagonal-2 {
    0% {
        transform: translate(0, -100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translate(-50px, calc(100vh + 100px)) rotate(-360deg);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Pixel Border Effect */
.pixel-border {
    border: 4px solid var(--pixel-pink);
    border-radius: 0;
    padding: 20px;
    background: var(--pixel-bg-light);
    box-shadow: 
        0 0 0 4px var(--pixel-bg),
        0 0 0 8px var(--pixel-purple),
        8px 8px 0 0 var(--shadow-color);
    position: relative;
    image-rendering: pixelated;
}

.pixel-border::before,
.pixel-border::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--pixel-pink);
}

.pixel-border::before {
    top: -4px;
    left: -4px;
}

.pixel-border::after {
    bottom: -4px;
    right: -4px;
}

/* Header Styles */
.game-header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.8s ease-out;
}

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

.glitch-text {
    font-size: 1.5rem;
    color: var(--pixel-pink);
    text-shadow: 
        2px 2px 0 var(--pixel-purple),
        4px 4px 0 var(--pixel-blue);
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.subtitle {
    font-size: 0.8rem;
    color: var(--pixel-cyan);
    margin-top: 15px;
}

/* Section Titles */
.section-title {
    font-size: 1.2rem;
    color: var(--pixel-yellow);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0 var(--pixel-dark);
}

/* Photo Gallery Section */
.photo-section {
    margin-bottom: 60px;
    animation: fadeIn 1s ease-out 0.3s both;
}

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

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 0 auto;
    max-width: 800px;
}

.photo-card {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 4px solid var(--pixel-pink);
    box-shadow: 
        0 0 0 4px var(--pixel-bg),
        0 0 0 8px var(--pixel-cyan),
        8px 8px 0 0 var(--shadow-color);
    cursor: pointer;
    transition: transform 0.3s ease;
    background: var(--pixel-dark);
}

.photo-card:hover {
    transform: scale(1.05) rotate(2deg);
    z-index: 10;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: auto;
    filter: brightness(0.9);
    transition: filter 0.3s ease;
}

.photo-card:hover img {
    filter: brightness(0.4);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 157, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay p {
    font-size: 0.7rem;
    color: white;
    text-align: center;
    line-height: 1.6;
    text-shadow: 2px 2px 0 var(--pixel-dark);
}

/* Countdown Section */
.countdown-section {
    margin-bottom: 60px;
    animation: fadeIn 1s ease-out 0.6s both;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.countdown-card {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.countdown-card h3 {
    font-size: 0.7rem;
    color: var(--pixel-yellow);
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.countdown-display {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-value {
    font-size: 1.5rem;
    color: var(--pixel-pink);
    background: var(--pixel-dark);
    padding: 10px;
    border: 3px solid var(--pixel-cyan);
    min-width: 60px;
    text-align: center;
    box-shadow: 4px 4px 0 0 var(--shadow-color);
}

.time-label {
    font-size: 0.5rem;
    color: var(--pixel-cyan);
}

/* Quiz Button Section */
.quiz-button-section {
    text-align: center;
    margin: 60px 0;
    animation: fadeIn 1s ease-out 0.9s both;
}

.game-button {
    display: inline-block;
    padding: 25px 40px;
    background: var(--pixel-pink);
    border: 4px solid var(--pixel-purple);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
    box-shadow: 
        0 0 0 4px var(--pixel-bg),
        0 0 0 8px var(--pixel-yellow),
        8px 8px 0 0 var(--shadow-color);
}

.game-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 
        0 0 0 4px var(--pixel-bg),
        0 0 0 8px var(--pixel-yellow),
        6px 6px 0 0 var(--shadow-color);
}

.game-button:active {
    transform: translate(4px, 4px);
    box-shadow: 
        0 0 0 4px var(--pixel-bg),
        0 0 0 8px var(--pixel-yellow),
        4px 4px 0 0 var(--shadow-color);
}

.button-text {
    display: block;
    margin-bottom: 8px;
}

.button-subtext {
    display: block;
    font-size: 0.6rem;
    color: var(--pixel-yellow);
}

/* Footer */
.game-footer {
    text-align: center;
    margin-top: 80px;
    padding: 30px 0;
    border-top: 4px dashed var(--pixel-purple);
}

.game-footer p {
    font-size: 0.7rem;
    color: var(--pixel-cyan);
    margin-bottom: 15px;
}

.pixel-hearts {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 1.5rem;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(0.9);
    }
}

/* ============================================
   QUIZ PAGE STYLES
   ============================================ */

.quiz-container {
    max-width: 900px;
    margin: 0 auto;
}

.quiz-progress {
    margin-bottom: 30px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--pixel-yellow);
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--pixel-dark);
    border: 3px solid var(--pixel-cyan);
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pixel-pink), var(--pixel-purple));
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: progress-shine 1s linear infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-20px);
    }
    100% {
        transform: translateX(20px);
    }
}

.quiz-content {
    animation: fadeIn 0.5s ease-out;
}

.quiz-card {
    margin-bottom: 30px;
}

.quiz-image {
    width: 100%;
    max-width: 400px;
    height: 600px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 4px solid var(--pixel-cyan);
    background: var(--pixel-dark);
}

.quiz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
}

.quiz-question {
    margin-bottom: 25px;
}

.quiz-question h2 {
    font-size: 0.9rem;
    color: var(--pixel-yellow);
    line-height: 1.6;
    text-align: center;
}

.quiz-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.answer-button {
    padding: 20px;
    background: var(--pixel-blue);
    border: 4px solid var(--pixel-cyan);
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0 0 var(--shadow-color);
    text-align: center;
    line-height: 1.5;
}

.answer-button:hover {
    background: var(--pixel-cyan);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 var(--shadow-color);
}

.answer-button:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 0 var(--shadow-color);
}

.answer-button.correct {
    background: var(--pixel-green);
    border-color: var(--pixel-green);
    animation: correctAnswer 0.5s ease;
}

.answer-button.wrong {
    background: var(--pixel-red);
    border-color: var(--pixel-red);
    animation: wrongAnswer 0.5s ease;
}

@keyframes correctAnswer {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes wrongAnswer {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.quiz-feedback {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    font-size: 0.7rem;
    border-radius: 0;
    min-height: 50px;
}

.quiz-feedback.show {
    animation: slideUp 0.3s ease-out;
}

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

.quiz-feedback.correct {
    background: var(--pixel-green);
    color: var(--pixel-dark);
    border: 3px solid var(--pixel-dark);
}

.quiz-feedback.wrong {
    background: var(--pixel-red);
    color: white;
    border: 3px solid var(--pixel-dark);
}

/* Completion Screen */
.completion-screen {
    animation: fadeIn 0.8s ease-out;
}

.completion-screen.hidden {
    display: none;
}

.completion-card {
    text-align: center;
    padding: 40px;
}

.completion-title {
    font-size: 1.3rem;
    color: var(--pixel-yellow);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.completion-message {
    font-size: 0.8rem;
    color: var(--pixel-cyan);
    margin-bottom: 20px;
}

.completion-hearts {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 2rem;
    margin: 30px 0;
    animation: heartBeat 1.5s ease-in-out infinite;
}

.completion-score {
    font-size: 1.2rem;
    color: var(--pixel-pink);
    margin-bottom: 30px;
}

.completion-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.certificate-button {
    background: var(--pixel-yellow);
    border-color: var(--pixel-red);
    color: var(--pixel-dark);
}

.secondary-button {
    background: var(--pixel-purple);
    border-color: var(--pixel-pink);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .glitch-text {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 0.6rem;
    }

    .section-title {
        font-size: 0.9rem;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .photo-overlay p {
        font-size: 0.6rem;
    }

    .countdown-grid {
        grid-template-columns: 1fr;
    }

    .time-value {
        font-size: 1.2rem;
        min-width: 50px;
        padding: 8px;
    }

    .time-label {
        font-size: 0.4rem;
    }

    .game-button {
        padding: 20px 30px;
        font-size: 0.7rem;
    }

    .quiz-image {
        height: 200px;
    }

    .quiz-question h2 {
        font-size: 0.7rem;
    }

    .answer-button {
        font-size: 0.6rem;
        padding: 15px;
    }

    .completion-title {
        font-size: 1rem;
    }

    .completion-message {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .glitch-text {
        font-size: 0.8rem;
    }

    .pixel-border {
        padding: 15px;
    }

    .countdown-display {
        flex-wrap: wrap;
    }

    .time-unit {
        flex: 0 0 45%;
    }

    .quiz-answers {
        grid-template-columns: 1fr;
    }
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

