/* Global Reset & Theme Tokens */
:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(25, 28, 38, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f6fa;
    --text-secondary: #a0a5b5;
    
    /* Neon Accents */
    --accent-teal: #1f8eed;
    --accent-purple: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.35);
    
    /* Rarity Glow Colors */
    --glow-common: rgba(255, 255, 255, 0.15);
    --glow-rare: rgba(59, 130, 246, 0.5);
    --glow-ultra-rare: rgba(168, 85, 247, 0.7);
    --glow-secret-rare: rgba(234, 179, 8, 0.9);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glassmorphism Panel helper */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Header & Ticker Styling */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: rgba(13, 14, 18, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 36px;
    line-height: 36px;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
    padding-left: 100%;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ticker-item strong {
    color: var(--text-primary);
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 12, 16, 0.75);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-accent {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn.active, .nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.badge {
    background: var(--accent-purple);
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
    font-weight: 800;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
}

.username,
.username-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.username-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.username-btn:hover {
    color: var(--accent-teal);
    text-decoration: underline;
}

.balance-tag {
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Page Containers */
.container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Pack Shop Styles */
.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.pack-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.pack-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--accent-glow);
    border-color: var(--accent-purple);
}

.pack-card-image {
    height: 180px;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.pack-art-placeholder {
    width: 90px;
    height: 130px;
    background: linear-gradient(220deg, #a78bfa 0%, #7c3aed 100%);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.75rem;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    transform: rotate(-5deg);
    border: 1px solid rgba(255,255,255,0.15);
}

.pack-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pack-card-body h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.pack-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.pack-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pack-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-odds {
    background: transparent;
    color: var(--accent-teal);
    border: 1px solid rgba(31, 142, 237, 0.5);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-odds:hover {
    background: rgba(31, 142, 237, 0.15);
    border-color: var(--accent-teal);
}

.pack-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
}

.btn-open {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

.btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* Vault Page Styles */
.vault-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vault-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
}

.vault-summary div {
    font-size: 1.25rem;
    font-weight: 600;
}

.highlight {
    color: #10b981;
    font-weight: 800;
}

.subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.vault-buttons {
    display: flex;
    gap: 1rem;
}

.action-btn {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sell-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sell-btn:not(:disabled):hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.ship-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.ship-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.card-item {
    position: relative;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-item:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-item.selected {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.card-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--accent-purple);
}

.card-img-wrap {
    width: 140px;
    height: 196px;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    background: #111318;
}

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

.card-info {
    text-align: center;
    width: 100%;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.card-rarity-badge {
    font-size: 0.75rem;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.rarity-common { background: rgba(255, 255, 255, 0.1); color: #ccc; }
.rarity-rare { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.rarity-ultra { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.rarity-secret { background: rgba(234, 179, 8, 0.15); color: #facc15; }

/* Wallet UI */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.wallet-card {
    padding: 2rem;
}

.wallet-card h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.deposit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.deposit-form label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.payment-methods {
    display: flex;
    gap: 1rem;
}

.method-option {
    flex: 1;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.01);
}

.method-option.active, .method-option:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
}

.pay-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.85rem;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.account-summary {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Modals & Overlays */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: white;
}

/* Pack Opening Reveal Screen */
.pack-opening-experience {
    width: 90%;
    max-width: 650px;
    height: 520px;
    position: relative;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pack-opening-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pack foil wrapper */
.pack-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: bounce 2s infinite ease-in-out;
}

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

.pack-foil {
    width: 170px;
    height: 250px;
    background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), inset 0 0 20px rgba(255,255,255,0.3);
    position: relative;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-foil-artwork {
    text-align: center;
    padding: 1rem;
}

.pack-foil h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.25rem;
}

.pack-art-sub {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 800;
}

.rip-btn {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 99px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
    transition: all 0.3s;
}

.rip-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(225, 29, 72, 0.6);
}

/* 3D Card Reveal container */
.reveal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.trading-card-3d {
    width: 180px;
    height: 252px;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.card-back {
    background: #1e293b;
    border: 4px solid #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokeball {
    width: 80px;
    height: 80px;
    background: linear-gradient(to bottom, #ef4444 50%, white 50%);
    border-radius: 50%;
    border: 5px solid #0f172a;
    position: relative;
}

.pokeball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: white;
    border: 5px solid #0f172a;
    border-radius: 50%;
}

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

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

.reveal-details {
    padding: 1rem 2rem;
    width: 90%;
    text-align: center;
}

.card-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 0.75rem 0;
}

.price-tag {
    color: #10b981;
    font-weight: 800;
    font-size: 1.25rem;
}

.card-vault-status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.reveal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.keep-btn {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--border-color);
}

.keep-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.close-btn {
    background: transparent;
    color: var(--text-secondary);
}

/* Rarity glow visual effects */
.glow-container {
    position: absolute;
    width: 280px;
    height: 350px;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    transition: all 0.5s ease;
}

.rarity-glow-common {
    background: radial-gradient(circle, var(--glow-common) 0%, transparent 70%);
}

.rarity-glow-rare {
    background: radial-gradient(circle, var(--glow-rare) 0%, transparent 70%);
    animation: pulseGlow 2s infinite alternate;
}

.rarity-glow-ultra {
    background: radial-gradient(circle, var(--glow-ultra-rare) 0%, transparent 70%);
    animation: pulseGlow 1.5s infinite alternate;
}

.rarity-glow-secret {
    background: radial-gradient(circle, var(--glow-secret-rare) 0%, transparent 70%);
    animation: rainbowGlow 4s infinite linear;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.85; }
}

@keyframes rainbowGlow {
    0%, 100% { filter: hue-rotate(0deg) blur(40px); transform: scale(1.0); opacity: 0.7; }
    50% { filter: hue-rotate(180deg) blur(50px); transform: scale(1.15); opacity: 0.9; }
}

/* Shipping Checkout Form */
.shipping-modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
}

.shipping-modal-content h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.shipping-summary {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

.shipping-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    font-family: inherit;
    outline: none;
    resize: none;
    transition: all 0.3s;
}

.form-group textarea:focus {
    border-color: var(--accent-purple);
}

.shipping-fee-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 600;
}

.shipping-fee-display strong {
    color: #10b981;
    font-size: 1.4rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-buttons button {
    flex: 1;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.85rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

/* Toast Alerts */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: white;
    z-index: 2000;
    font-weight: 600;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.centered {
    text-align: center;
}

.text-left {
    text-align: left;
}

.hidden {
    display: none !important;
}

/* ===== PROMO BALANCE TAG (NAVBAR) ===== */
.promo-tag {
    font-weight: 700;
    font-size: 0.8rem;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ===== DAILY CHEST ===== */
.daily-chest-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(250, 204, 21, 0.2);
    background: rgba(250, 204, 21, 0.04);
    position: relative;
    overflow: hidden;
}

.daily-chest-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at left, rgba(250, 204, 21, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.chest-icon {
    font-size: 2.5rem;
    animation: chestBounce 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes chestBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    40% { transform: translateY(-6px) rotate(-5deg); }
    60% { transform: translateY(-6px) rotate(5deg); }
}

.chest-icon.locked {
    animation: chestShake 0.5s ease-in-out;
    filter: grayscale(1);
}

@keyframes chestShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.chest-info {
    flex: 1;
}

.chest-info h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: #facc15;
}

.chest-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.chest-btn {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #0b0c10;
    border: none;
    padding: 0.85rem 1.75rem;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.35);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.5);
}

.chest-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ===== PSA GRADED SLAB ===== */
.psa-slab {
    width: 180px;
    height: 280px;
    perspective: 1000px;
}

.psa-slab-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.psa-slab-inner.flipped {
    transform: rotateY(180deg);
}

.psa-slab-front, .psa-slab-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 6px;
    overflow: hidden;
}

.psa-slab-back {
    background: #1e293b;
    border: 4px solid #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psa-slab-front {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #d4d4d4 0%, #e5e5e5 30%, #f5f5f5 60%, #d4d4d4 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 1px #aaa, 0 12px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
}

/* PSA Red Header Label */
.psa-label {
    background: linear-gradient(135deg, #c00 0%, #900 100%);
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.psa-logo {
    font-size: 1rem;
    font-weight: 900;
    color: white;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.psa-grade-number {
    font-size: 1.75rem;
    font-weight: 900;
    color: #facc15;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
    line-height: 1;
}

.psa-grade-text {
    font-size: 0.55rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    text-align: right;
    line-height: 1.2;
}

/* Clear acrylic card window */
.psa-card-window {
    flex: 1;
    margin: 0.35rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

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

/* PSA Certificate label */
.psa-cert-label {
    background: rgba(0,0,0,0.08);
    border-top: 1px solid rgba(0,0,0,0.12);
    padding: 0.3rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    color: #333;
    flex-shrink: 0;
}

.psa-cert-label strong {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

/* PSA badge in reveal details */
.psa-mini-badge {
    background: linear-gradient(135deg, #c00 0%, #900 100%);
    color: #facc15;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* ===== LEADERBOARD ===== */
.leaderboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    min-height: 200px;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.podium-avatar {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.podium-slot:nth-child(1) .podium-avatar { border-color: #facc15; box-shadow: 0 0 15px rgba(250,204,21,0.4); }
.podium-slot:nth-child(2) .podium-avatar { border-color: #94a3b8; }
.podium-slot:nth-child(3) .podium-avatar { border-color: #b45309; }

.podium-name {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-value {
    font-size: 1rem;
    font-weight: 800;
    color: #10b981;
}

.podium-block {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(0,0,0,0.4);
    width: 90px;
}

.podium-slot:nth-child(1) .podium-block { background: linear-gradient(to top, #a16207, #facc15); height: 120px; }
.podium-slot:nth-child(2) .podium-block { background: linear-gradient(to top, #475569, #94a3b8); height: 90px; }
.podium-slot:nth-child(3) .podium-block { background: linear-gradient(to top, #7c2d12, #b45309); height: 70px; }

.leaderboard-table-wrap {
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

.leaderboard-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.95rem;
    vertical-align: middle;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.leaderboard-table tr.is-you td {
    background: rgba(139, 92, 246, 0.06);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.9rem;
}

.rank-1 { background: rgba(250,204,21,0.2); color: #facc15; }
.rank-2 { background: rgba(148,163,184,0.2); color: #94a3b8; }
.rank-3 { background: rgba(180,83,9,0.2); color: #b45309; }
.rank-other { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

.psa-grade-cell {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: linear-gradient(135deg, #c00 0%, #900 100%);
    color: #facc15;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* ===== AFFILIATES & PROMOS PAGE ===== */
.promos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.promos-grid > .promo-card {
    min-width: 0;
}

.promo-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
}

.promo-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.promo-icon-wrap {
    font-size: 2.5rem;
}

.promo-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.promo-input-row input {
    width: 100%;
    min-width: 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.3s;
    text-transform: uppercase;
    box-sizing: border-box;
}

.promo-input-row input:focus {
    border-color: var(--accent-purple);
}

.small-btn {
    padding: 0.65rem 1.25rem !important;
    font-size: 0.95rem !important;
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
    justify-self: end;
}

.promo-balance-display {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 8px;
}

.referral-link-box {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.referral-link-box span {
    flex: 1;
}

.copy-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.15);
}

.referral-stats {
    display: flex;
    gap: 1.5rem;
}

.ref-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ref-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
}

.ref-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.promo-info-card {
    grid-column: 1 / -1;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.info-list li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    padding-left: 0.5rem;
    border-left: 2px solid rgba(255,255,255,0.08);
}

.info-list li strong {
    color: var(--text-primary);
}

/* Login & odds modals */
.login-modal-content {
    width: 90%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
}

.login-modal-content h2 {
    margin-bottom: 0.75rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    text-align: left;
}

.login-form label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.demo-disclaimer {
    font-size: 0.8rem !important;
    margin-top: 1rem;
}

.odds-modal-content {
    width: 92%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.odds-table-wrap {
    margin: 1.25rem 0;
    overflow-x: auto;
}

.odds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.odds-table th,
.odds-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.odds-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.odds-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.odds-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
}

.centered-btn {
    display: block;
    margin: 0 auto;
}

/* Wallet history (Phase 2) */
.wallet-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.wallet-history-card h2 {
    margin-bottom: 0.35rem;
}

.history-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 360px;
    overflow-y: auto;
}

.history-empty {
    padding: 1.5rem 0 !important;
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}

.history-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.history-type {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.history-amount {
    font-weight: 800;
    font-size: 0.95rem;
    align-self: flex-end;
}

.history-amount.credit {
    color: #10b981;
}

.history-amount.debit {
    color: #f87171;
}

.history-shipping-detail {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.history-shipping-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.history-shipping-meta .subtext {
    font-size: 0.75rem;
    flex: 1;
    line-height: 1.4;
}

.status-pill {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    font-weight: 700;
    vertical-align: middle;
}

/* Pack artwork from DB */
.pack-image {
    max-height: 150px;
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.pack-foil-has-image {
    background-size: cover !important;
    background-position: center !important;
}

.pack-foil-has-image .pack-foil-artwork {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    padding: 0.5rem;
}

.referral-hint {
    color: var(--accent-teal);
    margin-top: 0.5rem;
}

/* Responsive — mobile & tablet */
@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem 4%;
    }

    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .user-status {
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .packs-grid {
        grid-template-columns: 1fr;
    }

    .wallet-grid,
    .wallet-history-grid,
    .promos-grid {
        grid-template-columns: 1fr;
    }

    .vault-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .vault-buttons {
        flex-direction: column;
    }

    .pack-opening-experience {
        height: auto;
        min-height: 480px;
        padding: 1.5rem;
    }

    .leaderboard-podium {
        flex-direction: column;
        align-items: center;
    }

    .odds-modal-content,
    .login-modal-content,
    .shipping-modal-content {
        width: 96%;
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
        margin-top: 1.5rem;
    }

    .balance-tag,
    .promo-tag {
        font-size: 0.75rem;
    }

    .pack-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pack-actions {
        width: 100%;
    }

    .pack-actions button {
        flex: 1;
    }

    .daily-chest-section {
        flex-direction: column;
        text-align: center;
    }

    .promo-input-row {
        grid-template-columns: 1fr;
    }

    .promo-input-row .small-btn {
        width: 100%;
        justify-self: stretch;
    }
}

