:root {
    --cell-size: 45px;
    --gap: 6px;
    --step: 51px; /* size + gap */
}

body {
    background: #0a0a0a;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

h1 { margin: 20px 0; text-shadow: 0 0 10px rgba(255,255,255,0.2); }

.grid {
    display: grid;
    grid-template-columns: repeat(8, var(--cell-size));
    grid-template-rows: repeat(8, var(--cell-size));
    gap: var(--gap);
    background: #1a1a1a;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: #252525;
    border-radius: 6px;
    transition: background 0.1s;
}

/* Patlama Animasyonu */
@keyframes explode {
    0% { transform: scale(1); opacity: 1; filter: brightness(2); }
    100% { transform: scale(1.4); opacity: 0; filter: brightness(3); }
}

.cell.exploding {
    animation: explode 0.4s ease-out forwards;
    z-index: 10;
}

.cell.preview {
    background: rgba(255, 255, 255, 0.2) !important;
}

.cell.filled {
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.1), inset -2px -2px 5px rgba(0,0,0,0.5);
}

.pieces-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
    min-height: 150px;
    width: 100%;
}

.piece {
    position: relative;
    cursor: grab;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p-cell {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 6px;
    box-shadow: inset 2px 2px 4px rgba(255,255,255,0.2);
}

.drag {
    opacity: 0.9;
    transform: scale(1.1);
    z-index: 9999;
    cursor: grabbing;
}

#game-over {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: #f72585;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(247, 37, 133, 0.3);
}