/* responsive.css - Desktop and mobile media queries */
/* Desktop short screens — scale down right panel overlays */
@media(min-width:769px) and (max-height:820px){
  .stake-overlay{width:240px;padding:10px;top:8px;right:8px}
  .stake-amount{font-size:18px}
  .stake-header{margin-bottom:6px}
  .stake-slider{margin-bottom:6px;height:4px}
  .stake-slider::-webkit-slider-thumb{width:13px;height:13px}
  .stake-range{margin-bottom:8px;font-size:10px}
  .stake-presets{gap:4px}
  .stake-btn{padding:5px 0;font-size:11px}
  .bet-buttons{padding:8px 10px;gap:5px}
  .bet-btn{padding:10px 0;font-size:13px;letter-spacing:0.5px}
  .positions-overlay{width:240px;bottom:8px;right:8px;max-height:40%}
  .pos-card{padding:5px 8px 4px;margin-bottom:3px}
  .pos-dir{font-size:10px}
  .pos-lev{font-size:8px;padding:1px 3px}
  .pos-badge{font-size:8px;padding:1px 4px}
  .pos-stake{font-size:12px}
  .pos-pnl{font-size:12px}
  .pos-live{font-size:11px}
  .pos-r3{font-size:10px}
  .pos-header{padding:8px 0 6px}
  .pos-count{font-size:11px}
  .sb-label{font-size:10px;margin-bottom:6px;letter-spacing:1px}
}
@media(min-width:769px) and (max-height:700px){
  .stake-overlay{width:220px;padding:8px;top:6px;right:6px}
  .stake-amount{font-size:16px}
  .stake-header{margin-bottom:4px}
  .stake-slider{margin-bottom:4px;height:3px}
  .stake-slider::-webkit-slider-thumb{width:11px;height:11px}
  .stake-range{margin-bottom:6px;font-size:9px}
  .stake-presets{gap:3px}
  .stake-btn{padding:4px 0;font-size:10px}
  .bet-buttons{padding:6px 8px;gap:4px}
  .bet-btn{padding:8px 0;font-size:12px;gap:4px}
  .bet-btn .arrow{font-size:13px}
  .positions-overlay{width:220px;bottom:6px;right:6px;max-height:35%}
  .pos-card{padding:4px 7px 3px;margin-bottom:2px}
  .pos-r1{margin-bottom:2px}
  .pos-r2{margin-bottom:1px}
  .pos-dir{font-size:9px}
  .pos-lev{font-size:7px}
  .pos-badge{font-size:7px}
  .pos-timer{font-size:8px}
  .pos-stake{font-size:11px}
  .pos-pnl{font-size:11px}
  .pos-live{font-size:10px}
  .pos-r3{font-size:9px}
  .pos-header{padding:6px 0 4px}
  .pos-count{font-size:10px}
  .positions-area{padding:0 8px 8px}
  .sb-label{font-size:9px;margin-bottom:4px;padding-bottom:3px}
  .stat-cell{padding:5px 6px}
  .stat-cell .s-label{font-size:9px;margin-bottom:2px}
  .stat-cell .s-val{font-size:16px}
}

/* Narrow desktop — medium (1200px) */
@media(min-width:769px) and (max-width:1200px){
  .topbar{gap:8px;padding:0 10px}
  .topbar-pair{font-size:13px;padding:4px 8px}
  .topbar-live,.topbar-demo,.topbar-jackpot{font-size:10px;padding:2px 6px 2px 16px}
  .topbar-live::before,.topbar-demo::before{left:5px;width:5px;height:5px}
  .topbar-stat{padding:0 2px 0 10px}
  .topbar-stat-val{font-size:12px}
  .topbar-balance{font-size:13px;padding:3px 8px}
  .connect-wallet{font-size:11px;padding:5px 10px}
  .bottombar{gap:12px;font-size:11px}
}

/* Narrow desktop — small (1000px) */
@media(min-width:769px) and (max-width:1000px){
  .topbar{gap:6px;padding:0 8px}
  .topbar-pair{font-size:12px}
  .topbar-stat{padding:0 2px 0 8px}
  .topbar-stat-label{font-size:8px}
  .topbar-stat-val{font-size:11px}
  .topbar-balance{font-size:12px}
  .connect-wallet{font-size:10px;padding:4px 8px}
  .topbar-help{display:none}
  .topbar-sound{width:26px;height:26px}
  .bottombar{gap:8px;font-size:10px;padding:0 8px}
  .stake-overlay{width:240px}
}

