/* ==========================================
   CARD ROYALE - GACHA CSS
   Estilos para sobres, cartas y colección
   ========================================== */

/* ==========================================
   CUBO 3D DEL SOBRE
   ========================================== */

.envelope-3d-container {
    perspective: 1200px;
    -webkit-perspective: 1200px;
    width: 100%;
    max-width: 600px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.envelope-3d-cube {
    position: relative;
    -webkit-transform-style: preserve-3d;
    width: 260px;
    height: 360px;
    transform-style: preserve-3d;
    animation: rotateCube 6s infinite linear;
    -webkit-animation: rotateCube 6s infinite linear;
}

.envelope-face {
    position: absolute;
    -webkit-backface-visibility: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
}

/* Frente */
.envelope-front {
    transform: translateZ(0px);
    z-index: 3;
}

.envelope-front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    cursor: grab;
    transition: transform 0.1s ease, filter 0.1s ease;
    user-select: none;
}

.envelope-front img:active {
    cursor: grabbing;
}

.envelope-3d-cube.dragging .envelope-front img {
    filter: brightness(1.05);
}

@-webkit-keyframes rotateCube {
    0%   { -webkit-transform: rotateX(6deg)   rotateY(10deg); }
    25%  { -webkit-transform: rotateX(12deg)  rotateY(0deg); }
    50%  { -webkit-transform: rotateX(6deg)   rotateY(-10deg); }
    75%  { -webkit-transform: rotateX(-6deg)  rotateY(0deg); }
    100% { -webkit-transform: rotateX(6deg)   rotateY(10deg); }
}

@keyframes rotateCube {
    0%   { transform: rotateX(6deg)   rotateY(10deg); }
    25%  { transform: rotateX(12deg)  rotateY(0deg); }
    50%  { transform: rotateX(6deg)   rotateY(-10deg); }
    75%  { transform: rotateX(-6deg)  rotateY(0deg); }
    100% { transform: rotateX(6deg)   rotateY(10deg); }
}

/* Interactividad */
.envelope-3d-cube.dragging {
    animation: none;
}

.envelope-3d-cube.rotating-x {
    animation: none;
}

.envelope-modal {
    position: fixed;
    -webkit-user-select: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    overflow: hidden;
}

/* ==========================================
   CARTA PEEK - REVERSO ASOMÁNDOSE DEL SOBRE
   ========================================== */

.envelope-modal-content {
    position: relative;
}

.envelope-card-peek {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    z-index: 1;
    animation: cardPeekBob 2s ease-in-out infinite;
}

.envelope-card-peek-img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(122, 77, 102, 0.25);
}

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

/* Al abrir: carta peek sube mientras sobre baja */
.envelope-card-peek.exit {
    animation: cardPeekExit 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes cardPeekExit {
    0%   { transform: translateX(-50%) translateY(0);     opacity: 1; }
    100% { transform: translateX(-50%) translateY(-80px); opacity: 0; }
}

.envelope-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 232, 242, 0.72), rgba(235, 229, 255, 0.72));
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(2px);
}



.envelope-modal-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 95vh;
    overflow: hidden;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

/* ==========================================
   ÍCONO DE SWIPE
   ========================================== */

/* Efecto de corte en el sobre */
.envelope-cut-animation {
    animation: envelopeCutOpen 2.5s ease-in-out forwards;
    position: relative;
}

@keyframes envelopeCutOpen {
    0% {
        transform: scaleY(1);
        filter: brightness(1);
    }
    25% {
        /* Destello de corte */
        filter: brightness(1.3);
    }
    50% {
        /* Se levanta la parte de arriba */
        transform: perspective(800px) rotateX(15deg) scaleY(0.95);
        filter: brightness(1.1);
    }
    75% {
        transform: perspective(800px) rotateX(20deg) scaleY(0.9);
    }
    100% {
        /* Vuelve pero se ve "abierto" */
        transform: perspective(800px) rotateX(15deg) scaleY(0.88);
        filter: brightness(1);
    }
}

/* Efecto de destello de corte */
.envelope-cut-animation::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, #fbbf24, #fff, transparent);
    animation: cutFlash 2.5s ease-in-out;
}

@keyframes cutFlash {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    30% {
        opacity: 1;
        transform: scaleX(1);
    }
    100% {
        opacity: 0;
        transform: scaleX(1);
    }
}

