@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;1,600&family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-base: #07090f; 
    --bg-panel: rgba(17, 24, 39, 0.85); 
    --bg-inset: rgba(11, 15, 25, 0.95);
    --text-main: #e2e8f0; 
    --text-muted: #94a3b8;
    --gold-primary: #d4af37; 
    --gold-hover: #f1c40f;
    --accent-blue: #3b82f6; 
    --danger: #ef4444; 
    --success: #10b981;
    --purple-bm: #a855f7; 
    --teal-shop: #14b8a6;
    --border-light: rgba(212, 175, 55, 0.25); 
    --border-heavy: rgba(212, 175, 55, 0.6);
    --header-font: 'Playfair Display', serif;
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.2);
}

body[data-theme="city"] { 
    --bg-base: #020617; 
    --bg-panel: rgba(15, 23, 42, 0.9); 
    --bg-inset: rgba(2, 6, 23, 0.95); 
    --gold-primary: #0ea5e9; 
    --gold-hover: #38bdf8; 
    --border-light: rgba(14, 165, 233, 0.25); 
    --border-heavy: rgba(14, 165, 233, 0.6); 
    --header-font: 'Inter', sans-serif; 
    --shadow-glow: 0 0 15px rgba(14, 165, 233, 0.3);
}

body[data-theme="gala"] { 
    --bg-base: #2a0a0a; 
    --bg-panel: rgba(69, 10, 10, 0.85); 
    --bg-inset: rgba(38, 5, 5, 0.95); 
    --gold-primary: #fbbf24; 
    --gold-hover: #fcd34d; 
    --border-light: rgba(251, 191, 36, 0.3); 
    --border-heavy: rgba(251, 191, 36, 0.6); 
    --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.4);
}

body { 
    font-family: 'Inter', sans-serif; 
    background: radial-gradient(circle at top, var(--bg-panel) 0%, var(--bg-base) 100%); 
    color: var(--text-main); 
    margin: 0; 
    padding: 20px 10px; 
    display: flex; 
    justify-content: center; 
    min-height: 100vh; 
}

::-webkit-scrollbar { width: 8px; } 
::-webkit-scrollbar-track { background: var(--bg-inset); } 
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); }

h1, h2, h3, h4 { font-family: var(--header-font); margin: 0; color: #fff; letter-spacing: 0.5px; }

#main-wrapper { 
    width: 100%; 
    max-width: 1300px; 
    display: grid; 
    grid-template-columns: 2.5fr 1fr; 
    gap: 20px; 
}

.panel { 
    background: var(--bg-panel); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1); 
    display: flex; 
    flex-direction: column; 
    border: 1px solid var(--border-light); 
    overflow: hidden; 
    position: relative;
}

#top-bar { 
    grid-column: 1 / -1; 
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.4));
    backdrop-filter: blur(10px);
    padding: 15px 25px; 
    border-radius: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid var(--border-heavy); 
    box-shadow: var(--shadow-glow);
    font-size: 0.95em; 
    font-weight: 600; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.stat-badge { 
    background: rgba(0,0,0,0.6); 
    padding: 8px 18px; 
    border-radius: 30px; 
    border: 1px solid rgba(255,255,255,0.1); 
    display: flex; 
    align-items: center; 
    gap: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.xp-bar-container { height: 6px; width: 100%; background: rgba(0,0,0,0.8); margin-top: 6px; border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.9); }
.xp-bar { height: 100%; background: linear-gradient(90deg, var(--gold-primary), var(--gold-hover)); width: 0%; transition: width 0.4s ease-out; box-shadow: 0 0 10px var(--gold-primary); }

