:root {
    --fifa-navy: #012b5d;
    --fifa-blue: #007bff;
    --fifa-gold: #d4af37;
    --fifa-white: #ffffff;
    --fifa-grey-light: #f9f9f9;
    --fifa-grey-mid: #e1e1e1;
    --fifa-dark: #0a1a33;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --container-max: 1200px;
}

/* Base Reset */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;800;900&display=swap');

body {
    background-color: var(--fifa-white);
    color: var(--fifa-navy);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header */
header {
    background-color: var(--fifa-white);
    color: var(--fifa-navy);
    padding: 0 5%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--fifa-grey-mid);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--fifa-navy);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--fifa-blue);
}

.nav-links {
    height: 100%;
    display: flex;
    gap: 32px;
}

.nav-links a {
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--fifa-navy);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--fifa-blue);
    border-bottom-color: var(--fifa-blue);
}

.download-btn {
    background: var(--fifa-blue);
    color: var(--fifa-white);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    transition: var(--transition);
    text-align: center;
}

.download-btn:hover {
    background: var(--fifa-dark);
}

/* Language Dropdown */
.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lang-dropdown {
    position: relative;
    cursor: pointer;
    outline: none;
}

.lang-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fifa-navy);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.lang-btn:hover {
    background: var(--fifa-grey-light);
}

.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    padding: 8px 0;
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.lang-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--fifa-navy);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.lang-menu a:hover {
    background: var(--fifa-grey-light);
    color: var(--fifa-blue);
}

.lang-menu a.active {
    color: var(--fifa-blue);
    font-weight: 700;
}

/* Hero Section */
.hero {
    background: url('../fifa_hero_photography_1777557018305.png') center/cover no-repeat;
    color: var(--fifa-white);
    padding: 120px 5%;
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(1, 43, 93, 0.9) 0%, rgba(1, 43, 93, 0.4) 50%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.hero h1 span {
    color: var(--fifa-blue);
    display: block;
}

.hero p {
    font-size: 1.125rem;
    color: var(--fifa-white);
    margin-bottom: 40px;
    font-weight: 400;
    opacity: 0.9;
    max-width: 540px;
    line-height: 1.6;
}

.hero .download-btn {
    display: inline-block;
    padding: 16px 48px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

.hero .download-btn:hover {
    background: var(--fifa-white);
    color: var(--fifa-navy);
    transform: translateY(-2px);
}

/* Live Ticker */
.live-ticker {
    background: var(--fifa-grey-light);
    border-bottom: 1px solid var(--fifa-grey-mid);
    padding: 12px 0;
    overflow: hidden;
}

.ticker-wrapper {
    display: flex;
    width: max-content;
    animation: tickerMove 60s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    padding: 0 32px;
    font-size: 0.8125rem;
    color: var(--fifa-navy);
    font-weight: 600;
    border-right: 1px solid var(--fifa-grey-mid);
    white-space: nowrap;
}

.ticker-item span {
    background: #e91b23;
    color: white;
    font-size: 0.625rem;
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 12px;
    font-weight: 800;
}

@keyframes tickerMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Media Wall */
.media-wall {
    padding: 80px 5%;
    background-color: var(--fifa-grey-light);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--fifa-navy);
    text-transform: uppercase;
}

.grid-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 420px;
    gap: 24px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.grid-item {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.grid-item.large {
    grid-column: span 2;
}

.item-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.grid-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fifa-blue);
    margin-bottom: 8px;
}

.grid-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--fifa-navy);
    margin-bottom: 12px;
}

.grid-btn {
    align-self: flex-start;
    padding: 8px 0;
    color: var(--fifa-blue);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.grid-item:hover .grid-btn {
    border-bottom-color: var(--fifa-blue);
}

/* Stats Bar */
.stats-bar {
    background: var(--fifa-navy);
    padding: 60px 5%;
}

.stats-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--fifa-blue);
    margin-bottom: 8px;
}

.stat-item p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Wallet Features */
.wallet-features {
    padding: 100px 5%;
    background: var(--fifa-white);
}

