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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #222 0%, #333 50%, #444 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    background: rgba(68, 68, 68, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.header h1 {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFEB3B);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.header .subtitle {
    font-size: 1.2em;
    color: #FFD700;
}

.back-link-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.back-link-game {
    display: inline-block;
    background: linear-gradient(135deg, #555 0%, #666 100%);
    color: #FFD700;
    padding: 8px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
    margin-right: 10px;
}

.back-link {
    display: inline-block;
    background: linear-gradient(135deg, #555 0%, #666 100%);
    color: #FFD700;
    padding: 8px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
    margin-bottom: 0;
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.back-link-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.purchase-card {
    background: rgba(68, 68, 68, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(85, 85, 85, 0.5);
}

.purchase-card h2 {
    color: #FFD700;
    margin-bottom: 25px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-methods {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.payment-method {
    background: rgba(85, 85, 85, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.payment-method:hover {
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

.payment-method.selected {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
}

.payment-method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.payment-method-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #FFD700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-method-icon {
    font-size: 1.5em;
}

.payment-method-rate {
    font-size: 0.9em;
    color: #4CAF50;
    font-weight: 600;
}

.payment-method-desc {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #FFD700;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    background: rgba(85, 85, 85, 0.6);
    color: #e0e0e0;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #FFD700;
}

.form-input::placeholder {
    color: #999;
}

.currency-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.currency-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(85, 85, 85, 0.6);
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.currency-btn.active {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    color: #FFD700;
}

.conversion-display {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.conversion-arrow {
    font-size: 1.5em;
    color: #FFD700;
    margin: 10px 0;
}

.conversion-result {
    font-size: 1.8em;
    font-weight: 700;
    color: #FFD700;
}

.conversion-rate {
    font-size: 0.9em;
    color: #ccc;
    margin-top: 5px;
}

.purchase-button {
    width: 100%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 18px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.purchase-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 215, 0, 0.5);
}

.purchase-button:disabled {
    background: linear-gradient(135deg, #666 0%, #777 100%);
    color: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Wallet Connection Styles */
.wallet-connection {
    background: rgba(85, 85, 85, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 20px 5px;
    margin-bottom: 20px;
    text-align: center;
}

.wallet-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.wallet-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4444;
}

.wallet-indicator.connected {
    background: #4CAF50;
}

.connect-wallet-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    width:96%;
}

.connect-wallet-btn:hover {
    transform: translateY(-2px);
}

.wallet-connection.connected .wallet-connection-instructions {
    display: none !important;
}

.connected-wallet-info {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    display: none;
    width:95%;
    margin-left:2.5%;
}

.connected-wallet-info.visible {
    display: block;
}

.wallet-address-display {
    font-family: monospace;
    font-size: 0.8em;
    color: #4CAF50;
    word-break: break-all;
    background: rgba(85, 85, 85, 0.6);
    padding: 8px;
    border-radius: 6px;
    margin-top: 8px;
}

.disconnect-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 8px;
    width:96%;
}

/* Wallet Selection Modal */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wallet-modal-overlay.visible {
    display: flex;
}

.wallet-modal {
    background: rgba(68, 68, 68, 0.98);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.wallet-modal h3 {
    color: #FFD700;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.wallet-options {
    display: grid;
    gap: 15px;
}

.wallet-option {
    background: rgba(85, 85, 85, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wallet-option:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

.wallet-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.wallet-option-icon.solflare {
    background: linear-gradient(135deg, #fffc45, #f1c814);
}

.wallet-option-icon.phantom {
    background: linear-gradient(135deg, #AB9FF2, #4E44CE);
}

.wallet-option-icon.coinbase {
    background: linear-gradient(135deg, #0052FF, #2c00cc);
}

.wallet-option-icon.atomic {
    background: linear-gradient(135deg, #cbd2d4, #465064);
}

.wallet-option-icon.metamask {
    background: linear-gradient(135deg, #ff9900, #cc6300);
}

.wallet-option-content {
    flex: 1;
    text-align: left;
}

.wallet-option-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.wallet-option-desc {
    font-size: 0.85em;
    color: #999;
}

.wallet-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
}

.info-card {
    background: rgba(68, 68, 68, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(85, 85, 85, 0.5);
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 1.3em;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8em;
    opacity: 0.8;
}

.tier-preview {
    background: rgba(85, 85, 85, 0.6);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tier-name {
    color: #FFD700;
    font-weight: 600;
    margin-bottom: 8px;
}

.tier-tokens {
    font-size: 1.1em;
    font-weight: 700;
}

.security-notice {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.security-notice h3 {
    color: #4CAF50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-notice ul {
    margin-left: 20px;
    color: #e0e0e0;
}

.security-notice li {
    margin-bottom: 5px;
}

.progress-bar {
    background: rgba(85, 85, 85, 0.6);
    border-radius: 10px;
    height: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    height: 100%;
    width: 25%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9em;
    color: #ccc;
    margin-top: 5px;
}

.contract-info-display {
    background: rgba(85, 85, 85, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
}

.contract-info-label {
    color: #FFD700;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.contract-info-value {
    color: #4CAF50;
    font-size: 0.8em;
    word-break: break-all;
}

.transaction-status {
    background: rgba(68, 68, 68, 0.95);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    display: none;
}

.transaction-status.visible {
    display: block;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .currency-selector {
        flex-direction: column;
    }

    .wallet-modal {
        width: 95%;
        padding: 20px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Additional CSS for RAMP Integration - Add to existing presalePurchase.css */

/* Enhanced payment method styling */
.payment-method-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

/* RAMP specific styling */
.ramp-payment-notice {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    font-size: 0.85em;
    color: #FFD700;
}

/* Currency button enhancements */
.currency-btn {
    transition: all 0.3s ease;
    position: relative;
}

.currency-btn:not(.active):hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

/* RAMP widget container (if using embedded mode) */
.ramp-widget-container {
    width: 100%;
    min-height: 600px;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

/* Payment process indicator */
.payment-process-steps {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 0 10px;
}

.payment-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.payment-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: rgba(255, 215, 0, 0.3);
    z-index: 1;
}

.payment-step.active::after {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.payment-step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(85, 85, 85, 0.8);
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px auto;
    font-size: 0.8em;
    position: relative;
    z-index: 2;
}

.payment-step.active .payment-step-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.payment-step.completed .payment-step-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
}

.payment-step-label {
    font-size: 0.75em;
    color: #ccc;
    margin-top: 5px;
}

.payment-step.active .payment-step-label {
    color: #FFD700;
    font-weight: 600;
}

/* Enhanced conversion display for RAMP */
.conversion-display.ramp-mode {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.4);
}

.conversion-display.ramp-mode .conversion-result {
    background: linear-gradient(135deg, #4CAF50, #FFD700);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* RAMP status indicators */
.ramp-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 10px 0;
}

.ramp-status-indicator.processing {
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid rgba(255, 165, 0, 0.4);
    color: #FFA500;
}

.ramp-status-indicator.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #4CAF50;
}

.ramp-status-indicator.failed {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff4444;
}

/* Purchase button states for RAMP */
.purchase-button.ramp-mode {
    background: linear-gradient(135deg, #4CAF50 0%, #FFD700 50%, #FFA500 100%);
    background-size: 200% 100%;
    animation: rampShimmer 2s ease-in-out infinite alternate;
}

@keyframes rampShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Enhanced mobile responsiveness for RAMP */
@media (max-width: 768px) {
    .payment-process-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .payment-step:not(:last-child)::after {
        display: none;
    }
    
    .ramp-widget-container {
        min-height: 500px;
    }
    
    .conversion-display {
        padding: 15px;
    }
}

/* RAMP widget loading state */
.ramp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 40px;
}

.ramp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.ramp-loading-text {
    color: #FFD700;
    font-weight: 600;
    text-align: center;
}

/* Enhanced error display for RAMP */
#persistentError .ramp-error {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-left: 4px solid #FFA500;
    padding-left: 15px;
}

/* Payment method selection enhancement */
.payment-method:hover .payment-method-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.payment-method.selected .payment-method-icon {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}