/* Global styles */
body {
    font-family: 'Press Start 2P', cursive;
    background-color: #0a0a0a;
    background-image: 
        linear-gradient(90deg, transparent 98%, #ffffff 100%),
        linear-gradient(transparent 98%, #ffffff 100%);
    background-size: 3px 3px;
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    text-shadow: 0 0 10px #ffffff;
}

/* Atari-style title */
h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
    border: 2px solid #ffffff;
    padding: 10px 20px;
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Canvas styles */
#matrixRain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Container styles */
.container {
    max-width: 800px;
    margin: 25vh auto 2rem;  /* Added bottom margin for scrolling */
    padding: 20px;
    position: relative;
    z-index: 1;
    border: 2px solid #ffffff;
    border-radius: 0;
    box-shadow: 
        0 0 20px #ffffff,
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.8);
}

/* Why Button - Upper Left */
.why-button {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    font-family: 'Press Start 2P', cursive;
    background-color: #0a0a0a;
    color: #ff6b6b;
    padding: 8px 16px;
    border: 2px solid #ff6b6b;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.why-button:hover {
    background-color: rgba(255, 107, 107, 0.1);
    box-shadow: 0 0 20px #ff6b6b;
    text-shadow: 0 0 15px #ff6b6b;
    transform: scale(1.05);
}

/* Button styles */
button {
    font-family: 'Press Start 2P', cursive;
    background-color: #0a0a0a;
    color: #0080ff;
    padding: 15px 30px;
    border: 2px solid #0080ff;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #0080ff;
    box-shadow: 0 0 10px rgba(0, 128, 255, 0.3);
}

button:hover {
    background-color: rgba(0, 128, 255, 0.1);
    box-shadow: 0 0 20px #0080ff;
    text-shadow: 0 0 15px #0080ff;
    transform: scale(1.05);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background-color: rgba(0, 0, 0, 0.5);
    color: #666;
    border-color: #666;
    text-shadow: none;
    box-shadow: none;
}

button:disabled:hover {
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: none;
    text-shadow: none;
    transform: none;
}

/* Result container styles */
#resultContainer {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 0;
    margin-top: 20px;
    border: 2px solid #ffffff;
    box-shadow: 
        0 0 15px #ffffff,
        inset 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Number and description styles */
#numberDisplay {
    font-weight: bold;
    color: #0080ff;  /* Blue */
    text-shadow: 0 0 15px #0080ff;  /* Blue glow effect */
    font-size: 24px;
}

#descriptionDisplay {
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 5px #ffffff;
    font-size: 12px;
    line-height: 1.6;
}

/* Pixel Oracle Home Button - Top Right Corner */
.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: 'Press Start 2P', cursive;
    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: 'Press Start 2P', cursive;
    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);
}

/* Share Reading Container */
.share-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-container h3 {
    font-size: 0.7rem;
    margin-bottom: 15px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #ffffff;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    background: linear-gradient(45deg, rgba(100, 100, 100, 0.7), rgba(150, 150, 150, 0.7), rgba(100, 100, 100, 0.7));
    background-size: 200% 200%;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 0;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.4),
        0 0 10px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
    display: inline-block;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.5), rgba(200, 200, 200, 0.5), rgba(255, 255, 255, 0.5));
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 0;
    animation: borderGlow 3s ease-in-out infinite;
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.6),
        0 0 20px rgba(255, 255, 255, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    animation: none;
}

.share-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(255, 255, 255, 0.4),
        0 1px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

