body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", sans-serif;
    background: #0a0c10;
    color: #E6E6E6;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at 30% 20%, rgba(180,50,20,0.15), transparent),
                linear-gradient(135deg, #0f1116 0%, #1a1d24 100%);
}

/* Nav & Header */
#mainNav { background: rgba(10,12,16,0.98); padding: 16px 0; position: sticky; top: 0; z-index: 100; }
#mainNav ul { list-style: none; display: flex; justify-content: center; gap: 40px; }
#mainNav a { color: #E6E6E6; text-decoration: none; padding: 8px 18px; }
#mainNav a:hover { color: #f0d9a0; }

header { text-align: center; padding: 60px 20px 40px; }
header h1 { font-size: 3.4rem; color: #f04e37; text-shadow: 0 0 25px #f04e37; }
.types { color: #d4b070; font-size: 1.35rem; }

/* Game Container */
.game-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(20,15,15,0.92);
    border: 4px solid #c9a66b;
    border-radius: 20px;
    text-align: center;
}

/* Current Card - 3D Fancy Style */
.current-card {
    min-height: 460px;
    margin: 30px 0;
    perspective: 1500px;
}

.card {
    width: 320px;
    height: 440px;
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card:hover {
    transform: scale(1.05) rotateY(8deg) rotateX(8deg);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
}

.card-front {
    background: linear-gradient(#1a0f0f, #2c1a1a);
    border: 6px solid #f04e37;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
}

.card-back {
    background: #1a0f0f;
    border: 6px solid #c9a66b;
    transform: rotateY(180deg);
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.draw-btn, .collection-btn {
    font-size: 1.3rem;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
}

.draw-btn {
    background: linear-gradient(#f04e37, #8b1f10);
    color: white;
    box-shadow: 0 8px 25px rgba(240,78,55,0.6);
}

.collection-btn {
    background: #3a2a1f;
    color: #d4b070;
    border: 2px solid #c9a66b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a0f0f;
    border: 4px solid #c9a66b;
    border-radius: 20px;
    padding: 30px;
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.collected-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.collected-grid .card {
    height: 260px;
    width: 100%;
}

.close-btn {
    background: #8b1f10;
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Enlarged Card Overlay */
.enlarged-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: pointer;
}

.enlarged-card {
    width: 420px;
    height: 580px;
    perspective: 2000px;
}

.enlarged-card .card-back.enlarged {
    width: 100%;
    height: 100%;
    border: 8px solid #f04e37;
    box-shadow: 0 0 60px rgba(240, 78, 55, 0.8);
    transform: rotateY(0deg);
}

.enlarged-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.enlarged-card h3 {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 1.4rem;
    color: #f0d9a0;
}
/* Collection Cards - Show illustration by default */
.collection-card {
    height: 260px;
    width: 100%;
}

.collection-card .card-back {
    transform: rotateY(0deg) !important;
    border: 3px solid #c9a66b;
}

/* Enlarged View */
.enlarged-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: pointer;
}

.enlarged-card {
    width: 420px;
    height: 580px;
    border: 8px solid #f04e37;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(240, 78, 55, 0.9);
    position: relative;
}

.enlarged-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.enlarged-card h3 {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    padding: 10px 25px;
    border-radius: 30px;
    color: #f0d9a0;
    font-size: 1.5rem;
}