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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.app {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

h1 { margin-bottom: 10px; }

.subtitle {
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Grid */
#grid {
    display: grid;
    grid-template-columns: repeat(9, 50px);
    gap: 2px;
    justify-content: center;
    margin: 20px 0;
    background: rgba(255,255,255,0.3);
    padding: 4px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.5);
}

/* Thick 3x3 box borders - vertical separators after col 3 and col 6 */
.cell:nth-child(9n+4),
.cell:nth-child(9n+7) {
    border-left: 2px solid rgba(255,255,255,0.6);
}
/* Thick 3x3 box borders - horizontal separators before row 4 and row 7 */
.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.6);
}

.cell {
    width: 50px;
    height: 50px;
    font-size: 18px;
    text-align: center;
    border-radius: 6px;
    border: none;
    outline: none;
    transition: all 0.15s ease;
    background: rgba(255,255,255,0.12);
    color: white;
    font-family: 'Poppins', sans-serif;
}

.cell.original {
    background: rgba(255,255,255,0.28);
    font-weight: 700;
    color: white;
}

.cell.filled {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.12);
}

.cell.current {
    background: #ffeb3b !important;
    color: #333 !important;
    transform: scale(1.1);
    z-index: 2;
}

.cell.highlight {
    background: rgba(255,255,255,0.2);
}

.cell.box-highlight {
    background: rgba(0, 255, 200, 0.15);
}

/* Buttons */
.buttons {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

button {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: #00c6ff;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Poppins', sans-serif;
}

button:hover {
    background: #0072ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stop-btn {
    background: #ef4444;
}

.stop-btn:hover {
    background: #b91c1c;
}

/* Speed control */
.speed-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.9;
}

#speedSlider {
    width: 130px;
    accent-color: #00c6ff;
    cursor: pointer;
}

#speedLabel {
    min-width: 70px;
    text-align: left;
    font-weight: 600;
}

/* Status message */
.status {
    margin-top: 14px;
    min-height: 22px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status.ok  { color: #4ade80; }
.status.err { color: #f87171; }