/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&display=swap');

:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --accent: #3B82F6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --common: #94a3b8;
    --uncommon: #4ade80;
    --rare: #60a5fa;
    --epic: #c084fc;
    --legendary: #fbbf24;
    --mythical: #f43f5e;
    --godtier: #00ffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header & Stats */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.player-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.currency { color: #FCD34D; }
.rank { color: #A78BFA; }

/* Navigation */
nav {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    justify-content: center;
}

.nav-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.nav-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* Expedition Map */
.map-container {
    width: 100%;
    height: 600px;
    background: url('https://images.unsplash.com/photo-1524661135-423995f22d0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80') center/cover;
    border-radius: 20px;
    position: relative;
    border: 2px solid var(--glass-border);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
}

.map-marker {
    position: absolute;
    padding: 0.5rem 1rem;
    background: rgba(10, 10, 20, 0.8);
    border: 2px solid;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 10;
    transition: all 0.3s ease;
}
.map-marker:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.marker-green { color: #4caf50; border-color: #4caf50; box-shadow: 0 0 15px #4caf50; }
.marker-blue { color: #2196f3; border-color: #2196f3; box-shadow: 0 0 15px #2196f3; }
.marker-yellow { color: #ffeb3b; border-color: #ffeb3b; box-shadow: 0 0 15px #ffeb3b; }
.marker-red { color: #f44336; border-color: #f44336; box-shadow: 0 0 15px #f44336; }
.marker-rainbow { 
    color: #fff; 
    animation: rainbowBorder 2s infinite linear; 
}
.marker-black { 
    color: #ffeb3b; 
    background: #000;
    border-color: #ffeb3b;
    box-shadow: 0 0 20px #ffeb3b;
    animation: blackShock 0.8s infinite alternate; 
}

@keyframes rainbowBorder {
    0% { border-color: #ff0000; box-shadow: 0 0 15px #ff0000; }
    33% { border-color: #00ff00; box-shadow: 0 0 15px #00ff00; }
    66% { border-color: #0000ff; box-shadow: 0 0 15px #0000ff; }
    100% { border-color: #ff0000; box-shadow: 0 0 15px #ff0000; }
}
@keyframes blackShock {
    0% { box-shadow: 0 0 15px #ffeb3b; border-color: #ffeb3b; }
    100% { box-shadow: 0 0 50px #fff, 0 0 20px #ffeb3b; border-color: #fff; color: #fff;}
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.risk-content {
    background: rgba(40, 5, 5, 0.95);
    border: 3px solid #ff0000;
    box-shadow: 0 0 40px #ff0000;
    text-align: center;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 12px;
}
.risk-content h2 {
    color: #ff4444;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: flashRisk 1s infinite;
}
.risk-content p {
    margin-bottom: 1rem;
}
@keyframes flashRisk {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.btn-action {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-action:hover {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
    transform: scale(1.05);
}

.btn-action:disabled {
    background: #475569;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Timer styles */
.timer-text {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    margin: 1rem 0;
}

/* Preparation grid and team */
.prep-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    height: 600px;
}

.char-list, .team-list {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    overflow-y: auto;
}

.char-list h2, .team-list h2 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748B; }

.char-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.char-card:hover {
    transform: translateX(5px);
    background: rgba(255,255,255,0.05);
}

.char-card.in-team {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.char-info h3 { margin-bottom: 0.2rem; font-size: 1.1rem; }
.char-stats { font-size: 0.85rem; color: var(--text-secondary); display: flex; gap: 1rem; }
.tier-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.2rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-bottom-left-radius: 8px;
}

/* Tiers */
.tier-common { background: var(--common); color: #0f172a; }
.tier-uncommon { background: var(--uncommon); color: #0f172a; }
.tier-rare { background: var(--rare); color: #0f172a; }
.tier-epic { background: var(--epic); color: white; }
.tier-legendary { background: var(--legendary); color: #0f172a; text-shadow: 0 0 5px white; }
.tier-mythical { background: var(--mythical); color: white; text-shadow: 0 0 5px white; box-shadow: 0 0 10px var(--mythical); }
.tier-god-tier { 
    background: linear-gradient(45deg, #00ffff, #ff00ff); 
    color: white; 
    font-weight: 900; 
    text-shadow: 0 0 10px white; 
    box-shadow: 0 0 20px #00ffff;
}

/* Gacha */
.gacha-container {
    text-align: center;
    padding: 4rem 0;
}

.gacha-machine {
    width: 300px;
    height: 300px;
    margin: 0 auto 3rem;
    background: radial-gradient(circle, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 4px solid var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 0 50px var(--accent-glow), inset 0 0 30px rgba(0,0,0,0.8);
}

.gacha-machine::after {
    content: '🔮';
    font-size: 6rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.pull-result {
    margin-top: 2rem;
    min-height: 150px;
}

.pull-card {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid transparent;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Utility */
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* Gacha Animations */
.gacha-animating {
    animation: shake 0.1s linear infinite;
    box-shadow: 0 0 100px var(--legendary), inset 0 0 50px rgba(255,255,255,0.8);
    border-color: #fff;
}

.gacha-animating::after {
    animation: spinFlash 0.3s linear infinite;
}

@keyframes shake {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes spinFlash {
    0% { transform: scale(1) rotate(0deg); filter: brightness(1); }
    50% { transform: scale(1.3) rotate(180deg); filter: brightness(2); }
    100% { transform: scale(1) rotate(360deg); filter: brightness(1); }
}

.bam-effect {
    animation: bam 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bam {
    0% { transform: scale(0); opacity: 0; filter: drop-shadow(0 0 50px white); }
    50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 0px transparent); }
    100% { transform: scale(1); opacity: 1; }
}
