:root {
    --primary-color: #FF006E;
    --secondary-color: #FB5607;
    --accent-color: #FFBE0B;
    --purple-color: #8338EC;
    --blue-color: #3A86FF;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(255, 0, 110, 0.3);
    --gradient-bg: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    --holographic: linear-gradient(45deg, #ff006e, #fb5607, #ffbe0b, #8338ec, #3a86ff);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--holographic);
    background-size: 400% 400%;
    animation: holographicMove 15s ease infinite;
    opacity: 0.05;
    z-index: -1;
}

@keyframes holographicMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

.header {
    background: var(--gradient-bg);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
}

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

.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-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

#gameCanvas {
    width: 100%;
    max-width: 400px;
    height: 600px;
    background: linear-gradient(to bottom, #001122, #003366);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
    display: block;
    margin: 0 auto 1rem;
    box-shadow: inset 0 0 50px rgba(255, 0, 110, 0.2);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.flipper-btn, .launch-btn {
    background: var(--gradient-bg);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-weight: 600;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    flex: 1;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flipper-btn:hover, .launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 0, 110, 0.4);
}

.flipper-btn:active, .launch-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(255, 0, 110, 0.3);
}

.power-ups-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 60px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.table-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--holographic);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.table-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 50px rgba(255, 0, 110, 0.4);
}

.table-card h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.table-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.select-table-btn {
    background: var(--gradient-bg);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.select-table-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.leaderboard-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.leaderboard-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.25rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: calc(var(--border-radius) - 2px);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tab-btn.active {
    background: var(--gradient-bg);
    color: var(--text-light);
    box-shadow: var(--shadow);
}

.leaderboard-list {
    display: none;
}

.leaderboard-list.active {
    display: block;
}

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

.leaderboard-item:nth-child(1) {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-item:nth-child(2) {
    border-left-color: #C0C0C0;
    background: rgba(192, 192, 192, 0.1);
}

.leaderboard-item:nth-child(3) {
    border-left-color: #CD7F32;
    background: rgba(205, 127, 50, 0.1);
}

.settings-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.setting-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

.setting-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 0.75rem;
    font-size: 1rem;
    outline: none;
}

.reset-btn {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.faq-section {
    margin-top: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.faq-section h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

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

.faq-question[aria-expanded="true"] {
    background: var(--gradient-bg);
}

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

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

.faq-answer {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    line-height: 1.6;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    padding: 0.5rem;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
}

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

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

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

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

footer {
    background: var(--bg-card);
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 1rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .flipper-btn, .launch-btn {
        min-height: 50px;
        padding: 0.75rem;
    }
    
    .tables-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    #gameCanvas {
        height: 500px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    #gameCanvas {
        height: 400px;
    }
    
    .game-controls {
        gap: 0.25rem;
    }
    
    .flipper-btn, .launch-btn {
        min-height: 45px;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

.power-up-item {
    display: inline-block;
    background: var(--gradient-bg);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: powerUpPulse 2s ease-in-out infinite;
}

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

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.game-over-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow);
    border: 1px solid var(--primary-color);
}

.game-over-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.game-over-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.restart-btn {
    background: var(--gradient-bg);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient-bg);
    color: var(--text-light);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    animation: comboAnimation 2s ease-out forwards;
    z-index: 1500;
    pointer-events: none;
}

@keyframes comboAnimation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1) translateY(-50px);
    }
}
