


@media (pointer:coarse) {
  #game-screen .card[data-uid],
  #game-screen .manual-stack-card[data-uid],
  #game-screen .manual-seal-slice[data-uid],
  #game-screen .god-link-part[data-uid],
  #game-screen .forbidden-seal-card[data-uid],
  #game-screen .ffield-corner-seal[data-uid],
  #game-screen .manual-stack-handle,
  #game-screen .manual-zone-pop-card { touch-action: none; }
}


@media (max-width:600px), (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  body.dm-phone #manual-context-menu {
    max-width: min(90vw, 360px);
    max-height: 76vh;
    overflow-y: auto;
    
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.6);
  }
  body.dm-phone #manual-context-menu .manual-menu-card-preview {
    padding: 8px 8px 4px;
    text-align: center;
    cursor: zoom-in;
  }
  body.dm-phone #manual-context-menu .manual-menu-card-preview img {
    width: 152px; max-width: 60%; height: auto; display: block; margin: 0 auto;
    border-radius: 9px; box-shadow: 0 6px 18px rgba(0,0,0,0.5);
    -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
  }
  body.dm-phone #manual-context-menu .manual-menu-item,
  body.dm-phone #manual-context-menu .manual-menu-xrow { padding: 11px 14px; font-size: 14px; }
  body.dm-phone #manual-context-menu .manual-menu-title { font-size: 13px; padding: 8px 12px 7px; }

  
  body.dm-phone #manual-context-menu .manual-menu-text-toggle {
    display: block; width: calc(100% - 16px); margin: 6px auto 2px; padding: 9px;
    font-size: 13px; font-weight: 600; border-radius: 8px;
    background: #1b2433; color: #cfe3f7; border: 1px solid rgba(255, 255, 255, 0.16);
  }
  body.dm-phone #manual-context-menu .manual-menu-card-text { display: none; max-height: 42vh; overflow-y: auto; padding: 2px 10px 8px; }
  body.dm-phone #manual-context-menu.show-card-text .manual-menu-card-text { display: block; }
  body.dm-phone #manual-context-menu .manual-menu-card-text .tt-card-panel { font-size: 12px; color: #d6dee8; }
  body.dm-phone #manual-context-menu .manual-menu-card-text h3 { font-size: 14px; margin: 2px 0 4px; color: #ffe9b0; }
  body.dm-phone #manual-context-menu .manual-menu-card-text .tt-stats { font-size: 11px; color: #9fb0c4; margin-bottom: 5px; }
  body.dm-phone #manual-context-menu .manual-menu-card-text .tt-text { font-size: 12px; line-height: 1.45; }

  
  body.dm-phone #manual-context-menu .manual-b-btn,
  body.dm-phone #manual-context-menu .manual-s-btn,
  body.dm-phone #manual-context-menu .manual-fd-btn,
  body.dm-phone #manual-context-menu .manual-tap-btn,
  body.dm-phone #manual-context-menu .manual-u-btn,
  body.dm-phone #manual-context-menu .manual-5sd-btn { height: 28px; min-width: 30px; padding: 0 9px; font-size: 12px; }
  body.dm-phone #manual-context-menu .manual-orient-btn { width: 40px; height: 34px; font-size: 17px; }
  body.dm-phone #manual-context-menu .manual-x-dec,
  body.dm-phone #manual-context-menu .manual-x-inc { min-width: 30px; height: 28px; padding: 0 8px; font-size: 15px; }
  body.dm-phone #manual-context-menu .manual-x-num { height: 28px; font-size: 13px; }

  
  body.dm-phone #board .manual-bar-hotkey { display: none; }
  body.dm-phone #manual-context-menu .manual-menu-item > .manual-menu-key { display: none; }

  
  body.dm-phone #manual-context-menu .dm-mobile-hide { display: none; }

  
  body.dm-phone #manual-context-menu { position: fixed; }
  body.dm-phone #manual-context-menu .manual-menu-sub { position: static; }
  body.dm-phone #manual-context-menu.dm-submenu-active { overflow: hidden; }
  body.dm-phone #manual-context-menu .manual-submenu {
    display: block; position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    min-width: 0; max-width: none; margin: 0; border: 0; border-radius: 14px;
    background: #16181f; box-shadow: none; padding: 4px; z-index: 6;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(102%); transition: transform 0.2s ease;
  }
  body.dm-phone #manual-context-menu .manual-menu-sub.dm-sub-open > .manual-submenu { transform: translateX(0); }
  
  body.dm-phone #manual-context-menu .manual-submenu-head {
    display: flex; align-items: center; gap: 9px; padding: 10px 8px; margin: -4px -4px 5px; cursor: pointer;
    font-weight: 600; font-size: 14px; color: #cfe3f7; border-bottom: 1px solid #2a3140;
    border-radius: 14px 14px 0 0; background: #1b2433;
  }
  body.dm-phone #manual-context-menu .manual-submenu-back { font-size: 22px; line-height: 1; color: #f0c766; }

  
  body.dm-phone .chat-input,
  body.dm-phone #manual-context-menu .manual-x-num { font-size: 16px; }
}




