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

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

.crt-screen {
    position: relative;
    min-height: 100vh;
    background: #0a0a0a;
    padding: 20px;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 170, 255, 0.03) 50%
    );
    background-size: 100% 4px;
    z-index: 1000;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Home Button */
.home-button {
    position: absolute;
    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.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
    gap: 0.15rem;
    opacity: 0.75;
}

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

.home-crystal {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    object-fit: contain !important;
    display: block !important;
    transition: all 0.3s ease;
    opacity: 0.85;
}

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

.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(0, 170, 255, 0.3);
    border-radius: 4px;
    color: #00aaff;
    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(0, 170, 255, 0.3);
}

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

.home-url {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.35rem;
    color: #00aaff;
    text-shadow: 
        0 0 3px rgba(0, 170, 255, 0.8),
        0 0 6px rgba(0, 170, 255, 0.6);
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.85;
}

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

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

header {
    text-align: center;
    padding: 30px 20px;
    border: 4px solid #00aaff;
    background: rgba(0, 170, 255, 0.05);
    margin-bottom: 40px;
    box-shadow: 
        0 0 10px #00aaff,
        inset 0 0 10px rgba(0, 170, 255, 0.1);
    position: relative;
}

/* FAQ Button */
.faq-button {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #00aaff;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 170, 255, 0.4);
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    text-shadow: 
        0 0 3px rgba(0, 170, 255, 0.8),
        0 0 6px rgba(0, 170, 255, 0.6);
    opacity: 0.75;
    -webkit-tap-highlight-color: transparent;
}

.faq-button:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 170, 255, 0.7);
    color: #66ccff;
    text-shadow: 
        0 0 5px rgba(102, 204, 255, 1),
        0 0 10px rgba(0, 170, 255, 0.8);
    transform: scale(1.05);
}

.title {
    font-size: 1.8rem;
    color: #00aaff;
    text-shadow: 
        0 0 5px #00aaff,
        0 0 10px #00aaff,
        0 0 15px #00aaff;
    margin-bottom: 15px;
    letter-spacing: 2px;
    font-weight: normal;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 5px #00aaff,
            0 0 10px #00aaff,
            0 0 15px #00aaff;
    }
    to {
        text-shadow: 
            0 0 3px #00aaff,
            0 0 8px #00aaff,
            0 0 12px #00aaff,
            0 0 18px #00aaff;
    }
}

.subtitle {
    font-size: 0.7rem;
    color: #88ccff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: #00aaff;
    margin-bottom: 20px;
    animation: blink 1s infinite;
}

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

.loading-dots {
    font-size: 2rem;
    color: #00aaff;
    letter-spacing: 10px;
}

