:root {
    --bg-color: #0c0a09; /* stone-950 */
    --surface-color: #1c1917; /* stone-900 */
    --primary-color: #a855f7; /* purple-500 */
    --text-color: #e7e5e4; /* stone-200 */
    --border-color: #44403c; /* stone-700 */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

/* --- Screens --- */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    animation: fadeIn 0.5s forwards;
}
.screen.active {
    display: flex;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Main Menu --- */
.main-menu-bg {
    background-image: linear-gradient(rgba(12, 10, 9, 0.8), var(--bg-color)), url('https://lh3.googleusercontent.com/gg-dl/AJfQ9KRsgNpReOO3JQz_O7nYSoY-bLBeGQTYu70K4YHDJGgOj1Ke2aIRhBBCpKwhe9NulE3_YbrmchFuYE2SV9gbA6eODI54F2bS5jI3yBKi4GnudAKVRSuntCfCrOAowrhrBL0pKRgAC4yZqEAH57M6MtZBoQunvSJnMRzaCXN-eD6OpPY=s1024');
    background-size: cover;
    background-position: center;
}
.menu-button {
    background-color: rgba(28, 25, 23, 0.7);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.menu-button:hover {
    background-color: rgba(28, 25, 23, 0.9);
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 0 12px var(--primary-color);
}

/* --- Rarity Styles --- */
.legendary { --rarity-color: #facc15; }
.epic { --rarity-color: #a855f7; }
.rare { --rarity-color: #3b82f6; }
.uncommon { --rarity-color: #22c55e; }
.common { --rarity-color: #a1a1aa; }

.rarity-glow {
    text-shadow: 0 0 5px var(--rarity-color);
}
.rarity-text { color: var(--rarity-color); }
.rarity-border { border-color: var(--rarity-color); }

/* --- Improved Card Design --- */
.card-container {
    perspective: 1500px;
}
.card {
    background-color: #262626;
    border: 1px solid var(--border-color);
    transition: transform 0.4s, box-shadow 0.4s;
    transform-style: preserve-3d;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}
.card-container:hover .card {
    transform: translateY(-10px) scale(1.05) rotateX(5deg);
    box-shadow: 0 0 10px var(--rarity-color), 0 5px 30px rgba(0,0,0,0.6);
}

.card-header {
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
    border-bottom: 2px solid var(--rarity-color);
    padding: 8px;
}

.card-image-bg {
     background: radial-gradient(circle, var(--rarity-color) 0%, rgba(0,0,0,0) 60%), linear-gradient(45deg, #222, #111);
     background-blend-mode: screen;
     border: 2px solid #333;
}

/* --- Stat Bars for Viewer --- */
.stats-bar-bg { background-color: #3f3f46; /* zinc-700 */ }
.stats-bar { transition: width 0.5s ease-out; }

/* --- Deck Builder Tabs --- */
.tab-btn {
    border-bottom: 4px solid transparent;
    transition: all 0.3s ease;
}
.tab-btn.active {
    border-bottom-color: var(--primary-color);
    background-color: rgba(168, 85, 247, 0.1);
}

/* --- Battle Screen --- */
.battle-ground {
    flex-grow: 1;
    background-image: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 60%);
    border: 2px solid var(--border-color);
}

.battle-controls {
    width: 320px;
    flex-shrink: 0;
}

#card-wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#card-wheel-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 20px solid var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.wheel-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 140px;
    margin-top: -70px;
    margin-left: -50px;
    transform-origin: center;
    transition: all 0.5s ease;
    backface-visibility: hidden;
    border: 2px solid var(--border-color);
    opacity: 0.8;
    filter: grayscale(50%);
}

.wheel-card.selected {
    transform: var(--transform-base) scale(1.2) !important;
    opacity: 1;
    filter: grayscale(0%);
    border-color: var(--primary-color);
    box-shadow: 0 0 12px var(--primary-color);
    z-index: 10;
}

