@media (max-width: 768px) {

  .tcg-tabs {
    position: fixed !important;
    left: 50% !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    transform: translateX(-50%) !important;
    z-index: 650 !important;

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;

    width: min(calc(100vw - 12px), 520px) !important;
    max-width: calc(100vw - 12px) !important;
    padding: 5px !important;
    gap: 4px !important;
    border-radius: 18px !important;
    background: rgba(10, 11, 21, .97) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    box-shadow: 0 18px 52px rgba(0,0,0,.55) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    margin: 0 !important;
  }

  .tcg-tabs::-webkit-scrollbar { display: none !important; }

  .tcg-tab {

    flex: 0 0 auto !important;
    min-width: 58px !important;
    min-height: 50px !important;
    padding: .4rem .3rem !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: .15rem !important;
    border-radius: 13px !important;
    font-size: .44rem !important;
    line-height: 1 !important;
    letter-spacing: .5px !important;
    white-space: normal !important;
    text-align: center !important;
    cursor: pointer !important;
  }

  .tcg-tab-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
  }

  .tcg-tab-label {
    display: block !important;
    width: 100% !important;
  }

  .tcg-tabs::after {
    content: '';
    flex: 0 0 8px;
    pointer-events: none;
  }
}

@media (max-width: 380px) {
  .tcg-tabs {
    width: min(calc(100vw - 10px), 100vw) !important;
    padding: 4px !important;
    gap: 3px !important;
  }

  .tcg-tab {
    min-width: 52px !important;
    min-height: 46px !important;
    font-size: .4rem !important;
  }

  .tcg-tab-icon { font-size: 1rem !important; }
}

@media (max-width: 768px) {

  #tcg,
  .tcg-app-chrome {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .tcg-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .tcg-collection-controls {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .tcg-search {
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 140px !important;
    min-height: 44px !important;
  }

  .tcg-filter {
    min-height: 44px !important;
    flex: 1 1 100px !important;
    cursor: pointer !important;
  }

  .tcg-section-header {
    padding: 16px 0 12px !important;
    gap: .5rem !important;
  }
}

@media (max-width: 480px) {
  .tcg-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
}

@media (max-width: 768px) {

  #tcg-packs-grid {
    width: 100% !important;
    overflow: hidden !important;
  }

  #tcg-packs-grid canvas {
    width: 100% !important;
    height: auto !important;
    cursor: grab !important;
    touch-action: none !important; 
  }

  #tcg-packs-grid .tcg-circle-hint {
    display: block !important;
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: .55rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,.3);
    padding: .5rem 0 .25rem;
    text-transform: uppercase;
  }
}

@media (max-width: 768px) {
  .tcg-packs-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .tcg-pack {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem 1.1rem !important;
    text-align: left !important;
    border-radius: 14px !important;
  }

  .tcg-pack-icon {
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
    font-size: 2.2rem !important;
  }

  .tcg-pack-content {
    flex: 1 !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .tcg-pack-actions {
    flex-direction: column !important;
    gap: .5rem !important;
  }

  .tcg-pack-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
  }
}

@media (max-width: 768px) {
  .tcg-combat-arena {
    grid-template-columns: 1fr !important;
    gap: .75rem !important;
  }

  .tcg-vs {
    padding: 0 !important;
    font-size: 1.8rem !important;
    text-align: center !important;
  }

  .tcg-combat-side { gap: .75rem !important; }

  .tcg-combat-slot {
    width: min(100%, 160px) !important;
    max-width: 160px !important;
    margin: 0 auto !important;
  }

  .tcg-combat-stat-row { font-size: .58rem !important; }

  .tcg-combat-log {
    padding: .75rem !important;
    max-height: 120px !important;
    font-size: .6rem !important;
    line-height: 1.6 !important;
  }

  .tcg-combat-launch,
  .tcg-combat-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
  }
}

@media (max-width: 480px) {
  .tcg-combat-slot {
    width: min(100%, 136px) !important;
    max-width: 136px !important;
  }
}

@media (max-width: 768px) {
  .shop-shell {
    gap: 1.25rem !important;
    padding: .75rem 0 4rem !important;
  }

  .shop-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .85rem !important;
    padding: 0 !important;
  }

  .shop-header-right {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .6rem !important;
  }

  .shop-coins-badge {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .shop-timer-block {
    align-items: flex-start !important;
    flex: 0 0 auto !important;
  }

  .shop-refresh-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .75rem !important;
  }

  .shop-card-body { padding: .7rem .65rem .65rem !important; }
  .shop-card-name { font-size: .9rem !important; }

  .shop-buy-btn {
    min-height: 40px !important;
    font-size: .5rem !important;
  }
}

@media (max-width: 480px) {
  .shop-grid {
    grid-template-columns: 1fr !important;
  }

  .shop-card {
    flex-direction: row !important;
    border-radius: 14px !important;
  }

  .shop-card-img-wrap {
    width: 90px !important;
    flex: 0 0 90px !important;
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: 110px !important;
  }

  .shop-card-body {
    flex: 1 !important;
    min-width: 0 !important;
    padding: .75rem .6rem !important;
    justify-content: space-between !important;
  }
}