.loading-dots span {
    animation: dot-blink 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.error {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.error-text {
    color: #ff0000;
    font-size: 0.8rem;
    text-shadow: 0 0 10px #ff0000;
}

.snibbits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.snibbit-card {
    border: 3px solid #00aaff;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    position: relative;
    box-shadow: 
        0 0 10px rgba(0, 170, 255, 0.3),
        inset 0 0 10px rgba(0, 170, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    -webkit-touch-callout: none;
}

.snibbit-card:hover {
    box-shadow: 
        0 0 20px rgba(0, 170, 255, 0.6),
        inset 0 0 15px rgba(0, 170, 255, 0.1);
    transform: translateY(-2px);
}

/* Backdrop overlay - transparent element for click handling only */
.snibbit-backdrop {
    display: none;
}

/* Body overlay when card is expanded - visual backdrop */
body.has-expanded-card::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

/* Expanded state */
.snibbit-card.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw;
    max-width: 800px;
    max-height: 90vh;
    z-index: 100000 !important;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 
        0 0 40px rgba(0, 170, 255, 0.8),
        inset 0 0 30px rgba(0, 170, 255, 0.2);
    border-width: 4px;
    background: rgba(0, 0, 0, 0.98) !important;
    border-color: #00aaff !important;
    will-change: transform;
}

.snibbit-card.expanded * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Explicit colors - don't use inherit */
.snibbit-card.expanded .snibbit-text-expanded {
    color: #00aaff !important;
}

.snibbit-card.expanded .snibbit-source {
    color: #88ccff !important;
}

.snibbit-card.expanded .snibbit-meta-expanded,
.snibbit-card.expanded .snibbit-category {
    color: #888 !important;
}

.snibbit-card.expanded .snibbit-timestamp {
    color: #666 !important;
}

.snibbit-card.expanded:hover {
    transform: translate(-50%, -50%);
}

/* Collapsed view - only show categories */
.snibbit-meta.collapsed-view {
    display: block !important;
}

.snibbit-expanded-content {
    display: none !important;
}

.snibbit-card.expanded .snibbit-meta.collapsed-view {
    display: none !important;
}

.snibbit-card.expanded .snibbit-expanded-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100000 !important;
}

.snibbit-text-expanded {
    font-size: 0.95rem !important;
    color: #00aaff !important;
    line-height: 2.2 !important;
    margin-bottom: 20px !important;
    word-wrap: break-word !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100000 !important;
    letter-spacing: 0.5px !important;
    word-spacing: 2px !important;
    background: rgba(0, 20, 40, 0.4) !important;
    padding: 20px !important;
    border-radius: 4px !important;
}

.snibbit-card.expanded .snibbit-source {
    font-size: 1rem !important;
    margin-bottom: 20px !important;
    color: #88ccff !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100000 !important;
    display: block !important;
}

.snibbit-card.expanded .snibbit-meta-expanded {
    font-size: 0.7rem !important;
    color: #888 !important;
    margin-top: 20px !important;
    padding-top: 15px !important;
    border-top: 1px solid #333 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100000 !important;
}

.snibbit-card.expanded .snibbit-source {
    font-size: 1rem !important;
    color: #88ccff !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100000 !important;
    margin-bottom: 20px !important;
    display: block !important;
}

.snibbit-expand-indicator {
    font-size: 0.5rem;
    color: #66ccff;
    text-align: center;
    margin-top: 10px;
    opacity: 1;
    font-style: italic;
    transition: opacity 0.3s ease;
    display: block !important;
    visibility: visible !important;
    pointer-events: none;
}

.snibbit-card:hover .snibbit-expand-indicator {
    opacity: 1;
}

/* Always visible on touch devices */
@media (hover: none) and (pointer: coarse) {
    .snibbit-expand-indicator {
        opacity: 1 !important;
        font-size: 0.55rem;
    }
}

.snibbit-source {
    font-size: 0.7rem;
    color: #88ccff;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00aaff;
    letter-spacing: 1px;
}

.snibbit-text {
    font-size: 0.65rem;
    color: #00aaff;
    line-height: 1.8;
    margin-bottom: 15px;
    word-wrap: break-word;
    display: none; /* Hide by default - only show in expanded view */
}

.snibbit-meta {
    font-size: 0.5rem;
    color: #888;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.snibbit-category {
    color: #66ccff;
    margin-bottom: 5px;
}

.snibbit-timestamp {
    color: #666;
}

.snibbit-card.error-card {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.05);
}

.snibbit-card.error-card .snibbit-source {
    color: #ff0000;
    border-bottom-color: #ff0000;
}

.snibbit-card.error-card .error-message {
    color: #ff0000;
    font-size: 0.6rem;
}

