:root {
    --primary-bg: #101024;
    --secondary-bg: #1c1c3a;
    --card-bg: #2a2a52;
    --accent-color: #f03a70;
    --text-color: #e8e8ff;
    --gem-color: #ffd700;
    --rarity-common: #95a5a6;
    --rarity-uncommon: #2ecc71;
    --rarity-rare: #3498db;
    --rarity-epic: #9b59b6;
    --rarity-legendary: #f39c12;
    --rarity-mythique: #e74c3c;
    --rarity-inhumain: #ff00ff;
    --rarity-jackpot: linear-gradient(45deg, #f39c12, #e74c3c, #9b59b6, #3498db);
    --font-main: 'Roboto', sans-serif;
    --font-title: 'Orbitron', sans-serif;
    --theme-bg-default: #0d0d1a;
    --theme-bg-rich: #051a05;
    --theme-bg-legendary: #2a1f03;
    --theme-bg-prestige1: #1a0e24;
    --theme-accent-prestige1: #d050f0;
    --accent-color-rgb: 240, 58, 112; 
    --gem-color-rgb: 255, 215, 0;    
    --rarity-uncommon-rgb: 46, 204, 113; 
    --rarity-rare-rgb: 52, 152, 219; 
    --main-bg-rgb: 20, 20, 40; 
    --secondary-bg-rgb: 30, 30, 50; 
    --accent-color-rgb: 240, 58, 112; 
}

body {
    font-family: var(--font-main);
    background-color: var(--theme-bg-default);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    font-size: 16px;
    overflow-x: hidden;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

body[data-theme="rich"] {
    background-color: var(--theme-bg-rich);
}

body[data-theme="legendary"] {
    background-color: var(--theme-bg-legendary);
}

body[data-theme="prestige1"] {
    background-color: var(--theme-bg-prestige1);
    --accent-color: var(--theme-accent-prestige1);
}

body[data-highlight-rarity="commun"] {
    background-image: radial-gradient(circle at center, rgba(149, 165, 166, 0.15) 0%, transparent 70%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="inhabituel"] {
    background-image: radial-gradient(circle at center, rgba(46, 204, 113, 0.15) 0%, transparent 70%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="rare"] {
    background-image: radial-gradient(circle at center, rgba(52, 152, 219, 0.15) 0%, transparent 70%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="epique"] {
    background-image: radial-gradient(circle at center, rgba(155, 89, 182, 0.15) 0%, transparent 70%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="legendaire"] {
    background-image: radial-gradient(circle at center, rgba(243, 156, 18, 0.25) 0%, transparent 80%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="mythique"] {
    background-image: radial-gradient(circle at center, rgba(231, 76, 60, 0.20) 0%, transparent 80%);
    transition: background-image 0.5s ease;
}

body[data-highlight-rarity="inhumain"] {
    background-image: radial-gradient(circle at center, rgba(255, 0, 255, 0.25) 0%, transparent 80%);
    transition: background-image 0.5s ease;
}

#background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkleFloat 4s infinite ease-in-out;
}

@keyframes twinkleFloat {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.7) translateY(0px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateY(-10px);
    }
}

.visual-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

#jackpot-overlay.active {
    opacity: 1;
    animation: jackpotLights 0.15s linear infinite alternate, jackpotFadeOutStrong 2.5s 1.5s forwards;
}

@keyframes jackpotLights {
    0% {
        box-shadow: inset 0 0 120px 60px var(--rarity-legendary), 0 0 60px 30px var(--rarity-epic);
    }
    100% {
        box-shadow: inset 0 0 150px 75px var(--rarity-epic), 0 0 80px 40px var(--rarity-legendary);
    }
}

@keyframes jackpotFadeOutStrong {
    to {
        opacity: 0;
    }
}

#prestige-overlay.active {
    display: flex;
    opacity: 1;
    background-color: rgba(10,10,30,0.9);
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    color: white;
    font-family: var(--font-title);
    animation: fadeInPrestige 0.5s ease-out, prestigeShine 3s ease-in-out forwards;
}

#prestige-overlay h2 {
    font-size: 4.5em;
    color: var(--gem-color);
    text-shadow: 0 0 25px var(--gem-color), 0 0 50px #fff;
    margin-bottom: 25px;
    animation: pulsePrestigeTitle 1.2s infinite alternate;
}

#prestige-overlay p {
    font-size: 1.8em;
    margin: 12px 0;
    letter-spacing: 1px;
}

@keyframes fadeInPrestige {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulsePrestigeTitle {
    from {
        transform: scale(1);
        text-shadow: 0 0 20px var(--gem-color), 0 0 40px #fff;
    }
    to {
        transform: scale(1.08);
        text-shadow: 0 0 30px var(--gem-color), 0 0 60px #fff;
    }
}

@keyframes prestigeShine {
    0% {
        box-shadow: inset 0 0 0 0 rgba(255,223,0,0.3);
    }
    50% {
        box-shadow: inset 0 0 200px 100px rgba(255,223,0,0.5);
    }
    100% {
        box-shadow: inset 0 0 0 0 rgba(255,223,0,0.3);
        opacity: 0;
    }
}

.container {
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.7);
    width: 95%;
    max-width: 950px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 20px;
    transition: border-bottom-color 0.8s ease-in-out;
}

header h1 {
    color: var(--accent-color);
    font-family: var(--font-title);
    font-size: 2.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 15px var(--accent-color);
    transition: color 0.8s ease-in-out, text-shadow 0.8s ease-in-out;
}

#prestige-level-display {
    font-size: 0.6em; 
    vertical-align: middle;
    margin-left: 10px;
    padding: 4px 10px; 
    border-radius: 20px; 
    background: linear-gradient(145deg, var(--rarity-mythic, #c0392b), var(--rarity-legendary, #f39c12)); 
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); 
    display: inline-flex; 
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    transition: transform 0.2s ease-out;
}

#prestige-level-display::before {
    content: "🌟"; 
    margin-right: 5px;
    font-size: 1.1em; 
}

.prestige-info-card { 
    background-color: rgba(var(--theme-accent-rgb, 75, 0, 130), 0.15);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px; 
    border: 1px solid rgba(var(--theme-accent-rgb, 75, 0, 130), 0.4);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.prestige-info-card p {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 1.05em; 
    color: var(--text-color);
}

.prestige-info-card strong#current-prestige-level {
    color: var(--rarity-legendary, #f39c12); 
    font-size: 1.2em; 
    padding: 2px 6px;
    background-color: rgba(var(--rarity-legendary-rgb, 243, 156, 18), 0.1);
    border-radius: 4px;
}

.prestige-info-card em#next-prestige-bonus {
    color: var(--rarity-epic, #9b59b6); 
    display: block; 
    margin-top: 5px;
}

#prestige-requirement {
    font-size: 1em;
    color: var(--text-color-medium, #aaa);
    text-align: center; 
    padding-top: 10px;
    border-top: 1px dashed rgba(var(--theme-accent-rgb, 75, 0, 130), 0.3);
    margin-top: 15px;
}

#stats-content h3 {
    margin-bottom: 15px; 
}

#streak-display {
    font-size: 0.5em;
    color: var(--gem-color);
    margin-left: 10px;
    vertical-align: middle;
}

.player-stats-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.1em;
}

.stat-item {
    margin: 0 10px;
    position: relative;
}

#gem-animation-zone {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    pointer-events: none;
}

.gem-particle {
    position: absolute;
    width: 10px;
    height: 12px;
    background-color: var(--gem-color);
    border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
    box-shadow: 0 0 6px var(--gem-color), inset 0 0 2px white;
    animation: flyToGemCount 0.7s cubic-bezier(0.5, -0.5, 0.8, 1.5) forwards;
    opacity: 0;
}