@media (max-width: 768px) {
  .bp-shell {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .bp-header {
    flex-direction: column !important;
    gap: .85rem !important;
    margin-bottom: 1.25rem !important;
  }

  .bp-title {
    font-size: clamp(2.2rem, 13vw, 3.5rem) !important;
    letter-spacing: 0 !important;
  }

  .bp-hero-inner {
    grid-template-columns: 1fr !important;
    padding: 1.1rem !important;
    gap: .85rem !important;
  }

  .bp-tiers {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .bp-tier { padding: 1rem .65rem .85rem !important; }
  .bp-tier-icon { font-size: 1.9rem !important; }

  .bp-xp-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
  }

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

  .bp-how {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .4rem !important;
    margin-bottom: 1.25rem !important;
  }

  .bp-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .6rem !important;
  }

  .bp-section-header::after { display: none !important; }

  .bp-section-badge {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 380px) {
  .bp-tiers { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .deck-builder {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .deck-panel {
    position: static !important;
    max-height: none !important;
    border-radius: 14px !important;
  }

  .deck-collection-grid,
  #deck-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .deck-slots, #deck-slots {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }
}

@media (max-width: 768px) {
  .badges-grid,
  .tcg-badges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .badges-grid,
  .tcg-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .challenges-list,
  .tcg-challenges-list {
    gap: .6rem !important;
  }

  .challenge-card,
  .tcg-challenge-item {
    padding: .85rem 1rem !important;
  }

  .challenge-reward {
    flex-shrink: 0 !important;
  }
}

@media (max-width: 768px) {
  .tcg-leaderboard-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }

  .lb-col-wins,
  .lb-col-losses {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .ch {
    padding: calc(4.5rem + env(safe-area-inset-top, 0px)) .85rem 1rem !important;
    min-height: auto !important;
    align-items: flex-start !important;
  }

  .ch-content { width: 100% !important; }

  .ch-stats {
    position: static !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    margin-top: 1rem !important;
    border: 1px solid var(--border, rgba(255,255,255,.08)) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .ch-stat {
    padding: .7rem .4rem !important;
    border: 0 !important;
    border-right: 1px solid var(--border2, rgba(255,255,255,.04)) !important;
    border-bottom: 1px solid var(--border2, rgba(255,255,255,.04)) !important;
  }

  .ch-stat:nth-child(2n) { border-right: 0 !important; }
  .ch-stat:nth-last-child(-n+2) { border-bottom: 0 !important; }

  .ch-stat-val { font-size: 1.15rem !important; }
  .ch-stat-label { font-size: .4rem !important; letter-spacing: 1.2px !important; }

  .ch-cta { width: 100% !important; }

  .ch-btn-reveal,
  .ch-btn-scroll {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  .hero-collection-progress {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    margin-top: 1rem !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 768px) {
  #toast,
  .toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 80px) !important;
    left: .85rem !important;
    right: .85rem !important;
    max-width: none !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  #tcg-picker-overlay {
    flex-direction: column !important;
    padding: 1.5rem .85rem calc(env(safe-area-inset-bottom, 0px) + 1rem) !important;
    justify-content: flex-end !important;
  }

  #tcg-picker-grid {
    max-height: 60svh !important;
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .battle-pocket-shell,
  .tcg-arena {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

@media (max-width: 768px) {

  .battle-pocket-shell.arena-mode {
    min-height: auto !important;
    border-radius: 12px !important;
  }

  .battle-pocket-head {
    flex-direction: column !important;
    gap: .5rem !important;
    padding: .6rem .85rem !important;
  }

  .battle-pocket-head-actions {
    display: flex !important;
    gap: .5rem !important;
    width: 100% !important;
  }

  .battle-pocket-head-actions .btn {
    flex: 1 !important;
    justify-content: center !important;
    min-height: 38px !important;
    font-size: .55rem !important;
  }

  .arena-orb-1, .arena-orb-2,
  .arena-orb-3, .arena-orb-4 {
    filter: blur(60px) !important;
    opacity: .5 !important;
  }

  .ecb-header {
    padding: .45rem .75rem .4rem !important;
  }

  .ecb-score-row { gap: .3rem !important; }
  .ecb-score-label { font-size: .55rem !important; }
  .ecb-vs-badge { font-size: 1rem !important; }
  .ecb-round-label { font-size: .45rem !important; }

  .battle-pocket-board {
    padding: .5rem .4rem 0 !important;
  }

  .arena-consumable-sidebar,
  .arena-sidebar {
    width: auto !important;
    min-width: 0 !important;
  }

  .bko-wrap { gap: .35rem !important; }

  .battle-pocket-action-panel {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .battle-pocket-shell.result-mode .battle-result-title {
    font-size: clamp(2rem, 12vw, 3.5rem) !important;
  }

  .battle-pocket-shell.lobby-mode {
    padding: 1rem !important;
    border-radius: 12px !important;
    min-height: auto !important;
  }

  .battle-pocket-shell.picker-mode {
    min-height: auto !important;
  }
}

@media (max-width: 480px) {
  .battle-pocket-shell.arena-mode .battle-result-title {
    font-size: 2.6rem !important;
  }

  .battle-pocket-shell.arena-mode .dmg-number {
    font-size: 1.3rem !important;
  }

  .battle-pocket-shell.arena-mode .dmg-number.crit {
    font-size: 1.7rem !important;
  }

  .battle-pocket-card {
    width: min(100%, 80px) !important;
  }
}