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

:root {
    /* Пастельная палитра */
    --dusty-rose: #D4A5A5;
    --sage-green: #A8B5A0;
    --soft-beige: #E8E0D6;
    --cream: #F5F1EB;
    --milk: #FAF8F4;
    --soft-pink: #F4E6E6;
    --warm-gray: #8B7D7D;
    --gold-accent: #D4AF37;
    
    /* Тени и эффекты */
    --shadow-soft: 0 8px 32px rgba(212, 165, 165, 0.1);
    --shadow-medium: 0 12px 48px rgba(168, 181, 160, 0.15);
    --shadow-strong: 0 20px 60px rgba(139, 125, 125, 0.2);
    
    /* Glassmorphism - более четкий */
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--cream) 50%, var(--soft-beige) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 165, 165, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 181, 160, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

.container {
    width: 100%;
    animation: fadeIn 0.6s ease-out;
}

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

/* Glassmorphism эффект - более четкий */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
}

.header {
    text-align: center;
    margin-bottom: 16px;
    padding: 24px 0;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--warm-gray);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(139, 125, 125, 0.2);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-size: 0.95rem;
    color: var(--warm-gray);
    font-weight: 400;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.game-info {
    padding: 20px 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideUp 0.8s ease-out 0.2s both;
}

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

.current-player {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--warm-gray);
    font-weight: 600;
}

.player-icon {
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.score {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-label {
    color: var(--warm-gray);
    opacity: 0.85;
    font-size: 0.8rem;
    font-weight: 500;
}


.score-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.score-divider {
    color: var(--dusty-rose);
    opacity: 0.5;
    font-size: 1.2rem;
}

.board {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    margin-bottom: 24px;
    animation: scaleIn 0.8s ease-out 0.4s both;
    min-height: 300px;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(212, 165, 165, 0.2);
    position: relative;
    overflow: hidden;
}

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

.cell:hover:not(.disabled)::before {
    width: 100%;
    height: 100%;
}

.cell:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(212, 165, 165, 0.2);
    border-color: rgba(212, 165, 165, 0.4);
}

.cell:active:not(.disabled) {
    transform: translateY(0) scale(0.98);
}

.cell.disabled {
    cursor: not-allowed;
}

.cell svg {
    width: 60%;
    height: 60%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.cell.filled svg {
    opacity: 1;
    transform: scale(1);
}

.cell.player svg {
    color: var(--dusty-rose);
    filter: drop-shadow(0 2px 4px rgba(212, 165, 165, 0.3));
}

.cell.computer svg {
    color: var(--sage-green);
    filter: drop-shadow(0 2px 4px rgba(168, 181, 160, 0.3));
}

/* Модальное окно */
.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.result-modal.show {
    display: flex !important;
}

/* Контейнер для салюта */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--dusty-rose);
    animation: confetti-fall linear forwards;
    border-radius: 50%;
}

.confetti:nth-child(2n) {
    background: var(--sage-green);
    width: 8px;
    height: 8px;
}

.confetti:nth-child(3n) {
    background: var(--gold-accent);
    width: 12px;
    height: 12px;
}

.confetti:nth-child(4n) {
    background: var(--soft-pink);
    width: 6px;
    height: 6px;
}

.confetti:nth-child(5n) {
    background: var(--warm-gray);
    width: 9px;
    height: 9px;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 125, 125, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    z-index: 1;
    padding: 40px 32px;
    border-radius: 28px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-strong);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 500;
    color: var(--warm-gray);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.modal-message {
    font-size: 1rem;
    color: var(--warm-gray);
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 24px;
    font-weight: 300;
}

.promocode-container {
    margin: 24px 0;
    animation: fadeInUp 0.5s ease 0.3s both;
}

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

.promocode-label {
    font-size: 0.85rem;
    color: var(--warm-gray);
    opacity: 0.7;
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.promocode-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.promocode {
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--sage-green) 100%);
    color: white;
    padding: 16px 28px;
    border-radius: 16px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 16px rgba(212, 165, 165, 0.3);
    min-width: 180px;
    text-align: center;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--warm-gray);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(212, 165, 165, 0.2);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-success {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--sage-green);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.copy-success.show {
    opacity: 1;
    transform: translateY(0);
}

.play-again-btn {
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--sage-green) 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 24px;
    box-shadow: 0 4px 16px rgba(212, 165, 165, 0.3);
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
    width: 100%;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 165, 0.4);
}

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

.quote {
    font-style: italic;
    color: var(--warm-gray);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-top: 16px;
    line-height: 1.6;
}

/* Адаптивность */
@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .board {
        gap: 10px;
        padding: 12px;
    }
    
    .modal-content {
        padding: 32px 24px;
    }
    
    .modal-title {
        font-size: 1.75rem;
    }
    
    .promocode {
        font-size: 1.25rem;
        padding: 14px 24px;
        letter-spacing: 3px;
    }
}
