:root {
    --primary-bg: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --square-light: #e2e8f0;
    --square-dark: #64748b;
    --highlight: rgba(56, 189, 248, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Blobs */
.background-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

/* Container */
.game-container {
    width: 95%;
    max-width: 450px;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--glass-border);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* Chess Board */
.board-wrapper {
    aspect-ratio: 1 / 1;
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.square.light {
    background-color: var(--square-light);
}

.square.dark {
    background-color: var(--square-dark);
}

.square.selected {
    background-color: var(--highlight) !important;
}

.square.valid-move::after {
    content: '';
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.piece {
    width: 80%;
    height: 80%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Ensure high contrast */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.piece.white-piece {
    color: #ffffff;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.piece.black-piece {
    color: #1a1a1a;
    filter: drop-shadow(0 2px 3px rgba(255, 255, 255, 0.3));
    /* Slight light shadow for contrast on dark squares */
}

.piece:hover {
    transform: scale(1.1);
}

/* Footer */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.player-color.white {
    background: var(--square-light);
}

.player-color.black {
    background: var(--square-dark);
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 480px) {
    .game-container {
        padding: 1.5rem;
    }
}