#help-btn {
    background: linear-gradient(145deg, var(--button-secondary-bg, #3498db), var(--button-bg, #2980b9)); 
    border-color: var(--button-secondary-bg, #3498db);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

#help-btn:hover {
    border-color: white;
    box-shadow: 0 5px 15px rgba(var(--button-secondary-bg-rgb, 52, 152, 219), 0.4), inset 0 -1px 2px rgba(0,0,0,0.1);
}

@keyframes flyToGemCount {
    0% {
        transform: translate(var(--randXStart), var(--randYStart)) scale(1.8);
        opacity: 1;
    }
    100% {
        transform: translate(0px, 25px) scale(0.1);
        opacity: 0;
    }
}

#gem-count {
    color: var(--gem-color);
    font-weight: bold;
}

.gem-icon {
    color: var(--gem-color);
}

.game-controls-header {
    margin-top: 10px;
    font-size: 0.9em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.game-controls-header button {
    padding: 10px 18px; 
    font-size: 0.95em;
    font-weight: bold; 
    border-radius: 25px; 
    border: 2px solid transparent; 
    cursor: pointer;
    transition: all 0.25s ease-out;
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 -2px 3px rgba(0,0,0,0.2);
    background-color: var(--button-bg, #4a4a8a); 
    color: var(--button-text-color, white); 
    margin: 0 5px; 
}

.game-controls-header button:hover {
    transform: translateY(-2px) scale(1.03); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 -1px 2px rgba(0,0,0,0.1);
    filter: brightness(1.15); 
}

.game-controls-header button:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 1px 3px rgba(0,0,0,0.3);
    filter: brightness(0.9);
}

.game-controls-header .turbo-label {
    margin-right: 8px; 
    font-weight: bold;
    color: var(--text-color-lighter);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px; 
    height: 26px; 
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a5a; 
    border-radius: 26px; 
    transition: background-color 0.3s ease-out, box-shadow 0.2s ease-out;
    border: 1px solid #2c2c4a;
}

.slider:before { 
    position: absolute;
    content: "";
    height: 20px; 
    width: 20px;  
    left: 3px;
    bottom: 3px;
    background-color: #b0b0d0; 
    border-radius: 50%;
    transition: transform 0.3s ease-out, background-color 0.3s ease-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent-color);
    border-color: color-mix(in srgb, var(--accent-color) 60%, black);
    box-shadow: 0 0 8px rgba(var(--accent-color-rgb, 240, 58, 112), 0.5); 
}

.toggle-switch input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb, 240, 58, 112), 0.4); 
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px); 
    background-color: white; 
}

.toggle-switch .slider:hover {
    background-color: #4f4f7a;
}
.toggle-switch input:checked + .slider:hover {
    background-color: color-mix(in srgb, var(--accent-color) 80%, black);
}

.game-controls-header button {
    background-color: var(--rarity-rare);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.game-controls-header button:hover {
    background-color: color-mix(in srgb, var(--rarity-rare) 80%, black);
    transform: scale(1.03);
}

main > section {
    margin-bottom: 30px;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

main > section > h2 {
    color: var(--accent-color);
    text-align: left;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #3c3c6a;
    font-family: var(--font-title);
    font-size: 1.6em;
    transition: color 0.8s ease-in-out, border-bottom-color 0.8s ease-in-out;
}

#lootbox-options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.lootbox {
    border: 3px solid transparent;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    background-color: #383864;
    transition: transform 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.box-info-circle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    z-index: 2;
    padding: 0;
    font-style: italic;
}

.box-info-circle:hover {
    background-color: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.lootbox:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 18px color-mix(in srgb, var(--accent-color) 50%, transparent);
}

.lootbox .content-wrapper {
    cursor: pointer;
    flex-grow: 1;
}

/* .lootbox .box-info-button {
    font-size: 0.8em;
    padding: 3px 6px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
    display: inline-block;
} */

.lootbox .box-info-button:hover {
    background-color: rgba(255,255,255,0.2);
}

.lootbox h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.3em;
    font-family: var(--font-title);
}

.lootbox p {
    font-size: 0.9em;
    color: #bdc3f7;
    margin-bottom: 8px;
}

.lootbox .cost {
    font-weight: bold;
    color: var(--gem-color);
    font-size: 1.2em;
}

.lootbox .box-emoji {
    font-size: 1.5em;
    vertical-align: middle;
}

.lootbox .pity-info {
    font-size: 0.75em;
    color: #8a8ac7;
}

.lootbox .quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.lootbox .quantity-selector label {
    font-size: 0.9em;
    margin-right: 8px;
    color: #c0c0ff;
}

.lootbox .quantity-selector input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #50507a;
    background-color: #1c1c3a;
    color: var(--text-color);
    text-align: center;
    font-size: 1em;
    -moz-appearance: textfield;
    transition: border-color 0.2s, box-shadow 0.2s; 
}

.lootbox .quantity-selector input[type="number"]:focus { 
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(var(--accent-color-rgb, 240, 58, 112), 0.5);
    outline: none;
}

.lootbox .quantity-selector input[type="number"]::-webkit-outer-spin-button,
.lootbox .quantity-selector input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.opening-area {
    text-align: center;
}

#opening-title {
    transition: color 0.3s ease;
}

#box-animation-container {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#box-visual {
    font-size: 5em;
    cursor: default;
    transition: transform 0.3s ease-in-out;
    animation: idleBoxFloat 3s ease-in-out infinite;
}

@keyframes idleBoxFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 0 5px transparent;
    }
    50% {
        transform: translateY(-8px) scale(1.05);
        text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
}

#box-visual.opening {
    animation: boxOpenShakeDramatic 1s cubic-bezier(.36,.07,.19,.97) forwards;
}

@keyframes boxOpenShakeDramatic {
    0% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    10% {
        transform: scale(1.2) rotate(-10deg);
    }
    20% {
        transform: scale(1.2) rotate(10deg);
    }
    30% {
        transform: scale(1.2) rotate(-10deg);
    }
    40% {
        transform: scale(1.2) rotate(10deg);
    }
    60% {
        transform: scale(1.4) rotate(0deg) translateY(-10px);
        filter: brightness(1.8) drop-shadow(0 0 20px var(--accent-color));
    }
    80% {
        transform: scale(1.5) rotate(0deg) translateY(-15px);
        filter: brightness(2.2) drop-shadow(0 0 30px white);
    }
    100% {
        transform: scale(0.1) rotate(180deg) translateY(50px);
        opacity: 0;
        filter: brightness(3) drop-shadow(0 0 40px white);
    }
}

#multi-roulette-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    max-height: calc(110px * 4 + 10px * 3);
    overflow-y: auto;
    padding: 5px;
}

#multi-roulette-wrapper::-webkit-scrollbar {
    width: 6px;
}

#multi-roulette-wrapper::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 3px;
}

#multi-roulette-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 3px;
}

.roulette-instance {
    width: 100%;
    max-width: 650px;
    height: 110px;
    background-color: #080818;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 12px rgba(240, 58, 112, 0.3);
    animation: fadeInRoulette 0.4s ease-out;
}

