/* --- Global Styles & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&family=Orbitron:wght@700&display=swap');

:root {
    --primary-color: #ffd700; /* Gold */
    --primary-hover: #e6c300;
    --secondary-color: #4a5568; /* Gray */
    --secondary-hover: #2d3748;
    --accent-color: #00e5ff; /* Bright Cyan */
    --background-dark: #0d1117; /* Very Dark Blue/Gray */
    --background-medium: #161b22; /* Darker Gray */
    --background-light: #21262d; /* Lighter Gray */
    --text-primary: #c9d1d9; /* Light Gray */
    --text-secondary: #8b949e; /* Medium Gray */
    --border-color: #30363d;
    --success-color: #2ea043;
    --warning-color: #fca311;
    --error-color: #da3633;
    --legendary-glow: #ff8000; /* Orange/Gold for Legendary */
    --rare-glow: #4b0082; /* Purple for Rare */
    --common-glow: #1e90ff; /* Blue for Common */

    --font-body: 'Noto Sans SC', sans-serif;
    --font-heading: 'Orbitron', sans-serif; /* Techy/Gamey Font */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 15px rgba(var(--primary-rgb, 255, 215, 0), 0.5); /* Define primary-rgb if needed */
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: linear-gradient(rgba(13, 17, 23, 0.9), rgba(13, 17, 23, 0.95)); /* Add a subtle background image if you have one */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* --- Header & Navigation --- */
header {
    background-color: rgba(22, 27, 34, 0.85); /* Semi-transparent */
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
    transition: transform 0.3s ease;
}
.logo span {
    color: var(--primary-color); /* Highlight part of the logo */
}
.logo:hover {
    transform: scale(1.05);
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.nav-links a:hover {
    color: var(--text-primary);
}
.nav-links a:hover::after {
    width: 100%;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .welcome-msg {
    color: var(--text-secondary);
    margin-right: 10px;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-dark);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.copy-btn {
    padding: 5px 10px;
    margin-left: 10px;
    font-size: 0.8rem;
    background-color: var(--background-light);
    color: var(--text-secondary);
    min-width: 40px; /* Ensure space for icon */
}
.copy-btn:hover {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}
.copy-btn svg {
    vertical-align: middle;
}

/* --- Main Content --- */
main.container {
    padding-top: 40px;
    padding-bottom: 60px;
}

.section-title {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    letter-spacing: 1px;
}

/* --- Probability Info --- */
.probability-info {
    background: linear-gradient(135deg, var(--background-medium), var(--background-light));
    border-left: 5px solid var(--accent-color);
    padding: 15px 25px;
    margin: 0 auto 40px auto;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden; /* For pseudo-element animation */
}

.info-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative; /* Ensure text is above animated background */
    z-index: 2;
}
.info-icon {
    margin-right: 10px;
    color: var(--accent-color);
    font-size: 1.2em; /* Make icon slightly larger */
    vertical-align: middle;
}

/* Subtle background animation */
.animated-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.1), transparent);
    animation: shimmer 4s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}


/* --- Cases Grid & Cards --- */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
}

.case-card {
    background-color: var(--background-medium);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    position: relative; /* For glow */
}

.case-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}

.case-img-wrapper {
    height: 220px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, var(--background-light) 0%, var(--background-medium) 70%);
    position: relative; /* Needed for glow */
}

.case-img {
    max-height: 90%;
    max-width: 90%;
    object-fit: contain; /* Ensure image fits well */
    transition: transform 0.4s ease;
}

.case-card:hover .case-img {
    transform: scale(1.1);
}

/* Rarity Glow Effect */
.case-rarity-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%; /* Larger than image */
    height: 120%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1; /* Behind image */
    filter: blur(30px); /* Soft glow */
    background-color: var(--primary-color); /* Default glow */
}
/* Specific Rarity Glows (Add classes like common-glow, rare-glow, legendary-glow to the div) */
.case-rarity-glow.common-glow { background-color: var(--common-glow); }
.case-rarity-glow.rare-glow { background-color: var(--rare-glow); }
.case-rarity-glow.legendary-glow { background-color: var(--legendary-glow); }

.case-card:hover .case-rarity-glow {
    opacity: 0.4; /* Show glow on hover */
}


.case-info {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--background-light);
    border-top: 1px solid var(--border-color);
}

.case-name {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.3rem;
    min-height: 2.6rem; /* Ensure consistent height */
}

.case-price {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 700;
    font-family: var(--font-body); /* Use body font for price */
}

.open-btn {
    width: 90%;
    margin: 0 auto;
}

