/* HKC Raid Tools · phone layout. Loaded only on screens up to 760px wide (media attribute on the <link>),
   so the desktop layout is untouched. The sidebar becomes a slide-out menu (assets/raid-mobile.js adds the
   menu button and the current-page bar); wide tables scroll sideways inside their own box. */

html,
body {
  overflow-x: clip;
}

/* ---------- top bar: logo · tools · actions on one row, season / bosses scroll on the next ---------- */
.topbar {
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar .logo {
  height: 36px;
}
.prodsw a span {
  display: none;
}
.tbright {
  gap: 8px;
  margin-left: auto;
}
.lastupd {
  display: none;
}
.loginbtn span {
  display: none;
}
.loginbtn {
  padding: 7px 9px;
}
.topbar nav.bossbar {
  order: 10;
  flex: 1 1 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.topbar nav.bossbar::-webkit-scrollbar {
  display: none;
}
.topbar nav.bossbar .boss:not(.all) {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
}

/* ---------- current-page bar with the menu button (added by raid-mobile.js) ---------- */
.mbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--ring);
}
.mnavbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--ring);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.mnavbtn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.mnavbtn .mnavsub {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- sidebar → slide-out menu ---------- */
.shell {
  display: block;
}
.sidenav {
  position: fixed;
  z-index: 70;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 86vw);
  height: 100dvh;
  flex-direction: column;
  border-right: 1px solid var(--ring);
  border-bottom: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
  padding-top: env(safe-area-inset-top);
}
body.mnav-open .sidenav {
  transform: none;
}
.mnavback {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
body.mnav-open .mnavback {
  opacity: 1;
  pointer-events: auto;
}
body.mnav-open {
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .sidenav,
  .mnavback {
    transition: none;
  }
}
nav.tabs {
  flex-direction: column;
  overflow: visible;
  padding: 12px 8px;
}
nav.tabs button {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  border-left: 3px solid transparent;
  border-bottom: 0;
  border-radius: 0 8px 8px 0;
}
nav.tabs button[aria-selected='true'] {
  border-left-color: var(--brand);
  border-bottom-color: transparent;
}
.scopebox {
  border-left: 0;
  border-top: 1px solid var(--ring);
  margin: 4px 8px 0;
  padding: 10px 12px 12px;
  min-width: 0;
}
.scopebox .sblabel {
  display: block;
}
.sidenav .settings {
  margin-top: auto;
  border-left: 0;
  border-top: 1px solid var(--ring);
}
.sidebtn span {
  display: inline;
}
.sidenav .settings .menu {
  left: 8px;
  right: 8px;
  top: auto;
  bottom: calc(100% + 6px);
}

/* ---------- page content ---------- */
.shell > main,
main {
  padding: 12px 12px 32px;
  max-width: 100%;
  overflow-x: clip;
}
.grid {
  gap: 10px;
}
.kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.two,
.grid.two {
  grid-template-columns: minmax(0, 1fr);
}
.card {
  padding: 12px;
}

/* tables: scroll sideways inside their box; the page itself never scrolls sideways */
.tablewrap,
.tablewrap.wide {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
table {
  font-size: 12.5px;
}
th,
td {
  padding: 7px 8px;
}

/* popovers and dialogs fit the screen */
.tooltip {
  max-width: calc(100vw - 16px);
}
.specpop,
.tiermenu {
  max-width: calc(100vw - 16px);
  max-height: 70vh;
  overflow-y: auto;
}
.updpanel {
  position: fixed;
  left: 8px;
  right: 8px;
  top: 60px;
  width: auto;
  max-width: none;
}
.dlg {
  width: calc(100vw - 24px);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
.toast {
  left: 12px;
  right: 12px;
  max-width: none;
}

/* bigger touch targets */
.btn,
.iconbtn,
select {
  min-height: 38px;
}
.dtile {
  width: 26px;
}

/* player name stays pinned on the left while a wide table scrolls sideways */
.tablewrap td:has(> .pname),
.tablewrap th[data-k='name'] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--ring);
}
.tablewrap th[data-k='name'] {
  z-index: 3;
}
.tablewrap .rankcol {
  display: none;
}

/* Player Lookup spec guide rows fit a phone */
.coachcard .guide {
  grid-template-columns: minmax(0, 1fr);
}
.coachcard .gsec {
  padding: 10px;
}
.coachcard .ghd,
.coachcard .grow {
  grid-template-columns: minmax(0, 1fr) 40px 62px 50px 44px;
  gap: 6px;
}
.coachcard .ghd {
  font-size: 9.5px;
  white-space: normal;
  line-height: 1.15;
}
.coachcard .gt {
  font-size: 12px;
}
.coachcard .perf {
  padding: 2px 6px;
  font-size: 10.5px;
}
.coachhd {
  flex-wrap: wrap;
}

/* in the slide-out menu the Performance heading and its indented sub-pages come back */
nav.tabs .tabgrp {
  display: flex;
  font-size: 15px;
  min-height: 40px;
}
nav.tabs button.tabsub {
  padding-left: 32px;
  font-size: 14.5px;
}

/* Settings › Rules: title on top, buttons below */
.rulehead {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.rulebtns {
  display: flex;
  gap: 8px;
}
.rulebtns .btn {
  flex: 1;
  justify-content: center;
}

/* guild source button: icon + short name on phones */
.dsbtn {
  max-width: 170px;
  padding: 7px 9px;
}
.dsbtn .extag {
  padding: 1px 5px;
  font-size: 9px;
}
.dsbtn .chev {
  display: none;
}

/* no hover on phones: All | Deep sits open under Progression | Farm in the menu */
.scopebox .deepfly {
  position: static;
  display: block;
}
.scopebox .deepin {
  box-shadow: none;
  background: none;
  border: 0;
  padding: 0;
}
/* panel is always open on phones, so no chevron */
.scopebox .pchev {
  display: none;
}
.dsbtn > svg:first-child {
  display: none;
}

/* no hover on phones */
nav.tabs .tabinfo {
  display: none;
}

/* boss checks: player rows fit a phone */
.wirow {
  grid-template-columns: minmax(80px, 1fr) 50px 34px 62px;
}
.wirow .wid {
  display: none;
}
.wihd {
  grid-template-columns: 36px 12px 20px minmax(0, 1fr);
  gap: 6px;
  padding: 9px 10px;
}
.wibd {
  padding: 2px 10px 12px;
}
