:root {
    --primary: #f3d47d; /* Gold */
    --accent: #9d50bb; /* Purple */
    --accent-dark: #6e48aa;
    --bg-dark: #0f0c29;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0a0a12 url('bg_minimal.jpg') no-repeat center center fixed;
    background-size: cover;
    color: white;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.app-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(15, 12, 41, 0.8), transparent);
    z-index: 10;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary);
    text-transform: uppercase;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filters button {
    background: var(--glass);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.filters button:hover {
    background: var(--glass-heavy);
    transform: translateY(-2px);
}

.filters button:active {
    transform: scale(0.9);
}

.filters button.active {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

#toggle-favs.active {
    background: rgba(255, 71, 87, 0.3); /* Soft red instead of purple */
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.4);
    border-color: rgba(255, 71, 87, 0.5);
}

/* Timeline */
#timeline-container {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 100px;
}

.timeline-track {
    display: flex;
    width: 300%; /* 3 days */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-view {
    width: 33.33%;
    padding: 0 20px;
}

.more-stages-btn {
    width: 100%;
    background: var(--glass);
    border: 1px dashed rgba(255,255,255,0.3);
    color: white;
    padding: 15px;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.more-stages-btn:hover {
    background: var(--glass-heavy);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.more-stages-btn span {
    font-size: 1.5rem;
    color: var(--primary);
}

.stage-section {
    margin-bottom: 30px;
}

.stage-title {
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--primary), transparent);
}

.acts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Desktop Horizontal View */
@media (min-width: 768px) {
    .acts-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        gap: 15px;
    }
    
    .act-card {
        min-width: 300px;
        scroll-snap-align: start;
    }
    
    .acts-list::-webkit-scrollbar {
        height: 6px;
    }
    
    .acts-list::-webkit-scrollbar-thumb {
        background: var(--glass-heavy);
        border-radius: 3px;
    }
}

/* Act Card */
.act-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.act-card:active {
    transform: scale(0.98);
    background: var(--glass-heavy);
}

.act-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(243, 212, 125, 0.2);
}

.act-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.act-time {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.ascii-reaction {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 5px;
    opacity: 0.9;
    animation: float-ascii 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes float-ascii {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.05); }
}

.act-rating-display {
    font-size: 1.5rem;
}

.popular-badge {
    color: var(--primary);
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    display: flex;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
    margin-bottom: var(--safe-bottom);
}

.nav-item {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 12px 5px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item.active {
    background: var(--primary);
    color: #000;
}

.day-label {
    font-size: 0.9rem;
    font-weight: 800;
}

.day-date {
    font-size: 0.6rem;
    opacity: 0.8;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-radius: 30px 30px 0 0;
    padding: 20px 20px calc(20px + var(--safe-bottom));
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.bottom-sheet.visible {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 20px;
}

#rating-artist-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

#rating-stage-time {
    color: var(--primary);
    margin-bottom: 30px;
    font-weight: 600;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.emoji-btn {
    background: var(--glass);
    border: none;
    font-size: 2.2rem;
    padding: 15px 0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:active {
    transform: scale(0.95);
}

.emoji-btn.active {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary);
    border: 2px solid white;
}

.act-card.social-highlight {
    border: 2px solid #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 10px rgba(255, 0, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 255, 0.6); }
    100% { box-shadow: 0 0 10px rgba(255, 0, 255, 0.2); }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Stats */
.global-stats {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.stat-bar {
    height: 8px;
    width: 100%;
    background: #333;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    margin-bottom: 10px;
}

.stat-pos {
    height: 100%;
    background: #4cd137;
}

.stat-neg {
    height: 100%;
    background: #e84118;
}

#stat-summary {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
}

.search-links {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.search-btn {
    flex: 1;
    text-decoration: none;
    text-align: center;
    padding: 10px 0;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
    transition: transform 0.2s;
}

.search-btn:active {
    transform: scale(0.95);
}

.search-btn.yt { background: #ff0000; }
.search-btn.sp { background: #1DB954; }
.search-btn.sc { background: #ff7700; }

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1a1a2e;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}

.modal header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.wallet {
    background: var(--glass);
    padding: 5px 15px;
    border-radius: 12px;
    font-weight: 800;
    color: var(--primary);
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Shop */
.shop-grid {
    display: grid;
    gap: 20px;
}

.shop-item {
    background: var(--glass);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.item-preview {
    width: 80px;
    height: 80px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.item-preview img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.buy-btn {
    margin-top: 10px;
    background: var(--primary);
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.shop-item.unlocked .buy-btn {
    background: #4cd137;
    pointer-events: none;
}

.shop-item.unlocked .buy-btn::after {
    content: ' - OWNED';
}

/* Game */
#game-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
}

#game-start-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    pointer-events: auto;
    z-index: 10;
}

#game-start-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

#start-game-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.game-content header {
    transition: opacity 0.3s;
}

#game-score-display {
    transition: opacity 0.3s;
}

.hidden {
    display: none !important;
}