#news-ticker-container { grid-column: 1 / -1; background: #000; border: 1px solid var(--border-heavy); border-radius: 8px; padding: 6px 12px; font-size: 0.9em; color: var(--gold-primary); display: flex; align-items: center; gap: 15px; box-shadow: inset 0 0 10px rgba(0,0,0,0.8);}
.ticker-label { font-weight: 800; background: var(--gold-primary); color: #000; padding: 3px 8px; border-radius: 4px; font-size: 0.8em; text-transform: uppercase; white-space: nowrap; z-index: 10; letter-spacing: 1px;}
.ticker-wrapper { width: 100%; overflow: hidden; white-space: nowrap; box-sizing: border-box; }
.ticker-text { display: inline-block; padding-left: 100%; animation: scroll-ticker 25s linear infinite; text-shadow: 0 0 5px var(--gold-primary);}
@keyframes scroll-ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

#market-trends { grid-column: 1 / -1; display: flex; gap: 20px; justify-content: center; padding: 12px; background: rgba(0,0,0,0.4); border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); font-size: 0.9em; position: relative; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
.trend-item { display: flex; align-items: center; gap: 6px; font-weight: 600;}
#challenge-banner { position: absolute; right: 15px; color: var(--purple-bm); font-weight: 800; font-size: 0.95em; text-shadow: 0 0 8px var(--purple-bm); }

#tabs { display: flex; background: rgba(0,0,0,0.6); border-bottom: 1px solid var(--border-light); font-size: 0.9em; flex-wrap: wrap;}
.tab { flex: 1; padding: 15px 5px; text-align: center; cursor: pointer; font-family: var(--header-font); color: var(--text-muted); transition: all 0.3s; min-width: 80px; border-bottom: 2px solid transparent; text-transform: uppercase; letter-spacing: 1px; font-weight: 600;}
.tab:hover { color: #fff; background: rgba(255,255,255,0.05); }
.tab.active { background: var(--bg-inset); color: var(--gold-primary); border-bottom: 2px solid var(--gold-primary); text-shadow: 0 0 10px var(--gold-primary);}

.view { display: none; padding: 25px; flex-grow: 1; overflow-y: auto; max-height: 65vh; } 
.view.active { display: block; animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

#auction-stage { text-align: center; padding-bottom: 30px; border-bottom: 1px solid var(--border-light); position: relative;}
.shake { animation: tiltShake 0.4s infinite; }
@keyframes tiltShake { 0% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } 100% { transform: rotate(-1deg); } }

#item-visual { font-size: 6em; margin: 15px 0; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8)); transition: transform 0.3s ease;}
#item-visual:hover { transform: scale(1.05); }
#item-name { color: #fff; font-size: 2em; margin-bottom: 8px; text-shadow: 0 2px 4px rgba(0,0,0,0.5);}
#item-category { font-size: 0.8em; color: var(--gold-primary); text-transform: uppercase; letter-spacing: 3px; font-weight: 800;}
.auc-type { display:inline-block; padding: 3px 8px; background: var(--danger); color: white; font-size: 0.6em; font-weight: 800; border-radius: 4px; margin-left: 10px; vertical-align: middle; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);}
#est-value { color: var(--text-main); font-size: 1em; margin: 20px 0; padding: 10px 20px; background: rgba(0,0,0,0.4); display: inline-block; border-radius: 8px; border: 1px dashed var(--gold-primary); font-weight: 600;}

#bid-status { font-family: var(--header-font); font-size: 3em; color: var(--gold-primary); margin: 15px 0; position: relative; text-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
#ui-leader { font-family: 'Inter', sans-serif; font-size: 0.3em; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; display: block; margin-top: 5px;}

.controls-row { display: grid; gap: 15px; margin-top: 25px; } 
.grid-4 { grid-template-columns: repeat(4, 1fr); } 
.grid-3 { grid-template-columns: repeat(3, 1fr); } 

button { background: rgba(0,0,0,0.6); color: var(--text-main); border: 1px solid rgba(255,255,255,0.1); padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.9em; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 6px rgba(0,0,0,0.3);}
button:hover:not(:disabled) { background: rgba(255,255,255,0.05); border-color: var(--gold-primary); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.5), 0 0 10px rgba(212, 175, 55, 0.2);}
button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 4px rgba(0,0,0,0.5);} 
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-gold { background: linear-gradient(135deg, var(--gold-primary), #997a00); color: #000; border: none; font-weight: 800; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4); text-shadow: 0 1px 1px rgba(255,255,255,0.3);}
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, var(--gold-hover), var(--gold-primary)); color: #000; box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);}
.btn-pass { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.btn-pass:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #fff; box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);}

.grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; margin-top: 20px;}
.card { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); padding: 18px; border-radius: 10px; font-size: 0.9em; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.2);}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.15);}
.card h4 { color: var(--gold-primary); margin-bottom: 10px; font-size: 1.2em; font-family: 'Inter', sans-serif;}

input[type="number"], select { background: rgba(0,0,0,0.8); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 10px; border-radius: 6px; width: 100%; box-sizing: border-box; margin-bottom: 10px; font-family: 'Inter', sans-serif; transition: border-color 0.2s;}
input[type="number"]:focus, select:focus { outline: none; border-color: var(--gold-primary); box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);}

.right-col-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; } 
.right-col-section h3 { padding: 15px; background: rgba(0,0,0,0.6); border-bottom: 1px solid var(--border-light); font-size: 1.1em; text-align: center; margin-bottom: 0; text-transform: uppercase; letter-spacing: 2px;}

#log-container { flex: 1; overflow-y: auto; padding: 15px; background: var(--bg-inset); font-size: 0.85em; line-height:1.5; font-family: monospace;}
.log-entry { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,0.05); }
.log-win { color: var(--success); text-shadow: 0 0 5px rgba(16, 185, 129, 0.3); } 
.log-loss { color: var(--danger); text-shadow: 0 0 5px rgba(239, 68, 68, 0.3); } 
.log-sys { color: var(--accent-blue); text-shadow: 0 0 5px rgba(59, 130, 246, 0.3); } 

#lb-content { padding: 15px; overflow-y: auto; max-height: 280px; background: var(--bg-inset); }
.lb-entry { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: rgba(0,0,0,0.4); margin-bottom: 8px; border-left: 4px solid #555; border-radius: 6px; font-size: 0.9em; cursor:pointer; transition: all 0.2s;}
.lb-entry:hover { background: rgba(255,255,255,0.05); transform: translateX(5px); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 100; justify-content: center; align-items: center; backdrop-filter: blur(5px);}
.modal-content { background: var(--bg-panel); padding: 30px; border-radius: 12px; border: 1px solid var(--gold-primary); width: 450px; text-align: center; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.9), 0 0 30px rgba(212, 175, 55, 0.15);}

#minigame-area { width: 100%; height: 40px; background: rgba(0,0,0,0.8); margin: 25px 0; position: relative; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);}
#mg-target { position: absolute; height: 100%; background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), var(--success), rgba(16, 185, 129, 0.5)); width: 50px; left: 50%; transform: translateX(-50%); opacity: 0.8; box-shadow: 0 0 15px var(--success);}
#mg-cursor { position: absolute; height: 100%; width: 4px; background: #fff; left: 0; box-shadow: 0 0 10px #fff;}