:root {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --purple: #8338EC;
    --blue: #3A86FF;
    --dark: #1a1a1a;
    --light: #ffffff;
    --gray: #666666;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, #2d2d2d 100%);
    color: var(--light);
    min-height: 100vh;
    padding-bottom: 80px;
}

header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    box-shadow: 0 4px 20px rgba(255, 0, 110, 0.3);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Game Section */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-info {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}

.game-info span {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
    color: var(--light);
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
}

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

.control-btn:active {
    transform: translateY(0);
}

.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.grid-container {
    display: grid;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.grid-cell {
    width: 50px;
    height: 50px;
    background: var(--light);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.grid-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 190, 11, 0.5);
}

.grid-cell.eliminated {
    background: var(--dark);
    color: var(--light);
    box-shadow: inset 0 0 10px rgba(255, 0, 110, 0.5);
}

.grid-cell.hint {
    animation: pulse 1s infinite;
    box-shadow: 0 0 20px var(--accent);
}

.grid-cell.error {
    background: var(--danger);
    color: var(--light);
    animation: shake 0.5s ease-in-out;
}

.grid-cell.isolated {
    background: var(--warning);
    color: var(--dark);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.game-status {
    text-align: center;
}

.status-message {
    font-size: 1.1rem;
    margin-bottom: 10px;
    min-height: 25px;
}

.validation-result {
    font-size: 1rem;
    min-height: 20px;
}

.validation-result.success {
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.validation-result.error {
    color: var(--danger);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Rules Section */
.rules-container {
    max-width: 800px;
    margin: 0 auto;
}

.rules-container h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 15px rgba(255, 190, 11, 0.5);
}

.rules-content {
    display: grid;
    gap: 20px;
}

.rule-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.rule-item h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.rule-item p {
    line-height: 1.6;
    font-size: 1rem;
}

/* Statistics Section */
.stats-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.stats-container h2 {
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 15px rgba(58, 134, 255, 0.5);
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(255, 0, 110, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.stats-actions {
    margin-top: 30px;
}

.danger-btn {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--light);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-container h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 15px rgba(131, 56, 236, 0.5);
}

.faq-items {
    display: grid;
    gap: 15px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--light);
    padding: 20px;
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

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

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    color: var(--accent);
}

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

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.show {
    padding: 20px;
    max-height: 200px;
}

.faq-answer p {
    line-height: 1.6;
    color: var(--gray);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark) 0%, #2d2d2d 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

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

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .grid-cell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rule-item,
    .faq-item {
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 15px;
    }
    
    .grid-cell {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Neon glow effects */
.grid-cell:focus {
    outline: none;
    box-shadow: 0 0 20px var(--accent);
}

.control-btn:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.6);
}

.nav-item:focus {
    outline: none;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

/* Success animation */
@keyframes celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.celebration {
    animation: celebration 0.6s ease-in-out;
}

/* Grid size variations */
.grid-5x5 { grid-template-columns: repeat(5, 1fr); }
.grid-6x6 { grid-template-columns: repeat(6, 1fr); }
.grid-7x7 { grid-template-columns: repeat(7, 1fr); }
.grid-8x8 { grid-template-columns: repeat(8, 1fr); }
