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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 95%;
}

h1 {
    text-align: center;
    color: #e94560;
    margin-bottom: 1.5rem;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

button, select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

button {
    background-color: #e94560;
    color: white;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(233, 69, 96, 0.4);
}

select {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

select:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 3px;
    border-radius: 10px;
    margin-bottom: 1rem;
    width: fit-content;
    margin: 0 auto 1rem auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cell {
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.cell::-webkit-outer-spin-button,
.cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.cell.fixed {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    cursor: not-allowed;
}

.cell.selected {
    background-color: rgba(233, 69, 96, 0.2);
}

.cell.error {
    color: #e94560;
    background-color: rgba(233, 69, 96, 0.1);
}

/* Add borders for 3x3 boxes */
.cell:nth-child(3n) {
    border-right: 2px solid rgba(255, 255, 255, 0.5);
}

.cell:nth-child(9n) {
    border-right: none;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

/* Add thicker borders for 3x3 boxes */
.cell:nth-child(3n+1) {
    border-left: 2px solid rgba(255, 255, 255, 0.5);
}

.cell:nth-child(n+1):nth-child(-n+9),
.cell:nth-child(n+28):nth-child(-n+36),
.cell:nth-child(n+55):nth-child(-n+63) {
    border-top: 2px solid rgba(255, 255, 255, 0.5);
}

#message {
    text-align: center;
    margin-top: 1rem;
    min-height: 1.5rem;
    color: white;
}

.lives-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.lives-container i {
    color: #e94560;
    font-size: 24px;
}

.lives-container i.fa-heart-broken {
    color: rgba(255, 255, 255, 0.3);
}

.cell.hint {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(233, 69, 96, 0.1);
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    z-index: 100;
}

.back-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 500px) {
    .cell {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    button, select {
        width: 100%;
    }

    h1 {
        font-size: 2.5rem;
    }

    .back-button {
        top: 10px;
        left: 10px;
        font-size: 1em;
        padding: 6px 12px;
    }

    .container {
        width: 98%;
        padding: 1rem;
    }

    .sudoku-board {
        width: 100%;
        max-width: 350px;
        margin: 0 auto 1rem auto;
    }
}

@media (max-width: 400px) {
    .cell {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .sudoku-board {
        max-width: 320px;
    }
}

@media (max-width: 360px) {
    .cell {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .sudoku-board {
        max-width: 290px;
    }
} 