@keyframes fadeInRoulette {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.roulette-instance .roulette-track {
    display: flex;
    position: absolute;
    left: 0;
    height: 100%;
}

.roulette-instance .roulette-selector {
    position: absolute;
    left: 50%;
    top: -4px;
    bottom: -4px;
    width: 4px;
    background-image: linear-gradient(to bottom, var(--gem-color), #fff8dc, var(--gem-color));
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 12px var(--gem-color);
    border-radius: 2px;
    animation: pulseSelector 1.2s infinite alternate ease-in-out;
}

@keyframes pulseSelector {
    from {
        box-shadow: 0 0 10px var(--gem-color), 0 0 2px white;
        transform: scaleY(1);
    }
    to {
        box-shadow: 0 0 20px var(--gem-color), 0 0 5px white;
        transform: scaleY(1.05);
    }
}

.roulette-instance .roulette-item {
    width: 80px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px 3px;
    box-sizing: border-box;
    border-right: 1px solid #1a1a3a;
    position: relative;
    filter: brightness(0.9);
    opacity: 0.95;
    transition: filter 0.1s ease, transform 0.1s ease, opacity 0.1s;
}

.roulette-instance .roulette-item.is-selected {
    filter: brightness(1.3) saturate(1.3) drop-shadow(0 0 6px var(--gem-color));
    transform: scale(1.12);
    opacity: 1;
    z-index: 1;
}

.roulette-instance .roulette-item .item-emoji {
    font-size: 2.2em;
    margin-bottom: 5px;
    line-height: 1;
}

.roulette-instance .roulette-item .item-name-preview {
    font-size: 0.55em;
    text-align: center;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 95%;
    font-weight: bold;
    padding: 1px 0;
    border-radius: 2px;
}

.roulette-instance .roulette-item.rarity-bg-commun {
    background-color: color-mix(in srgb, var(--rarity-common) 15%, transparent);
}

.roulette-instance .rarity-bg-commun .item-name-preview {
    color: var(--rarity-common);
}

.roulette-instance .roulette-item.rarity-bg-inhabituel {
    background-color: color-mix(in srgb, var(--rarity-uncommon) 15%, transparent);
}

.roulette-instance .rarity-bg-inhabituel .item-name-preview {
    color: var(--rarity-uncommon);
}

.roulette-instance .roulette-item.rarity-bg-rare {
    background-color: color-mix(in srgb, var(--rarity-rare) 20%, transparent);
}

.roulette-instance .rarity-bg-rare .item-name-preview {
    color: var(--rarity-rare);
}

.roulette-instance .roulette-item.rarity-bg-epique {
    background-color: color-mix(in srgb, var(--rarity-epic) 25%, transparent);
}

.roulette-instance .rarity-bg-epique .item-name-preview {
    color: var(--rarity-epic);
}

.roulette-instance .roulette-item.rarity-bg-legendaire {
    background-color: color-mix(in srgb, var(--rarity-legendary) 30%, transparent);
}

.roulette-instance .rarity-bg-legendaire .item-name-preview {
    color: var(--rarity-legendary);
}

.roulette-instance .roulette-item.rarity-bg-mythique {
    background-color: color-mix(in srgb, var(--rarity-mythique) 30%, transparent);
}

.roulette-instance .rarity-bg-mythique .item-name-preview {
    color: var(--rarity-mythique);
}

.roulette-instance .roulette-item.rarity-bg-inhumain {
    background-color: color-mix(in srgb, var(--rarity-inhumain) 35%, transparent);
}

.roulette-instance .rarity-bg-inhumain .item-name-preview {
    color: var(--rarity-inhumain);
}

#item-won-display {
    padding: 20px;
    border-radius: 8px;
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a3a;
    border: 1px dashed #3c3c6a;
    position: relative;
    overflow: hidden;
}

#item-won-display.visible {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#item-won-display .item-card {
    border-width: 4px;
    animation: itemFinalRevealDramatic 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center;
    box-shadow: 0 0 15px -2px var(--glow-color, transparent) !important;
}

@keyframes itemFinalRevealDramatic {
    0% {
        opacity: 0;
        transform: scale(0.4) rotateY(120deg) translateY(60px);
        filter: blur(6px);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3) rotateY(-20deg) translateY(0px);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: scale(1.15) rotateY(0deg) translateY(0px);
        filter: blur(0px);
    }
}

#item-won-display.hidden-by-multi-roulette,
#multi-open-results-display.hidden-by-multi-roulette {
    display: none !important;
}

.item-card.legendary-reveal::before,
.item-card.mythique-reveal::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: conic-gradient(transparent, var(--rarity-legendary) 15%, transparent 35%);
    animation: rotateRayFull 2.5s linear infinite;
    z-index: 0;
    opacity: 0.8;
}

.item-card.mythique-reveal::before {
    background-image: conic-gradient(transparent, var(--rarity-mythique) 15%, transparent 35%);
    animation-duration: 2s;
}

.item-card.epic-reveal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, color-mix(in srgb, var(--rarity-epic) 50%, transparent) 0%, transparent 65%);
    animation: epicPulseFullCard 1.2s ease-out infinite alternate;
    z-index: 0;
}

@keyframes rotateRayFull {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes epicPulseFullCard {
    from {
        transform: scale(0.85);
        opacity: 0.7;
    }
    to {
        transform: scale(1.15);
        opacity: 0.3;
    }
}

#multi-open-results-display {
    display: none;
    padding: 15px;
    margin-top: 20px;
    background-color: #1a1a3a;
    border-radius: 8px;
    text-align: center;
}

#multi-open-results-display h4 {
    width: 100%;
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 10px;
}

#multi-open-results-display .results-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

#multi-open-results-display .results-grid .item-card {
    transform: scale(0.9);
    min-width: 130px;
    animation: revealGridItem 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

#multi-open-results-display .results-grid::-webkit-scrollbar {
    width: 8px;
}

#multi-open-results-display .results-grid::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 4px;
}

#multi-open-results-display .results-grid::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}

@keyframes revealGridItem {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px) rotateX(-45deg);
    }
    60% {
        opacity: 1;
        transform: scale(0.95) translateY(-5px) rotateX(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(0.9) translateY(0) rotateX(0deg);
    }
}

.feedback-message {
    margin-top: 15px;
    font-style: italic;
    min-height: 1.3em;
    font-size: 1.1em;
    font-weight: bold;
    animation: fadeInSlideUpFeedback 0.3s ease-out forwards; 
}

@keyframes fadeInSlideUpFeedback { 
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-success {
    color: var(--rarity-uncommon);
    text-shadow: 0 0 5px var(--rarity-uncommon);
}

.feedback-error {
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

.feedback-info,
.feedback-info_sticky {
    color: #a7c0f7;
}

.feedback-jackpot {
    font-size: 1.5em !important;
    background: var(--rarity-jackpot);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: jackpotTextGlow 1.5s ease-in-out infinite alternate;
}

@keyframes jackpotTextGlow {
    from {
        text-shadow: 0 0 10px #fff, 0 0 20px var(--rarity-legendary), 0 0 30px var(--rarity-epic);
    }
    to {
        text-shadow: 0 0 20px #fff, 0 0 30px var(--rarity-legendary), 0 0 40px var(--rarity-epic);
    }
}

#claim-daily-reward-btn {
    background-color: var(--rarity-uncommon);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 15px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#claim-daily-reward-btn:hover {
    background-color: color-mix(in srgb, var(--rarity-uncommon) 80%, black);
    transform: scale(1.05);
}

#claim-daily-reward-btn:disabled {
    margin-bottom: 15px;
    background-color: #555;
    cursor: not-allowed;
}

.player-info-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid #3c3c6a;
}

.tab-button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #a7c0f7;
    border-bottom: 3px solid transparent;
    margin-right: 10px;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.tab-button.active,
.tab-button:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.tab-content.active {
    display: flex; 
    flex-direction: column; 
    opacity: 1;
    transform: translateY(0);
}

#inventory-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    background-color: #1a1a3a;
    border-radius: 6px;
}

#inventory-items-container::-webkit-scrollbar {
    width: 10px;
}

#inventory-items-container::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 5px;
}

#inventory-items-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 5px;
}

