* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Home Button */
.home-button {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 100;
    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;
    opacity: 0.5;
}

/* Mobile-only home button (hidden by default) */
.home-button-mobile {
    display: none;
}

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

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

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

.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: #00FFFF;
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    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(0, 255, 255, 0.3);
}

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

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

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

body {
    font-family: 'Press Start 2P', monospace;
    background: #000011;
    color: #00ff00;
    overflow-x: hidden;
    min-height: 100vh;
}

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

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.stars::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.stars::after {
    top: 60%;
    right: 15%;
    animation-delay: 1.5s;
}

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

/* Add more stars */
.stars::before {
    box-shadow: 
        100px 200px 0 #ffffff,
        300px 100px 0 #ffffff,
        500px 300px 0 #ffffff,
        700px 150px 0 #ffffff,
        900px 250px 0 #ffffff,
        200px 400px 0 #ffffff,
        400px 500px 0 #ffffff,
        600px 450px 0 #ffffff,
        800px 350px 0 #ffffff,
        150px 600px 0 #ffffff,
        350px 700px 0 #ffffff,
        550px 650px 0 #ffffff,
        750px 750px 0 #ffffff,
        950px 550px 0 #ffffff;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.title {
    font-size: 1.8rem;
    color: #FF8C00;
    text-shadow: 3px 3px 0px #CC6600, 0 0 8px #FF8C00;
    animation: titleGlimmer 2s ease-out;
    text-align: center;
}

.pixel-oracle-link {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #00ff00;
    color: #000011;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 0.7rem;
    border: 2px solid #00ff00;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pixel-oracle-link:hover {
    background: #000011;
    color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

@keyframes titleGlimmer {
    0% { 
        opacity: 0;
        color: #FF6600;
        text-shadow: 3px 3px 0px #CC6600, 0 0 20px #FF8C00, 0 0 40px #FF6600, 0 0 60px #FF8C00; 
    }
    50% { 
        opacity: 1;
        color: #FF8C00;
        text-shadow: 3px 3px 0px #CC6600, 0 0 30px #FF8C00, 0 0 50px #FF6600, 0 0 70px #FF8C00; 
    }
    100% { 
        opacity: 1;
        color: #FF8C00;
        text-shadow: 3px 3px 0px #CC6600, 0 0 8px #FF8C00; 
    }
}

.search-container {
    margin-top: 20px;
}

.search-input {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    padding: 15px;
    background: #000011;
    border: 2px solid #00ff00;
    color: #00ff00;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
}

.search-input:focus {
    outline: none;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.5), 0 0 20px rgba(0, 255, 0, 0.5);
}

.search-input::placeholder {
    color: #006600;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    border: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.pagination-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    padding: 10px 15px;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: #006600;
    border-color: #006600;
}

.page-info {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: #00ff00;
    text-shadow: 1px 1px 0px #006600;
    min-width: 120px;
    text-align: center;
}

/* Names Grid */
.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.name-item {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.6rem;
    position: relative;
    overflow: hidden;
}

.name-item:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

.name-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    transition: left 0.5s;
}

.name-item:hover::before {
    left: 100%;
}

/* Footer Stats */
footer {
    border: 3px solid #00ff00;
    padding: 20px;
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    font-size: 0.7rem;
}

.stat-label {
    display: block;
    margin-bottom: 5px;
    color: #006600;
}

.stat-value {
    color: #00ff00;
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 17, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #000011;
    margin: 5% auto;
    padding: 30px;
    border: 3px solid #00ff00;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 17, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.5);
}

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

.close {
    color: #00ff00;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
}

#modalName {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: #00ff00;
    text-shadow: 2px 2px 0px #006600;
}

.name-details {
    margin-top: 20px;
}

.detail-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #006600;
    background: rgba(0, 255, 0, 0.05);
}

.detail-section h3 {
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: #006600;
}

.detail-section p {
    font-size: 0.7rem;
    line-height: 1.6;
    color: #00ff00;
}

/* Share Section */
.share-section {
    margin-top: 25px;
    padding: 15px;
    border: 1px solid #006600;
    background: rgba(0, 255, 0, 0.05);
}

.share-section h3 {
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: #006600;
    text-align: center;
}

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

.share-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    padding: 10px 15px;
    border: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.share-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

.share-btn:active {
    transform: translateY(0);
}

.share-facebook:hover {
    border-color: #1877F2;
    color: #1877F2;
    box-shadow: 0 0 15px rgba(24, 119, 242, 0.5);
}

.share-twitter:hover {
    border-color: #1DA1F2;
    color: #1DA1F2;
    box-shadow: 0 0 15px rgba(29, 161, 242, 0.5);
}

.share-linkedin:hover {
    border-color: #0077B5;
    color: #0077B5;
    box-shadow: 0 0 15px rgba(0, 119, 181, 0.5);
}

.share-copy:hover {
    border-color: #00FFFF;
    color: #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* iPad-specific fixes */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
    .title {
        font-size: 1.4rem;
    }
    
    .pixel-oracle-link {
        font-size: 0.5rem;
        padding: 4px 8px;
    }
    
    .home-button {
        top: 0.25rem;
        right: 0.25rem;
        padding: 0.25rem;
        gap: 0.1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }
    
    .title {
        font-size: 0.9rem;
        color: #CC6600;
        text-shadow: 2px 2px 0px #994400, 0 0 4px #CC6600;
        opacity: 0.85;
    }
    
    .pixel-oracle-link {
        position: static;
        transform: none;
        font-size: 0.6rem;
        padding: 6px 12px;
    }
    
    /* Hide fixed home button on mobile */
    .home-button {
        display: none;
    }
    
    /* Show mobile home button between search and names */
    .home-button-mobile {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin: 20px auto;
        padding: 10px 15px;
        background: transparent;
        border: 2px solid #00ff00;
        border-radius: 6px;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.3s ease;
        opacity: 0.7;
        max-width: 250px;
    }
    
    .home-button-mobile:hover {
        opacity: 1;
        background: rgba(0, 255, 0, 0.1);
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
        transform: scale(1.02);
    }
    
    .home-crystal-mobile {
        width: 32px;
        height: 32px;
        object-fit: contain;
        transition: all 0.3s ease;
    }
    
    .home-url-mobile {
        font-family: 'VT323', monospace;
        font-size: 0.7rem;
        color: #00FFFF;
        text-shadow: 
            0 0 3px rgba(0, 255, 255, 0.8),
            0 0 6px rgba(0, 255, 255, 0.6);
        letter-spacing: 0.5px;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .home-button-mobile:hover .home-url-mobile {
        color: #FFFFFF;
        text-shadow: 
            0 0 5px rgba(255, 255, 255, 1),
            0 0 10px rgba(0, 255, 255, 0.8);
    }
    
    .pagination-controls {
        gap: 10px;
        padding: 10px;
    }
    
    .pagination-btn {
        font-size: 0.5rem;
        padding: 8px 10px;
        min-width: 60px;
    }
    
    .page-info {
        font-size: 0.5rem;
        min-width: 100px;
    }
    
    .names-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .name-item {
        font-size: 0.5rem;
        padding: 6px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        max-height: 90vh;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .share-btn {
        font-size: 0.45rem;
        padding: 8px 12px;
        min-width: auto;
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    font-size: 1rem;
    color: #006600;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Dynamic stars */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

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