@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    color: var(--text-primary);
}

.checkers-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.checkers-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
}

.game-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    color: #ffffff;
    /* Or keep specific color if needed, but white/theme is safer */
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.checkers-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
    color: var(--text-secondary);
}

.checkers-main {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.mode-selection h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.card-icon i {
    font-size: 24px;
    color: white;
}

.game-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
    color: var(--text-primary);
}

.card-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.difficulty-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-select:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.difficulty-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.difficulty-select option {
    background: #1a1a2e;
    color: var(--text-primary);
}

.primary-button {
    width: 100%;
    padding: 15px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.primary-button:active {
    transform: translateY(0);
}

.game-rules {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    border-left: 4px solid #667eea;
    border: 1px solid var(--border-color);
}

.game-rules h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.game-rules ul {
    list-style: none;
    padding: 0;
}

.game-rules li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.game-rules li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Join Page Specifics */
.center-content {
    justify-content: center;
    max-width: 800px;
}

.join-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-info {
    margin-bottom: 30px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.status-message {
    margin-bottom: 30px;
    font-style: italic;
    color: var(--text-secondary);
    min-height: 24px;
}

.loader-animation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .checkers-header h1 {
        font-size: 36px;
    }

    .mode-cards {
        grid-template-columns: 1fr;
    }

    .checkers-main {
        padding: 20px;
    }

    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
    }
}