.item-card {
    padding: 15px;
    border-radius: 8px;
    background-color: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
    border-left: 6px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.item-card.rarity-commun {
    border-left-color: var(--rarity-common);
}

.item-card.rarity-commun .item-name {
    color: var(--rarity-common);
}

.item-card.rarity-inhabituel {
    border-left-color: var(--rarity-uncommon);
}

.item-card.rarity-inhabituel .item-name {
    color: var(--rarity-uncommon);
}

.item-card.rarity-rare {
    border-left-color: var(--rarity-rare);
}

.item-card.rarity-rare .item-name {
    color: var(--rarity-rare);
}

.item-card.rarity-epique {
    border-left-color: var(--rarity-epic);
}

.item-card.rarity-epique .item-name {
    color: var(--rarity-epic);
}

.item-card.rarity-legendaire {
    border-left-color: var(--rarity-legendary);
}

.item-card.rarity-legendaire .item-name {
    color: var(--rarity-legendary);
}

.item-card.rarity-mythique {
    border-left-color: var(--rarity-mythique);
}

.item-card.rarity-mythique .item-name {
    color: var(--rarity-mythique);
}

.item-card.rarity-inhumain {
    border-left-color: var(--rarity-inhumain);
}

.item-card.rarity-inhumain .item-name {
    color: var(--rarity-inhumain);
}

.item-card .item-emoji {
    font-size: 2.8em;
    margin-bottom: 10px;
    line-height: 1;
}

.item-card .item-name {
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 6px;
    min-height: 2.3em;
}

.item-card .item-rarity {
    font-size: 0.85em;
    margin-bottom: 10px;
    font-style: italic;
    color: #a7c0de;
}

.item-card .item-sell-value {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: var(--gem-color);
}

.item-card .item-sell-value .gem-icon {
    font-size: 0.9em;
}

.item-card button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-size: 0.95em;
    font-weight: bold;
    width: 95%;
}

.item-card button:hover {
    background-color: #d6304b;
    transform: scale(1.05);
}

.item-card button:active {
    transform: scale(0.98);
}

#player-stats-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px; 
}

#quests-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px; 
}

#quests-list li.quest-claimed-animation {
      animation: questClaimedEffect 1s ease-out;
}

@keyframes questClaimedEffect {
    0% { background-color: transparent; transform: scale(1); }
    50% { background-color: var(--rarity-uncommon-transparent); transform: scale(1.05); } 
    100% { background-color: transparent; transform: scale(1); }
}

#player-stats-list li {
    background-color: rgba(30, 30, 60, 0.7); 
    padding: 18px 20px; 
    border-radius: 8px;
    border-left: 5px solid var(--accent-color); 
    font-size: 1.1em; 
    color: var(--text-color);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    box-shadow: 0 3px 7px rgba(0,0,0,0.3);
    line-height: 1.5;
}

#quests-list li {
    background-color: rgba(42, 42, 82, 0.85); 
    padding: 20px;
    border-radius: 10px; 
    border-left: 6px solid var(--accent-color); 
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    color: var(--text-color);  
    font-size: 1.05em;
    line-height: 1.6;
}

#quests-list li:hover {
    transform: translateY(-4px);
    background-color: rgba(50, 50, 90, 0.95);
    box-shadow: 0 6px 16px rgba(var(--accent-color-rgb, 240, 58, 112), 0.25);
}

#player-stats-list li:hover {
    transform: translateY(-4px) scale(1.02);
    background-color: rgba(40, 40, 70, 0.85);
    box-shadow: 0 6px 14px rgba(var(--accent-color-rgb, 240, 58, 112), 0.2); 
}

#player-stats-list li::after { 
    content: attr(data-value); 
    font-weight: bold;
    color: var(--gem-color);
    margin-left: 10px;
}

#quests-list li.completed {
    border-left-color: var(--rarity-uncommon);
    text-decoration: line-through;
    opacity: 0.7;
}

#quests-list li .quest-reward {
    display: block;
    font-weight: bold;
    color: var(--gem-color);
    font-size: 1.15em; 
    text-align: right;
    margin-top: 12px; 
    text-shadow: 0 0 5px rgba(var(--gem-color-rgb, 255, 215, 0), 0.5);
}

#quests-list li .quest-reward {
    font-weight: bold;
    color: var(--gem-color);
}

#quests-list li button {
    background: linear-gradient(45deg, var(--rarity-uncommon, #2ecc71), var(--rarity-rare, #3498db));
    color: white;
    border: none;
    padding: 12px 22px; 
    border-radius: 30px; 
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px; 
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    display: block;
    width: fit-content;
    margin: 18px auto 0 auto; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#quests-list li button:hover {
    transform: scale(1.07) translateY(-2px); 
    box-shadow: 0 6px 18px rgba(var(--rarity-rare-rgb, 52, 152, 219), 0.4); 
    filter: brightness(1.15);
}

#quests-list li button:active {
    transform: scale(1.02) translateY(0px);
}

#quests-list li.completed {
    border-left-color: var(--rarity-common, #95a5a6);
    opacity: 0.6; 
    background-color: rgba(30, 30, 50, 0.7); 
    text-decoration: line-through;
    color: var(--text-color-medium, #9090b0); 
}

#quests-list li.completed:hover { 
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    background-color: rgba(35, 35, 55, 0.75);
}

#quests-list li.completed .quest-reward {
    text-decoration: line-through;
    color: var(--text-color-medium, #9090b0) !important; 
    text-shadow: none;
}

#quests-list li.quest-claimed-animation {
    animation: questClaimedEffectEnhanced 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

@keyframes questClaimedEffectEnhanced {
    0% {
        background-color: rgba(42, 42, 82, 0.85);
        transform: scale(1);
        opacity: 1;
    }
    30% {
        background-color: rgba(var(--rarity-uncommon-rgb, 46, 204, 113), 0.5);
        transform: scale(1.08) rotate(-1deg);
        box-shadow: 0 0 20px var(--rarity-uncommon, #2ecc71);
        opacity: 1;
    }
    70% {
        background-color: rgba(var(--rarity-uncommon-rgb, 46, 204, 113), 0.3);
        transform: scale(1.03) rotate(1deg);
        opacity: 1;
    }
    100% {
        background-color: rgba(30, 30, 50, 0.7); 
        transform: scale(1);
        opacity: 0.6; 
        border-left-color: var(--rarity-common, #95a5a6);
    }
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #3c3c6a;
}

footer button {
    background-color: #c0392b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

footer button:hover {
    background-color: var(--accent-color);
}

.tooltip {
    position: absolute;
    background-color: #111;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 0.85em;
    max-width: 200px;
    text-align: left;
    pointer-events: none;
    border: 1px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transform: translate(-50%, calc(-100% - 10px));
}

.tooltip.visible {
    opacity: 0.95;
    transform: translate(-50%, calc(-100% - 15px));
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    animation: fadeInModalBg 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--secondary-bg);
    margin: auto;
    padding: 25px;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    position: relative;
    animation: scaleUpModalContent 0.3s ease-out;
}

@keyframes fadeInModalBg {
    from {
        background-color: rgba(0,0,0,0);
    }
    to {
        background-color: rgba(0,0,0,0.7);
    }
}

@keyframes scaleUpModalContent {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.modal button {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin: 10px 5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.modal button:hover {
    background-color: color-mix(in srgb, var(--accent-color) 80%, black);
    transform: scale(1.05);
}

#fortune-wheel-visual-spinner {
    width: 150px; height: 150px;
    border: 8px solid var(--rarity-rare); 
    border-radius: 50%; margin: 20px auto;
    display: flex; align-items: center; justify-content: center;
    animation: fortuneSpinnerIdle 2s ease-in-out infinite;
    transition: border-color 0.5s;
}

#fortune-wheel-visual-spinner.spinning {
    animation: fortuneSpinnerAnimationActual 0.12s linear infinite, fortuneSpinnerColorChange 0.8s linear infinite;
}

#fortune-wheel-visual-spinner .spinner-text {
    font-size: 3em;
    animation: fortuneTextPulse 1.5s ease-in-out infinite alternate;
}

#fortune-wheel-open-btn {
    background: linear-gradient(145deg, var(--rarity-epic, #9b59b6), var(--rarity-legendary, #f39c12));
    border-color: var(--rarity-legendary, #f39c12);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

#fortune-wheel-open-btn:hover {
    border-color: white;
    box-shadow: 0 5px 15px rgba(var(--button-secondary-bg-rgb, 52, 152, 219), 0.4), inset 0 -1px 2px rgba(0,0,0,0.1);
}

#fortune-wheel-open-btn:hover:not(:disabled) {
    background-color: #f57c00;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    transform: scale(1.00765);
}

#fortune-wheel-open-btn:active:not(:disabled) {
    background-color: #e65100;
    transform: translateY(0px) scale(0.98);
}

#fortune-wheel-open-btn:disabled {
    background-color: #757575;
    color: #bdbdbd;
    border-color: #616161;
    cursor: not-allowed;
    opacity: 0.7;
    text-shadow: none;
    box-shadow: none;
    transform: none;
}

