/* Base styles in the spirit of 7495.org */
body {
    background-color: #0c0f12;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
}

h1 {
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dynamic formula display panel */
.formula-display {
    color: #ff9900;
    font-size: 1.4rem;
    font-weight: bold;
    height: 35px;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(255, 153, 0, 0.4);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Safe container preventing overflow */
.matrix-wrapper {
    width: 100%;
    max-width: 580px; 
    box-sizing: border-box;
}

/* 9 columns total: 1 for left header + 8 for numbers 2 to 9 */
.matrix-container {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    background: #161b22;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #30363d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden; /* Contains the pure CSS grid lines */
}

/* Grid cells */
.cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    position: relative;
    z-index: 2;
    user-select: none;
}

.cell.empty {
    background: transparent;
}

/* Border lines styling */
.cell.header-top {
    color: #ff9900;
    border-bottom: 3px solid #ff9900;
    font-size: 1.2rem;
    border-radius: 0;
}

.cell.header-left {
    color: #ff9900;
    border-right: 3px solid #ff9900;
    font-size: 1.2rem;
    border-radius: 0;
}

/* Internal result blocks */
.cell.result {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s, box-shadow 0.1s;
}

/* Hover active state */
.cell.result:hover {
    background: #00ffcc !important;
    color: #0c0f12 !important;
    border-color: #00ffcc;
    box-shadow: 0 0 15px #00ffcc;
    z-index: 5;
}

/* Pure CSS Crosshair highlight lines */
.cell.result:hover::before,
.cell.result:hover::after {
    content: '';
    position: absolute;
    background: rgba(0, 255, 204, 0.07);
    pointer-events: none;
    z-index: -1;
}

/* Vertical column line */
.cell.result:hover::before {
    width: 100vw;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Horizontal row line */
.cell.result:hover::after {
    width: 100%;
    height: 100vh;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 480px) {
    h1 {
        font-size: 1.25rem;
        margin-bottom: 5px;
    }

    .formula-display {
        font-size: 1.1rem;
        height: 25px;
        margin-bottom: 10px;
    }

    .matrix-container {
        padding: 8px;
        gap: 3px;
        border-radius: 8px;
    }

    .cell {
        font-size: 0.85rem;
    }

    .cell.header-top, .cell.header-left {
        font-size: 0.95rem;
    }

    .cell.header-top {
        border-bottom-width: 2px;
    }

    .cell.header-left {
        border-right-width: 2px;
    }

    .cell.result:hover::before,
    .cell.result:hover::after {
        background: rgba(0, 255, 204, 0.12);
    }
}

/* Container for alignment */
.btn-container {
    margin-top: 30px;
    text-align: center;
    width: 100%;
}

/* Base style for the glowing transition button */
.next-level-btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 6px;
    border: 2px solid transparent;
    
    /* Background gradient animation preparation */
    background: linear-gradient(90deg, #0c0f12, #161b22, #0c0f12);
    background-size: 200% 100%;
    
    /* Colors and shadows animation setup */
    color: #00ffcc;
    animation: neonGlow 4s linear infinite;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s;
}

/* Hover physics: scale up and boost neon intensity */
.next-level-btn:hover {
    transform: scale(1.05);
    color: #ffffff;
    animation: neonGlowHover 1.5s linear infinite;
}

/* Keyframes for smooth normal state glow */
@keyframes neonGlow {
    0% {
        border-color: #00ffcc;
        box-shadow: 0 0 10px rgba(0, 255, 204, 0.3), inset 0 0 5px rgba(0, 255, 204, 0.1);
        color: #00ffcc;
        background-position: 0% 50%;
    }
    50% {
        border-color: #ff9900;
        box-shadow: 0 0 15px rgba(255, 153, 0, 0.4), inset 0 0 5px rgba(255, 153, 0, 0.1);
        color: #ff9900;
        background-position: 100% 50%;
    }
    100% {
        border-color: #00ffcc;
        box-shadow: 0 0 10px rgba(0, 255, 204, 0.3), inset 0 0 5px rgba(0, 255, 204, 0.1);
        color: #00ffcc;
        background-position: 0% 50%;
    }
}

/* Keyframes for aggressive hover state glow */
@keyframes neonGlowHover {
    0% {
        border-color: #00ffcc;
        box-shadow: 0 0 20px #00ffcc, inset 0 0 10px rgba(0, 255, 204, 0.5);
    }
    50% {
        border-color: #ff9900;
        box-shadow: 0 0 25px #ff9900, inset 0 0 10px rgba(255, 153, 0, 0.5);
    }
    100% {
        border-color: #00ffcc;
        box-shadow: 0 0 20px #00ffcc, inset 0 0 10px rgba(0, 255, 204, 0.5);
    }
}

/* Styling for the blockchain information layout */
.blockchain-info-section {
    background: #111418;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #21262d;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}















