:root {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --purple: #8338EC;
    --blue: #3A86FF;
    --dark: #1a1a1a;
    --darker: #0f0f0f;
    --light: #ffffff;
    --gray: #666666;
    --light-gray: #f5f5f5;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
}

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

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

.app-header {
    background: rgba(255, 0, 110, 0.1);
    border-bottom: 2px solid var(--primary);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 0 10px var(--primary);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px var(--primary); }
    to { text-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary); }
}

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

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

.content-section.active {
    display: block;
}

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

.game-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 0, 110, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.2);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.2rem;
}

.stat span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent);
}

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

.action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 110, 0.4);
}

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

.game-board-container {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.game-board {
    display: grid;
    gap: 2px;
    background: var(--dark);
    padding: 10px;
    border-radius: 15px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
    max-width: 100%;
    overflow: auto;
}

.cell {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.cell:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.cell.filled {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.cell.selected {
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.cell.error {
    background: linear-gradient(135deg, var(--error), #ff4757);
    animation: shake 0.5s ease-in-out;
}

.cell.hint {
    background: linear-gradient(135deg, var(--warning), var(--accent));
    animation: pulse 1s ease-in-out infinite;
}

.cell.ripple-highlight {
    background: rgba(255, 190, 11, 0.3);
    border: 1px solid var(--accent);
}

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

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

.region-1 { background-color: rgba(255, 0, 110, 0.3); }
.region-2 { background-color: rgba(251, 86, 7, 0.3); }
.region-3 { background-color: rgba(255, 190, 11, 0.3); }
.region-4 { background-color: rgba(131, 56, 236, 0.3); }
.region-5 { background-color: rgba(58, 134, 255, 0.3); }
.region-6 { background-color: rgba(255, 0, 110, 0.5); }
.region-7 { background-color: rgba(251, 86, 7, 0.5); }
.region-8 { background-color: rgba(255, 190, 11, 0.5); }

.number-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 0, 110, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.2);
}

.selector-label {
    text-align: center;
    margin-bottom: 0.8rem;
    font-weight: bold;
    color: var(--accent);
}

.number-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.number-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--blue);
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.2), rgba(131, 56, 236, 0.2));
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--blue);
}

.number-btn.selected {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent);
}

.validation-message {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: bold;
    transition: all 0.3s ease;
}

.validation-message.success {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.validation-message.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--error);
    border: 1px solid var(--error);
}

.validation-message.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.tutorial-content {
    max-width: 800px;
    margin: 0 auto;
}

.tutorial-content h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.tutorial-step {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.2);
}

.tutorial-step h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tutorial-step ul {
    padding-left: 1.5rem;
}

.tutorial-step li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.tutorial-interactive {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 2px solid var(--blue);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.3);
}

.tutorial-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    max-width: 200px;
    margin: 1rem auto;
    background: var(--dark);
    padding: 10px;
    border-radius: 10px;
}

.tutorial-board .cell {
    width: 35px;
    height: 35px;
    font-size: 1rem;
}

.demo-btn {
    display: block;
    margin: 1rem auto;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(58, 134, 255, 0.3);
}

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

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 0, 110, 0.3);
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.2);
}

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

.faq-question:hover {
    background: rgba(255, 0, 110, 0.1);
}

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

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

.faq-answer {
    padding: 0 1.2rem 1.2rem;
    color: var(--gray);
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -5px 20px rgba(255, 0, 110, 0.3);
    z-index: 1000;
}

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

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

.nav-item.active {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

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

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

footer {
    text-align: center;
    padding: 1rem;
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-actions {
        justify-content: center;
    }
    
    .action-btn {
        min-width: 80px;
        font-size: 0.9rem;
    }
    
    .cell {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .number-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .tutorial-step {
        padding: 1rem;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
}

@media (min-width: 768px) {
    .app-main {
        padding: 2rem;
    }
    
    .game-board {
        padding: 20px;
    }
    
    .cell {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .tutorial-board .cell {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .game-info {
        padding: 1.5rem;
    }
    
    .tutorial-step {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        position: relative;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 0, 110, 0.3);
        border-radius: 15px;
        margin: 2rem auto 0;
        max-width: 400px;
        box-shadow: 0 0 20px rgba(255, 0, 110, 0.2);
    }
    
    body {
        padding-bottom: 0;
    }
    
    .nav-item {
        padding: 1rem;
    }
    
    .nav-item i {
        font-size: 1.8rem;
    }
    
    .nav-item span {
        font-size: 0.9rem;
    }
}