@keyframes borderGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Twitter Button */
.share-twitter {
    background: linear-gradient(45deg, rgba(29, 161, 242, 0.7), rgba(91, 192, 255, 0.7), rgba(29, 161, 242, 0.7));
    background-size: 200% 200%;
    border-color: rgba(29, 161, 242, 0.6);
    box-shadow: 
        0 0 0 1px rgba(29, 161, 242, 0.4),
        0 0 10px rgba(29, 161, 242, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.share-twitter::before {
    background: linear-gradient(45deg, rgba(29, 161, 242, 0.5), rgba(91, 192, 255, 0.5), rgba(29, 161, 242, 0.5));
    background-size: 400% 400%;
}

.share-twitter:hover {
    background: linear-gradient(45deg, rgba(29, 161, 242, 0.8), rgba(91, 192, 255, 0.8), rgba(29, 161, 242, 0.8));
    box-shadow: 
        0 0 0 1px rgba(29, 161, 242, 0.6),
        0 0 20px rgba(29, 161, 242, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Facebook Button */
.share-facebook {
    background: linear-gradient(45deg, rgba(24, 119, 242, 0.7), rgba(66, 103, 178, 0.7), rgba(24, 119, 242, 0.7));
    background-size: 200% 200%;
    border-color: rgba(24, 119, 242, 0.6);
    box-shadow: 
        0 0 0 1px rgba(24, 119, 242, 0.4),
        0 0 10px rgba(24, 119, 242, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.share-facebook::before {
    background: linear-gradient(45deg, rgba(24, 119, 242, 0.5), rgba(66, 103, 178, 0.5), rgba(24, 119, 242, 0.5));
    background-size: 400% 400%;
}

.share-facebook:hover {
    background: linear-gradient(45deg, rgba(24, 119, 242, 0.8), rgba(66, 103, 178, 0.8), rgba(24, 119, 242, 0.8));
    box-shadow: 
        0 0 0 1px rgba(24, 119, 242, 0.6),
        0 0 20px rgba(24, 119, 242, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Copy Link Button */
.share-copy {
    background: linear-gradient(45deg, rgba(135, 206, 235, 0.7), rgba(173, 216, 230, 0.7), rgba(135, 206, 235, 0.7));
    background-size: 200% 200%;
    border-color: rgba(135, 206, 235, 0.6);
    box-shadow: 
        0 0 0 1px rgba(135, 206, 235, 0.4),
        0 0 10px rgba(135, 206, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.share-copy::before {
    background: linear-gradient(45deg, rgba(135, 206, 235, 0.5), rgba(173, 216, 230, 0.5), rgba(135, 206, 235, 0.5));
    background-size: 400% 400%;
}

.share-copy:hover {
    background: linear-gradient(45deg, rgba(135, 206, 235, 0.8), rgba(173, 216, 230, 0.8), rgba(135, 206, 235, 0.8));
    box-shadow: 
        0 0 0 1px rgba(135, 206, 235, 0.6),
        0 0 20px rgba(135, 206, 235, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments for share buttons */
@media (max-width: 600px) {
    .share-container {
        padding: 15px;
        margin-top: 20px;
    }
    
    .share-container h3 {
        font-size: 0.5rem;
        margin-bottom: 12px;
    }
    
    .share-buttons {
        gap: 10px;
    }
    
    .share-btn {
        padding: 8px 16px;
        font-size: 0.4rem;
        letter-spacing: 0.3px;
    }
}

@media (max-width: 1024px) and (min-width: 601px) {
    .share-container {
        padding: 18px;
        margin-top: 25px;
    }
    
    .share-container h3 {
        font-size: 0.6rem;
    }
    
    .share-btn {
        padding: 9px 18px;
        font-size: 0.45rem;
    }
}

/* App description styles */
.app-description {
    color: #ffffff;  /* White */
    font-size: 10px;
    margin-top: 10px;
    text-shadow: 0 0 5px #ffffff;  /* White glow effect */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
    border: 1px solid #ffffff;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Mobile and tablet styles for app description */
@media (max-width: 1024px) {
    .app-description {
        color: #ffffff !important;  /* White color for mobile and iPad */
        text-shadow: none !important;  /* No glow effect for crisp text */
        font-size: 9px !important;
        border-color: #ffffff !important;
    }
    
    h1 {
        text-shadow: none !important;  /* No title glow for crisp text */
    }
    
    #numberDisplay {
        text-shadow: 0 0 3px #0080ff !important;  /* Keep blue glow for number */
    }
    
    #descriptionDisplay {
        text-shadow: none !important;  /* No description glow for crisp text */
    }
    
    /* iPad adjustments for home button */
    .home-button {
        padding: 0.25rem;
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.2rem;
        opacity: 0.7;
    }

    .home-crystal {
        width: 32px;
        height: 32px;
        opacity: 0.8;
    }

    .home-tooltip {
        font-size: 0.5rem;
        padding: 0.3rem 0.5rem;
    }

    .home-url {
        font-size: 0.35rem;
        opacity: 0.8;
    }
    
    /* iPad adjustments for why button */
    .why-button {
        font-size: 8px;
        padding: 6px 12px;
        opacity: 0.8;
    }
}

/* Additional mobile-specific queries for better coverage */
@media (max-width: 768px) {
    .app-description {
        color: #ffffff !important;
        text-shadow: none !important;
        border-color: #ffffff !important;
    }
    
    h1 {
        text-shadow: none !important;
    }
    
    #numberDisplay {
        text-shadow: 0 0 3px #0080ff !important;
    }
    
    #descriptionDisplay {
        text-shadow: none !important;
    }
    
    /* Mobile adjustments for home button */
    .home-button {
        padding: 0.2rem;
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.18rem;
        opacity: 0.8;
    }

    .home-crystal {
        width: 28px;
        height: 28px;
        opacity: 0.85;
    }

    .home-tooltip {
        font-size: 0.45rem;
        padding: 0.3rem 0.45rem;
    }

    .home-url {
        font-size: 0.3rem;
        opacity: 0.85;
    }
    
    /* Mobile adjustments for why button */
    .why-button {
        font-size: 7px;
        padding: 5px 10px;
        opacity: 0.85;
    }
}

@media (max-width: 480px) {
    .app-description {
        color: #ffffff !important;
        text-shadow: none !important;
        border-color: #ffffff !important;
    }
    
    h1 {
        text-shadow: none !important;
    }
    
    #numberDisplay {
        text-shadow: 0 0 3px #0080ff !important;
    }
    
    #descriptionDisplay {
        text-shadow: none !important;
    }
    
    /* Mobile adjustments for home button */
    .home-button {
        padding: 0.15rem;
        top: 0.5rem;
        right: 0.5rem;
        border-width: 1px;
        border-radius: 4px;
        opacity: 0.85;
        gap: 0.15rem;
    }

    .home-crystal {
        width: 20px;
        height: 20px;
        opacity: 0.9;
    }

    .home-tooltip {
        font-size: 0.4rem;
        padding: 0.25rem 0.4rem;
    }

    .home-url {
        font-size: 0.25rem;
        opacity: 0.9;
    }
    
    /* Small mobile adjustments for why button */
    .why-button {
        font-size: 6px;
        padding: 4px 8px;
        opacity: 0.9;
    }
}