/* Sobre expandido */
.envelope-modal-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: 600px;
    border-radius: 12px;
    animation: envelopeExpand 0.6s ease-out;
    object-fit: contain;
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 16px;
}

@keyframes envelopeExpand {
    0% {
        transform: scale(0.3) translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   SOBRE NORMAL (CLICKEABLE)
   ========================================== */

/* Container 3D con perspectiva fuerte */
.envelope-3d-perspective {
    perspective: 1200px;
    -webkit-perspective: 1200px;
    width: 280px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: grab;
}

.envelope-3d-perspective:active {
    cursor: grabbing;
}

.envelope-image {
    width: 245px;
    height: 100%;
    max-height: 400px;
    box-shadow: 0 20px 60px rgba(196, 126, 158, 0.26);
    border-radius: 12px;
    object-fit: cover;
    position: relative;
    transition: all 0.1s ease-out;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
}

.envelope-image:active {
    cursor: grabbing;
}

/* Efecto hover suave */
.envelope-image:hover {
}

/* Al arrastrar */
.envelope-image.dragging {
    cursor: grabbing;
    box-shadow: 0 30px 100px rgba(196, 126, 158, 0.35);
    transition: none;
}

/* Efecto de salida */
.envelope-image.exit {
    animation: envelopeExit 1.2s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

/* También aplica al modal image */
.envelope-modal-image.exit {
    animation: envelopeExit 1.2s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes envelopeExit {
    0%   { transform: translateY(0);      opacity: 1; }
    35%  { transform: translateY(60px);   opacity: 1; }
    60%  { transform: translateY(80px);   opacity: 1; }
    100% { transform: translateY(140vh);  opacity: 0; }
}

/* Efecto de brillo al voltear */
.envelope-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.envelope-image.flipping::before {
    opacity: 1;
}

/* ==========================================
   SISTEMA DE CARTAS APILADAS
   ========================================== */

.card-stack-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: calc(100svh - 104px);
    gap: 14px;
    padding: 52px 0 76px;
}

.card-stack-container {
    perspective: 1200px;
    width: 100%;
    max-width: 360px;
    height: min(58svh, 500px);
    min-height: 430px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.card-stack {
    position: relative;
    width: min(76vw, 330px);
    aspect-ratio: 3 / 4;
    height: auto;
    overflow: visible;
}

.stack-card {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    perspective: 1200px;
    -webkit-perspective: 1200px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* Flotación suave en la carta del frente del mazo */
.stack-card.front {
    animation: cardFloat 3s ease-in-out infinite;
    -webkit-animation: cardFloat 3s ease-in-out infinite;
}

@-webkit-keyframes cardFloat {
    0%, 100% { -webkit-transform: translateY(0); }
    50%       { -webkit-transform: translateY(-10px); }
}

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

/* Cuando se está revelando, parar la flotación */
.stack-card.revealing {
    animation: none !important;
}

.stack-card.front {
    z-index: 100;
}

.stack-card.back {
    z-index: 99;
}

.stack-card.back2 {
    z-index: 98;
}

/* Efecto de offset en el stack */
.stack-card.back {
    transform: translateY(8px) translateX(4px) scale(0.98);
}

.stack-card.back2 {
    transform: translateY(16px) translateX(8px) scale(0.96);
}

.stack-card.stack-position-3 {
    z-index: 97;
    transform: translateY(24px) translateX(12px) scale(0.94);
}

.stack-card.stack-position-4 {
    z-index: 96;
    transform: translateY(32px) translateX(16px) scale(0.92);
}

.stack-card.revealing {
    z-index: 1000 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.stack-card.flipped .card-inner {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.card-back,
.card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Dorso de la carta */
.card-back {
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 1;
}

.card-back::before {
    display: none;
}

.card-back-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    position: relative;
    z-index: 2;
}

.card-back-design {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Frente de la carta */
.card-front {
    background: transparent;
    border: 0;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    z-index: 2;
    overflow: visible;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.tcg-card {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 22px;
    color: #7d3f54;
    isolation: isolate;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    filter: drop-shadow(0 16px 30px rgba(122, 77, 102, 0.18));
}

.tcg-card-photo {
    position: absolute;
    left: 9.2%;
    top: 7.1%;
    width: 81.6%;
    height: 85.4%;
    object-fit: cover;
    object-position: center top;
    border-radius: 5.2%;
    z-index: 1;
    transform: scale(1.02);
}

.tcg-card-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
}

.tcg-card-title,
.tcg-card-type,
.tcg-card-rarity,
.tcg-card-serial,
.tcg-card-stat {
    position: absolute;
    z-index: 4;
    text-align: center;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.tcg-card-title {
    left: 18%;
    right: 10%;
    top: 2.8%;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tcg-card-type {
    left: 2.6%;
    top: 4.1%;
    width: 13%;
    font-size: 8px;
    font-weight: 900;
    color: #9d5367;
    text-transform: uppercase;
}

.tcg-card-rarity {
    left: 34%;
    bottom: 7.5%;
    width: 19%;
    font-size: 8px;
    font-weight: 900;
    color: #b95d77;
    text-transform: uppercase;
}

.tcg-card-serial {
    left: 10%;
    right: 10%;
    bottom: 2.4%;
    font-size: 7px;
    font-weight: 700;
    color: #6f3f4d;
}

.tcg-card-stat {
    bottom: 7.9%;
    width: 19%;
    font-size: 9px;
    font-weight: 900;
}

.tcg-card-attack {
    left: 29%;
}

.tcg-card-defense {
    right: 28%;
    color: #5367b0;
}

.tcg-card-thumb .tcg-card-title,
.tcg-card-thumb .tcg-card-type,
.tcg-card-thumb .tcg-card-rarity,
.tcg-card-thumb .tcg-card-serial,
.tcg-card-thumb .tcg-card-stat {
    transform: scale(0.82);
}

.card-info {
    width: 100%;
    padding: var(--spacing-md);
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
}

.card-info h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.card-info p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Rareza de la carta */
.card-rarity {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}

.rarity-legendary {
    background: rgba(251, 191, 36, 0.2);
    color: var(--legendary);
    border: 1px solid var(--legendary);
}

.rarity-epic {
    background: rgba(167, 139, 250, 0.2);
    color: var(--epic);
    border: 1px solid var(--epic);
}

.rarity-rare {
    background: rgba(96, 165, 250, 0.2);
    color: var(--rare);
    border: 1px solid var(--rare);
}

.rarity-common {
    background: rgba(209, 213, 219, 0.2);
    color: var(--common);
    border: 1px solid var(--common);
}

/* Efectos de rareza */
.stack-card.legendary {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.stack-card.epic {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.stack-card.rare {
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

/* Animación al voltear */
.stack-card.exit {
    z-index: 1000 !important;
    animation: cardExit 0.6s ease-out forwards;
}

@keyframes cardExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
}

/* WRAPPER DE CARTA Y ACCIONES */

.card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: var(--spacing-lg);
}

#card-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
}

.hint-text {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    animation: fadeInOut 2s ease-in-out infinite;
}

#card-flip {
    flex-shrink: 0;
}

.gacha-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
}

.gacha-results {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: var(--spacing-xl);
    padding-bottom: 88px;
}

.gacha-results-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(96px, 150px));
    gap: var(--spacing-md);
    align-items: start;
    justify-content: center;
    width: 100%;
    max-width: 860px;
}

.gacha-result-card {
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gacha-result-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 14px 28px rgba(236, 111, 157, 0.2);
}

.gacha-result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.gacha-results-actions {
    position: sticky;
    bottom: 76px;
    z-index: 25;
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: nowrap;
    width: min(100%, 430px);
    padding: 0 6px;
}

.gacha-results-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 13px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.card-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 232, 242, 0.64), rgba(235, 229, 255, 0.64));
    backdrop-filter: blur(3px);
}

.card-preview-image {
    width: min(82vw, 420px);
    aspect-ratio: 3 / 4;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 10px;
}

.card-preview-image .tcg-card {
    width: 100%;
    height: 100%;
}

.card-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #8f4f70;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* ==========================================
   COLECCIÓN (COLLECTION)
   ========================================== */

.collection-card {
    background: var(--bg-secondary);
    border: 1px solid var(--primary);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    text-align: left;
}

.collection-card > .tcg-card {
    width: 100%;
    aspect-ratio: 3 / 4;
}

.collection-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(236, 111, 157, 0.18);
}

.collection-card-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center top;
    background: var(--bg-tertiary);
    display: block;
    border-bottom: 1px solid rgba(244, 143, 177, 0.45);
}

