/* ============================================================
   Mzero314 Responsive Overrides
   Apply this file AFTER the main styles to fix layout issues
   ============================================================ */

/* --- Base fixes --- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    line-height: 1.5;
}

img {
    max-width: 100% !important;
    height: auto !important;
}

/* --- Container --- */
.container {
    width: 100% !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
}

/* --- Header --- */
.header-container {
    width: 100% !important;
    max-width: 1440px !important;
    padding: 8px 40px !important;
    gap: 20px;
}

.logo img {
    width: 160px !important;
    height: auto !important;
}

.nav-links {
    gap: 24px !important;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    font-size: 15px;
    white-space: nowrap;
}

/* --- Hero --- */
.hero {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
    padding: 120px 40px 60px 40px !important;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    width: 50% !important;
    max-width: 720px;
    padding-left: 0 !important;
    flex: 1 1 500px;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 64px) !important;
    line-height: 1.15;
}

.hero p {
    font-size: clamp(1rem, 1.2vw, 20px) !important;
    max-width: 700px;
}

.hero-cta {
    flex-wrap: wrap;
    gap: 15px;
}

.hero-cta img {
    width: 200px;
    height: auto;
}

.hero-stats {
    flex-wrap: wrap;
    gap: 32px !important;
    margin-top: 40px !important;
}

.stat-value {
    font-size: clamp(1.25rem, 1.8vw, 36px) !important;
}

.hero > img[alt="mascot"] {
    width: 50% !important;
    max-width: 600px;
    height: auto !important;
    flex: 1 1 400px;
}

/* --- Features --- */
.features {
    padding: 100px 0 !important;
}

.features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 30px;
}

.feature-card {
    display: flex;
    flex-direction: column;
}

.feature-card img {
    width: 100% !important;
    max-width: 400px;
    height: auto !important;
    margin: 0 auto 24px auto;
    display: block;
}

.feature-card .btn {
    align-self: flex-start;
    margin-top: auto;
}

.section-title h2 {
    font-size: clamp(1.75rem, 3vw, 48px) !important;
}

.section-title p {
    font-size: clamp(1rem, 1.2vw, 20px) !important;
}

/* --- Token Section --- */
.token-section {
    padding: 100px 0 !important;
}

.token-grid {
    display: grid !important;
    grid-template-columns: minmax(280px, 30%) 1fr !important;
    gap: 60px;
    align-items: center;
}

.token-image img {
    width: 100% !important;
    max-width: 500px !important;
    height: auto !important;
    border-radius: 20px;
    margin: 0 auto;
}

.token-content h2 {
    font-size: clamp(1.6rem, 2.8vw, 48px) !important;
}

.token-content p {
    font-size: clamp(1rem, 1.1vw, 18px) !important;
}

.benefit-item {
    margin-bottom: 24px;
}

.benefit-text h4 {
    font-size: clamp(1.05rem, 1.2vw, 20px) !important;
}

/* --- Competition Section --- */
.competition-section {
    padding: 100px 0 !important;
}

.competition-card {
    padding: clamp(30px, 5vw, 60px) !important;
}

.competition-header {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.competition-header > div:first-child {
    flex: 1 1 500px;
}

.competition-header img {
    width: 100% !important;
    max-width: 305px !important;
    height: auto !important;
    margin-bottom: 20px;
}

.competition-header > div:last-child img {
    max-width: 200px !important;
}

.competition-features {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 30px;
    margin-top: 60px;
}

.comp-feature img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin-bottom: 16px;
}

.comp-feature h4 {
    font-size: clamp(1.05rem, 1.2vw, 20px) !important;
}

/* --- CTA Section --- */
.cta-section {
    padding: 100px 0 !important;
}

.cta-section > .container > img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 16px;
    margin-bottom: 40px;
}

.cta-section h2 {
    font-size: clamp(1.5rem, 2.6vw, 48px) !important;
}

.cta-section p {
    font-size: clamp(1rem, 1.2vw, 20px) !important;
}

