* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 20px;
}

.game-container {
    display: none;
}

.game-container.active {
    display: block;
}

.home-screen {
    text-align: center;
    display: none;
}

.home-screen.active {
    display: block;
}

.game-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    text-align: center;
}

.game-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.info-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    min-width: 150px;
    text-align: center;
}

.info-box span {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.cell {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 4px;
}

.cell.white {
    background: #f0d9b5;
}

.cell.black {
    background: #b58863;
}

.cell.selected {
    background: #7ef67e !important;
    box-shadow: 0 0 15px #7ef67e;
}

.cell.valid-move {
    background: #ffeb3b !important;
    animation: pulse 1.5s infinite;
}

.cell.obstacle {
    background: #ff4444 !important;
}

.obstacle-piece {
    font-size: 35px;
    color: #000;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.queen {
    font-size: 45px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s ease;
}

.target {
    color: #ff4444;
    font-size: 35px;
    user-select: none;
    animation: rotate 3s infinite linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

button.home-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

button.best-score-btn {
    background: linear-gradient(45deg, #FFC107, #FFA000);
}

.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    display: none;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    display: none;
    z-index: 1000;
}

.best-scores {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
}

.best-scores h2 {
    color: #ffd700;
    margin-bottom: 15px;
}

.best-scores ol {
    text-align: left;
    padding-left: 30px;
}

.best-scores li {
    margin: 10px 0;
    color: #fff;
}

@media (max-width: 600px) {
    .cell {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .game-title {
        font-size: 2rem;
    }

    .info-box {
        padding: 8px 16px;
        min-width: 120px;
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #f44336, #d32f2f);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.close-btn:hover {
    transform: rotate(90deg);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.close-btn::before,
.close-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: white;
    border-radius: 1px;
}

.close-btn::before {
    transform: rotate(45deg);
}

.close-btn::after {
    transform: rotate(-45deg);
}