/* Responsive */
@media (max-width: 768px) {
    .faq-button {
        top: 0.4rem;
        left: 0.4rem;
        font-size: 0.45rem;
        padding: 0.3rem 0.5rem;
        opacity: 0.75;
    }
    
    .home-button {
        padding: 0.15rem;
        top: 0.4rem;
        right: 0.4rem;
        opacity: 0.75;
    }

    .home-button .home-crystal {
        width: 20px;
        height: 20px;
        max-width: 20px;
        max-height: 20px;
        min-width: 20px;
        min-height: 20px;
        opacity: 0.85;
    }

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

    .home-url {
        font-size: 0.3rem;
        opacity: 0.85;
    }
    
    .home-button:hover {
        opacity: 1;
    }
    
    .home-button:hover .home-crystal {
        opacity: 1;
    }
    
    .home-button:hover .home-url {
        opacity: 1;
    }
    
    .title {
        font-size: 1.4rem;
    }
    
    .snibbits-grid {
        grid-template-columns: 1fr;
    }
    
    .snibbit-card {
        padding: 15px;
    }
    
    .snibbit-card.expanded {
        width: 95vw;
        max-height: 85vh;
        padding: 20px;
        background: rgba(0, 0, 0, 0.98) !important;
    }
    
    .snibbit-card.expanded * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .snibbit-card.expanded .snibbit-text-expanded {
        color: #00aaff !important;
    }
    
    .snibbit-card.expanded .snibbit-source {
        color: #88ccff !important;
    }
    
    .snibbit-card.expanded .snibbit-meta-expanded,
    .snibbit-card.expanded .snibbit-category {
        color: #888 !important;
    }
    
    .snibbit-card.expanded .snibbit-text-expanded {
        font-size: 0.8rem !important;
        line-height: 2.1 !important;
        letter-spacing: 0.5px !important;
        word-spacing: 2px !important;
        color: #00aaff !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 100000 !important;
        background: rgba(0, 20, 40, 0.4) !important;
        padding: 15px !important;
        border-radius: 4px !important;
    }
    
    .snibbit-card.expanded .snibbit-source {
        color: #88ccff !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-meta-expanded {
        color: #888 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-expanded-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-source {
        color: #88ccff !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-meta-expanded {
        color: #888 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-expanded-content {
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-expanded-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .faq-button {
        top: 0.3rem;
        left: 0.3rem;
        font-size: 0.4rem;
        padding: 0.25rem 0.4rem;
        opacity: 0.75;
    }
    
    .home-button {
        padding: 0.05rem !important;
        top: 0.4rem;
        right: 0.4rem;
        opacity: 0.75;
        gap: 0.1rem !important;
    }

    .home-button .home-crystal,
    .home-button img.home-crystal,
    img.home-crystal {
        width: 14px !important;
        height: 14px !important;
        max-width: 14px !important;
        max-height: 14px !important;
        min-width: 14px !important;
        min-height: 14px !important;
        opacity: 0.85;
    }

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

    .home-url {
        font-size: 0.25rem;
        opacity: 0.85;
    }
    
    .home-button:hover {
        opacity: 1;
    }
    
    .home-button:hover .home-crystal {
        opacity: 1;
    }
    
    .home-button:hover .home-url {
        opacity: 1;
    }
    
    .title {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.5rem;
    }
    
    .snibbit-text {
        font-size: 0.55rem;
    }
    
    .snibbit-card.expanded {
        width: 98vw;
        max-height: 90vh;
        padding: 15px;
        background: rgba(0, 0, 0, 0.98) !important;
    }
    
    .snibbit-card.expanded * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .snibbit-card.expanded .snibbit-text-expanded {
        color: #00aaff !important;
    }
    
    .snibbit-card.expanded .snibbit-source {
        color: #88ccff !important;
    }
    
    .snibbit-card.expanded .snibbit-meta-expanded,
    .snibbit-card.expanded .snibbit-category {
        color: #888 !important;
    }
    
    .snibbit-card.expanded .snibbit-text-expanded {
        font-size: 0.75rem !important;
        line-height: 2 !important;
        letter-spacing: 0.5px !important;
        word-spacing: 2px !important;
        color: #00aaff !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 100000 !important;
        background: rgba(0, 20, 40, 0.4) !important;
        padding: 12px !important;
        border-radius: 4px !important;
    }
    
    .snibbit-card.expanded .snibbit-source {
        font-size: 0.85rem !important;
        color: #88ccff !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-meta-expanded {
        color: #888 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    .snibbit-card.expanded .snibbit-expanded-content {
        z-index: 100000 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .snibbit-card.expanded .snibbit-expanded-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .snibbit-expand-indicator {
        font-size: 0.5rem !important;
        opacity: 1 !important;
        display: block !important;
        visibility: visible !important;
    }
}

/* Snibb.link Footer Link */
.snibb-link {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 100;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    opacity: 0.6;
}

.snibb-link:hover {
    transform: translateX(-50%) scale(1.05);
    opacity: 0.9;
}

.snibb-rabbit {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    object-fit: contain !important;
    display: block !important;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(0, 170, 255, 0.3));
}

.snibb-link:hover .snibb-rabbit {
    filter: drop-shadow(0 0 10px rgba(0, 170, 255, 0.6));
    transform: scale(1.1);
}

.snibb-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #00aaff;
    text-shadow: 
        0 0 3px rgba(0, 170, 255, 0.8),
        0 0 6px rgba(0, 170, 255, 0.6);
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.snibb-link:hover .snibb-text {
    color: #66ccff;
    text-shadow: 
        0 0 5px rgba(102, 204, 255, 1),
        0 0 10px rgba(0, 170, 255, 0.8);
}

/* Responsive adjustments for footer link */
@media (max-width: 768px) {
    .snibb-link {
        bottom: 0.75rem;
    }

    .snibb-rabbit {
        width: 48px !important;
        height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }

    .snibb-text {
        font-size: 0.45rem;
    }
}

@media (max-width: 480px) {
    .snibb-link {
        bottom: 0.5rem;
    }

    .snibb-rabbit {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .snibb-text {
        font-size: 0.4rem;
    }
}