.wallet-features .section-title {
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: #4a5568;
    font-size: 1.125rem;
    max-width: 640px;
    margin: 0 auto 60px;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.feature-card {
    padding: 40px 32px;
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-align: left;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: var(--fifa-blue);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--fifa-grey-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 0.9375rem;
    color: #4a5568;
    line-height: 1.6;
}

/* Tournament Schedule */
.tournament-section {
    padding: 100px 5%;
    background: var(--fifa-grey-light);
}

.schedule-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-row {
    display: grid;
    grid-template-columns: 120px 1fr 80px 1fr 160px;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.schedule-row:hover {
    border-color: var(--fifa-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.schedule-date {
    font-size: 0.8125rem;
    color: #4a5568;
    font-weight: 500;
}

.schedule-team {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--fifa-navy);
}

.schedule-team.right {
    justify-content: flex-end;
}

.schedule-vs {
    text-align: center;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--fifa-blue);
    font-size: 0.875rem;
}

.schedule-venue {
    font-size: 0.8125rem;
    color: #4a5568;
    text-align: right;
}

/* Partners & Trust */
.trust-section {
    padding: 80px 5%;
    background: var(--fifa-white);
    text-align: center;
}

.trust-section .section-title {
    font-size: 1.5rem;
    margin-bottom: 48px;
}

.partner-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: var(--container-max);
    margin: 0 auto 60px;
    flex-wrap: wrap;
}

.partner-logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--fifa-navy);
    opacity: 0.25;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
}

/* Download CTA */
.download-cta {
    padding: 100px 5%;
    background: var(--fifa-navy);
    text-align: center;
    color: var(--fifa-white);
}

.download-cta h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.download-cta h2 span {
    color: var(--fifa-blue);
}