@keyframes fortuneSpinnerIdle {
    0%, 100% { transform: scale(1); border-width: 8px; box-shadow: 0 0 10px var(--rarity-rare); }
    50% { transform: scale(1.05); border-width: 10px; box-shadow: 0 0 20px var(--rarity-rare); }
}

@keyframes fortuneSpinnerAnimationActual { 
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fortuneSpinnerColorChange {
    0% {
        border-color: var(--rarity-rare);
    }
    25% {
        border-color: var(--rarity-epic);
    }
    50% {
        border-color: var(--rarity-legendary);
    }
    75% {
        border-color: var(--rarity-uncommon);
    }
    100% {
        border-color: var(--rarity-rare);
    }
}

@keyframes fortuneTextPulse { 
    from { transform: scale(0.95); opacity: 0.9; }
    to { transform: scale(1.05); opacity: 1; }
}

#prestige-btn {
    display: block;
    width: calc(100% - 40px); 
    max-width: 350px; 
    margin: 20px auto;
    padding: 15px 25px; 
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    position: relative; 
    overflow: hidden; 
}

#prestige-btn:disabled {
    background-color: #40405c; 
    color: #777;
    cursor: not-allowed;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transform: none;
}

#prestige-btn:not(:disabled) {
    background: linear-gradient(145deg, var(--rarity-legendary, #f1c40f), var(--rarity-mythic, #e74c3c));
    box-shadow: 0 5px 15px rgba(0,0,0,0.2), 0 2px 5px rgba(0,0,0,0.15);
}

#prestige-btn:not(:disabled)::before { 
    content: "🌟 ";
    margin-right: 8px;
}

#prestige-btn:not(:disabled):hover {
    background: linear-gradient(145deg, var(--rarity-mythic, #e74c3c), var(--rarity-legendary, #f1c40f));
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3), 0 4px 8px rgba(0,0,0,0.2);
}

#prestige-btn:not(:disabled)::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.5s ease;
}

#prestige-btn:not(:disabled):hover::after {
    opacity: 1;
    animation: shine 1.5s infinite linear; 
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

#info-modal-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

#info-modal-content li {
    margin-bottom: 5px;
    padding: 3px 0;
    border-bottom: 1px solid #3c3c6a;
}

#info-modal-content li strong {
    color: var(--accent-color);
}

.warning-banner {
    background-color: rgba(255, 60, 60, 0.15);
    border: 2px solid #ff3c3c;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    animation: warningPulse 2s infinite alternate;
    box-shadow: 0 3px 8px rgba(255, 60, 60, 0.3);
    grid-column: 1 / -1;
}

.warning-icon {
    font-size: 1.8em;
    margin-right: 12px;
    animation: warningShake 1s ease-in-out infinite;
}

.warning-text {
    font-size: 1.1em;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

.warning-text strong {
    color: #ff3c3c;
}

@keyframes warningPulse {
    from {
        background-color: rgba(255, 60, 60, 0.15);
    }
    to {
        background-color: rgba(255, 60, 60, 0.25);
    }
}

@keyframes warningShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(8deg);
    }
    75% {
        transform: rotate(-8deg);
    }
}

#roulette-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

#roulette-overlay.active {
    display: flex;
}

.roulette-modal-content {
    position: relative;
    background-color: var(--secondary-bg);
    padding: 25px;
    border-radius: 12px;
    border: 3px solid var(--accent-color);
    width: 90%;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 0 30px rgba(240, 58, 112, 0.5);
    animation: scaleUp 0.4s ease-out;
}

.roulette-modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-family: var(--font-title);
    font-size: 1.8em;
    text-shadow: 0 0 10px var(--accent-color);
}

.roulette-modal-content .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    transition: color 0.2s, transform 0.2s;
}

.roulette-modal-content .close-button:hover {
    color: var(--accent-color);
}

#multi-roulette-wrapper-modal {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
    align-items: center;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#roulette-overlay .roulette-instance {
    width: 100%;
    max-width: 700px;
    height: 120px;
    background-color: rgba(8, 8, 24, 0.9);
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(240, 58, 112, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: fadeInRoulette 0.5s ease-out;
}

#roulette-overlay .roulette-selector {
    width: 5px;
    background-image: linear-gradient(to bottom, var(--gem-color), white, var(--gem-color));
    box-shadow: 0 0 15px var(--gem-color), 0 0 5px white;
    animation: pulseSelector 1s infinite alternate ease-in-out;
}

.modal button:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.modal button:disabled:hover {
    background-color: #555;
    transform: none;
}

.jackpot-counter {
    background: linear-gradient(135deg, #330867 0%, #8b0239 100%);
    padding: 12px 20px;
    border-radius: 10px;
    margin: 15px auto;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border: 2px solid gold;
    position: relative;
    overflow: hidden;
}

.jackpot-counter::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: jackpotGlow 4s infinite linear;
    z-index: 0;
    opacity: 0.1;
}

.jackpot-title {
    font-family: var(--font-title);
    font-size: 1.8em;
    color: gold;
    text-shadow: 0 0 10px gold;
    position: relative;
    z-index: 1;
}

.jackpot-subtitle {
    font-size: 0.9em;
    color: #ffccaa;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

#jackpot-amount {
    font-weight: bold;
    transition: transform 0.3s;
    display: inline-block;
}

.pulse-animation {
    animation: jackpotPulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes jackpotGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes jackpotPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: white; }
    100% { transform: scale(1); }
}

.jackpot-win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255,215,0,0.6) 0%, rgba(0,0,0,0.8) 70%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: jackpotWinFadeIn 0.5s ease-in, jackpotWinFadeOut 0.5s ease-out 4s forwards;
    pointer-events: none;
}

.jackpot-win-text {
    font-family: var(--font-title);
    font-size: 5em;
    color: gold;
    text-shadow: 0 0 20px gold, 0 0 40px white;
    animation: jackpotWinPulse 0.5s infinite alternate;
}

.jackpot-win-amount {
    font-size: 3em;
    color: white;
    margin-top: 20px;
    text-shadow: 0 0 15px gold;
}

@keyframes jackpotWinFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes jackpotWinFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes jackpotWinPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.mass-action-buttons {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px dashed var(--accent-color);
}

.mass-action-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

.mass-action-button:hover {
    background-color: color-mix(in srgb, var(--accent-color) 80%, white);
    transform: scale(1.05);
}

.jackpot-gem {
    position: fixed;
    width: 25px;
    height: 25px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2347b1ff"><path d="M12 2L4 10l8 8 8-8-8-8z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 3px gold);
    pointer-events: none;
    z-index: 10000;
    animation: jackpotGemFall 2s ease-in forwards;
}

@keyframes jackpotGemFall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(0) rotate(45deg) scale(1);
    }
    100% {
        transform: translateY(100vh) rotate(180deg) scale(0.7);
        opacity: 0;
    }
}

.item-sparkle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 3%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 3%),
        radial-gradient(circle at 40% 70%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 3%),
        radial-gradient(circle at 70% 90%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 3%);
    pointer-events: none;
    animation: sparkleMove 3s infinite linear;
}

.rarity-bg-legendaire .item-sparkle {
    background-color: rgba(255, 215, 0, 0.1);
}

.rarity-bg-mythique .item-sparkle {
    background-color: rgba(148, 0, 211, 0.1);
}

.rarity-bg-inhumain .item-sparkle {
    background-color: rgba(255, 0, 255, 0.1);
}

