/* v100 — global mobile hardening for Steel Throne. Keeps desktop 520px layout intact. */
@media(max-width:600px){
  html,body{max-width:100%;overflow-x:hidden}
  body.game-page{min-width:0!important}
  .page-col,#game-main,.game-body-shell,.game-shell{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:auto!important;margin-right:auto!important;box-sizing:border-box!important}
  .glass-panel{padding:0!important}
  .game-body-shell{overflow-x:hidden!important}
  .game-body-shell>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .game-body-shell :where(img,svg,video,canvas,iframe){max-width:100%!important;height:auto}
  .game-body-shell :where(input,textarea,select,button){max-width:100%;font-size:16px}
  .game-body-shell :where(p,a,span,strong,b,small,label,td,th,li){overflow-wrap:anywhere;word-break:normal}
  .game-body-shell :where(table){width:100%!important;table-layout:fixed!important;border-collapse:collapse}
  .game-body-shell :where(td,th){min-width:0!important;white-space:normal!important}
  .game-body-shell :where(dialog){max-width:calc(100vw - 20px)!important;margin:auto!important}
  .game-body-shell :where(.pagination,.pager,.pages,[class*="-pages"]){max-width:100%!important;overflow:hidden!important;gap:4px!important}
  .game-body-shell :where(.pagination,.pager,.pages,[class*="-pages"]) a{min-width:32px;min-height:32px}
  .game-body-shell :where(.grid,.cards,.list,.rows,.items,.entries){min-width:0!important}

  /* Shared forms and action bars */
  .royal-theme .game-body-shell :where(form){min-width:0!important;max-width:100%!important}
  .royal-theme .game-body-shell :where(.actions,.action-row,.buttons,.toolbar,.tools){max-width:100%!important;flex-wrap:wrap!important}
  .royal-theme .game-body-shell :where(.actions,.action-row,.buttons,.toolbar,.tools)>*{min-width:0!important}

  /* Home */
  .h44-grid{grid-template-columns:1fr 1fr!important;gap:5px!important;padding:5px!important}
  .h44-card{min-width:0!important;overflow:hidden!important}
  .h44-card>.h44-scene{max-width:none!important}
  .h44-copy>strong,.h44-copy>span{max-width:100%!important}

  /* Chat */
  .c37,.cc41{width:100%!important;max-width:100%!important;overflow:hidden!important}
  .c37-message{min-width:0!important;max-width:100%!important}
  .c37-content,.c37-meta,.c37-bubble,.c37-quote,.c37-actions{min-width:0!important;max-width:100%!important}
  .c37-bubble,.c37-quote{overflow-wrap:anywhere!important}
  .c37-menu-panel{max-width:calc(100vw - 24px)!important}

  /* Mail */
  .m39{width:100%!important;max-width:100%!important;overflow:hidden!important}
  .m39-message,.m39-thread-head,.m39-read>header{min-width:0!important}
  .m39-content,.m39-content>header,.m39-subject,.m39-excerpt{min-width:0!important;max-width:100%!important}
  .m39-row-actions{min-width:0!important}
  .m39-menu-panel{max-width:calc(100vw - 24px)!important}

  /* Forum */
  .f87-forum-homehead,.f87-sections,.f87-sec-card,.f87-recent-panel,.gf-card,.r26-forum-table{width:100%!important;max-width:100%!important;min-width:0!important}
  .f87-sec-card{overflow:hidden!important}
  .f87-sec-info,.f87-recent-main{min-width:0!important}
  .r26-forum-row{min-width:0!important}

  /* Profile */
  .r26-profile-top,.r26-profile-cards,.profile-grid,.profile-stats,.profile-actions{max-width:100%!important;min-width:0!important}
  .r26-profile-cards{grid-template-columns:1fr 1fr!important}
  .r26-profile-cards>*{min-width:0!important}

  /* Clan */
  .c43,.c56,.clan-page,.clan-shell{max-width:100%!important;min-width:0!important;overflow:hidden!important}
  .c43-nav,.c43-actions,.clan-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .c43-nav>a,.c43-actions>a,.clan-actions>a{min-width:0!important}

  /* Quests / rating / online / settings */
  .q35,.r36,.o38,.settings-page,.settings-shell{max-width:100%!important;min-width:0!important;overflow:hidden!important}
  .q35-grid,.r36-grid,.o38-grid{min-width:0!important}

  /* Shops */
  #shop94,.shop94,.shop-page,.store-page{max-width:100%!important;min-width:0!important;overflow:hidden!important}
  .shop94-grid,.shop-grid,.store-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  .shop94-grid>*,.shop-grid>*,.store-grid>*{min-width:0!important}

  /* Combat/adventure modules */
  #coliseum97,#arena93,#daily95,.a56,.r26-scene,.battle-page,.adventure-page{width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important}
  #coliseum97 .c97-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #coliseum97 .c97-main-buttons{grid-template-columns:1fr!important}
  #coliseum97 .c97-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #coliseum97 .c97-row{min-width:0!important}
  #coliseum97 .c97-row>div:not(.c97-avatar){min-width:0!important}
  #coliseum97 .c97-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #coliseum97 .c97-combat{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #coliseum97 .c97-prizes{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  /* Events */
  .ve-event,.ny-page,[class*="event-page"],[class*="event-shell"]{width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important}

  /* Footer */
  .game-footer,.footer-nav,.f82{max-width:100%!important;overflow:hidden!important}
}
@media(max-width:380px){
  .h44-grid{grid-template-columns:1fr!important}
  .r26-profile-cards{grid-template-columns:1fr!important}
  .shop94-grid,.shop-grid,.store-grid{grid-template-columns:1fr!important}
  #coliseum97 .c97-tabs{grid-template-columns:1fr!important}
}
