/* Phone polish on top of mobile.css / mobile-hub.css, same design language:
   the Hall shows your champion beside the play card the way the desktop Hall
   does, and Settings keeps its tabs and Close in reach while the pane scrolls. */

/* ---- Hall: champion on the stage, play card on the left ---- */
html.touch-play .hub-stage {
  display: block !important;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42%;
  pointer-events: none;
}
html.touch-play:not(.hub-mode-campaign) #arena-play-card {
  max-width: 58% !important;
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: 100% !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
html.touch-play.hub-mode-campaign #campaign-play-card { max-width: 58% !important; }
html.touch-play:not(.hub-mode-campaign) #arena-play-card .queue-fields { gap: 6px; }

/* ---- Settings: header and actions stay put, the pane scrolls ---- */
html.touch-play #settings-card,
html.touch-play #settings-card.controls-open {
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
  height: calc(var(--app-h, 100dvh) - 12px - var(--sat) - var(--sab));
  padding: 6px 10px 8px !important;
  box-sizing: border-box;
}
html.touch-play #settings-title {
  flex: 0 0 auto;
  margin: 0 0 4px !important;
  font-size: 17px !important;
  letter-spacing: 0.14em;
}
html.touch-play #settings-card .settings-tabs { flex: 0 0 auto; margin-bottom: 4px; }
html.touch-play #settings-card .settings-tabs button { min-height: 34px; }
html.touch-play #settings-card .settings-pane:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
html.touch-play #settings-card .settings-actions {
  flex: 0 0 auto;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(201, 162, 74, 0.25);
}


/* ---- Post-match: the card fits the screen; title and Leave stay, the meter scrolls ---- */
html.touch-play #screen-post { overflow: hidden !important; }
html.touch-play #screen-post .post-card {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 16px - var(--sal) - var(--sar)));
  max-height: calc(var(--app-h, 100dvh) - 16px - var(--sat) - var(--sab));
  overflow: hidden;
  box-sizing: border-box;
  border-width: 14px;
  padding: 0 10px 6px;
}
html.touch-play #screen-post .post-card > * { flex: 0 0 auto; }
html.touch-play #post-title { font-size: 20px; margin: 0; }
html.touch-play #post-reason { margin: 0 0 2px; font-size: 13px; }
html.touch-play #screen-post .post-stat-grid { margin: 4px 0; }
html.touch-play #post-meter:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  margin: 4px 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
html.touch-play #post-awards { margin: 4px 0; }
html.touch-play #btn-post-hub { margin-top: 4px; min-height: 40px; }

/* ---- Hall sheets (Party, Friends, Blocked, Battles): a card over the dimmed Hall ---- */
html.touch-play.hub-sheet .hub-rail {
  left: max(calc(12px + var(--sal, 0px)), calc(50% - 280px)) !important;
  right: max(calc(12px + var(--sar, 0px)), calc(50% - 280px)) !important;
  top: calc(14px + var(--sat, 0px)) !important;
  bottom: auto !important;
  max-height: calc(var(--app-h, 100dvh) - 28px - var(--sat, 0px) - var(--sab, 0px));
  padding: 42px 8px 8px !important;
  box-sizing: border-box;
  background: linear-gradient(180deg, #1e140c, #120c08) !important;
  border: 2px solid #c4a050 !important;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(40, 26, 10, 0.9), 0 14px 36px rgba(0, 0, 0, 0.75);
}
html.touch-play.hub-sheet .hub-rail .panel,
html.touch-play.hub-sheet .hub-rail .live-matches-card { margin: 0 0 6px !important; }
#hub-sheet-back { display: none; }
html.touch-play.hub-sheet #hub-sheet-back {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(6, 4, 2, 0.72);
  pointer-events: auto;
}
html.touch-play.hub-sheet #hub-sheet-close {
  top: calc(20px + var(--sat, 0px)) !important;
  right: calc(max(calc(12px + var(--sar, 0px)), calc(50% - 280px)) + 6px) !important;
  width: 32px !important;
  height: 32px;
  min-height: 32px !important;
  padding: 0 !important;
  font-size: 0 !important;
  color: #ffe2a0;
  background: radial-gradient(circle at 50% 35%, #3a2a14, #1a1008 75%);
  border: 2px solid #c9a24a;
  border-radius: 4px;
  box-shadow: 0 2px 0 #120a04;
}
html.touch-play.hub-sheet #hub-sheet-close::before { content: "\2715"; font-size: 16px; line-height: 28px; }

/* ---- Portrait: the turn-sideways gate wears the Hall's colours ---- */
html.touch-play.touch-portrait #touch-rotate {
  flex-direction: column;
  gap: 26px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(120, 60, 18, 0.35), transparent 60%),
    linear-gradient(180deg, #1a0e06, #0a0503);
}
#touch-rotate::before {
  content: "GOREFALL";
  font-size: 30px;
  letter-spacing: 0.22em;
  color: #e8c46a;
  text-shadow: 0 2px 0 #3a1c06, 0 0 18px rgba(255, 170, 60, 0.35);
}
#touch-rotate p { font-size: 18px; color: #f3dfb0; }
#touch-rotate p::before {
  content: "";
  display: block;
  width: 38px;
  height: 66px;
  margin: 0 auto 26px;
  border: 3px solid #c9a24a;
  border-radius: 8px;
  box-shadow: inset 0 -6px 0 -3px #c9a24a, 0 0 14px rgba(255, 190, 80, 0.3);
  animation: touch-rotate-tip 2.4s ease-in-out infinite;
}
#touch-rotate p::after {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, #c9a24a, transparent);
}
@keyframes touch-rotate-tip {
  0%, 20% { transform: rotate(0deg); }
  45%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  #touch-rotate p::before { animation: none; transform: rotate(-90deg); }
}

/* The Phone graphics preset only shows on phones and tablets. */
html:not(.touch-play) #gfx-phone { display: none; }
html.touch-play .gfx-row { grid-template-columns: repeat(4, 1fr); }

/* Ascent on a phone: the run clock sits beside the race standing instead of
   on top of it. */
html.touch-play.match-open #screen-match.jump-quest #match-clock {
  top: calc(36px + var(--sat, 0px)) !important;
  left: calc(50% + 96px) !important;
  transform: none !important;
  font-size: 24px;
}
