:root {
    --bg-color: #f5f5f5;
    /* Nền chính rất tối */
    --board-bg: #000;
    /* Nền bàn chơi */
    --grid-color: #282828;
    /* Màu của các ô lưới nền */
    --panel-bg: #1e1e1e;
    /* Nền bảng điều khiển */
    --panel-border: #333;
    /* Viền bảng điều khiển */
    --text-primary: #000000;
    /* Màu chữ chính */
    --text-secondary: #000000;
    /* Màu chữ phụ */
    --accent-color: #ffc107;
    /* Màu nhấn (vàng) */
}

/* --- Ghi đè style chung --- */
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.game-title-area h1,
.game-title-area h6 {
    color: var(--text-primary);
}

/* --- Khu vực game --- */
.tetris-game-wrapper {
    max-width: 960px;
    margin: auto;
}

/* Bàn chơi game */
.board-container {
    position: relative;
    display: inline-block;
    border: 5px solid var(--panel-border);
    border-radius: 8px;
    background-color: var(--board-bg);
    overflow: hidden;
    /* Đảm bảo bo góc cho cả canvas */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#tetris-board {
    display: block;
}

/* Bảng điều khiển */
.info-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 20px !important;
}

.game-stats h5 {
    margin-bottom: 0.2rem;
    color: var(--text-secondary);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.9em;
}

.game-stats p {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1;
}

/* Khu vực khối tiếp theo */
.next-piece-area h5 {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9em;
}

.next-piece-area canvas {
    background-color: #000;
    border: 2px solid var(--panel-border);
    border-radius: 4px;
}

/* Các nút điều khiển */
.main-controls .btn {
    margin: 5px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}


/* Overlay Game Over */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #dc3545;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000;
    backdrop-filter: blur(2px);
    /* Hiệu ứng mờ nền */
}

/* Nút điều khiển mobile (cũng theo dark theme) */
.mobile-controls {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 10px;
}

.btn-control {
    font-size: 1.5rem;
    padding: 10px 20px;
    background-color: #333;
    color: var(--text-primary);
    border: 1px solid #444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.btn-control.btn-action {
    font-size: 2rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
}

.btn-control.btn-block {
    background-color: var(--accent-color);
    color: #111;
    font-weight: bold;
}