:root {
    --primary: #00f2ff;
    --secondary: #7000ff;
    --accent: #ff00e1;
    --gold: #ffcc00;
    --bg-dark: #050510;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --font-main: 'Outfit', sans-serif;
    --font-display: 'Rajdhani', sans-serif;
    --success: #00ff88;
    --warning: #ffcc00;
    --danger: #ff4444;
}

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

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-image: url('../assets/bg_main.png');
    background-size: cover;
    background-position: center;
}

#bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(5, 5, 16, 0.7) 100%);
    pointer-events: none;
}

/* HUD Styling */
#hud {
    padding: 2.5rem 1.5rem 1rem;
    z-index: 10;
    text-align: center;
}

.currency-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.currency-label {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

#total-credits {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
    letter-spacing: 1px;
}

.income-rate {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

#prestige-bar-container {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0.5rem auto;
    overflow: hidden;
}

#prestige-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    width: 0%;
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.3s ease;
}

#prestige-level {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
}

/* Interaction Area */
#main-scene {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1000px;
}

#core-wrapper {
    width: 280px;
    height: 280px;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}

#core-wrapper:active {
    transform: scale(0.95);
}

#main-core {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px var(--primary));
    animation: corePulse 4s infinite ease-in-out;
    mix-blend-mode: screen; /* Removes black background */
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px var(--primary)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 60px var(--accent)); }
}

/* Floating Text */
.floating-text {
    position: absolute;
    color: white;
    font-weight: 800;
    pointer-events: none;
    animation: floatUp 1.2s forwards ease-out;
    font-family: var(--font-display);
    z-index: 100;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1.5); opacity: 1; }
    100% { transform: translateY(-150px) scale(1); opacity: 0; }
}

/* Bottom Nav */
#bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(5, 5, 20, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 0.75rem;
    z-index: 20;
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.6;
    transition: all 0.3s;
}

.nav-btn.active {
    opacity: 1;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.1);
}

/* Side Panel */
#side-panel {
    position: absolute;
    bottom: 74px;
    left: 0;
    width: 100%;
    height: 60%;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(25px);
    border-top: 2px solid var(--primary);
    border-radius: 30px 30px 0 0;
    z-index: 30;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem;
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.5);
}

#side-panel.hidden {
    transform: translateY(110%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#panel-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

/* Business Item List */
#panel-content {
    overflow-y: auto;
    height: calc(100% - 3rem);
    padding-bottom: 2rem;
}

.item-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.item-card:active {
    transform: scale(0.98);
}

.item-card.disabled {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
}

.item-card.locked {
    filter: blur(4px) grayscale(0.8);
    pointer-events: none;
}

.item-card.owned {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.05);
}

.status-tag {
    background: var(--success);
    color: black;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.item-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
}

.item-info {
    flex: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.item-name {
    font-weight: 700;
    font-size: 1rem;
}

.item-count {
    color: var(--gold);
    font-size: 0.8rem;
}

/* Progress Bars */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 0.5rem 0;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    box-shadow: 0 0 10px var(--primary);
}

/* Market Ticker */
#market-ticker {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
}

.active-boom { 
    color: var(--success); 
    background: rgba(0, 255, 136, 0.1);
    animation: blink 1s infinite;
}

.active-crash { 
    color: var(--danger); 
    background: rgba(255, 68, 68, 0.1);
    animation: blink 1s infinite;
}

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

.item-cost {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px var(--accent); }
    50% { box-shadow: 0 0 15px var(--accent); }
}

.buy-btn {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border: none;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.3);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-card {
    background: linear-gradient(180deg, rgba(30, 30, 60, 0.9) 0%, rgba(5, 5, 20, 0.95) 100%);
    border: 2px solid var(--primary);
    border-radius: 40px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
}

.tutorial-img {
    width: 100%;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
}

.overlay-card h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 3px;
    color: var(--primary);
}

.instruction-steps {
    margin: 2rem 0;
    text-align: left;
}

.step {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step span {
    background: var(--primary);
    color: black;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
}

.premium-btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3);
    width: 100%;
    transition: transform 0.2s;
}

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

.reward-amount {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.reward-amount img {
    width: 80px;
}

.reward-amount span {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
}

/* Big Desktop Support */
@media (min-width: 768px) {
    #side-panel {
        width: 450px;
        right: 0;
        left: auto;
        height: 80%;
        bottom: 10%;
        border-radius: 40px 0 0 40px;
        border: 2px solid var(--primary);
        border-right: none;
    }
}
