/* Global Reset & Base */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    /* Slightly lighter black */
    color: #fff;
    overflow: hidden;
    /* Strict no-scroll */
}

/* Background Layers */
/* Background Layers */
.ancient-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Deep Dark Background */
    background-color: #020203;

    /* Traditional "Cloud Thunder" (Yun Lei Wen) SVG Pattern - Embedded */
    /* Stroke Opacity 0.14 */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='yunLei' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M5,5 H45 V45 H5 V15 H35 V35 H15 V25 H25' fill='none' stroke='%232a3b55' stroke-width='3' stroke-opacity='0.12' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23yunLei)'/%3E%3C/svg%3E");

    /* Repeat the pattern */
    background-size: 60px 60px;
    background-repeat: repeat;

    opacity: 1;
    /* Background color stays opaque */
}

/* Wave pattern removed */

/* Grid Container */
.grid-container {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    /* Minimized Gap */
    background-color: transparent;
    /* Changed from #1a1a1a to allow bg to show through gaps if needed, or keep semi-transparent */
    padding: 4px;
    /* Minimized Padding */
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    /* Content above background */
}

/* Individual Cell */
.grid-cell {
    position: relative;
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent to show ancient bg */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Corner Marks & Hover Effects Removed */

/* Scanline Effect */
.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 50%,
            rgba(0, 255, 255, 0.02) 50%);
    background-size: 100% 4px;
    z-index: 20;
    pointer-events: none;
    animation: scanlineMove 6s linear infinite;
}

.scanline::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    animation: flicker 0.15s infinite;
    pointer-events: none;
}

@keyframes scanlineMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

@keyframes flicker {
    0% {
        opacity: 0.02;
    }

    50% {
        opacity: 0.05;
    }

    100% {
        opacity: 0.02;
    }
}

/* Info Card Styles */
.info-card-normal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
}

.info-card-alarm {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, rgba(50, 0, 0, 1) 0%, rgba(20, 0, 0, 1) 100%);
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.5);
    border: 2px solid rgba(255, 0, 0, 0.8);
    animation: alarmBreathing 1s infinite alternate;
    padding: 10%;
    box-sizing: border-box;
}

@keyframes alarmBreathing {
    0% {
        border-color: rgba(255, 0, 0, 0.4);
        box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    }

    100% {
        border-color: rgba(255, 0, 0, 1);
        box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.6);
    }
}

/* Typography Clamps */
.text-clamp-xl {
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.text-clamp-lg {
    font-size: clamp(1rem, 2.5vw, 2rem);
}

.text-clamp-md {
    font-size: clamp(0.8rem, 2vw, 1.5rem);
}

.text-clamp-sm {
    font-size: clamp(0.6rem, 1.5vw, 1rem);
}