@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Poppins:wght@300;400;600&display=swap');

:root {
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --color-bg: #0a0a0a;
    --color-surface: #1a1a1a;
    --color-primary: #00ffff;
    --color-secondary: #ff00ff;
    --color-text: #e0e0e0;
    --color-text-muted: #888;
}

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

/* Disable touch gestures and zooming */
html, body {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, video {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* --- Header --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 45px;
    width: 45px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo-text strong {
    font-weight: 900;
    background: linear-gradient(45deg, #a855f7, #eab308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    transition: color 0.3s ease;
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--color-primary);
    text-shadow: 0 0 5px var(--color-primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
    width: 30px;
    height: 22px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
}

.mobile-menu-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--color-primary);
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.mobile-menu-toggle span:nth-child(1) { top: 0px; }
.mobile-menu-toggle span:nth-child(2) { top: 9px; }
.mobile-menu-toggle span:nth-child(3) { top: 18px; }

.mobile-menu-toggle.active span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    left: -60px;
}
.mobile-menu-toggle.active span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
}

/* --- Buttons --- */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-primary);
    background-color: transparent;
    color: var(--color-primary);
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border-radius: 4px;
}

.btn:hover {
    background-color: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 15px var(--color-primary);
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-secondary {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-secondary:hover {
    background-color: var(--color-secondary);
    color: var(--color-bg);
    box-shadow: 0 0 15px var(--color-secondary);
}

/* P2E Beta Button */
.btn-p2e-beta {
    border-color: #ff6b35;
    color: #ff6b35;
    position: relative;
}

.btn-p2e-beta:hover {
    background-color: #ff6b35;
    color: var(--color-bg);
    box-shadow: 0 0 15px #ff6b35;
}

/* NEW Badge */
.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    animation: pulse-badge 2s infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 钱包按钮状态 */
.btn-connecting {
    background-color: #ffa500;
    color: var(--color-bg);
    border-color: #ffa500;
    animation: pulse 2s infinite;
}

.btn-connected {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    text-transform: none;
}

.wallet-status {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
}

.wallet-status.connected {
    color: #4CAF50;
}

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

/* --- Hero Section --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
}

/* Desktop video (landscape) */
.hero-desktop {
    display: block;
}

/* Mobile video (portrait) - hidden by default */
.hero-mobile {
    display: none;
}

#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.main-heading {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-secondary);
}

.sub-heading {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}


/* --- General Section Styling --- */
section {
    padding: 6rem 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
}


/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-muted);
}

.about-video video {
    border-radius: 15px;
    border: 2px solid var(--color-surface);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- Pets Section --- */
#pets {
    background-color: var(--color-surface);
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.pet-card {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pet-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 20px var(--color-primary), 0 0 30px var(--color-secondary);
}

.pet-card.rarity-common { border-color: #8a9fba; }
.pet-card.rarity-rare { border-color: #88aaff; }
.pet-card.rarity-legendary { border-color: #facc15; }
.pet-card.rarity-legendary:hover {
    box-shadow: 0 0 25px #facc15, 0 0 40px #f59e0b;
}

.pet-rarity-badge {
    position: absolute;
    top: 10px;
    right: -1px;
    padding: 5px 15px;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.8rem;
    z-index: 3;
    clip-path: polygon(0% 0%, 100% 0, 100% 100%, 0% 100%, 10% 50%);
    color: #111;
}

.rarity-common .pet-rarity-badge { background: #8a9fba; }
.rarity-rare .pet-rarity-badge { background: #88aaff; }
.rarity-legendary .pet-rarity-badge { background: linear-gradient(45deg, #facc15, #f59e0b); }

.pet-card .pet-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.pet-card:hover .pet-video {
    opacity: 1;
}


.pet-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.pet-image-container .pet-image,
.pet-image-container .pet-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pet-stats-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
    backdrop-filter: blur(5px);
}

.pet-card:hover .pet-stats-overlay {
    opacity: 1;
}

.pet-stats-overlay h4 {
    font-family: var(--font-display);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
.pet-stats-overlay p {
    font-size: 1rem;
    line-height: 1.5;
}

.pet-info {
    padding: 1.5rem;
    color: var(--color-text-muted);
}

.pet-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.pet-card.rarity-rare .pet-info h3 {
    color: #b0c8ff;
}

.pet-card.rarity-legendary .pet-info h3 {
    color: #fde047;
    text-shadow: 0 0 8px #facc15;
}

.pet-info p {
    color: var(--color-text-muted);
}

/* Global Rarity Colors */
.rarity-common { color: #aaa; }
.rarity-rare { color: #88aaff; }
.rarity-legendary { 
    color: #fde047;
    text-shadow: 0 0 8px #facc15;
}

/* --- Gameplay Section --- */
.gameplay-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    text-align: center;
}

.step .step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-primary), var(--color-secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.step .step-icon span {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-bg);
}

.step h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.step p {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* --- Footer --- */
.main-footer-bottom {
    background-color: #000;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo img {
    height: 50px;
}

.footer-logo p {
    color: var(--color-text-muted);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a:hover {
    color: var(--color-primary);
}


/* --- Responsive Design --- */

/* Tablet and small laptop adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-heading {
        font-size: 4rem;
    }
    
    .sub-heading {
        font-size: 1.3rem;
    }
    
    .container {
        width: 90%;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    .nav-links {
        /* Mobile menu styles */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        background-color: var(--color-bg);
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100vh;
        transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links a {
        font-size: 2rem;
        opacity: 0;
    }
    
    .nav-links.active a {
        animation: fadeIn 0.5s ease forwards;
        animation-delay: 0.4s;
    }
    
    .nav-links.active a:nth-child(2) { animation-delay: 0.5s; }
    .nav-links.active a:nth-child(3) { animation-delay: 0.6s; }
    .nav-links.active .btn { animation-delay: 0.7s; }

    .mobile-menu-toggle {
        display: block;
    }

    /* Hero video switching for mobile */
    .hero-desktop {
        display: none;
    }
    
    .hero-mobile {
        display: block;
    }
    
    /* Mobile hero adjustments */
    #hero {
        height: 100vh;
        padding: 0 1rem;
    }
    
    .hero-content {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .main-heading {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .sub-heading {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 200px;
        font-size: 1rem;
    }
    
    /* Ensure mobile video fits properly */
    .hero-mobile {
        object-fit: cover;
        object-position: center;
    }

    .about-content, .gameplay-steps {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

.success-message {
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}

