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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #f0e6ff 50%, #fff4e6 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: linear-gradient(135deg, #ffffff 0%, #fef7ff 100%);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.15);
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(255, 182, 193, 0.2);
}

h1 {
    text-align: center;
    background: linear-gradient(135deg, #d946ef 0%, #a855f7 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.game-info {
    text-align: center;
    margin-bottom: 25px;
}

#status {
    font-size: 18px;
    color: #7c3aed;
    font-weight: 500;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    padding: 5px;
}

.cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ffffff 0%, #fef7ff 100%);
    border: 2px solid #e9d5ff;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(216, 70, 239, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cell:hover {
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    transform: translateY(-3px) scale(1.02);
    border-color: #c084fc;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.2);
}

.cell:hover::before {
    width: 200%;
    height: 200%;
}

.cell:active {
    transform: translateY(-1px) scale(0.98);
}

.cell[data-symbol="X"] {
    color: #ec4899;
    font-weight: 600;
}

.cell[data-symbol="O"] {
    color: #8b5cf6;
    font-weight: 600;
}

.result {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    min-height: 30px;
    color: #7c3aed;
}

.result div {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-reset {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #d946ef 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-reset:hover {
    background: linear-gradient(135deg, #c026d3 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}

/* Эффект разбитого стекла */
.board.broken-glass {
    position: relative;
    animation: shake 0.5s ease-in-out;
}

.board.broken-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.3) 49%, rgba(255, 255, 255, 0.3) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(255, 255, 255, 0.3) 49%, rgba(255, 255, 255, 0.3) 51%, transparent 52%);
    background-size: 20px 20px;
    opacity: 0;
    animation: crack 0.6s ease-in-out 0.3s forwards;
    pointer-events: none;
    z-index: 10;
}

.board.broken-glass .cell {
    animation: cellBreak 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes crack {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.4;
        transform: scale(1.1);
    }
}

@keyframes cellBreak {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(0.95) rotate(-2deg); }
    50% { transform: scale(0.9) rotate(2deg); }
    75% { transform: scale(0.95) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .container {
        padding: 25px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .cell {
        font-size: 40px;
    }
}