/* General Styles */
body {
    font-family: 'VT323', monospace;
    background-color: #000000;
    background-image: url('images/stars.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ffffff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 20px;
}

/* Starry Night Animation */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Shooting Star */
.shooting-star {
    position: fixed;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: shoot 3s linear infinite;
    z-index: 1000;
}

@keyframes shoot {
    0% {
        transform: translateX(-100%) translateY(0) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translateX(200%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 8s infinite;
}

.star:nth-child(1) { top: 5%; left: 15%; animation-delay: 0.1s; }
.star:nth-child(2) { top: 15%; left: 45%; animation-delay: 0.3s; }
.star:nth-child(3) { top: 25%; left: 75%; animation-delay: 0.5s; }
.star:nth-child(4) { top: 35%; left: 25%; animation-delay: 0.7s; }
.star:nth-child(5) { top: 45%; left: 85%; animation-delay: 0.9s; }
.star:nth-child(6) { top: 55%; left: 35%; animation-delay: 1.1s; }
.star:nth-child(7) { top: 65%; left: 65%; animation-delay: 1.3s; }
.star:nth-child(8) { top: 75%; left: 15%; animation-delay: 1.5s; }
.star:nth-child(9) { top: 85%; left: 55%; animation-delay: 1.7s; }
.star:nth-child(10) { top: 95%; left: 25%; animation-delay: 1.9s; }
.star:nth-child(11) { top: 10%; left: 85%; animation-delay: 0.2s; }
.star:nth-child(12) { top: 20%; left: 35%; animation-delay: 0.4s; }
.star:nth-child(13) { top: 30%; left: 65%; animation-delay: 0.6s; }
.star:nth-child(14) { top: 40%; left: 15%; animation-delay: 0.8s; }
.star:nth-child(15) { top: 50%; left: 45%; animation-delay: 1.0s; }
.star:nth-child(16) { top: 60%; left: 75%; animation-delay: 1.2s; }
.star:nth-child(17) { top: 70%; left: 25%; animation-delay: 1.4s; }
.star:nth-child(18) { top: 80%; left: 85%; animation-delay: 1.6s; }
.star:nth-child(19) { top: 90%; left: 35%; animation-delay: 1.8s; }
.star:nth-child(20) { top: 15%; left: 65%; animation-delay: 0.3s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.container {
    text-align: center;
    background-color: transparent;
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 250px;
    margin: 8px auto;
    display: block;
}

button:hover {
    background-color: #12045e;
}

.card-selector {
    display: block;
    margin: 15px auto;
    text-align: center;
    width: 100%;
    max-width: 250px;
}

#card-dropdown {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem auto;
    width: 100%;
    max-width: 250px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    -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' viewBox='0 0 24 24' fill='none' stroke='%236a1b9a' 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 8px center;
    background-size: 16px;
}

#card-dropdown option {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    background-color: #000000;
    color: #ffffff;
    padding: 0.8rem;
}

#card-dropdown:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 5px #9c27b0;
}

#card-display {
    text-align: center;
    margin: 20px auto;
    padding: 20px;
    max-width: 90%;
    width: 400px;
}

#card-image {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    display: none;
}

#card-back {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    display: block;
}

#card-interpretation {
    font-size: 1.8rem;
    line-height: 1.8;
    margin: 2rem auto;
    padding: 1.5rem;
    max-width: 800px;
    text-align: left;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

#history {
    margin-top: 30px;
}

#history h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

#history-list {
    list-style-type: none;
    padding: 0;
}

#history-list li {
    font-size: 16px;
    margin-bottom: 5px;
    color: #ffffff;
}

@media screen and (max-width: 768px) {
    body {
        font-size: 18px;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    #card-interpretation {
        font-size: 1.4rem;
        line-height: 1.6;
        padding: 1rem;
    }

    #card-dropdown, #draw-card {
        font-family: 'VT323', monospace;
        font-size: 1.2rem;
        padding: 0.6rem 1rem;
        max-width: 220px;
    }

    #card-dropdown option {
        font-family: 'VT323', monospace;
        font-size: 1.2rem;
    }

    .container {
        padding: 0.8rem;
    }

    #card-image, #card-back {
        max-width: 90%;
        margin: 8px auto;
    }

    button {
        padding: 8px 16px;
        font-size: 17px;
        max-width: 250px;
        margin: 8px auto;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2.4rem;
    }

    h2 {
        font-size: 2rem;
    }

    #card-interpretation {
        font-size: 1.3rem;
        line-height: 1.6;
        padding: 1rem;
    }

    #card-dropdown, #draw-card {
        font-family: 'VT323', monospace;
        font-size: 1.1rem;
        padding: 0.5rem 0.8rem;
        max-width: 200px;
    }

    #card-dropdown option {
        font-family: 'VT323', monospace;
        font-size: 1.1rem;
    }

    #card-image, #card-back {
        max-width: 85%;
        margin: 8px auto;
    }

    /* Specific mobile button styles */
    button, #draw-card {
        padding: 8px 16px;
        font-size: 16px;
        max-width: 200px;
        margin: 8px auto;
        height: auto;
        min-height: 40px;
        line-height: 1.3;
    }
}