/* ==========================================
   GLOBAL STYLES & RESET
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #050508; /* Ultra-dark, near pitch black background */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Trigger Button on Main Screen */
.trigger-btn {
    background: transparent;
    color: #ffffff;
    border: 2px solid #00f2ff;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
    transition: all 0.3s ease;
}

.trigger-btn:hover {
    background: #00f2ff;
    color: #050508;
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.6);
}

/* ==========================================
   OVERLAY & MODAL WINDOW
   ========================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 2, 5, 0.95); /* Deepest dark overlay to isolate the card */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.4s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================
   THE IRIDESCENT GLASS TRADING CARD
   ========================================== */
.trading-card {
    position: relative;
    width: 750px;
    max-width: 95vw;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.85) 0%, rgba(5, 5, 10, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 242, 255, 0.25);
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform 0.1s ease;
}

/* Moving Light Reflection Effect */
.card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(0, 242, 255, 0.08) 47%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(0, 242, 255, 0.08) 53%,
        transparent 60%
    );
    pointer-events: none;
    transform: rotate(-15deg);
    animation: shineSweep 8s infinite linear;
}

@keyframes shineSweep {
    0% { transform: translate(-30%, -30%) rotate(-15deg); }
    100% { transform: translate(10%, 10%) rotate(-15deg); }
}

/* Close Window Button */
.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #00f2ff;
}

/* ==========================================
   CARD LAYOUT COMPONENTS
   ========================================== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.character-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card-points {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: #00f2ff;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.card-body {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

/* Left Side: 3D Studio Frame */
.card-left {
    flex: 1;
    min-width: 280px;
}

.character-image {
    width: 100%;
    height: 320px;
    background: radial-gradient(circle at center, #0a1520 0%, #020408 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    outline: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

/* Right Side: Data Frame */
.card-right {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cyan-text {
    color: #00f2ff;
    font-weight: bold;
}

.value-badge {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #00f2ff;
}

/* Sections (Bio & Stats) */
.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 6px;
}

.bio-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

/* Attributes Grid Styles */
.stats-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stats-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
}

/* ==========================================
   FOOTER ACTIONS
   ========================================== */
.card-footer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.trade-btn {
    width: 100%;
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
    border: none;
    color: #ffffff;
    padding: 14px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
    transition: all 0.3s ease;
}

.trade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 198, 255, 0.6);
}

/* ==========================================
   ANIMATIONS (Fly-Away & Arrive)
   ========================================== */
.prepare-arrival {
    opacity: 0;
    transform: scale(0.5) translateY(100px) rotateX(45deg);
}

.arrive {
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0deg);
}

.fly-away {
    transition: all 0.6s cubic-bezier(0.55, 0.055, 0.675, 0.19);
    opacity: 0;
    transform: scale(0.8) translateY(-500px) rotateY(45deg);
}

/* ==========================================
   MOBILE RESPONSIVENESS (THE LAYOUT FIX)
   ========================================== */
@media (max-width: 768px) {
    /* Stacks the 3D box on top of the text */
    .card-body {
        flex-direction: column; 
        gap: 16px;
    }

    /* Centers the header and points badge */
    .card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Adjusts the 3D box so it looks good stacked */
    .character-image {
        height: 280px; 
    }

    /* Ensures the card doesn't go off-screen and allows scrolling if needed */
    .trading-card {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Makes the stats grid slightly more compact for phones */
    .stats-list {
        grid-template-columns: 1fr;
    }
}