@keyframes sparkleMove {
    0% { background-position: 0% 0%; opacity: 0.5; }
    25% { opacity: 1; }
    50% { background-position: 100% 100%; opacity: 0.5; }
    75% { opacity: 1; }
    100% { background-position: 0% 0%; opacity: 0.5; }
}

.lootbox.can-purchase {
    position: relative;
    overflow: hidden;
}

.lootbox.can-purchase::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(255, 215, 0, 0.2) 0%, 
        rgba(255, 215, 0, 0) 70%);
    animation: pulseBuyButton 2s infinite;
    z-index: 0;
    opacity: 0;
}

.lootbox.can-purchase .content-wrapper {
    position: relative;
    z-index: 1;
}

.lootbox.can-purchase:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--gem-color);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.lootbox.can-purchase .cost {
    animation: costPulse 1.5s infinite alternate ease-in-out;
}

@keyframes pulseBuyButton {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0; }
}

@keyframes costPulse {
    from { transform: scale(1); text-shadow: 0 0 5px var(--gem-color); }
    to { transform: scale(1.08); text-shadow: 0 0 12px var(--gem-color), 0 0 20px white; }
}

.loyalty-display {
    position: relative;
    margin-top: 5px;
}

.loyalty-icon {
    color: gold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.loyalty-progress-bar {
    height: 5px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 3px;
    overflow: hidden;
}

.loyalty-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #ff0059, gold);
    width: 0%;
    transition: width 0.5s;
}

.loyalty-progress-fill.almost-complete {
    animation: progressPulse 1s infinite alternate;
}

.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(45deg, #570091, #ff0059);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    box-shadow: 0 0 30px rgba(255, 0, 89, 0.7);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.level-up-notification h3 {
    color: gold;
    font-size: 1.6em;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

.level-bonus {
    color: #4fff83;
    font-style: italic;
    margin-top: 10px;
}

@keyframes progressPulse {
    from { background: linear-gradient(to right, #ff0059, gold); }
    to { background: linear-gradient(to right, #ff0059, #fff700); box-shadow: 0 0 10px gold; }
}

#combo-meter {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 8px;
    margin-top: 10px;
    transition: all 0.3s;
}

.combo-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.combo-count {
    color: white;
}

.combo-multiplier {
    color: #4fff83;
}

.combo-timer-container {
    height: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
}

#combo-timer-bar {
    height: 100%;
    background-color: #ff0059;
    width: 0%;
}

#combo-counter {
    transition: all 0.2s;
}

#combo-counter.combo-increase {
    color: #4fff83;
    transform: scale(1.3);
}

#combo-meter.medium-combo {
    background-color: rgba(255, 0, 89, 0.2);
}

#combo-meter.high-combo {
    background-color: rgba(255, 0, 89, 0.4);
    box-shadow: 0 0 10px rgba(255, 0, 89, 0.3);
}

#combo-meter.insane-combo {
    background-color: rgba(255, 0, 89, 0.6);
    box-shadow: 0 0 15px rgba(255, 0, 89, 0.5);
    animation: insaneCombo 1s infinite alternate;
}

@keyframes insaneCombo {
    from { transform: scale(1); }
    to { transform: scale(1.03); box-shadow: 0 0 20px rgba(255, 0, 89, 0.7); }
}

.rush-option {
    text-align: center;
    margin-bottom: 15px;
}

.rush-button {
    background: linear-gradient(45deg, #ff6b00, #ff9d00);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rush-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.6);
}

.rush-button.active {
    background: linear-gradient(45deg, #ff0059, #ff5e00);
    animation: rushActive 1.5s infinite alternate;
}

.rush-icon {
    font-size: 1.4em;
    margin-bottom: 5px;
}

.rush-description {
    font-size: 0.8em;
    opacity: 0.8;
}

@keyframes rushActive {
    from { box-shadow: 0 0 15px rgba(255, 0, 89, 0.6); }
    to { box-shadow: 0 0 25px rgba(255, 0, 89, 0.9); }
}

.notification-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close-btn:hover {
    opacity: 1;
}

.easter-egg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse-bg 2s infinite;
}

.easter-egg-message {
    background: linear-gradient(135deg, #4b0082, #9932cc, #ff00ff);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px #ff00ff;
    animation: pulse 1s infinite alternate;
}

.easter-egg-message h2 {
    color: #ffffff;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #ffffff;
}

.easter-egg-message p {
    color: #ffffff;
    font-size: 1.2em;
}

.easter-egg-particle {
    position: absolute;
    border-radius: 50%;
    animation: float 2s ease-out forwards;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes pulse-bg {
    0%, 100% { background-color: rgba(0, 0, 0, 0.7); }
    50% { background-color: rgba(75, 0, 130, 0.5); }
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--x, 100px), var(--y, -100px)) rotate(360deg); opacity: 0; }
}

.fade-out {
    animation: fade-out 1s forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.slot-machine-content {
    max-width: 600px;
    background: linear-gradient(135deg, #1a0e2a 0%, #2e1a4a 100%);
    border: 3px solid #ff9d00;
}

.slot-machine-display {
    background-color: #000;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid #ff9d00;
    box-shadow: 0 0 20px rgba(255, 157, 0, 0.4);
}

.slot-reels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    height: 120px;
    gap: 10px;
}

#slot-machine-btn {
    background: linear-gradient(145deg, var(--accent-color, #f03a70), var(--rarity-epic, #9b59b6));
    border-color: var(--accent-color, #f03a70);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

#slot-machine-btn:hover {
    border-color: white;
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb, 240, 58, 112), 0.4), inset 0 -1px 2px rgba(0,0,0,0.1);
}

.reel {
    flex: 1;
    border: 3px solid gold;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    background-color: #1e1e3a;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.symbol {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    transition: transform 0.1s;
}

#slot-result {
    text-align: center;
    font-size: 1.2em;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffcc00;
    text-shadow: 0 0 5px gold;
}

.bet-controls {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    align-items: center;
}

.bet-amount-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-display {
    background-color: #000;
    padding: 8px 15px;
    border-radius: 5px;
    border: 2px solid gold;
    font-weight: bold;
    color: #ffcc00;
}

.bet-amount-container button {
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    padding: 0;
    line-height: 1;
    background-color: #3a1f5e;
}

.spin-button {
    background: linear-gradient(45deg, #ff0059, #ff5e00) !important;
    font-size: 1.3em !important;
    padding: 12px 25px !important;
    border-radius: 50px !important;
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.5);
    animation: pulseSpin 1.5s infinite alternate;
}

.spin-button:hover, #craft-item-btn:not(:disabled):hover { 
      transform: scale(1.05);
      box-shadow: 0 0 15px var(--accent-color), 0 0 25px var(--accent-color);
  }

@keyframes pulseSpin {
    from { transform: scale(1); box-shadow: 0 0 15px rgba(255, 94, 0, 0.5); }
    to { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 94, 0, 0.8); }
}

.slot-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.jackpot-display {
    font-size: 1.3em;
    color: gold;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    font-weight: bold;
    flex: 1;
}

.slot-history {
    flex: 1;
    text-align: right;
}

#win-history {
    list-style: none;
    padding: 0;
    max-height: 80px;
    overflow-y: auto;
    font-size: 0.9em;
    color: #a7c0f7;
}

.winning-spin {
    animation: winningLight 0.8s ease-in-out;
}

@keyframes winningLight {
    0%, 100% { box-shadow: 0 0 15px gold; }
    50% { box-shadow: 0 0 30px gold, 0 0 50px white; }
}

.paytable {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed gold;
}

.paytable h3 {
    text-align: center;
    margin-top: 0;
    color: gold;
    font-size: 1.1em;
}

.paytable-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    font-size: 0.85em;
}

.paytable-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 4px;
    text-align: center;
}

.reel.spinning .symbol {
    animation: blurSymbols 0.1s infinite;
}