@media (max-width: 600px), (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  #menu-screen .menu-belt-card.card { width: 64px; height: 90px; flex: 0 0 64px; margin: 0; }
  #menu-screen .menu-belt-card.menu-belt-card-zeron.card { width: 104px; height: 97px; flex: 0 0 104px; }
  
  #menu-screen > h1 { font-size: 42px; }
}

@media (pointer: coarse) {
  .menu-belt-card:hover,
  .menu-card-belt-bottom .menu-belt-card:hover { transform: none; opacity: 0.84; box-shadow: 0 10px 24px rgba(0,0,0,0.42), 0 0 0 1px rgba(240,199,102,0.08); border-color: rgba(255,255,255,0.26); }
}






.dm-mobile-gamebar { display: none; }
.dm-mobile-scrim { display: none; }
@media (max-width: 600px), (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  
  body.dm-phone #game-screen .dm-mobile-gamebar {
    display: flex; position: fixed; right: 10px; left: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 130;
    padding: 0; background: none; border: 0;
  }
  body.dm-phone #game-screen .dm-mb-btn {
    width: 46px; height: 46px; flex: 0 0 auto; padding: 0; border-radius: 50%;
    font-size: 22px; line-height: 1; color: #d8e6f5;
    background: rgba(20, 28, 39, 0.96); border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  }
  body.dm-phone #game-screen .dm-mb-btn:active { background: #28384c; }
  body.dm-phone.dm-sheet-open #game-screen .dm-mobile-scrim {
    display: block; position: fixed; inset: 0; z-index: 125; background: rgba(0, 0, 0, 0.45);
  }

  
  body.dm-phone #game-screen .game-layout,
  body.dm-phone #game-screen.manual-mode .game-layout,
  body.dm-phone #game-screen.board-theme-table .game-layout { grid-template-columns: 1fr !important; }
  body.dm-phone #game-screen .sidebar-vresizer { display: none !important; }

  
  body.dm-phone #board {
    zoom: var(--dm-phone-board-zoom, 0.7);
    
    padding: 22px 2px calc(22px + env(safe-area-inset-bottom, 0px));
    
    touch-action: none;
  }
  
  body.dm-phone #board .hand-zone {
    flex-wrap: nowrap; overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch;
    
    touch-action: pan-x;
    padding-bottom: 16px;
    scrollbar-width: auto;
  }
  body.dm-phone #board .hand-zone::-webkit-scrollbar { height: 13px; -webkit-appearance: none; }
  body.dm-phone #board .hand-zone::-webkit-scrollbar-thumb { background: rgba(240,199,102,0.6); border-radius: 7px; border: 2px solid rgba(0,0,0,0.3); }
  body.dm-phone #board .hand-zone::-webkit-scrollbar-track { background: rgba(0,0,0,0.28); border-radius: 7px; }
  
  body.dm-phone #board .player-label { flex-wrap: wrap; min-height: 0; row-gap: 4px; }
  body.dm-phone #board .manual-bar-controls { flex-wrap: wrap; gap: 4px; }

  
  body.dm-phone #game-screen .manual-tt-dock,
  body.dm-phone #game-screen .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto;
    height: 66vh; max-height: 66vh; min-width: 0; z-index: 1550;
    border: 0; border-top: 1px solid rgba(240, 199, 102, 0.28);
    border-radius: 16px 16px 0 0; box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.55);
    transform: translateY(106%); transition: transform 0.22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.dm-phone.dm-sheet-detail #game-screen .manual-tt-dock { transform: translateY(0); }
  body.dm-phone.dm-sheet-feed #game-screen .sidebar { transform: translateY(0); }
  
  body.dm-phone #game-screen .sidebar { height: 66vh; }
  
  body.dm-phone.dm-sheet-open .dm-language-toggle,
  body.dm-phone.dm-sheet-open #dm-settings-btn,
  body.dm-phone.dm-sheet-open #dm-bell-btn { display: none !important; }
  
  body.dm-phone.dm-sheet-feed #game-screen .dm-mobile-gamebar { display: none; }

  

  
  body.dm-phone #board .mana-zone .card.has-img .card-power { display: none; }
}



body.dm-phone #game-screen { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.dm-phone #game-screen .sidebar { -webkit-user-select: text; user-select: text; }


body.dm-phone #board .manual-side-tab,
body.dm-phone #board .card.manual-stack-target::before,
body.dm-phone #board .card.manual-stack-target::after,
body.dm-phone #board .manual-stack-card.manual-stack-target::before,
body.dm-phone #board .manual-stack-card.manual-stack-target::after { display: none !important; content: none !important; }


body.dm-phone #board .neo-evo-badge { display: none !important; }


@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  body.dm-phone.dm-landscape #board {
    zoom: var(--dm-phone-board-zoom-land, 0.52);
    padding: 6px 2px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  body.dm-phone.dm-landscape #game-screen .manual-tt-dock,
  body.dm-phone.dm-landscape #game-screen .sidebar { height: 90vh; max-height: 90vh; }
  
  body.dm-phone.dm-landscape #game-screen .dm-mobile-gamebar { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