/* Mobile */
@media(max-width:768px),((pointer:coarse) and (hover:none) and (max-width:1024px)){
  :root{--sat:max(env(safe-area-inset-top,0px),8px)}
  .app{display:flex;flex-direction:column;height:100vh;height:100dvh;gap:0}
  .app.demo-active{height:calc(100vh - 32px);height:calc(100dvh - 32px)}
  .ticker{display:none!important}
  .desktop-trade-feed{display:none!important}
  .bottombar{display:none}
  .topbar{flex-shrink:0;height:calc(44px + var(--sat));padding-top:var(--sat);background:#0a0b0e;border-bottom:none;position:relative;z-index:60}
  .mob-trade-feed{display:block}
  .chart-area{flex:1;min-height:0;margin-top:calc(-44px - var(--sat));padding-top:0;border-radius:16px 16px 0 0;overflow:hidden}
  .stake-overlay{display:none!important}
  .positions-overlay{top:auto;bottom:72px;width:calc(100% - 16px);left:8px;right:8px;max-height:55%;display:none!important;border-radius:12px;background:linear-gradient(180deg,#1a1d24 0%,#12141a 100%);border:1.5px solid rgba(252,213,53,0.25);box-shadow:0 -4px 24px rgba(0,0,0,0.5),0 0 20px rgba(252,213,53,0.06)}
  .positions-overlay.mob-visible{display:flex!important}
  .positions-overlay .pos-header{background:linear-gradient(180deg,#1a1d24 0%,#181b22 100%);padding:12px 16px 10px!important;border-bottom:1px solid rgba(252,213,53,0.1)}
  .positions-overlay .pos-card{background:linear-gradient(135deg,rgba(252,213,53,0.04) 0%,rgba(252,213,53,0.01) 100%);border:1px solid rgba(252,213,53,0.12);border-radius:10px;padding:10px 12px 8px;margin-bottom:6px}
  .positions-overlay .pos-card::before{border-radius:10px 0 0 10px;width:3px}
  .positions-overlay .pos-card.pos-winning{border-color:rgba(14,203,129,0.25);background:linear-gradient(135deg,rgba(14,203,129,0.06) 0%,rgba(14,203,129,0.01) 100%)}
  .positions-overlay .pos-card.pos-losing{border-color:rgba(246,70,93,0.2);background:linear-gradient(135deg,rgba(246,70,93,0.04) 0%,rgba(246,70,93,0.01) 100%)}
  .chart-area{min-height:0}
  .chart-controls{bottom:88px;left:50%;transform:translateX(-50%);z-index:6}
  .chart-ctrl-btn{width:36px;height:36px;padding:0;backdrop-filter:blur(8px);background:rgba(30,32,38,0.9);font-size:12px}
  .chart-reset-btn{font-size:16px}
  .chart-tooltip{display:none!important}
  .stake-duration{display:none}
  .activity-panel{display:none}
  .topbar-help{display:none}
  .topbar-stat{display:none}
  .topbar-badge{display:inline-block;font-size:10px;padding:3px 6px}
  .mode-hint{display:none!important}
  .mode-selector{display:none}
  .mode-toggle{display:none}
  .topbar-jackpot{display:none}
  .topbar-balance-wrap{display:none}
  .topbar-sound{display:none}
  .theme-wrap{display:none!important}
  .topbar-theme{width:28px;height:28px;min-width:28px;min-height:28px;padding:0}
  .theme-picker-overlay .theme-picker{max-height:85vh;overflow-y:auto;-webkit-overflow-scrolling:touch}
  .topbar{padding:var(--sat) 12px 0;gap:8px;height:calc(44px + var(--sat))}
  .topbar-logo{height:28px;top:-2.7px}
  .topbar-brand{gap:7px;padding:4px 6px;overflow:hidden}
  .topbar-pair{display:none!important}
  .topbar.rush-active .topbar-pair{display:flex!important;font-size:13px;padding:7px 10px 5px;margin-left:auto;order:98;border:1px solid #2B2F36;border-radius:6px;background:rgba(30,32,38,0.6);align-items:center;gap:4px;line-height:1;transition:none;-webkit-tap-highlight-color:transparent}
  .topbar-pair.pair-locked{display:flex!important;font-size:13px;padding:7px 10px 5px;margin-left:auto;order:98;border:1px solid #2B2F36;border-radius:6px;background:rgba(30,32,38,0.6);align-items:center;gap:4px;line-height:1;opacity:1}
  .pair-dropdown-backdrop{background:rgba(0,0,0,0.75)}
  .topbar.rush-active .topbar-pair:hover{background:rgba(30,32,38,0.6);border:1px solid #2B2F36;border-bottom:1px solid #2B2F36;border-radius:6px;margin-bottom:0}
  .topbar-pair:hover .pair-dropdown:not(.mob-open){display:none!important}
  .topbar.rush-active .topbar-pair .pair-arrow{font-size:12px;margin-left:2px;line-height:1;position:relative;top:-1px}
  .topbar.rush-active .topbar-pair .pair-dropdown{position:fixed;top:44px;left:12px;right:12px;width:auto;border-radius:12px;max-height:min(70vh, calc(100vh - 44px - 72px - env(safe-area-inset-bottom)));display:none;flex-direction:column;overflow:hidden}
  .topbar.rush-active .topbar-pair .pair-dropdown .pd-search,.topbar.rush-active .topbar-pair .pair-dropdown .pd-tags,.topbar.rush-active .topbar-pair .pair-dropdown .pd-header{flex-shrink:0}
  .topbar.rush-active .topbar-pair .pair-dropdown .pd-list{max-height:none;flex:1;min-height:0;overflow-y:auto}
  .topbar-live{display:none!important}
  .topbar-demo{display:none!important}
  .hamburger{width:38px;height:38px;margin-left:auto;order:100}
  .hamburger-icon{gap:5px}
  .hamburger-icon span{width:22px;height:2.5px}
  .hamburger .nav-menu{display:none!important}
  .wallet-wrap{display:none!important}
  .mob-trade-bar{display:none!important}
  .tap-grid-overlay{width:68%;grid-template-columns:repeat(4,1fr)!important;grid-template-rows:repeat(8,1fr)!important}
  .tap-cell .tap-mult{font-size:10px}
  .tap-cell .tap-payout{font-size:8px}
  .tap-time-header{width:68%}
  .mob-positions-toggle{display:none!important}
  .mob-bottom-bar{display:flex;flex-direction:column;align-items:stretch}
  .mob-size-float{display:none!important}
  .aff-view{top:calc(44px + var(--sat))}
  .aff-inner{padding-top:48px}
  .wallet-popup{width:calc(100vw - 32px);max-width:400px;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-y:auto}
  .wp-grid{gap:6px}
  .wp-wallet{padding:10px 6px;gap:4px}
  .wp-icon-wrap{width:30px;height:30px;border-radius:8px;-webkit-mask-image:-webkit-radial-gradient(white,black)}
  .wp-wallet-name{font-size:10px}
  .wallet-popup h2{font-size:18px}
  .wallet-popup .wp-sub{font-size:11px;margin-bottom:14px}
  .wp-section{font-size:9px;margin-bottom:6px;margin-top:12px}
  .profile-overlay{overflow-y:auto;-webkit-overflow-scrolling:touch;align-items:flex-start;padding:20px 0}
  .profile-popup{width:calc(100vw - 32px);max-width:420px;margin:auto;padding:24px 20px}
  .pp-avatars{grid-template-columns:repeat(4,1fr)}
  .pp-avatar-wrap{border-radius:8px}
  .bao-sheet-inner{width:calc(100vw - 32px);max-width:400px}
  .jackpot-popup{width:calc(100vw - 24px);max-width:480px}
  .jpwin-popup{width:calc(100vw - 24px);max-width:420px}
}
@media(max-width:380px){
  .wallet-popup{padding:20px 16px}
  .wp-wallet{padding:8px 4px;gap:3px;border-radius:8px}
  .wp-icon-wrap{width:26px;height:26px;border-radius:6px;-webkit-mask-image:-webkit-radial-gradient(white,black)}
  .wp-wallet-name{font-size:9px}
  .wp-grid{gap:5px}
  .profile-popup{padding:20px 16px}
  .profile-popup h2{font-size:18px}
  .pp-avatars{gap:6px}
}
