/* ===================================================
 * PACK SYSTEM 3D - 3D Pack Preview & Opening System
 * Extrahiert aus cards-album.ejs für bessere Organisation
 * =================================================== */

/* === KOMBINIERTES PACK PREVIEW SYSTEM === */
.pack-preview-combined {
    position: relative;
    width: 100%;
    height: 200px;
}

.pack-3d-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Strahlen ganz unten */
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    pointer-events: none;
}

.pack-clock-tiny {
    width: 30px;
    height: 30px;
    position: relative;
    flex-shrink: 0;
}

.pack-timer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    pointer-events: none;
}

.pack-overlay-content .pack-timer,
.pack-overlay-content .pack-ready {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: 2px solid rgba(255, 215, 0, 0.6); /* Gold Outline */
    outline-offset: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    align-self: center;
    margin: -0.5rem auto;
}

.pack-timer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto; /* Buttons in dieser Row klickbar machen */
}

.pack-lock {
    position: absolute;
    top: -80px; /* Höher über dem Pack */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem; /* Etwas kleiner */
    opacity: 0.9;
    z-index: 20;
    animation: lockFloat 2s ease-in-out infinite;
}

@keyframes lockFloat {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.pack-timer .timer-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    white-space: nowrap;
}

.pack-timer .timer-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-top: 0.1rem;
}

.pack-rarity-indicator {
    background: rgba(255, 215, 0, 0.9);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: none;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    animation: rarityGlow 2s ease-in-out infinite alternate;
}

@keyframes rarityGlow {
    0% { 
        box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}

.pack-preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25; /* Pack über Timer Container (z-index: 10) */
}

.pack-preview-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.pack-preview-canvas:hover canvas {
    transform: scale(1.1); /* 10% größer beim Hovern */
}

/* === 2D CLOCK SYSTEM === */
.pack-clock-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-clock-face {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clock-background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.clock-handle {
    position: absolute;
    width: 80%;
    height: 80%;
    object-fit: contain;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.3s ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* === RARITY-SPECIFIC GLOW EFFECTS === */
.pack-preview-3d[data-rarity="common"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #8B5E3C, #CD7F32);
    color: white;
}

.pack-preview-3d[data-rarity="uncommon"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #C0C0C0, #DCDCDC);
    color: #333;
}

.pack-preview-3d[data-rarity="rare"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #FFD700, #FFDF00);
    color: #000;
}

.pack-preview-3d[data-rarity="epic"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #800080, #BA55D3);
    color: white;
}

.pack-preview-3d[data-rarity="heroic"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #00BFFF, #40E0D0);
    color: #000;
}

.pack-preview-3d[data-rarity="legendary"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #FFA500, #FF8C00);
    color: white;
}

.pack-preview-3d[data-rarity="mythic"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #E0115F, #FF4500);
    color: white;
}

.pack-preview-3d[data-rarity="ancient"] .pack-rarity-indicator {
    background: linear-gradient(45deg, #FF00FF, #8A2BE2);
    color: white;
}

/* === PACK OPENING OVERLAY (EXAMPLE-STYLE) === */
.pack-opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: auto;
}

.pack-opening-backdrop {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: radial-gradient(circle at center, rgba(139, 94, 60, 0.4) 0%, rgba(0,0,0,0.8) 100%);
    transition: background 600ms ease;
    overflow: hidden;
}

.pack-3d-container {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pack-3d-canvas {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, 
        rgba(255, 215, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.8) 100%);
}

.pack-3d-ui {
    width: 350px;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.pack-upgrade-header h2 {
    color: #FFD700;
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.pack-upgrade-header p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}

.pack-upgrade-info {
    margin-bottom: 2rem;
    width: 100%;
}

.pack-rarity-display,
.pack-cards-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rarity-label,
.cards-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.rarity-value {
    color: #00FF88;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: capitalize;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.cards-value {
    color: #FFD700;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.pack-3d-upgrade-btn {
    background: linear-gradient(45deg, #9966CC, #6644AA);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(153, 102, 204, 0.3);
}

.pack-3d-upgrade-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(153, 102, 204, 0.5);
    background: linear-gradient(45deg, #AA77DD, #7755BB);
}

.pack-3d-upgrade-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(45deg, #666666, #444444);
}

.pack-3d-upgrade-btn .btn-text {
    font-size: 1rem;
    font-weight: 700;
}

.pack-3d-upgrade-btn .btn-chance {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

.pack-upgrade-dots-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.pack-3d-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-3d-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* === MOBILE RESPONSIVENESS === */
@media (max-width: 768px) {
    .pack-3d-container {
        width: 95vw;
        height: 85vh;
        flex-direction: column;
    }
    
    .pack-3d-canvas {
        height: 60%;
    }
    
    .pack-3d-ui {
        width: 100%;
        height: 40%;
        padding: 1rem;
    }
    
    .pack-upgrade-header h2 {
        font-size: 1.4rem;
    }
}

/* === GEM SKIP SYSTEM === */
.insufficient-gems-error {
    color: #ff4444 !important;
    animation: shakeGems 0.5s ease-in-out;
}

@keyframes shakeGems {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.skip-error-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 68, 68, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
    animation: tooltipFadeIn 0.3s ease-out;
    z-index: 1000;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===================================================
 * VOLUME CONTROL für 3D Pack Overlay (während Upgrade)
 * =================================================== */
.pack-3d-volume-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10004; /* Über allem im 3D Overlay */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .pack-3d-volume-control {
        top: 15px;
        right: 15px;
    }
}