@keyframes blurSymbols {
    0% { filter: blur(0px); transform: translateY(0); }
    50% { filter: blur(2px); transform: translateY(-2px); }
    100% { filter: blur(0px); transform: translateY(0); }
}

@keyframes jackpotPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.legendary-reveal {
    box-shadow: 0 0 30px var(--rarity-legendary), 0 0 50px var(--rarity-legendary), 0 0 100px var(--rarity-legendary);
    animation: jackpotPulse 3s ease infinite;
    background: linear-gradient(270deg, var(--rarity-legendary), #ffd700, #ffa500, var(--rarity-legendary));
    background-size: 300% 300%;
}

.winning-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    animation: celebrationFade 3s forwards;
}

@keyframes celebrationFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    from { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    to { transform: translateY(calc(100vh + 20px)) rotate(360deg); opacity: 0; }
}

.recovery-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.recovery-win {
    background-color: rgba(0, 255, 0, 0.2);
    color: #4fff83;
}

.recovery-loss {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
}

.win-text, .loss-text {
    font-size: 1.3em;
    font-weight: bold;
}

.recovery-close-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    font-weight: bold;
}

.rarity-hint {
    font-size: 0.8em;
    color: #ffcc00;
    font-style: italic;
    opacity: 0.8;
}

.one-more-offer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.one-more-offer.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.one-more-content {
    background: linear-gradient(135deg, #1a0e2a 0%, #2e1a4a 100%);
    border: 3px solid #ff9d00;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 157, 0, 0.5);
    width: 320px;
}

.one-more-content h3 {
    color: #ff9d00;
    margin-top: 0;
    font-size: 1.4em;
}

.one-more-content p {
    color: white;
    margin-bottom: 20px;
}

.offer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glowing-button {
    background: linear-gradient(45deg, #ff0059, #ff5e00) !important;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    animation: pulseSpin 1.5s infinite alternate;
}

.discount-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #ff0059;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 0, 89, 0.7);
    animation: pulseBadge 1.5s infinite alternate;
    z-index: 2;
}

.decline-one-more {
    background-color: #555;
    color: #ccc;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.decline-one-more:hover {
    background-color: #666;
    color: white;
}

.decline-one-more:active {
    transform: scale(0.98);
}

@keyframes pulseBadge {
    from { transform: scale(1); }
    to { transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 0, 89, 0.9); }
}

.spin-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.spin-symbol {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    height: 120px;
    top: -120px;
}

@keyframes spinSymbol {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(240px);
    }
}

.reel {
    height: 120px;
    position: relative;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin: 0 5px;
}

.final-symbol {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 3em;
    animation: finalReveal 0.3s ease-out;
}

@keyframes finalReveal {
    0% { transform: scale(1.5); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

.winning-spin .symbol {
    animation: winningPulse 0.5s infinite alternate;
}

@keyframes winningPulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.2); filter: brightness(1.3); }
}

.skip-animation-button {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.85;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.4);
}

.skip-animation-button:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6);
}

.skip-animation-button:disabled {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
 
@keyframes spinSymbol {
    0% { transform: translateY(0); }
    100% { transform: translateY(900px); } 
}

#crafting-content {
    gap: 30px; 
}

#crafting-content > h2 { 
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 10px; 
}

#crafting-content > p { 
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.05em;
    color: var(--text-color-medium);
}

#crafting-content.active {
    flex-direction: column; 
}

#crafting-area {
    background-color: rgba(var(--secondary-bg-rgb, 30, 30, 50), 0.7);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-color-rgb, 240, 58, 112), 0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 30px; 
}

#crafting-inputs {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 15px; 
    flex-basis: 150px;
    flex-grow: 1; 
}

#crafting-inputs > p { 
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px; 
    font-size: 1.1em;
    text-align: center;
}


.crafting-input-slots-wrapper { 
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
}

#crafting-output {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 15px; 
    flex-basis: 150px; 
    flex-grow: 1; 
}

#crafting-output > p {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px; 
    font-size: 1.1em;
    text-align: center;
}

.crafting-slots-container {
    display: flex;
    flex-direction: row; 
    justify-content: center; 
    align-items: flex-start; 
    gap: 15px; 
    width: 100%;
    margin-bottom: 10px;
}

.crafting-slots-container p {
    margin-bottom: 5px;
    font-weight: bold;
}

.crafting-input-slot, 
#crafting-output .item-card-placeholder, 
#crafting-output .item-card { 
    width: 110px;
    height: 140px;
    border: 3px dashed var(--accent-color-medium, #606090);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent-color-medium, #888);
    font-size: 2.5em; 
    border-radius: 8px;
    background-color: rgba(var(--main-bg-rgb, 20, 20, 40), 0.6); 
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    box-sizing: border-box;
}

.crafting-input-slot:not(.item-card):hover,
#crafting-output .item-card-placeholder:hover {
    border-color: var(--accent-color);
    background-color: rgba(var(--accent-color-rgb, 240, 58, 112), 0.15);
    transform: scale(1.03);
}

.crafting-input-slot.item-card,
#crafting-output .item-card {
    border-style: solid; 
    font-size: 1em; 
    padding: 10px; 
}

#crafting-output .item-card { 
    width: 110px;
    height: 140px;
}

#craft-item-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    min-width: 150px;
    width: auto; 
    max-width: 280px; 
    margin-top: 20px; 
    order: 3; 
    flex-basis: auto; 
    align-self: center; 
    text-align: center; 
}

#craft-item-btn:not(:disabled) {
    background: linear-gradient(145deg, var(--rarity-epic, #9b59b6), var(--accent-color, #f03a70)); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#craft-item-btn:not(:disabled):hover {
    background: linear-gradient(145deg, var(--accent-color, #f03a70), var(--rarity-epic, #9b59b6));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(var(--accent-color-rgb, 240, 58, 112), 0.3);
    pointer-events: all;
    cursor: pointer;
}

#craft-item-btn:disabled {
    background-color: #40405c;
    color: #777;
    cursor: not-allowed;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

#craft-item-btn:hover:not(:disabled) {
    background-color: #45a049;
}

#crafting-feedback {
    text-align: center;
    margin-top: 15px;
    min-height: 1.5em;
    font-size: 1.05em;
    font-weight: bold;
    color: var(--text-color-medium);
    width: 100%; 
    order: 4; 
    flex-basis: 100%; 
}

#crafting-feedback.success { color: var(--rarity-uncommon); }

#crafting-feedback.error { color: var(--rarity-common); } 

#crafting-inventory-selection h3 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 18px;
    font-size: 1.3em;
}

#crafting-inventory-selection {
    background-color: rgba(var(--secondary-bg-rgb, 30, 30, 50), 0.7);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-color-rgb, 240, 58, 112), 0.2);
    flex: 1; 
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

#crafting-inventory-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 12px;
    max-height: 400px; 
    overflow-y: auto;
    padding: 15px;
    border: 1px solid rgba(var(--main-bg-rgb, 20, 20, 40), 0.8);
    border-radius: 8px;
    background-color: rgba(var(--main-bg-rgb, 20, 20, 40), 0.3);
}

.crafting-inventory-item { 
    cursor: grab; 
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.crafting-inventory-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 10px rgba(var(--accent-color-rgb, 240, 58, 112), 0.2);
}

.crafting-inventory-item:active {
    cursor: grabbing;
    opacity: 0.7;
}

.crafting-in-progress-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-style: solid; 
    border-color: var(--accent-color); 
    animation: pulseCraftBorder 1.2s infinite alternate; 
}

.crafting-in-progress-visual .spinner {
    width: 35px; 
    height: 35px;
    border: 5px solid rgba(255, 255, 255, 0.2); 
    border-top-color: var(--accent-color); 
    border-radius: 50%;
    animation: spin 0.8s linear infinite; 
    margin-bottom: 12px;
}

