* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5rem;
    color: #9b59b6;
    text-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

.game-header .subtitle {
    color: #ecf0f1;
    font-size: 1rem;
    margin-top: 5px;
    letter-spacing: 3px;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.diff-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.diff-btn.active {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-color: #9b59b6;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
}

.info-icon {
    font-size: 1.2rem;
}

.info-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ecf0f1;
    font-family: 'Courier New', monospace;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #2c3e50;
    padding: 3px;
    border-radius: 10px;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
}

.cell {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    font-weight: bold;
    background: #34495e;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    color: #ecf0f1;
}

.cell:hover:not(.fixed) {
    background: #4a6278;
}

.cell.selected {
    background: #9b59b6;
}

.cell.fixed {
    color: #3498db;
    cursor: default;
}

.cell.error {
    background: #e74c3c;
    animation: shake 0.3s ease;
}

.cell.highlight {
    background: rgba(155, 89, 182, 0.3);
}

.cell.same-number {
    background: rgba(52, 152, 219, 0.3);
}

/* 3x3 box borders */
.cell:nth-child(3n) {
    border-right: 2px solid #1a1a2e;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #1a1a2e;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.num-btn {
    aspect-ratio: 1;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(145deg, #4a5568, #2d3748);
    color: #ecf0f1;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.num-btn:hover {
    background: linear-gradient(145deg, #5a6578, #3d4758);
    transform: translateY(-2px);
}

.num-btn:active {
    transform: translateY(0);
}

.num-btn.erase {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
}

.num-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.hint-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.hint-btn:hover {
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.overlay-content h2 {
    color: #9b59b6;
    font-size: 2rem;
    margin-bottom: 20px;
}

.overlay-content p {
    color: #ecf0f1;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.overlay-content button {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.overlay-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

@media (max-width: 500px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .cell {
        font-size: 1rem;
    }

    .number-pad {
        max-width: 250px;
    }

    .num-btn {
        font-size: 1.2rem;
    }
}