/* --- Overlays & Modals --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 17, 23, 0.9); /* Darker, more opaque */
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s; /* Delay visibility change */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

.modal-container {
    background-color: var(--background-medium);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 550px;
    width: 90%;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative; /* For close button */
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.4s ease; /* Bounce + Fade */
    opacity: 0;
}

.overlay.active .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.close-btn-corner {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1;
}
.close-btn-corner:hover {
    color: var(--error-color);
    transform: rotate(90deg);
}

/* --- Prize Modal Specifics --- */
.prize-container .modal-title {
    color: var(--success-color); /* Green for success */
    text-shadow: 0 0 10px rgba(46, 160, 67, 0.7);
}
.prize-img {
    max-width: 70%;
    margin: 10px auto 20px auto;
    border-radius: 8px;
    background: radial-gradient(circle, var(--background-light) 0%, transparent 70%);
    padding: 10px;
}
.prize-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.prize-rarity {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 25px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}
/* Add classes for different rarities */
.prize-rarity.common { color: #fff; background-color: var(--common-glow); }
.prize-rarity.rare { color: #fff; background-color: var(--rare-glow); }
.prize-rarity.legendary { color: #fff; background-color: var(--legendary-glow); }


/* --- Purchase Modal Specifics --- */
.purchase-form {
    margin-top: 20px;
}
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background-color: var(--background-dark);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}
/* Style for number input spinner */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    opacity: 0.3;
}

.total-price-display {
    text-align: right;
    font-size: 1.1rem;
    margin-top: 10px;
}
.price-highlight {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.3em; /* Make price stand out */
}

/* --- Payment Modal Specifics --- */
.payment-info {
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.8;
}
.payment-info p {
    margin-bottom: 15px;
}
.payment-info strong {
    color: var(--text-secondary);
    min-width: 100px; /* Align values */
    display: inline-block;
}
.info-highlight {
    color: var(--accent-color);
    font-weight: 600;
}
.warning-text {
    color: var(--warning-color);
    font-weight: bold;
    background-color: rgba(252, 163, 17, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
}
.warning-text .info-icon { color: var(--warning-color); }

.address-container {
    display: flex;
    align-items: center;
    background-color: var(--background-dark);
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin: 10px 0 20px 0;
}
#payment-address {
    flex-grow: 1;
    font-family: monospace;
    color: var(--text-primary);
    word-break: break-all; /* Wrap long addresses */
    margin-right: 10px;
    font-size: 0.9rem;
}

.status-text {
    color: var(--text-secondary);
}
.status-text .info-icon {
    color: var(--accent-color);
    animation: spin 2s linear infinite; /* Loading spinner */
}
.payment-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}
.payment-status.success { background-color: rgba(46, 160, 67, 0.1); border-left: 3px solid var(--success-color); color: var(--success-color);}
.payment-status.pending { background-color: rgba(252, 163, 17, 0.1); border-left: 3px solid var(--warning-color); color: var(--warning-color);}
.payment-status.error { background-color: rgba(218, 54, 51, 0.1); border-left: 3px solid var(--error-color); color: var(--error-color);}


/* --- Utility & Animations --- */
.button-group {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Apply fade in to cards */
.case-card {
    opacity: 0; /* Start hidden */
    animation: fadeIn 0.5s ease-out forwards;
}
/* Stagger animation for grid items */
.cases-grid .case-card:nth-child(1) { animation-delay: 0.1s; }
.cases-grid .case-card:nth-child(2) { animation-delay: 0.2s; }
.cases-grid .case-card:nth-child(3) { animation-delay: 0.3s; }
/* Add more delays if needed */
.cases-grid .case-card:nth-child(4) { animation-delay: 0.4s; }
.cases-grid .case-card:nth-child(5) { animation-delay: 0.5s; }
.cases-grid .case-card:nth-child(6) { animation-delay: 0.6s; }


/* --- Responsive Design (Basic Example) --- */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; }
    .nav-links { margin-top: 10px; }
    .section-title { font-size: 2.2rem; }
    .cases-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
    .modal-container { padding: 20px; max-width: 95%; }
    .modal-title { font-size: 1.5rem; }
    .button-group { flex-direction: column; gap: 10px; }
    .btn { width: 100%; }
    .copy-btn { margin-left: 5px; }
    #payment-address { font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.5rem; }
    .nav-links { gap: 15px; }
    .user-panel .btn { padding: 8px 15px; font-size: 0.85rem;}
    .case-card { border-radius: 8px; }
    .case-img-wrapper { height: 180px; }
    .case-name { font-size: 1.1rem; }
    .case-price { font-size: 1.2rem; }
}