#hub-phone,
#hub-sheet-close,
#hub-class-pop { display: none; }

html.touch-play #screen-hub:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}
html.touch-play #screen-hub .topbar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  flex: 0 0 36px;
  height: 36px;
  width: auto;
  padding-right: 132px;
  z-index: 5;
}
html.touch-play #hub-phone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 6;
  flex: 0 0 auto;
  padding: 4px 8px 2px;
  pointer-events: auto;
}
html.touch-play:not(.is-fullscreen):not(.touch-standalone) #hub-phone #btn-enter-fullscreen {
  min-height: 34px;
  margin: 0;
  font-size: 13px;
}
html.touch-play #screen-hub .hub-grid {
  display: flex !important;
  flex-direction: column;
  position: relative !important;
  margin-top: 0 !important;
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 8px 6px !important;
  overflow: hidden !important;
  grid-template-columns: none !important;
}
html.touch-play .hub-rail,
html.touch-play #hub-dock,
html.touch-play #champion-card { display: none; }
html.touch-play .play-modes { display: block; }
html.touch-play #campaign-play-card { display: none !important; }
html.touch-play.hub-mode-campaign #arena-play-card { display: none !important; }
html.touch-play.hub-mode-campaign #campaign-play-card { display: flex !important; }

.hub-phone-row { display: flex; gap: 8px; align-items: center; }
html.touch-play .hub-phone-class {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
  padding: 4px 8px;
  text-align: left;
  overflow: hidden;
}
html.touch-play .hub-phone-port.class-pick {
  width: 28px !important;
  height: 28px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  pointer-events: none;
  flex: 0 0 28px;
  display: block !important;
}
html.touch-play .hub-phone-port.class-pick::before {
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
}
html.touch-play label.hub-phone-mode {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 132px;
  margin: 0 !important;
  color: var(--gold);
  font-family: var(--ui-label);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html.touch-play label.hub-phone-mode > span { display: none; }
html.touch-play .hub-phone-mode select { min-height: 36px; height: 36px; font-size: 15px; margin: 0; padding: 4px 8px; }
html.touch-play .hub-phone-nav { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; }
html.touch-play .hub-phone-nav button {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.touch-play #screen-hub .queue-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
html.touch-play #screen-hub .play-modes {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 0;
}
.queue-fields { display: contents; }
html.touch-play:not(.hub-mode-campaign) #arena-play-card,
html.touch-play.hub-mode-campaign #campaign-play-card {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  margin: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  border-width: 8px;
  border-image-width: 8px;
  padding: 6px 8px;
}
.field-row { display: contents; }
html.touch-play .queue-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
}
html.touch-play .queue-fields > h2 { display: none; }
html.touch-play .queue-fields > .brackets { margin: 0; }
html.touch-play .brackets button { min-height: 32px; margin: 0; padding: 4px 6px; }
html.touch-play .field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
html.touch-play .field-row > .check {
  flex: 1 1 0;
  margin: 0 !important;
  min-height: 28px;
  font-size: 13px;
}
html.touch-play .queue-fields > .check {
  margin: 0 !important;
  min-height: 28px;
  font-size: 13px;
}
html.touch-play .field-row > label {
  flex: 0 0 auto;
  margin: 0 !important;
  white-space: nowrap;
}
html.touch-play .field-row > select,
html.touch-play .queue-fields #win-cond-wrap select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 2px 8px;
}
html.touch-play .queue-fields > #win-cond-wrap {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
html.touch-play .queue-fields > #win-cond-wrap.hidden { display: none !important; }
html.touch-play #arena-play-card .gold,
html.touch-play #campaign-play-card .gold {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 8px 12px;
  min-height: 40px;
}
html.touch-play #arena-play-card .err:empty,
html.touch-play #campaign-play-card .err:empty,
html.touch-play #arena-play-card .queue-hint:empty,
html.touch-play #campaign-play-card .queue-hint:empty {
  display: none;
  min-height: 0;
  margin: 0;
}
html.touch-play:not(.match-open) #xp-bar:not(.hidden) {
  position: fixed;
  top: 11px;
  left: 124px;
  right: auto;
  bottom: auto;
  width: min(260px, 32vw);
  height: 14px;
  z-index: 35;
}

html.touch-play.hub-sheet #screen-hub,
html.touch-play.hub-picking #screen-hub { z-index: 60; }
html.touch-play.hub-sheet #screen-hub .hub-grid { z-index: 8 !important; }
html.touch-play.hub-sheet .hub-rail {
  display: flex !important;
  position: fixed;
  z-index: 80;
  left: calc(8px + var(--sal, 0px));
  right: calc(8px + var(--sar, 0px));
  top: calc(8px + var(--sat, 0px));
  bottom: calc(8px + var(--sab, 0px));
  margin: 0;
  padding: 40px 8px 8px;
  overflow: auto;
  background: #120c08;
  border: 1px solid #c4a050;
  pointer-events: auto;
}
html.touch-play.hub-sheet #hub-sheet-close {
  display: block;
  position: fixed;
  z-index: 81;
  top: calc(14px + var(--sat, 0px));
  right: calc(16px + var(--sar, 0px));
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 4px 10px;
}
html.touch-play.hub-sheet-party .live-matches-card,
html.touch-play.hub-sheet-friends .live-matches-card,
html.touch-play.hub-sheet-blocked .live-matches-card,
html.touch-play.hub-sheet-party #friends-fold,
html.touch-play.hub-sheet-party #friends-body,
html.touch-play.hub-sheet-party #blocked-fold,
html.touch-play.hub-sheet-party #blocked-body,
html.touch-play.hub-sheet-friends .panel > h2:first-of-type,
html.touch-play.hub-sheet-friends #invite-inbox,
html.touch-play.hub-sheet-friends #party-list,
html.touch-play.hub-sheet-friends #btn-leave-party,
html.touch-play.hub-sheet-friends .party-invite-row,
html.touch-play.hub-sheet-friends #party-err,
html.touch-play.hub-sheet-friends #blocked-fold,
html.touch-play.hub-sheet-friends #blocked-body,
html.touch-play.hub-sheet-blocked .panel > h2:first-of-type,
html.touch-play.hub-sheet-blocked #invite-inbox,
html.touch-play.hub-sheet-blocked #party-list,
html.touch-play.hub-sheet-blocked #btn-leave-party,
html.touch-play.hub-sheet-blocked .party-invite-row,
html.touch-play.hub-sheet-blocked #party-err,
html.touch-play.hub-sheet-blocked #friends-fold,
html.touch-play.hub-sheet-blocked #friends-body,
html.touch-play.hub-sheet-battles .panel { display: none !important; }
html.touch-play.hub-sheet-blocked #blocked-body,
html.touch-play.hub-sheet-friends #friends-body { display: block !important; }

#hub-class-pop.hub-class-pop {
  position: fixed;
  inset: 0;
  z-index: 85;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 2, 0.72);
}
html.touch-play.hub-picking #hub-class-pop { display: flex; }
.hub-class-card {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 8px 12px 12px;
  background: #1a120c;
  border: 1px solid #c4a050;
  border-radius: 6px;
}
.hub-class-head { display: flex; align-items: center; gap: 8px; }
.hub-class-head h2 { margin: 0; color: var(--gold-bright); font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; }
#hub-class-mount .class-picks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
}
#hub-class-mount .class-pick { flex: none; min-height: 0; font-size: 12px; padding: 6px 4px; }
#hub-class-mount .class-pick::before { width: 52px; height: 52px; margin: 0 auto 4px; }
#hub-class-mount .class-pick .role { display: none; }