.cta-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* --- Footer --- */
footer {
    padding: 60px 0 !important;
}

.footer-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-logo img {
    width: 100% !important;
    max-width: 400px !important;
    height: auto !important;
    margin-bottom: 20px;
}

/* --- Menu Toggle --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
}

/* ============================================================
   TABLET BREAKPOINT (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .container { padding: 0 24px !important; }
    .header-container { padding: 8px 24px !important; }

    .hero {
        padding: 110px 24px 50px 24px !important;
        gap: 24px;
    }

    .hero-content {
        flex: 1 1 400px;
    }

    .hero > img[alt="mascot"] {
        flex: 1 1 300px;
    }

    .hero-stats {
        gap: 24px !important;
    }

    .token-grid {
        grid-template-columns: 1fr !important;
        gap: 40px;
    }

    .token-image {
        max-width: 400px;
        margin: 0 auto;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 40px;
    }
}

/* ============================================================
   MOBILE BREAKPOINT (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    section {
        padding: 60px 0 !important;
    }

    .container {
        padding: 0 16px !important;
    }

    .header-container {
        padding: 8px 16px !important;
        flex-wrap: nowrap;
    }

    .logo img {
        width: 120px !important;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(10, 14, 19, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 20px 16px;
        gap: 0;
        border-bottom: 1px solid rgba(255, 123, 44, 0.3);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.open {
        display: flex;
        max-height: 500px;
    }

    .nav-links a {
        padding: 14px 0;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
    }

    .hero {
        padding: 100px 16px 40px 16px !important;
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .hero-content {
        width: 100% !important;
        max-width: 100%;
        text-align: center;
    }

    .hero-content > img:first-child {
        margin: 0 auto 20px auto;
        display: block;
    }

    .hero h1 {
        font-size: clamp(1.5rem, 6vw, 2.25rem) !important;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
        gap: 20px !important;
    }

    .stat-item {
        min-width: 100px;
        align-items: center;
    }

    .hero > img[alt="mascot"] {
        width: 100% !important;
        max-width: 400px;
    }

    .features {
        padding: 60px 0 !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
    }

    .feature-card {
        padding: 24px 20px !important;
    }

    .token-section {
        padding: 60px 0 !important;
    }

    .competition-section {
        padding: 60px 0 !important;
    }

    .competition-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .competition-header > div:last-child {
        align-self: center;
    }

    .competition-features {
        grid-template-columns: 1fr !important;
    }

    .competition-content > div:last-child {
        flex-direction: column;
        align-items: stretch;
    }

    .competition-content > div:last-child .btn {
        width: 100%;
    }

    .cta-section {
        padding: 60px 0 !important;
    }

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

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 40px;
    }

    /* Token actions — the YouTube + Amazon buttons */
    .token-content > div:last-child {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .token-content > div:last-child .btn,
    .token-content > div:last-child img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   SMALL MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.4rem !important;
    }

    .section-title h2 {
        font-size: 1.6rem !important;
    }

    .btn {
        font-size: 14px;
        padding: 10px 18px;
    }
}

/* ============================================================
   AGENT DASHBOARD — RESPONSIVE OVERRIDES
   ============================================================ */

/* --- Base fixes --- */
body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* --- Container: single-column on mobile, two-column on desktop --- */
.container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px !important;
    display: grid !important;
    grid-template-columns: minmax(280px, 420px) 1fr !important;
    grid-gap: 20px;
    box-sizing: border-box;
}

/* --- Header --- */
.header {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px !important;
    gap: 20px;
}

.logo img {
    width: 225px !important;
    max-width: 100%;
    height: auto !important;
}

.kale-pool {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    flex-shrink: 0;
}

/* --- Leaderboard (left column) --- */
.leaderboard {
    width: 100% !important;
    box-sizing: border-box;
}

.trader-card {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 15px 10px !important;
}

.trader-avatar,
.trader-avatar1 {
    width: 50px !important;
    height: 50px !important;
    margin: 0 10px !important;
    flex-shrink: 0;
}

