* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #000;
    color: #0f0;
    background-image: 
        linear-gradient(rgba(0, 20, 0, 0.5), rgba(0, 0, 0, 0.5));
}

header {
    background-color: rgba(0, 0, 0, 0.8);
    color: #0f0;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #0f0;
    text-shadow: 0 0 5px #0f0;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.terminal-container {
    background-color: rgba(0, 15, 0, 0.7);
    border: 1px solid #0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #0f0;
    background-color: rgba(0, 25, 0, 0.5);
}

.terminal-controls {
    display: flex;
    gap: 10px;
}

.control {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #0f0;
}

.control.close { background-color: #f00; }
.control.minimize { background-color: #ff0; }
.control.maximize { background-color: #0f0; }

.terminal-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background-color: rgba(0, 20, 0, 0.3);
    padding: 15px;
    border: 1px solid #0f0;
    cursor: pointer;
    transition: all 0.3s;
}

.game-card:hover {
    background-color: rgba(0, 30, 0, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.game-preview {
    margin-top: 10px;
    font-family: monospace;
    color: #0f0;
    background-color: rgba(0, 10, 0, 0.3);
    padding: 10px;
    border: 1px dashed #0f0;
}

#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.welcome-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #0f0;
    text-align: center;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.player-info {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 5px;
    background-color: rgba(0, 20, 0, 0.3);
}

.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 20px auto;
    width: 300px;
}

.cell {
    width: 100px;
    height: 100px;
    border: 1px solid #0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    cursor: pointer;
}

.cell:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

.cf-grid {
    display: flex;
    gap: 5px;
    margin: 20px auto;
    background-color: rgba(0, 50, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
}

.cf-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.cf-cell {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #0f0;
    background-color: #000;
}

.cf-cell.red {
    background-color: #f00;
}

.cf-cell.yellow {
    background-color: #ff0;
}

.cards-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.dealer-cards, .player-cards {
    border: 1px solid #0f0;
    padding: 15px;
}

.bj-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.game-btn {
    background-color: rgba(0, 20, 0, 0.5);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.game-btn:hover {
    background-color: rgba(0, 255, 0, 0.2);
}

.terminal-footer {
    padding: 15px;
    border-top: 1px solid #0f0;
    text-align: center;
    background-color: rgba(0, 25, 0, 0.5);
}

footer {
    background-color: rgba(0, 0, 0, 0.9);
    color: #0f0;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #0f0;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.nav-links a:hover {
    text-shadow: 0 0 10px #0f0;
}

.matrix-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.blink {
    animation: blink 1s step-end infinite;
}

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

@media (max-width: 768px) {
    .game-selection {
        grid-template-columns: 1fr;
    }
    
    .ttt-grid {
        width: 240px;
    }
    
    .cell {
        width: 80px;
        height: 80px;
    }
    
    .cf-cell {
        width: 40px;
        height: 40px;
    }
    
    .bj-controls {
        flex-direction: column;
    }
}