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

body {
    background-color: #121212;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.fullscreen-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.message-content {
    text-align: center;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-size: clamp(16px, 4vw, 24px);
    position: relative;
    max-width: 90vw;
    padding: 20px;
}

.typewriter-text, .typewriter-text-2 {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    opacity: 0;
}

.typewriter-text.typing, .typewriter-text-2.typing {
    opacity: 1;
}

.cursor {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 1em;
    background-color: #00ff00;
    animation: blink-cursor 0.8s infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.sub-message {
    font-size: clamp(14px, 3vw, 16px);
    margin-top: 10px;
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.clock {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(26, 26, 26, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.1);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(5px);
    transform-origin: center;
}

.time-unit {
    display: flex;
    gap: 8px;
}

.cell-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    width: 30px;
    height: 50px;
}

.cell {
    width: 100%;
    height: 100%;
    background-color: rgba(42, 42, 42, 0.8);
    border-radius: 2px;
    transition: all 0.2s ease;
    position: relative;
}

.cell.active {
    background-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.cell.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0.5;
}

.separator {
    font-size: 40px;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    margin: 0 2px;
    line-height: 1;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

/* iOS-specific styles */
@supports (-webkit-touch-callout: none) {
    body {
        /* Prevent overscroll bounce */
        position: fixed;
        width: 100%;
        height: 100%;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
    }

    .fullscreen-message {
        /* Ensure proper height on iOS */
        height: 100vh;
        height: -webkit-fill-available;
    }

    .clock {
        /* Prevent text selection on iOS */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Fix for iPhone notch areas */
    @supports (padding: max(0px)) {
        .fullscreen-message {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
            padding-top: max(20px, env(safe-area-inset-top));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}

/* iOS PWA full-screen */
@media all and (display-mode: standalone) {
    body {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* Mobile-specific adjustments */
@media screen and (max-width: 480px) {
    .clock {
        padding: 15px;
        gap: 8px;
        transform: scale(0.8);
    }

    .cell-grid {
        width: 25px;
        height: 42px;
        gap: 2px;
    }

    .separator {
        font-size: 32px;
    }
}

/* Small mobile devices */
@media screen and (max-width: 380px) {
    .clock {
        padding: 12px;
        gap: 6px;
        transform: scale(0.7);
    }

    .cell-grid {
        width: 22px;
        height: 38px;
        gap: 1.5px;
    }

    .separator {
        font-size: 28px;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 320px) {
    .clock {
        padding: 10px;
        gap: 5px;
        transform: scale(0.6);
    }

    .cell-grid {
        width: 20px;
        height: 35px;
        gap: 1px;
    }

    .separator {
        font-size: 24px;
    }
}

/* Handle different aspect ratios */
@media screen and (max-aspect-ratio: 2/3) {
    .clock {
        transform: scale(0.7);
    }
}

@media screen and (min-aspect-ratio: 2/1) {
    .clock {
        transform: scale(0.9);
    }
}