/* Font Loading */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=block');

/* General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background-color: rgb(25, 35, 37);
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

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

.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    animation: twinkle 4s infinite ease-in-out;
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 4px 2px rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.container {
    position: relative;
    z-index: 1;
    text-align: center;
    background-color: transparent;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shimmer-effect {
    background: linear-gradient(90deg, #ffffff, #007bff, #ffffff);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out;
}

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: rgba(0, 123, 255, 0.8);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

button:hover {
    background-color: rgba(0, 123, 255, 0.9);
}

button:disabled {
    background-color: rgba(102, 102, 102, 0.8);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

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

#card-dropdown {
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 8px 12px;
    margin: 10px auto;
    width: 100%;
    max-width: 200px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
}

#card-dropdown option {
    background-color: #000000;
    color: #ffffff;
}

#card-display {
    margin-top: 20px;
}

#card-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#card-back {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#card-interpretation {
    font-size: 24px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

@keyframes blurOut {
    0% {
        filter: blur(0px);
        opacity: 1;
    }
    50% {
        filter: blur(5px);
        opacity: 0.5;
    }
    100% {
        filter: blur(10px);
        opacity: 0;
    }
}

@keyframes blurIn {
    0% {
        filter: blur(10px);
        opacity: 0;
    }
    50% {
        filter: blur(5px);
        opacity: 0.5;
    }
    100% {
        filter: blur(0px);
        opacity: 1;
    }
}

.card-blur-out {
    animation: blurOut 2s ease-in-out;
}

.card-blur-in {
    animation: blurIn 2s ease-in-out;
}

.text-shimmer {
    background: linear-gradient(90deg, #ffffff, #007bff, #ffffff);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.5s ease-in-out;
}

.info-button {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #ffffff;
    background: rgba(0, 123, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 6px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.info-button:hover {
    background: rgba(0, 123, 255, 0.8);
    transform: scale(1.03);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

#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;
}

/* Mobile styles for home button and title */
@media (max-width: 768px) {
    h1 {
        font-size: 18px;
        margin-bottom: 15px;
        color: #ffffff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    .container p[style*="font-size: 16px"] {
        font-size: 18px !important;
    }
    
    .home-button {
        top: 0.1rem;
        right: 0.1rem;
        padding: 0.1rem;
        gap: 0.05rem;
    }
    
    .home-crystal {
        width: 18px;
        height: 18px;
    }
    
    .home-tooltip {
        font-size: 0.3rem;
        padding: 0.2rem 0.3rem;
        margin-bottom: 0.2rem;
    }
    
    .home-url {
        font-size: 0.25rem;
    }
    
    .info-button {
        font-size: 7px;
        padding: 3px 4px;
        top: 0.1rem;
        left: 0.1rem;
    }
}

/* Home Button */
.home-button {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0.35rem;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
    gap: 0.25rem;
}

.home-button:hover {
    background: transparent;
    transform: scale(1.05);
    box-shadow: none;
}

.home-crystal {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.home-button:hover .home-crystal {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.home-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #ffffff;
    font-family: 'VT323', monospace;
    font-size: 0.6rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.home-button:hover .home-tooltip {
    opacity: 1;
}

.home-url {
    font-family: 'VT323', monospace;
    font-size: 0.5rem;
    color: #ffffff;
    text-shadow: 
        0 0 3px rgba(255, 255, 255, 0.8),
        0 0 6px rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-button:hover .home-url {
    color: #ffffff;
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 1),
        0 0 10px rgba(255, 255, 255, 0.8);
}

/* Mobile styles for home button */
@media (max-width: 768px) {
    .home-button {
        top: 0.1rem;
        right: 0.1rem;
        padding: 0.15rem;
        gap: 0.1rem;
    }
    
    .home-crystal {
        width: 24px;
        height: 24px;
    }
    
    .home-tooltip {
        font-size: 0.35rem;
        padding: 0.25rem 0.4rem;
        margin-bottom: 0.25rem;
    }
    
    .home-url {
        font-size: 0.3rem;
    }
}