.trader-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.trader-name,
.trader-specialty {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trader-backing {
    flex-shrink: 0;
}

/* --- Detail section (right column) --- */
.detail-section {
    display: grid !important;
    grid-template-rows: auto auto auto auto;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.trader-detail {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
    padding: 20px !important;
    box-sizing: border-box;
}

.trader-stats-detail {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
    width: 100%;
}

.trader-stats-detail .stat-card img {
    width: 100% !important;
    height: auto !important;
    max-width: 150px;
}

/* --- Activity feed --- */
.activity-feed,
.activity-feed2 {
    width: 100% !important;
    box-sizing: border-box;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item,
.activity-item1,
.activity-item2,
.activity-item3 {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
}

.activity-content,
.activity-content2 {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.activity-text {
    font-size: 13px;
    word-wrap: break-word;
}

/* --- Backing form --- */
.backing-form {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
}

.backing-input {
    flex: 1;
    min-width: 200px;
    width: auto !important;
}

/* --- NFT preview (Subordinate Agents) --- */
.nft-preview {
    display: flex !important;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.nft-card {
    flex: 0 0 auto;
    min-width: 130px;
}

/* --- Risk tolerance row --- */
.risk-tolerance {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD — TABLET (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr !important;
    }

    .trader-detail {
        grid-template-columns: 1fr !important;
    }

    .trader-stats-detail {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ============================================================
   DASHBOARD — MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
        gap: 15px;
    }

    .header {
        padding: 15px !important;
        gap: 15px;
    }

    .logo img {
        width: 160px !important;
    }

    .kale-pool {
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .kale-amount {
        font-size: 18px !important;
    }

    .leaderboard-title,
    .activity-title,
    .backing-title,
    .rewards-title {
        font-size: 18px !important;
    }

    .trader-card {
        padding: 12px 8px !important;
        gap: 8px;
    }

    .rank,
    .rank1 {
        font-size: 16px !important;
        width: 22px !important;
    }

    .trader-avatar,
    .trader-avatar1 {
        width: 40px !important;
        height: 40px !important;
        margin: 0 6px !important;
    }

    .trader-name {
        font-size: 15px !important;
    }

    .trader-specialty {
        font-size: 11px !important;
    }

    .back-button,
    .back-button1 {
        padding: 4px 10px !important;
        font-size: 12px !important;
    }

    .trader-detail {
        padding: 15px !important;
        gap: 15px !important;
    }

    .selected-trader-avatar {
        width: 90px !important;
        height: 90px !important;
    }

    .selected-trader-name {
        font-size: 22px !important;
    }

    .trader-stats-detail {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-value-large {
        font-size: 18px !important;
    }

    .activity-feed,
    .activity-feed2 {
        max-height: 320px;
        padding: 15px !important;
    }

    .activity-icon,
    .activity-icon1 {
        width: 30px !important;
        height: 30px !important;
        margin-right: 8px !important;
    }

    .activity-icon img,
    .activity-icon1 img {
        width: 30px !important;
        height: 30px !important;
    }

    .activity-text {
        font-size: 12px !important;
    }

    .activity-time {
        font-size: 10px !important;
    }

    .backing-form {
        flex-direction: column;
        align-items: stretch;
    }

    .backing-input {
        width: 100% !important;
        min-width: 0;
    }

    .backing-button {
        width: 100%;
    }

    .nft-card {
        min-width: 110px;
        padding: 8px;
    }

    .nft-image {
        width: 80px !important;
        height: 80px !important;
    }

    .nft-name {
        font-size: 12px !important;
    }

    .nft-rarity {
        font-size: 10px !important;
    }

    .risk-label {
        font-size: 13px !important;
    }
}

/* ============================================================
   DASHBOARD — SMALL MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
    .logo img {
        width: 140px !important;
    }

    .kale-logo {
        width: 40px !important;
        height: 48px !important;
    }

    .trader-stats-detail {
        grid-template-columns: 1fr !important;
    }

    .trader-specialty {
        display: none;
    }
}

/* Stat value large — applies at all screen sizes */
.stat-value-large {
    font-size: 15px !important;
}

/* ============================================================
   DASHBOARD — PORTRAIT MOBILE OVERFLOW KILLER
   ============================================================ */

@media (max-width: 900px) and (orientation: portrait) {

    /* --- Force the page to never exceed the viewport --- */
    html,
    body {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* --- Container: single-column, no overflow --- */
    .container {
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        gap: 15px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* --- Header --- */
    .header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 15px !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .logo img {
        width: 200px !important;
        height: auto !important;
    }

    .kale-pool {
        width: 100% !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        box-sizing: border-box !important;
    }

    .kale-amount {
        font-size: 18px !important;
    }

    /* --- Leaderboard --- */
    .leaderboard {
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        margin-bottom: 15px;
    }

    /* --- Trader cards --- */
    .trader-card {
        display: grid !important;
        grid-template-columns: auto auto 1fr auto !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 12px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .rank,
    .rank1 {
        font-size: 16px !important;
        width: 20px !important;
    }

    .trader-avatar,
    .trader-avatar1 {
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
    }

    .trader-info {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .trader-name {
        font-size: 14px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .trader-specialty {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .trader-backing {
        flex-shrink: 0 !important;
    }

    .back-button,
    .back-button1 {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    /* --- Detail section --- */
    .detail-section {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .trader-detail {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        margin-bottom: 15px;
        box-sizing: border-box !important;
    }

    .trader-profile {
        width: 100% !important;
        margin-bottom: 15px;
    }

    .selected-trader-avatar {
        width: 90px !important;
        height: 90px !important;
    }

    .selected-trader-name {
        font-size: 22px !important;
    }

    .trader-stats-detail {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .stat-card {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px !important;
    }

    .stat-card img {
        width: 100% !important;
        height: auto !important;
        max-width: 150px !important;
    }

    .stat-value-large {
        font-size: 14px !important;
    }

    .stat-title {
        font-size: 11px !important;
    }

    /* --- Backing section / chat --- */
    .backing-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        margin-bottom: 15px;
        box-sizing: border-box !important;
    }

    .backing-header {
        flex-wrap: wrap !important;
    }

    .backing-header img {
        width: 80px !important;
        height: auto !important;
    }

    .backing-title {
        font-size: 18px !important;
    }

    /* --- Activity feeds --- */
    .activity-feed,
    .activity-feed2 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box !important;
        max-height: 350px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .activity-item,
    .activity-item1,
    .activity-item2,
    .activity-item3 {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px !important;
    }

    .activity-content,
    .activity-content2 {
        min-width: 0 !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        flex: 1 !important;
    }

    .activity-text {
        font-size: 11px !important;
        word-wrap: break-word !important;
    }

    .activity-time {
        font-size: 10px !important;
    }

    .activity-icon,
    .activity-icon1 {
        width: 28px !important;
        height: 28px !important;
        margin-right: 6px !important;
        flex-shrink: 0 !important;
    }

    .activity-icon img,
    .activity-icon1 img {
        width: 28px !important;
        height: 28px !important;
    }

    /* --- Chat input --- */
    .backing-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .backing-input {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .backing-button {
        width: 100% !important;
    }

    /* --- Risk tolerance row --- */
    .risk-tolerance {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .risk-label {
        font-size: 12px !important;
    }

    .risk-meter {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* --- NFT preview (Subordinate Agents) --- */
    .nft-preview {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 0 !important;
        box-sizing: border-box !important;
    }

    .nft-card {
        flex: 0 0 auto !important;
        min-width: 100px !important;
        padding: 8px !important;
    }

    .nft-image {
        width: 70px !important;
        height: 70px !important;
    }

    .nft-name {
        font-size: 11px !important;
    }

    .nft-rarity {
        font-size: 9px !important;
    }

    /* --- Copyright --- */
    .copyright {
        padding-top: 30px !important;
        margin-top: 30px !important;
        font-size: 12px !important;
    }
}