/* NEXA V9 — mobile-first refinement of the existing Web3 experience.
   All visual changes are responsive; futures settlement and position logic remain untouched. */
html, body { max-width: 100%; }
.overview-card-foot .overview-source, .compact-source { display: none !important; }
.overview-chart-empty { min-height: 105px; display: flex; align-items: center; justify-content: center; color: #79879a; font-size: 12px; line-height: 1.5; text-align: center; border-radius: 9px; background: repeating-linear-gradient(90deg, #23303c21, #23303c21 10px, #11182005 10px, #11182005 20px); }
/* Existing responsive rules were primarily desktop-derived. Keep desktop layouts unchanged. */
@media (max-width: 640px) {
  :root { --header: 56px; --route-bar-height: 48px; }
  html { scroll-padding-top: 114px; }
  body { font-size: 14px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); overflow-x: clip; }
  .container { width: calc(100% - 32px); }
  .site-header { height: var(--header); padding-inline: 16px; gap: 8px; background: #0b0e11ef; }
  .brand { font-size: 21px; letter-spacing: .25px; gap: 6px; }
  .brand-symbol { width: 25px; height: 25px; }
  .header-actions { gap: 8px; }
  .header-actions > .contest-badge { display: none !important; }
  .header-actions .language-btn { padding: 10px 4px; font-size: 12px; min-height: 44px; }
  .header-actions .contest-account-btn { min-width: 42px; min-height: 42px; padding: 9px; }
  .route-back-shell { top: var(--header); }
  .route-back-inner { width: calc(100% - 32px); }
  .route-back-shell .back-bar { min-height: 46px; font-size: 12px; }
  .mobile-nav { height: calc(66px + env(safe-area-inset-bottom)); padding: 5px 4px env(safe-area-inset-bottom); background: #141a22f4; border-top: 1px solid #323b48; box-shadow: 0 -7px 20px #0006; }
  .mobile-nav button { min-height: 54px; font-size: 11px; gap: 4px; border-radius: 9px; }
  .mobile-nav button.active { background: #f0b90b12; }
  .mobile-nav .icon { width: 22px; height: 22px; }

  /* Shorter first fold and stronger reading order on narrow screens. */
  .home-hero { padding: 25px 0 3px; gap: 0; }
  .home-hero .eyebrow { margin-bottom: 12px; font-size: 10px; }
  .home-hero h1 { font-size: clamp(37px, 10vw, 47px); letter-spacing: -1.8px; line-height: 1.06; margin-bottom: 16px; }
  .hero-copy > p { font-size: 14px; line-height: 1.65; max-width: 34ch; margin-bottom: 17px; }
  .hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .hero-cta .btn { width: 100%; min-width: 0; padding: 10px 8px; min-height: 45px; font-size: 12px; overflow-wrap: anywhere; }
  .hero-caption { margin-top: 11px; font-size: 10px; color: #8794a7; }
  .hero-visual { margin-top: 0; height: 172px; width: 100%; overflow: hidden; position: relative; }
  .hero-visual .hero-art { display: block; width: min(100%, 380px); height: 220px; top: -31px; left: 50%; transform: translateX(-50%); object-fit: contain; color: transparent; font-size: 0; opacity: .78; }
  .hero-visual .orbit-label { display: none; }
  .market-strip { margin-top: 3px; margin-bottom: 22px; }
  .hub-metrics { margin-bottom: 18px; }
  .hub-tabs { overflow-x: auto; flex-wrap: nowrap; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hub-tabs::-webkit-scrollbar { display:none; }
  .hub-tabs button { white-space: nowrap; min-height: 44px; scroll-snap-align: start; flex: 0 0 auto; }

  /* A true mobile market layout: cap hero + two concise indicators + full-width RSI plot. */
  .market-overview { margin: 8px 0 25px; scroll-margin-top: calc(var(--header) + 18px); }
  .market-overview .section-head { margin-bottom: 13px; align-items: center; }
  .market-overview h2 { font-size: 22px; letter-spacing: -.5px; }
  .overview-actions .text-btn { font-size: 12px; min-height: 42px; padding: 9px 5px; gap: 5px; }
  .overview-actions .text-btn .icon { display: block; width: 15px; height: 15px; }
  .overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .overview-card { padding: 15px 14px 13px; min-width: 0; min-height: 0; border-radius: 15px; overflow: hidden; border: 1px solid #35404c; background: linear-gradient(155deg, #1b222b 0%,#131920 86%); box-shadow: inset 0 1px 0 #ffffff09; }
  .overview-card-title { min-height: 0; align-items: flex-start; gap: 6px; }
  .overview-card-title h3 { font-size: 12px; line-height: 1.5; font-weight: 600; color: #c9d1db; }
  .overview-card-title > .icon { display: block; width: 17px; height: 17px; color: #baa653; flex-shrink: 0; }
  .overview-value { font-size: 34px; line-height: 1.22; min-height: 0; margin-top: 10px; gap: 7px; letter-spacing: -.8px; font-weight: 700; overflow-wrap: anywhere; }
  .overview-value small { font-size: 12px; line-height: 1.3; }
  .overview-sub { font-size: 11px; line-height: 1.5; margin-top: 5px; min-height: 0; }
  .overview-card-foot { margin-top: 11px; min-height: 0; gap: 3px 7px; padding-top: 8px; font-size: 10px; line-height: 1.4; }
  .overview-card-foot time { font-size: 10px; white-space: normal; }
  .overview-card-foot .overview-source { display: none; }
  .cap-card { grid-column: 1 / -1; grid-row: auto; order: 1; padding: 17px 17px 13px; }
  .cap-card .overview-value { font-size: clamp(30px, 9.5vw, 42px); margin-top: 6px; padding: 0; white-space: normal; min-height: 0; display:flex; }
  .cap-breakdown { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px 18px; margin: 14px 0 2px; min-height: 0; }
  .cap-breakdown > div:not(.dominance-bar) { align-items: flex-start; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .cap-breakdown strong { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  .cap-breakdown .dominance-bar { grid-column: 1 / -1; grid-row: 2; height: 5px; margin: 0 0 2px; }
  .fear-card { order: 2; min-height: 192px; }
  .alt-card { order: 3; min-height: 192px; }
  .fear-card .overview-value, .alt-card .overview-value { font-size: clamp(29px, 8.5vw, 38px); }
  .fear-card .overview-sub .sentiment-label { font-size: 11px; }
  .sentiment-visual { margin: 15px 0 4px; }
  .sentiment-bar, .season-bar { height: 8px; }
  .sentiment-labels { margin-top: 9px; font-size: 9px; gap: 4px; line-height: 1.5; }
  .sentiment-visual p { display: none; }
  .alt-season-visual { margin: 24px 0 3px; }
  .alt-season-visual .sentiment-labels { flex-wrap: wrap; gap: 2px 4px; }
  .alt-season-visual .sentiment-labels span:nth-child(2) { order: 3; width: 100%; text-align: center; }
  .rsi-card { grid-column: 1 / -1; order: 4; min-height: 215px; }
  .rsi-card .overview-value { margin-top: 7px; font-size: 38px; }
  .rsi-card .overview-sub { margin-top: 0; }
  .indicator-chart { margin: 12px 0 4px; }
  .indicator-chart svg { height: 94px; }
  .indicator-dates { font-size: 11px; }
  .overview-chart-empty { min-height: 94px; margin-top: 14px; font-size: 12px; }

  /* Search and project cards favor tap targets and legibility over density. */
  .discover-section, .learn-section { margin-block: 28px; }
  .home-directory > .section-head h2 { font-size: 23px; }
  .home-directory > .section-head { gap: 8px; }
  .home-directory > .section-head > .text-btn { font-size: 12px; max-width: 115px; line-height: 1.35; }
  .directory-controls { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 18px 0 12px; }
  .directory-source-label { font-size: 12px; }
  .directory-controls .directory-sector, .directory-page .directory-sector { min-height: 44px; height: auto; width: 100%; min-width: 0; }
  .directory-controls .directory-sector select { width: 100%; min-width: 0; max-width: none; font-size: 13px; }
  .directory-controls .directory-search, .directory-page .directory-search { height: 44px; width: 100%; font-size: 13px; }
  .directory-search input { font-size: 13px; }
  .directory-grid, .directory-related { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .directory-card { display: block; padding: 14px 14px 12px; border-radius: 12px; min-height: 0; background: #151b23; }
  .directory-card-heading { align-items: center; gap: 10px; }
  .directory-card-heading > .icon { display: block; width: 16px; height: 16px; }
  .directory-card h3 { font-size: 14px; line-height: 1.4; }
  .directory-symbol { font-size: 10px; }
  .project-logo { width: 38px; height: 38px; }
  .directory-card p { font-size: 12px; line-height: 1.55; margin: 8px 0 9px; min-height: 0; -webkit-line-clamp: 2; }
  .directory-tags span { padding: 3px 7px; font-size: 10px; }
  .directory-foot { margin-top: 13px; font-size: 12px; gap: 12px; }
  .directory-source-switch { display:flex; gap: 7px; overflow-x: auto; width: 100%; }
  .directory-source-switch button { min-height: 42px; font-size: 12px; padding: 9px 12px; white-space: nowrap; }

  /* Primary flows stay usable for touch without changing account/trade state. */
  .market-groups { scroll-snap-type: x proximity; gap: 22px; }
  .market-groups button { min-height: 46px; scroll-snap-align: start; }
  .claim-cell .claim-btn, .btn-sm { min-height: 41px; }
  .terminal-toolbar button, .route-back-shell button { min-height: 42px; }
  .trade-form-panel button, .order-type-tabs button, .futures-order-tabs button { min-height: 42px; }
  .reading-page, .directory-page, .terminal-page, .arena-main { overflow-wrap: anywhere; }
  .reading-body p { font-size: 14px; line-height: 1.75; }
}

@media (max-width: 359px) {
  .container { width: calc(100% - 28px); }
  .site-header { padding-inline: 12px; }
  .brand { font-size: 20px; }
  .hero-cta .btn { font-size: 11px; }
  .overview-grid { gap: 8px; }
  .overview-card { padding: 12px 11px; }
  .cap-card { padding: 15px 13px 12px; }
  .overview-card-title h3 { font-size: 11px; }
  .fear-card .overview-value, .alt-card .overview-value { font-size: 30px; }
  .sentiment-labels { font-size: 8px; }
  .directory-card { padding: 12px; }
}

@media (min-width: 641px) and (max-width: 950px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-card { min-height: 255px; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion:reduce) { .overview-card { transition: none; } }
@media(max-width:640px){
  .arena-main .arena-table{margin-inline:-16px;}
  .directory-controls .directory-search,.directory-page .directory-search{max-width:none!important;width:100%;}
}
@media(max-width:359px){.arena-main .arena-table{margin-inline:-14px;}}
