/* Chess Game Styles - Dark Theme */

:root {
    --chess-bg: #0a0f1a;
    --chess-card: rgba(15, 23, 42, 0.95);
    --chess-border: rgba(0, 212, 255, 0.2);
    --chess-accent: #00d4ff;
    --chess-gold: #fbbf24;
    --chess-green: #22c55e;
    --chess-red: #ef4444;
    --chess-white: #f1d9c0;
    --chess-black: #769656;
    --chess-highlight: rgba(255, 255, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--chess-bg) 0%, #1a1a2e 100%);
    min-height: 100vh;
    color: #e2e8f0;
}

.chess-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    min-height: 100vh;
}

@media (max-width: 1024px) {
    .chess-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}

/* Header */
.chess-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--chess-card);
    border-radius: 16px;
    border: 1px solid var(--chess-border);
}

.chess-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--chess-accent), var(--chess-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    padding: 10px 20px;
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid rgba(100, 116, 139, 0.5);
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(100, 116, 139, 0.5);
    color: #fff;
}

/* Board Section */
.board-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.board-wrapper {
    background: var(--chess-card);
    border-radius: 16px;
    border: 1px solid var(--chess-border);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#chessboard {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1;
}

/* Chessboard.js overrides */
.board-b72b1 {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.square-55d63 {
    transition: background-color 0.1s;
}

.white-1e1d7 {
    background-color: var(--chess-white) !important;
}

.black-3c85d {
    background-color: var(--chess-black) !important;
}

.highlight-move {
    background-color: var(--chess-highlight) !important;
}

/* Game Status */
.game-status {
    background: var(--chess-card);
    border-radius: 12px;
    border: 1px solid var(--chess-border);
    padding: 15px 20px;
    text-align: center;
}

.status-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.status-thinking {
    color: var(--chess-gold);
    animation: pulse 1.5s infinite;
}

.status-your-turn {
    color: var(--chess-green);
}

.status-checkmate {
    color: var(--chess-accent);
    font-size: 1.5rem;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Controls */
.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--chess-accent), #0099cc);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid rgba(100, 116, 139, 0.5);
    color: #94a3b8;
}

.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.5);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--chess-red);
    color: var(--chess-red);
}

.btn-danger:hover {
    background: var(--chess-red);
    color: #fff;
}

/* Side Panel */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-card {
    background: var(--chess-card);
    border-radius: 16px;
    border: 1px solid var(--chess-border);
    padding: 20px;
}

.panel-card h3 {
    color: var(--chess-accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

/* Difficulty Selector */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.difficulty-option:hover {
    background: rgba(0, 212, 255, 0.1);
}

.difficulty-option.selected {
    border-color: var(--chess-accent);
    background: rgba(0, 212, 255, 0.15);
}

.difficulty-option input {
    display: none;
}

.difficulty-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-icon {
    font-size: 1.2rem;
}

.difficulty-name {
    font-weight: 600;
}

.difficulty-reward {
    color: var(--chess-gold);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Move History */
.move-history {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.move-row {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.move-number {
    color: #64748b;
}

.move-white,
.move-black {
    color: #e2e8f0;
}

/* Reward Section */
.reward-section {
    text-align: center;
    padding: 25px;
}

.reward-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--chess-gold);
    margin: 10px 0;
}

.reward-label {
    color: #94a3b8;
    margin-bottom: 20px;
}

.claim-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--chess-gold), #f59e0b);
    color: #000;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

.claim-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.4);
}

.claim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Victory Modal */
.victory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.victory-content {
    background: var(--chess-card);
    border-radius: 20px;
    border: 2px solid var(--chess-gold);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.victory-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.victory-title {
    font-size: 2rem;
    color: var(--chess-gold);
    margin-bottom: 10px;
}

.victory-subtitle {
    color: #94a3b8;
    margin-bottom: 30px;
}

/* Stats */
.chess-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--chess-accent);
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 212, 255, 0.3);
    border-top-color: var(--chess-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--chess-accent);
    font-size: 1.2rem;
}