.collection-card-info {
    display: none;
}

.collection-card-rarity-badge {
    position: absolute;
    bottom: 5px;
    left: 24px;
    transform: translateX(-50%);
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.collection-card-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff93b6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.collection-empty {
    grid-column: 1 / -1;
    width: 100%;
    padding: 48px 24px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--text-secondary);
}

.collection-empty h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ==========================================
   APILAMIENTO (STACKING)
   ========================================== */

.collection-stack {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.stack-section {
    flex: 1;
    min-width: 200px;
}

.stack-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.stack-items {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stack-item {
    width: 50px;
    height: 70px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.stack-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(236, 111, 157, 0.18);
}

.stack-item-count {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* ==========================================
   EFECTOS VISUALES DE RAREZA
   ========================================== */

.card-legendary {
    border-color: var(--legendary);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.card-legendary .card-front {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
}

.card-epic {
    border-color: var(--epic);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.card-epic .card-front {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(167, 139, 250, 0.05));
}

.card-rare {
    border-color: var(--rare);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

.card-rare .card-front {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(96, 165, 250, 0.05));
}

.card-common {
    border-color: var(--common);
}

/* ==========================================
   INSTRUCCIONES DE SWIPE
   ========================================== */

.swipe-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 20px;
    text-align: center;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .card-flip {
        width: 200px;
        height: 280px;
    }
    
    .card-stack-container {
        max-width: 340px;
        height: min(58svh, 480px);
        min-height: 400px;
    }

    .card-stack {
        width: min(74vw, 318px);
    }
    
    .envelope-3d-perspective {
        width: 200px;
        height: 300px;
    }
    
    .envelope-image {
        width: 200px;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .gacha-results-grid {
        grid-template-columns: repeat(3, minmax(88px, 1fr));
        max-width: 460px;
    }
}

@media (max-width: 480px) {
    .card-flip {
        width: 160px;
        height: 220px;
    }
    
    .card-stack-wrapper {
        min-height: calc(100svh - 82px);
        padding: 42px 0 74px;
        gap: 10px;
    }

    .card-stack-container {
        max-width: 330px;
        height: min(60svh, 470px);
        min-height: 390px;
    }

    .card-stack {
        width: min(78vw, 310px);
    }
    
    .envelope-3d-perspective {
        width: 160px;
        height: 240px;
    }
    
    .envelope-image {
        width: 160px;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .rarity-filter {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }

    .gacha-results-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .gacha-results-actions {
        width: 100%;
        gap: 8px;
    }

    .gacha-results-actions .btn {
        width: auto;
        padding: 12px 8px;
        font-size: 12px;
    }
}

/* Compact mobile collection */
@media (max-width: 560px) {
    .rarity-filter {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 10px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .rarity-filter::-webkit-scrollbar {
        display: none;
    }

    .rarity-filter .admin-select {
        flex: 0 0 auto;
        min-width: 108px;
        max-width: 132px;
        padding: 7px 8px;
        border-radius: 999px;
        font-size: 11px;
    }

    .collection-season-progress {
        margin: 0 0 10px;
        gap: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .collection-season-progress::-webkit-scrollbar {
        display: none;
    }

    .season-progress-pill {
        flex: 0 0 auto;
        padding: 5px 7px;
        font-size: 10px;
    }

    .collection-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 7px;
    }

    .collection-card {
        border-radius: 7px;
    }

    .collection-card-count {
        top: 4px;
        right: 4px;
        padding: 2px 5px;
        border-radius: 999px;
        font-size: 9px;
    }

    .collection-card-rarity-badge {
        left: 50%;
        bottom: 3px;
        max-width: calc(100% - 8px);
        overflow: hidden;
        padding: 2px 5px;
        font-size: 8px;
        text-overflow: ellipsis;
    }

    .destroy-duplicate-btn {
        left: 4px;
        right: 4px;
        bottom: 4px;
        min-height: 22px;
        border-radius: 999px;
        font-size: 8px;
    }

    .collection-card:has(.destroy-duplicate-btn) .collection-card-rarity-badge {
        bottom: 30px;
    }
}
