/* css/ruleta.css */
:root {
    --ruleta-color-1: #6366f1; 
    --ruleta-color-2: #3730a3;
    --casino-gold-light: #fef3c7;
    --casino-gold-dark: #b45309;
    --casino-silver-light: #f1f5f9;
    --casino-silver-dark: #475569;
}
[data-theme="batman"] {
    --ruleta-color-1: #facc15; 
    --ruleta-color-2: #a16207;
}
[data-theme="hellokitty"] {
    --ruleta-color-1: #f472b6; 
    --ruleta-color-2: #be185d;
}

.ruleta-layout, .casino-layout {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-deep) 100%);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

/* ========================================
   HUB DEL CASINO (SALA DE DECISIONES)
   ======================================== */
.casino-hub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.casino-hub-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-pure);
    margin-bottom: 40px;
    text-shadow: 0 4px 15px var(--accent-glow);
    letter-spacing: 1px;
}

.casino-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.casino-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.casino-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    box-shadow: 0 15px 40px var(--accent-glow);
}

.casino-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.casino-card h3 {
    color: var(--text-pure);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.casino-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* ========================================
   VISTA ACTIVA DE JUEGO (HEADER UNIFICADO)
   ======================================== */
.casino-active-game-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.4s ease;
}

.casino-game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(0,0,0,0.3);
    padding: 15px 20px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.back-hub-pro-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-pure);
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: 0.2s;
    position: relative;
    z-index: 10;
}

.back-hub-pro-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.casino-game-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.casino-game-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* ========================================
   1. RULETA NATIVA
   ======================================== */
.ruleta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    padding: 20px;
}

.ruleta-grafica-container {
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: transform 0.2s;
}

.ruleta-grafica-container:active {
    transform: scale(0.98);
}

.ruleta-outer-ring {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(0,0,0,0.5));
    padding: 15px; 
    box-shadow: 0 25px 60px rgba(0,0,0,0.7), inset 0 5px 15px rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

[data-theme="hellokitty"] .ruleta-outer-ring {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(244,114,182,0.4));
    box-shadow: 0 20px 50px rgba(244,114,182,0.4);
}

#ruletaCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
}

.ruleta-pointer-pro {
    position: absolute; 
    top: -25px; 
    left: 50%; 
    transform: translateX(-50%); 
    color: var(--accent-color); 
    z-index: 10; 
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

.ruleta-pointer-pro svg {
    display: block;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.premium-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15%;
    height: 15%;
    background: var(--bg-secondary);
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    z-index: 5;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.2);
}

.ruleta-result {
    color: var(--text-pure);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 30px;
    letter-spacing: 1px;
    text-align: center;
    min-height: 35px;
}

.winning-highlight {
    color: var(--accent-electric, #22c55e);
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 15px var(--accent-electric, #22c55e);
}

/* ========================================
   PANEL DE EDICIÓN FLOTANTE (UNIVERSAL PRO)
   ======================================== */
.casino-edit-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    z-index: 1000;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8);
    animation: popInCenter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="hellokitty"] .casino-edit-panel {
    background: rgba(253, 242, 248, 0.98);
    border: 2px solid rgba(244, 114, 182, 0.3);
    box-shadow: 0 25px 60px rgba(219, 39, 119, 0.3);
}

.casino-edit-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.option-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    color: var(--text-pure);
}

.remove-opt-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
}

/* ========================================
   2. MONEDA 3D FOTORREALISTA (NEUTRA)
   ======================================== */
.moneda-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.moneda-3d-wrapper {
    perspective: 1500px;
    margin: 50px 0;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
}

.moneda-3d {
    width: 240px;
    height: 240px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
}

.moneda-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        inset 0 5px 10px rgba(255,255,255,0.3),
        0 0 1px 1px rgba(255,255,255,0.1);
}

.moneda-front {
    background: 
        radial-gradient(circle at 50% 10%, rgba(255,255,255,0.4) 0%, transparent 60%),
        url('https://www.transparenttextures.com/patterns/brushed-alum.png'),
        linear-gradient(135deg, #fceabc 0%, #fb9b2a 50%, #cf781a 51%, #fceabc 100%);
    background-blend-mode: soft-light, normal, normal;
    transform: rotateY(0deg);
}

.moneda-back {
    background: 
        radial-gradient(circle at 50% 10%, rgba(255,255,255,0.4) 0%, transparent 60%),
        url('https://www.transparenttextures.com/patterns/brushed-alum.png'),
        linear-gradient(135deg, #f5f7fa 0%, #b8c6db 50%, #8e9eab 51%, #f5f7fa 100%);
    background-blend-mode: soft-light, normal, normal;
    transform: rotateY(180deg);
}

.moneda-content-relief {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 85%;
    height: 85%;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,0.15);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(255,255,255,0.2);
    padding: 10px;
}

.moneda-text-relief {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(0,0,0,0.85);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5); /* Sombra clara para contraste en plata */
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

.moneda-edge-pro {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    transform-style: preserve-3d;
}

.moneda-edge-pro::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: repeating-conic-gradient(
        #333 0deg 1deg, 
        #888 1.1deg 2deg,
        #333 2.1deg 3deg
    );
    transform: translateZ(-1px);
}

/* ========================================
   3. TRAGAMONEDAS (SLOTS)
   ======================================== */
.slots-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.slots-machine {
    display: flex;
    gap: 15px;
    background: linear-gradient(to bottom, #2a2a2a, #111, #2a2a2a);
    padding: 30px;
    border-radius: 20px;
    border: 4px solid var(--accent-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 20px #000;
    margin: 40px 0;
    position: relative;
}

.slots-machine::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.5) 100%);
    border-radius: 15px;
    pointer-events: none;
}

.slot-reel {
    width: 100px;
    height: 120px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 15px 20px rgba(0,0,0,0.5), inset 0 -15px 20px rgba(0,0,0,0.5);
}

.reel-strip {
    display: flex;
    flex-direction: column;
}

.slot-item {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    height: 120px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes popInCenter {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}