:root {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --purple: #8338EC;
    --blue: #3A86FF;
    --dark: #1a1a1a;
    --darker: #0f0f0f;
    --light: #ffffff;
    --gray: #666666;
    --light-gray: #f0f0f0;
    --success: #00ff88;
    --danger: #ff0066;
    --warning: #ffaa00;
}

* {
    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;
    overflow-x: hidden;
    padding-bottom: 80px;
}

.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 0, 110, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
}

.stat i {
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent));
}

.app-main {
    padding: 1rem;
    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-controls {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.difficulty-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.action-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: var(--light);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 86, 7, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, var(--gray) 0%, var(--dark) 100%);
}

.action-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(102, 102, 102, 0.4);
}

.game-board-container {
    position: relative;
    margin-bottom: 1rem;
}

.game-board {
    display: grid;
    gap: 2px;
    background: var(--dark);
    border-radius: 10px;
    padding: 10px;
    margin: 0 auto;
    max-width: 100%;
    overflow: auto;
}

.cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    position: relative;
}

.cell:hover {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    transform: scale(1.05);
}

.cell.revealed {
    background: linear-gradient(135deg, var(--light-gray) 0%, #ddd 100%);
    color: var(--dark);
    cursor: default;
}

.cell.revealed:hover {
    transform: none;
}

.cell.flagged {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: var(--light);
}

.cell.mine {
    background: linear-gradient(135deg, var(--danger) 0%, #cc0055 100%);
    color: var(--light);
}

.cell.number-1 { color: var(--blue); }
.cell.number-2 { color: var(--success); }
.cell.number-3 { color: var(--primary); }
.cell.number-4 { color: var(--purple); }
.cell.number-5 { color: var(--secondary); }
.cell.number-6 { color: var(--accent); }
.cell.number-7 { color: var(--dark); }
.cell.number-8 { color: var(--gray); }

.game-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
}

.game-message.hidden {
    display: none;
}

.message-content {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    border-radius: 15px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

.message-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.message-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.message-text {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.message-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: var(--light);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.logic-hints {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logic-hints h3 {
    margin-bottom: 0.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 190, 11, 0.5);
}

.hints-container {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

.tutorial-header, .settings-header, .faq-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tutorial-header h2, .settings-header h2, .faq-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-content {
    margin-bottom: 2rem;
}

.tutorial-step {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-step.active {
    display: block;
    animation: slideIn 0.3s ease-in-out;
}

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

.tutorial-step h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

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

.tutorial-board .cell {
    min-height: 40px;
    font-size: 1rem;
}

.tutorial-explanation {
    background: rgba(255, 190, 11, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin-top: 1rem;
    font-style: italic;
}

.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: var(--light);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.tutorial-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-indicator {
    font-weight: bold;
    color: var(--accent);
}

.settings-content {
    max-width: 600px;
    margin: 0 auto;
}

.setting-group {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-group h3 {
    margin-bottom: 1rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 190, 11, 0.3);
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item label:hover {
    transform: translateX(5px);
}

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

.setting-label {
    font-weight: bold;
    flex: 1;
}

.setting-item small {
    display: block;
    opacity: 0.7;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

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

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 190, 11, 0.3);
}

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

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

.faq-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 0, 110, 0.2);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    border: none;
    background: transparent;
    color: var(--light);
    font-weight: bold;
    font-size: 1.1rem;
    text-align: left;
    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.1);
}

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

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

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
    overflow: hidden;
    max-height: 0;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    max-height: 200px;
    animation: expandAnswer 0.3s ease-in-out;
}

@keyframes expandAnswer {
    from { max-height: 0; }
    to { max-height: 200px; }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

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

.nav-item:hover {
    color: var(--light);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

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

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

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

footer {
    background: var(--darker);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    opacity: 0.7;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .game-stats {
        gap: 1rem;
    }
    
    .stat {
        font-size: 0.9rem;
    }
    
    .difficulty-selector {
        flex-direction: column;
    }
    
    .difficulty-btn {
        min-width: auto;
    }
    
    .cell {
        min-height: 25px;
        font-size: 0.8rem;
    }
    
    .tutorial-board .cell {
        min-height: 30px;
        font-size: 0.9rem;
    }
    
    .stats-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .app-main {
        padding: 2rem;
    }
    
    .game-board {
        max-width: 600px;
    }
    
    .cell {
        min-height: 40px;
        font-size: 1rem;
    }
    
    .tutorial-board {
        max-width: 300px;
    }
    
    .tutorial-board .cell {
        min-height: 50px;
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        position: relative;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        margin: 2rem auto 0;
        max-width: 600px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    body {
        padding-bottom: 0;
    }
    
    .nav-item {
        min-width: 80px;
        padding: 1rem;
    }
    
    .nav-item i {
        font-size: 1.5rem;
    }
    
    .nav-item span {
        font-size: 0.9rem;
    }
}

.neon-glow {
    filter: drop-shadow(0 0 10px currentColor);
}

.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-10px); }
    70% { transform: translateY(-5px); }
    90% { transform: translateY(-2px); }
}