.download-cta p {
    font-size: 1.125rem;
    opacity: 0.8;
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.download-cta .download-btn {
    display: inline-block;
    padding: 18px 56px;
    font-size: 1rem;
}

.app-badges {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.8125rem;
    opacity: 0.6;
}

/* Footer */
footer {
    background: var(--fifa-navy);
    color: var(--fifa-white);
    padding: 60px 5%;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-column h4 {
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.footer-column a {
    display: block;
    color: white;
    opacity: 0.7;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

/* FX Background - Kept as is */
.web3-football-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.ambient-glow {
    position: absolute;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: slowDrift 20s infinite alternate ease-in-out;
    mix-blend-mode: screen;
}

.glow-red {
    top: -15%;
    left: -10%;
    background: #E1000F;
}

.glow-green {
    bottom: -15%;
    right: -10%;
    background: #00B140;
    animation-delay: -7s;
}

.glow-blue {
    top: 30%;
    left: 30%;
    width: 35vw;
    height: 35vw;
    background: #0055FF;
    animation-delay: -14s;
    opacity: 0.2;
}

.hex-node {
    position: absolute;
    bottom: -150px;
    width: 80px;
    height: 92.3px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: nodeFloat linear infinite;
    transform: scale(var(--scale, 1));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hex-node::after {
    content: '';
    position: relative;
    width: 40px;
    height: 40px;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='white' d='M256 32C132.3 32 32 132.3 32 256s100.3 224 224 224 224-100.3 224-224S379.7 32 256 32zm0 416c-48.4 0-93.5-17.6-128.8-46.7L216.7 321h78.6l89.5 80.3C349.5 430.4 304.4 448 256 448zm-119.5-66.5C104.4 350.5 85.5 305.4 82 256.7L154.2 210v92.1l82.3 71.4zm239 0l-82.3-71.4V210l72.2 46.7c-3.5 48.7-22.4 93.8-54.5 124.8zM256 128l74.1 48-28.3 87.1h-91.6L181.9 176zM153.5 163.3L83.3 207c9.3-39.1 31.2-73.4 61.1-98.3l61.5 39.9zm205 0l-52.3-34.7 61.5-39.9c29.9 24.9 51.8 59.2 61.1 98.3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    animation: corePulse 2s infinite alternate ease-in-out;
}

.color-red::before {
    background: rgba(225, 0, 15, 0.05);
    box-shadow: inset 0 0 20px rgba(225, 0, 15, 0.6);
}

.color-red::after {
    filter: drop-shadow(0 0 12px #E1000F);
}

.color-green::before {
    background: rgba(0, 177, 64, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 177, 64, 0.6);
}

.color-green::after {
    filter: drop-shadow(0 0 12px #00B140);
}

.color-blue::before {
    background: rgba(0, 85, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 85, 255, 0.6);
}

.color-blue::after {
    filter: drop-shadow(0 0 12px #0055FF);
}

@keyframes nodeFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(var(--scale, 1));
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-130vh) rotate(360deg) scale(var(--scale, 1));
        opacity: 0;
    }
}

@keyframes corePulse {
    0% {
        transform: scale(0.85);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* =========================================
   H5 MOBILE OPTIMIZATION (MAX-WIDTH: 768PX)
========================================= */
@media (max-width: 992px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* 1. Header & Navigation (转换为底部标签栏) */
    header {
        height: 60px;
        padding: 0 16px;
    }

    .logo {
        font-size: 1.25rem;
    }

    .header-right {
        gap: 12px;
    }

    .lang-btn {
        padding: 6px;
        font-size: 0.75rem;
    }

    .header-right .download-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    /* 不改变HTML，将原有横向导航重构为固定在底部的 App 式 Tab Bar */
    .nav-center {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--fifa-grey-mid);
        z-index: 2000;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    }

    .nav-links {
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    .nav-links a {
        flex: 1;
        justify-content: center;
        font-size: 0.7rem;
        font-weight: 700;
        border-bottom: none;
        border-top: 3px solid transparent;
        /* 顶部高亮 */
        padding-top: 4px;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: var(--fifa-grey-light);
        border-bottom: none;
        border-top-color: var(--fifa-blue);
    }

    /* 2. Hero 区域间距调整 */
    .hero {
        padding: 80px 5% 60px;
        min-height: 70vh;
        text-align: center;
    }

    .hero::after {
        background: linear-gradient(180deg, rgba(1, 43, 93, 0.7) 0%, rgba(1, 43, 93, 0.9) 100%);
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
        margin-left: auto;
        margin-right: auto;
    }

    .hero .download-btn {
        display: block;
        width: 100%;
        padding: 16px 0;
    }

    /* 3. Media Wall & Layouts (变更为单列流式布局) */
    .media-wall {
        padding: 60px 5%;
    }

    .section-title {
        font-size: 2rem;
        text-align: center;
        margin-bottom: 32px;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 40px;
    }

    .grid-wall {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .grid-item.large {
        grid-column: span 1;
    }

    .item-image {
        height: 200px;
    }

    /* 4. Stats & Features */
    .stats-bar {
        padding: 40px 5%;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .stat-item h3 {
        font-size: 2rem;
    }

    .wallet-features {
        padding: 60px 5%;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .feature-card {
        padding: 24px;
    }

    /* 5. Tournament Schedule (卡片式堆叠) */
    .tournament-section {
        padding: 60px 5%;
    }

    .schedule-row {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
        padding: 20px;
    }

    .schedule-date {
        color: #718096;
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .schedule-team {
        justify-content: center !important;
        font-size: 1.1rem;
    }

    .schedule-vs {
        margin: 4px 0;
    }

    .schedule-venue {
        text-align: center;
        margin-top: 8px;
        font-weight: 500;
    }

    /* 6. Partners & Trust */
    .trust-section {
        padding: 60px 5%;
    }

    .partner-logos {
        gap: 24px;
        justify-content: center;
    }

    .partner-logo {
        font-size: 1.1rem;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    /* 7. Download CTA */
    .download-cta {
        padding: 80px 5%;
    }

    .download-cta h2 {
        font-size: 2.25rem;
    }

    .download-cta .download-btn {
        display: block;
        width: 100%;
        padding: 16px 0;
    }

    .app-badges {
        flex-direction: column;
        gap: 12px;
    }

    /* 8. Footer (为底部导航留出防遮挡空间) */
    footer {
        padding: 60px 5% 100px;
    }

    /* Bottom padding 100px to avoid tab bar overlap */
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
    }

    .footer-column a {
        display: inline-block;
        margin: 0 8px 12px;
    }

    .footer-column p {
        margin-left: auto;
        margin-right: auto;
        max-width: 280px;
    }
}

/* =========================================
   SUBPAGES INTERACTIVE STYLES
========================================= */

.subpage-hero {
    position: relative;
    padding: 120px 5% 40px;
    background: var(--fifa-navy);
    color: var(--fifa-white);
    text-align: center;
    overflow: hidden;
}

.subpage-content {
    background: var(--fifa-grey-light);
    padding: 60px 5%;
    color: var(--fifa-navy);
    position: relative;
}

.subpage-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(1, 43, 93, 0.6) 0%, var(--fifa-dark) 100%);
    z-index: 1;
}

.subpage-hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.subpage-hero p {
    font-size: 1.125rem;
    max-width: 680px;
    margin: 0 auto 40px;
    opacity: 0.85;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.subpage-container {
    max-width: var(--container-max);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* 1. Queue Card styling */
.queue-card {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    color: var(--fifa-navy);
}

.queue-circle-progress svg {
    filter: drop-shadow(0 4px 8px rgba(0,123,255,0.25));
}

.queue-details .detail-item {
    flex: 1;
}

.queue-details .detail-item:not(:last-child) {
    border-right: 1px solid var(--fifa-grey-mid);
}

/* 2. Security (MPC Node Simulation) styles */
.security-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.security-simulator-panel {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mpc-node-item {
    background: var(--fifa-grey-light);
    border: 2px solid var(--fifa-grey-mid);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 140px;
    transition: var(--transition);
    position: relative;
    z-index: 3;
}

.mpc-node-item.active {
    background: rgba(0, 123, 255, 0.05);
    border-color: var(--fifa-blue);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3);
}

.mpc-node-item.active.completed {
    background: rgba(0, 177, 64, 0.05);
    border-color: #00B140;
    box-shadow: 0 0 15px rgba(0, 177, 64, 0.3);
}

.mpc-node-item h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 8px;
    color: var(--fifa-navy);
}

/* 3. Trade (Chart and Token Swapper) styles */
.trade-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.chart-panel {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    padding: 24px;
}

.chart-tab {
    padding: 8px 16px;
    background: var(--fifa-grey-light);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-sm);
    color: var(--fifa-navy);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-tab:hover {
    border-color: var(--fifa-blue);
    color: var(--fifa-blue);
}

.chart-tab.active {
    background: var(--fifa-blue);
    border-color: var(--fifa-blue);
    color: var(--fifa-white);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.swap-panel {
    background: var(--fifa-navy);
    color: var(--fifa-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(1, 43, 93, 0.3);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.swap-field input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    width: 100%;
}

.swap-field select {
    background: var(--fifa-navy);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-weight: 600;
}

/* 4. Community (Fan Chat & Match Prediction) styles */
.community-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.chat-panel {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background: var(--fifa-grey-light);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    background: white;
    border: 1px solid var(--fifa-grey-mid);
    border-radius: 12px;
    padding: 10px 14px;
    max-width: 80%;
    align-self: flex-start;
    animation: bubbleAppear 0.3s ease;
}

.chat-bubble.mine {
    background: var(--fifa-blue);
    color: white;
    border: none;
    align-self: flex-end;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.chat-input-area input:focus {
    border-color: var(--fifa-blue);
}

.prediction-panel {
    background: var(--fifa-navy);
    color: var(--fifa-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(1, 43, 93, 0.3);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 500px;
}

.prediction-team-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.prediction-team-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--fifa-blue);
}

.prediction-team-btn.selected {
    background: rgba(0, 123, 255, 0.2);
    border-color: var(--fifa-blue);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
}

/* 5. Article & Static Pages */
.article-header {
    text-align: left;
    margin-bottom: 40px;
}

.article-content {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4a5568;
}

.article-content p {
    margin-bottom: 24px;
}

.article-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fifa-navy);
    margin: 40px 0 16px;
}

/* 6. Help & Contact */
.faq-item {
    background: var(--fifa-white);
    border: 1px solid var(--fifa-grey-mid);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 18px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--fifa-navy);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    color: #4a5568;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding: 0 24px 24px;
    max-height: 200px;
}

/* 7. Animations */
@keyframes bubbleAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 8. Mobile Subpage Adaptations */
@media (max-width: 992px) {
    /* Override inline grid styles on mobile/tablet */
    .security-layout, .trade-layout, .community-layout, .contact-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .partners-grid, .media-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .subpage-hero {
        padding: 80px 5% 30px !important;
    }
    
    .subpage-hero h1 {
        font-size: 2rem !important;
    }
    
    .subpage-hero p {
        font-size: 0.95rem !important;
        margin-bottom: 20px !important;
    }

    .subpage-content {
        padding: 40px 5% 80px !important; /* Spacing to prevent fixed bottom tab bar collision */
    }
}

@media (max-width: 576px) {
    .partners-grid, .media-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .download-layout, .queue-card {
        padding: 24px !important;
        margin-top: 30px !important;
    }

    .queue-circle-progress {
        width: 150px !important;
        height: 150px !important;
    }

    .queue-number-display #queue-pos {
        font-size: 1.5rem !important;
    }

    .queue-details {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px !important;
    }

    .queue-details .detail-item {
        border-right: none !important;
        border-bottom: 1px solid var(--fifa-grey-mid) !important;
        padding-bottom: 16px !important;
        width: 100% !important;
    }

    .queue-details .detail-item:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .mpc-node-item {
        width: 90px !important;
        padding: 10px !important;
        font-size: 0.75rem !important;
    }

    .mpc-node-item h4 {
        font-size: 0.8rem !important;
    }

    .nodes-container {
        height: 180px !important;
    }

    .prediction-panel {
        padding: 20px !important;
    }

    #apply-modal > div {
        margin: 16px !important;
        width: calc(100% - 32px) !important;
        padding: 20px !important;
    }
}