:root {
    --primary-color: #FF006E;
    --secondary-color: #FB5607;
    --accent-color: #FFBE0B;
    --purple-color: #8338EC;
    --blue-color: #3A86FF;
    --dark-bg: #1a1a1a;
    --light-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: var(--text-color);
    min-height: 100vh;
    padding-bottom: 80px;
}

body.dark-mode {
    background: linear-gradient(135deg, #2d1b69, #1a1a1a);
    color: #ffffff;
}

body.dark-mode .app-header {
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

body.dark-mode .content-section {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .crossword-cell {
    background: #2d2d2d;
    color: #ffffff;
    border-color: #555;
}

body.dark-mode .crossword-cell.blocked {
    background: #1a1a1a;
}

.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--purple-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
}

.app-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-color);
}

select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 110, 0.1);
}

.primary-btn, .secondary-btn, .action-btn, .danger-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
    grid-column: 1 / -1;
}

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

.secondary-btn {
    background: var(--accent-color);
    color: var(--text-color);
    grid-column: 1 / -1;
}

.secondary-btn:hover {
    background: #e6a800;
    transform: translateY(-2px);
}

.action-btn {
    background: var(--blue-color);
    color: white;
    flex: 1;
}

.action-btn:hover {
    background: #2968cc;
    transform: translateY(-2px);
}

.danger-btn {
    background: var(--danger-color);
    color: white;
}

.danger-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.game-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .game-container {
        grid-template-columns: 1fr 300px;
    }
    
    .game-controls {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .primary-btn, .secondary-btn {
        grid-column: span 2;
    }
}

.crossword-grid {
    display: grid;
    gap: 2px;
    background: var(--border-color);
    border-radius: 10px;
    padding: 10px;
    justify-content: center;
    max-width: 100%;
    overflow: auto;
}

.crossword-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #ccc;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.crossword-cell:hover {
    background: #f0f8ff;
    transform: scale(1.05);
}

.crossword-cell.blocked {
    background: #333;
    cursor: default;
}

.crossword-cell.blocked:hover {
    background: #333;
    transform: none;
}

.crossword-cell.active {
    background: rgba(255, 0, 110, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
}

.crossword-cell.correct {
    background: rgba(40, 167, 69, 0.1);
    border-color: var(--success-color);
}

.crossword-cell.incorrect {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger-color);
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: var(--text-light);
    font-weight: normal;
}

.crossword-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.crossword-cell input:focus {
    outline: none;
}

.clues-container {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.clues-section {
    margin-bottom: 1.5rem;
}

.clues-section h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.clues-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.clue-item {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.clue-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-left-color: var(--primary-color);
}

.clue-item.active {
    background: rgba(255, 0, 110, 0.1);
    border-left-color: var(--primary-color);
}

.clue-number {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.game-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.game-status {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 1rem;
}

.game-status.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.game-status.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 2px solid var(--warning-color);
}

.game-status.info {
    background: rgba(58, 134, 255, 0.1);
    color: var(--blue-color);
    border: 2px solid var(--blue-color);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--blue-color), var(--purple-color));
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.theme-stats-list {
    display: grid;
    gap: 1rem;
}

.theme-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.theme-name {
    font-weight: 600;
    color: var(--text-color);
}

.theme-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-group {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border-left: 4px solid var(--blue-color);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.setting-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-left: 2.75rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
}

.faq-question {
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.7);
}

.faq-question[aria-expanded="true"] {
    background: rgba(255, 0, 110, 0.1);
    color: var(--primary-color);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1rem 1rem;
    color: var(--text-light);
    line-height: 1.6;
    animation: slideDown 0.3s ease-in-out;
}

.faq-answer[hidden] {
    display: none;
}

.faq-answer ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.25rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 10px;
    min-width: 60px;
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(255, 0, 110, 0.1);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(255, 0, 110, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.2);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 2rem;
}

@media (max-width: 767px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .content-section {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .crossword-cell {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .clues-container {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .crossword-cell {
        width: 25px;
        height: 25px;
        font-size: 11px;
    }
    
    .cell-number {
        font-size: 8px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-controls {
        grid-template-columns: 1fr;
    }
}

.neon-glow {
    box-shadow: 
        0 0 5px var(--primary-color),
        0 0 10px var(--primary-color),
        0 0 15px var(--primary-color),
        0 0 20px var(--primary-color);
    animation: neonPulse 2s infinite alternate;
}

@keyframes neonPulse {
    from {
        box-shadow: 
            0 0 5px var(--primary-color),
            0 0 10px var(--primary-color),
            0 0 15px var(--primary-color),
            0 0 20px var(--primary-color);
    }
    to {
        box-shadow: 
            0 0 2px var(--primary-color),
            0 0 5px var(--primary-color),
            0 0 8px var(--primary-color),
            0 0 12px var(--primary-color);
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
