/* Dots (Totchki) Index Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #4ecdc4 0%, #556270 100%);
    /* Teal/Dark Grey */
    --accent-blue: #4ecdc4;
    --accent-red: #ff6b6b;
    --dark-bg: #0f2027;
    --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: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('/images/dots-bg.svg') no-repeat center center fixed;
    background-size: cover;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.game-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    color: var(--accent-blue);
    /* Or gradient text */
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

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

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

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.game-card:hover {
    border-color: rgba(78, 205, 196, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.2);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

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

.game-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.card-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.primary-button {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.4);
}

/* Selectors */
.selector-group {
    margin-bottom: 20px;
    text-align: left;
}

.selector-group label {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.selector-options {
    display: flex;
    gap: 5px;
    width: 100%;
}

.selector-option {
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    min-width: 0;
}

.selector-option:hover {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.selector-option.active {
    border-color: var(--accent-blue);
    background: rgba(78, 205, 196, 0.2);
    color: var(--text-primary);
    font-weight: 600;
}

.selector-option.active i {
    color: var(--accent-blue);
}

/* Rules Section */
.game-rules {
    background: var(--card-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    padding: 30px;
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--accent-blue);
}

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

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

.game-rules li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
}

.game-rules li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-size: 1.3rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .mode-cards {
        grid-template-columns: 1fr;
    }

    .game-container {
        padding: 15px;
    }

    .back-button {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        margin-bottom: 20px;
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }

    .game-header h1 {
        font-size: 2rem;
        word-break: break-word;
    }

    .game-card {
        padding: 20px;
    }

    /* Critical fix to prevent overflow */
    .mode-cards {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    /* Vertical stacking for inputs on mobile */
    .selector-options {
        flex-direction: column;
        gap: 8px;
    }

    .selector-option {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .back-button {
        width: 100%;
        margin-bottom: 15px;
        justify-content: center;
        display: flex;
    }

    .primary-button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }

    .mode-selection h2 {
        font-size: 1.5rem;
    }
}