* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: #1e1e1e;
    padding: 30px 25px;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
}

h1 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 8px;
    color: #f0f0f0;
}
.sub {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Phần thông tin đoán */
.guess-area {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px 25px;
    border: 1px solid #3a3a3a;
}

.guess-number {
    font-size: 48px;
    font-weight: 700;
    color: #4fc3f7;
    min-width: 80px;
    text-align: center;
}

.guess-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.guess-info .label {
    font-size: 14px;
    color: #aaa;
}
.guess-info .count {
    font-size: 22px;
    font-weight: 600;
    color: #ffb74d;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    background: #333;
    border: none;
    color: #eee;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #555;
    min-width: 100px;
}

.btn:hover:not(:disabled) {
    background: #444;
    transform: scale(1.02);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #0d47a1;
    border-color: #1565c0;
}
.btn-primary:hover:not(:disabled) {
    background: #1565c0;
}

.btn-success {
    background: #1b5e20;
    border-color: #2e7d32;
}
.btn-success:hover:not(:disabled) {
    background: #2e7d32;
}

.btn-danger {
    background: #b71c1c;
    border-color: #c62828;
}
.btn-danger:hover:not(:disabled) {
    background: #c62828;
}

.btn-reset {
    background: #4a4a4a;
    border-color: #666;
}
.btn-reset:hover:not(:disabled) {
    background: #5a5a5a;
}

/* Bảng số */
.grid-container {
    margin-top: 15px;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 12px;
    border: 1px solid #333;
    max-height: 400px;
    overflow-y: auto;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
}

.cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    transition: 0.15s;
    border: 1px solid #3a3a3a;
    flex-shrink: 0;
}

/* Trạng thái các ô */
.cell.in-range {
    background: #1a3a5a;
    border-color: #2a6a9a;
    color: #e0f0ff;
}

.cell.out-of-range {
    opacity: 0.3;
    background: #222;
    color: #555;
    border-color: #2a2a2a;
}

.cell.current-guess {
    background: #f57c00;
    border-color: #ffb74d;
    color: #fff;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 10px #f57c00aa;
}

.cell.found {
    background: #2e7d32;
    border-color: #66bb6a;
    color: #fff;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 0 10px #2e7d32aa;
}

/* Thông báo kết thúc */
.end-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    background: #1a3a1a;
    border: 1px solid #2e7d32;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #a5d6a7;
    display: none;
}

.end-message.show {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    .guess-area {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .btn-group {
        justify-content: center;
    }
    .btn {
        min-width: 80px;
        padding: 8px 14px;
        font-size: 14px;
    }
    .cell {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .guess-number {
        font-size: 38px;
    }
}

@media (max-width: 450px) {
    .cell {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    .grid {
        gap: 1.5px;
    }
}