/* Base styles */
body {
    background: #FAFAFA;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #2C2C2C;
    margin: 0;
    padding: 0;
}

main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 32px;
}

/* Parameters section */
#parameters {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 32px;
    display: grid;
    gap: 16px;
}

#parameters input[type="number"],
#parameters select {
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: inherit;
    margin-left: 8px;
}

#parameters input[type="number"]:focus,
#parameters select:focus {
    outline: 2px solid #445CFF;
    outline-offset: -1px;
}

#parameters button {
    background: #2C2C2C;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

#parameters button:hover {
    background: #444;
    transform: translateY(-1px);
}

#parameters button:active {
    transform: translateY(0);
}

/* Checkbox styling */
#parameters input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 24px;
    background: #E0E0E0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;
    transition: background-color 0.2s;
}

#parameters input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    transition: transform 0.2s;
}

#parameters input[type="checkbox"]:checked {
    background: #445CFF;
}

#parameters input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}

/* Game status */
#current-player {
    margin: 20px 0;
    font-weight: 600;
    font-size: 1.1em;
    color: #2C2C2C;
}

/* Game board */
#board {
    display: inline-grid;
    gap: 6px;
    background: #E0E0E0;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 0 auto;
    overflow: hidden;
}

.cell {
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cell:hover:not(.player1):not(.player2) {
    background: #F5F5F5;
    transform: translateY(-1px);
}

.cell.player1 {
    background: #FF445C;
    color: white;
    cursor: default;
}

.cell.player2 {
    background: #445CFF;
    color: white;
    cursor: default;
}

.cell.just-placed {
    animation: popIn 0.3s ease-out;
}

.cell.hint {
    background: #E6E6E6;
    animation: pulse 1.5s infinite;
}

.cell.hint.player1,
.cell.hint.player2 {
    background: inherit;
}

.cell.dangerous {
    background: rgba(255, 68, 92, 0.1);
}

.cell.dangerous.player1,
.cell.dangerous.player2 {
    background: inherit;
}

/* Game-end highlight */
.cell.cocyclic {
    position: relative;
    z-index: 2;
    animation: highlight-pop 1.2s ease-out forwards;
}

.cell.cocyclic.player1 {
    box-shadow: 0 4px 12px rgba(255, 68, 92, 0.4);
}

.cell.cocyclic.player2 {
    box-shadow: 0 4px 12px rgba(68, 92, 255, 0.4);
}

@keyframes highlight-pop {
    0% { transform: scale(1); }
    20% { transform: scale(1.15); }
    40% { transform: scale(1); }
    60% { transform: scale(1.12); }
    80% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Animations */
@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Responsive design */
@media (max-width: 600px) {
    main {
        margin: 20px auto;
        padding: 16px;
    }

    #board {
        gap: 4px;
        padding: 6px;
    }

    .cell {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    #parameters {
        padding: 16px;
    }
}