.crafting-in-progress-visual span {
    font-size: 0.9em;
    color: var(--accent-color);
    font-weight: bold;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulseCraftBorder {
    from { 
        box-shadow: 0 0 3px var(--accent-color);
        border-width: 2px;
    }
    to { 
        box-shadow: 0 0 12px var(--accent-color), 0 0 18px var(--accent-color);
        border-width: 3px;
    }
}

.crafting-disabled {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.item-card-placeholder {
    width: 100px;
    height: 120px;
    border: 2px dashed #666;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 2em;
    border-radius: 5px;
    background-color: rgba(255,255,255,0.05);
}

#achievements-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px;
}

.achievement-item {
    background-color: rgba(40, 40, 70, 0.6); 
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #4a4a8a; 
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.achievement-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.achievement-item.unlocked {
    background-color: rgba(50, 70, 50, 0.7); 
    border-left: 5px solid var(--rarity-uncommon); 
}

.achievement-icon {
    font-size: 2.5em;
    margin-right: 15px;
    padding: 5px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    line-height: 1;
    width: 50px; 
    height: 50px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-item.unlocked .achievement-icon {
    background-color: rgba(var(--rarity-uncommon-rgb), 0.2); 
}

.achievement-details {
    flex-grow: 1;
}

.achievement-name {
    font-weight: bold;
    font-size: 1.15em;
    color: var(--accent-color);
    margin-bottom: 5px;
    display: block;
}

.achievement-item.unlocked .achievement-name {
    color: var(--rarity-uncommon); 
}

.achievement-description {
    font-size: 0.9em;
    color: #b0b0d0; 
    margin-bottom: 8px;
    line-height: 1.4;
}

.achievement-reward {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--gem-color); 
    display: block;
    margin-top: 5px;
}

.achievement-status {
    font-size: 0.85em;
    font-style: italic;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: rgba(0,0,0,0.2);
}

.achievement-item.unlocked .achievement-status {
    color: #ffffff;
    background-color: var(--rarity-uncommon); 
    font-weight: bold;
}

.achievement-item:not(.unlocked) {
    opacity: 0.7; 
}

.achievement-item:not(.unlocked) .achievement-icon {
    filter: grayscale(80%);
}

#crafting-output .item-card-placeholder { 
    width: 100px; 
    height: 140px; 
    border: 2px dashed var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 2.5em;
    border-radius: 8px;
    background-color: rgba(var(--accent-color-rgb, 240, 58, 112), 0.05);
    animation: pulseCraftPlaceholder 2s infinite alternate; 
    margin: 10px auto; 
}

@keyframes pulseCraftPlaceholder { 
    from {
        box-shadow: 0 0 5px rgba(var(--accent-color-rgb, 240, 58, 112), 0.2);
        transform: scale(1);
    }
    to {
        box-shadow: 0 0 12px rgba(var(--accent-color-rgb, 240, 58, 112), 0.5);
        transform: scale(1.02);
    }
}

@keyframes questClaimedAnimation {
    0% {
        opacity: 1;
        transform: translateX(0);
        background-color: color-mix(in srgb, var(--accent-color) 25%, transparent);
    }
    60% {
        opacity: 0.8;
        transform: translateX(15px);
        background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
    }
    100% {
        opacity: 0.4; 
        transform: translateX(-20px);
        background-color: transparent;
    }
}

#quests-list li.quest-claimed-animation {
    animation: questClaimedAnimation 1s ease-in-out forwards;
}

#quests-list li.completed {
    opacity: 0.6;
    text-decoration: line-through;
    font-style: italic;
    background-color: rgba(var(--text-color-rgb, 230, 230, 230), 0.05); 
}

.player-info-tabs .tab-button {
    padding: 10px 15px;
    background-color: var(--background-color-lighter);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom: 3px solid transparent; 
    cursor: pointer;
    font-size: 0.95em;
    border-radius: 6px 6px 0 0;
    margin-right: 5px;
    transition: background-color 0.2s, color 0.2s, border-color 0.3s ease-out; 
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1) inset;
    position: relative;
}

.player-info-tabs .tab-button:hover:not(.active) {
    background-color: color-mix(in srgb, var(--accent-color) 20%, var(--background-color-lighter));
    color: var(--accent-color);
    border-bottom-color: color-mix(in srgb, var(--accent-color) 50%, transparent); 
}

.player-info-tabs .tab-button.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-bottom-color: color-mix(in srgb, var(--accent-color) 70%, black); 
    font-weight: bold;
}

.lootbox .daily-status {
    font-style: italic;
    margin-top: 5px;
    font-size: 0.9em;
    line-height: 1.2; 
}

.lootbox .unavailable-info.daily-status {
    color: var(--text-color-muted, #9e9e9e); 
}

.lootbox .available-info.daily-status {
    color: #76ff03; 
    font-weight: bold;
}

.lootbox.daily-unavailable {
    opacity: 0.65;
    border-left: 5px solid var(--text-color-muted, #757575);
    background-color: color-mix(in srgb, var(--background-color-lighter, #2a2a4a) 70%, black);
}

.lootbox.daily-unavailable .content-wrapper {
    cursor: not-allowed;
}

.lootbox.daily-unavailable h3,
.lootbox.daily-unavailable .cost {
    color: var(--text-color-muted, #9e9e9e);
}

.lootbox .quantity-selector, .lootbox .daily-status-placeholder {
    min-height: 30px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

#double-or-nothing-modal .modal-content {
    background: linear-gradient(145deg, var(--secondary-bg), var(--primary-bg)); 
    border: 2px solid var(--gem-color); 
    box-shadow: 0 0 25px rgba(var(--gem-color-rgb, 255, 215, 0), 0.4), 
                0 0 10px rgba(var(--accent-color-rgb, 240, 58, 112), 0.2) inset;
    padding: 25px; 
}

#double-or-nothing-modal h2 {
    color: var(--gem-color); 
    font-family: var(--font-title);
    text-shadow: 0 0 10px rgba(var(--gem-color-rgb, 255, 215, 0), 0.7);
    margin-bottom: 20px;
}

#double-or-nothing-modal p {
    color: var(--text-color);
    font-size: 1.1em;
    margin-bottom: 15px;
}

#double-or-nothing-modal #don-sell-value {
    color: var(--gem-color);
    font-weight: bold;
}

#double-or-nothing-modal .don-choices {
    display: flex;
    justify-content: center;
    gap: 20px; 
    margin: 25px 0;
}

#double-or-nothing-modal .don-choices button {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
    min-width: 130px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#double-or-nothing-modal #don-bet-btn {
    background: linear-gradient(45deg, var(--accent-color), #ff8c00); 
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-color-rgb, 240, 58, 112), 0.4);
    animation: pulseDonBetButton 1.5s infinite alternate;
}

#double-or-nothing-modal #don-bet-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-color-rgb, 240, 58, 112), 0.6);
}

#double-or-nothing-modal #don-bet-btn:active {
    transform: scale(0.98);
}

#double-or-nothing-modal #don-skip-btn {
    background-color: var(--primary-bg);
    color: var(--text-color-medium, #a0a0c0);
    border: 1px solid var(--secondary-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#double-or-nothing-modal #don-skip-btn:hover {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border-color: var(--accent-color);
    transform: scale(1.03);
}

#double-or-nothing-modal #don-result {
    font-size: 1.2em;
    font-weight: bold;
    min-height: 1.5em;
    margin-top: 20px;
    transition: color 0.3s ease;
}

@keyframes pulseDonBetButton {
    from {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(var(--accent-color-rgb, 240, 58, 112), 0.3);
    }
    to {
        transform: scale(1.03);
        box-shadow: 0 4px 20px rgba(var(--accent-color-rgb, 240, 58, 112), 0.5);
    }
}

#double-or-nothing-modal #don-result.win {
    color: var(--rarity-legendary); /* Ou var(--gem-color) */
    text-shadow: 0 0 8px var(--rarity-legendary);
}

#double-or-nothing-modal #don-result.lose {
    color: var(--rarity-mythique); 
    text-shadow: 0 0 8px var(--rarity-mythique);
}