/* VK mini app runs inside a resizable frame. Keep menus usable at its actual size. */
#home button.hAva,#rwProfile button.ava {padding:0;cursor:pointer}
#dlgSettings .row > label,#dlgSettings .row small,#dlgSettings .photoCtl {min-width:0;overflow-wrap:anywhere}
@media (max-width:680px), (max-width:900px) and (max-height:480px) {
  html body #home.home:not([hidden]) {display:flex!important;flex-direction:column;inset:0;box-sizing:border-box;width:100%;height:100%;height:100dvh;overflow:auto!important;overscroll-behavior:contain}
  html body #home.home>.hTop {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"profile bonus" "wallet wallet" "nav nav";gap:5px!important;padding:5px 7px!important;height:auto!important;min-height:0!important;align-items:center}
  #home.home #hProf {grid-area:profile;min-width:0;width:100%;height:auto;min-height:38px;box-sizing:border-box;gap:4px;padding:2px 4px;position:relative}
  #home.home #hProf .hAva {width:32px!important;height:32px!important;flex:0 0 32px}
  #hProf .hWho {min-width:0}
  #home.home #hProf .hWho b,#home.home #hProf .hWho small {display:block;font-size:12px;line-height:1.12;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #home.home #hClaim {grid-area:bonus;min-width:0;max-width:100%;justify-content:end}
  html body #home.home #hClaim button {margin:0;min-width:0!important;width:100%;height:auto!important;min-height:38px!important;padding:3px 4px!important;gap:3px!important;font-size:12px!important;white-space:normal!important}
  #home.home #hClaim button b,#home.home #hClaim button small {font-size:11px!important;line-height:1.12}
  #home.home #hClaim .hcIco,#home.home #hClaim img {width:24px!important;height:auto!important;font-size:18px!important}
  #home.home #hWal {grid-area:wallet;justify-content:center;gap:4px}
  #home.home #hWal>span {padding:2px 6px;font-size:12px}
  html body #home.home .hTop .hNav {grid-area:nav;margin:0!important;width:100%!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px!important}
  html body #home.home .hTop .hNav button.hBtn {position:relative;display:flex!important;flex-direction:column;justify-content:center;align-items:center;gap:1px!important;width:100%!important;min-width:0!important;min-height:40px!important;height:auto!important;max-height:none!important;padding:2px!important;font-size:11px!important;line-height:1.1!important;color:#fff4d8!important;text-shadow:0 1px 2px #03021f!important;white-space:normal!important;overflow-wrap:anywhere}
  html body #home.home .hTop .hNav .hBtn>img,html body #home.home .hTop .hNav .hBtn>span {height:17px!important;width:auto!important;font-size:16px!important;line-height:17px!important}
  html body #home.home>.hMain {order:1;display:flex!important;flex-direction:column;flex:none;gap:5px!important;padding:5px 7px!important;height:auto!important;max-height:none!important;overflow:visible!important}
  html body #home.home .hCenter {order:0;display:grid!important;grid-template-columns:minmax(0,1fr);height:auto;gap:5px!important;min-width:0}
  html body #home.home .hCenter>.hbLira:not([hidden]) {justify-self:stretch;width:100%!important;margin:0!important;max-width:none!important;height:42px!important;min-height:0!important;display:flex!important;align-items:center;justify-content:center;gap:8px;padding:2px!important}
  html body #home.home .hbLira .hbLiImg {width:36px!important;height:36px!important;flex:none!important}
  html body #home.home .hbLira b,html body #home.home .hbLira small {position:static!important;width:auto!important;font-size:13px!important}
  html body #home.home .hCenter #hTiles {display:flex!important;height:clamp(132px,32dvh,215px)!important;min-height:0!important;width:100%;overflow-x:auto;overflow-y:hidden;gap:6px;scroll-snap-type:x proximity}
  html body #home.home .hCenter #hTiles>.hTile {min-width:0!important;width:clamp(119px,37vw,177px)!important;flex:0 0 clamp(119px,37vw,177px)!important;height:100%!important;min-height:0!important;scroll-snap-align:start}
  html body #home.home #hTiles .hTile b,html body #home.home #hTiles .hTile small {white-space:normal!important;line-height:1.12!important}
  html body #home.home .hLeftCol {order:1;min-width:0}
  html body #home.home>.hBar {order:2;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:6px!important}
  html body #home.home>.hBar button {min-width:0!important;min-height:38px!important;height:auto!important;font-size:12px!important;padding:3px!important;line-height:1.1!important;white-space:normal}
  html body #home.home>.hBar .hNow {grid-column:1/-1;min-height:42px!important}
  html body #home.home>.hBar .hNow b {font-size:18px!important}
  #dlgSettings[open],#dlgOnb[open] {width:calc(100% - 12px)!important;max-width:700px!important;max-height:calc(100dvh - 12px)!important;box-sizing:border-box}
  html body #dlgSettings>.tabs {display:flex!important;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:3px 6px}
  html body #dlgSettings>.tabs>.tab {flex:0 0 auto;min-height:36px!important;font-size:12px!important;padding:4px 7px!important;white-space:nowrap}
  html body #dlgSettings>.dlgFoot {display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:5px;padding:4px 6px}
  html body #dlgSettings>.dlgFoot>button:not([hidden]) {min-height:36px!important;height:auto!important;width:auto!important;flex:0 1 auto;padding:4px 8px!important;font-size:13px!important;white-space:normal;line-height:1.15}
  #dlgSettings .pane select,#dlgSettings .pane input {min-width:0;max-width:100%;box-sizing:border-box}
  #dlgSettings .row label {max-width:100%;white-space:normal}
  html body #dlgOnb .onbWrap {display:flex!important;max-height:calc(100dvh - 22px);min-height:0;height:auto;padding:0}
  #dlgOnb .onbHost {display:none!important}
  html body #dlgOnb .onbPanel {display:flex;flex-direction:column;width:100%;min-height:0;overflow:hidden;padding:7px;box-sizing:border-box}
  #dlgOnb #onbBody {min-height:0;overflow:auto;overscroll-behavior:contain;flex:1}
  #dlgOnb .onbFoot {flex:none}
  #dlgOnb .onbAvas {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media (min-width:500px) and (max-height:480px) and (max-width:900px) {
  html body #home.home>.hTop {grid-template-columns:minmax(135px,1fr) minmax(110px,1fr) minmax(225px,2fr);grid-template-areas:"profile wallet nav" "bonus wallet nav"}
}
@media (max-width:680px), (max-width:900px) and (max-height:480px) {
  html body #home.home .hTop .hNav button.hBtn {grid-column:auto!important;grid-row:auto!important}
  html body #home.home>.hBar {order:1}
  html body #home.home>.hMain {order:2}
  html body #home.home>.hBar .hB img {max-height:20px!important;max-width:25px!important;object-fit:contain}
}
#hUtilities {display:none}
@media (max-width:680px), (max-width:900px) and (max-height:480px) {
  html body #home.home>.hTop {grid-template-columns:repeat(3,minmax(0,1fr)) auto;grid-template-areas:"profile profile bonus bonus" "wallet wallet wallet tools" "nav nav nav nav"}
  #home.home #hUtilities {display:flex;align-items:center;gap:3px;grid-area:tools}
  #home.home #hUtilities:empty {display:none}
  html body #home #hUtilities :is(#topBtns,#gameClose) {position:static!important;inset:auto!important;margin:0!important;transform:none!important}
  html body #home #hUtilities #topBtns:not([hidden]) {display:flex!important;gap:3px}
  html body #home #hUtilities #topBtns button,html body #home #hUtilities #gameClose {width:32px!important;height:32px!important;min-height:0!important;padding:2px!important}
  html body #home #hTiles button.hTile {grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) auto auto!important;gap:2px!important;padding:2px 4px 5px!important}
  html body #home #hTiles button.hTile>b,html body #home #hTiles button.hTile>small {width:100%;max-width:100%;box-sizing:border-box;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.13!important;grid-column:1!important;letter-spacing:normal}
  html body #home #hTiles button.hTile>b {font-size:clamp(13px,3vw,16px)!important;grid-row:2}
  html body #home #hTiles button.hTile>small {font-size:12px!important;grid-row:3}
  html body #home.home .hCenter .hTitle {font-size:clamp(15px,3.8vw,22px)!important;line-height:1.15!important;margin:2px 0!important}
  html body #home.home:not(.hub)>.hBar {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:500px) and (max-height:480px) and (max-width:900px) {
  html body #home.home>.hTop {grid-template-columns:minmax(126px,1fr) minmax(210px,2fr) auto;grid-template-areas:"profile wallet tools" "bonus nav nav"}
}
@media (max-width:400px) {
  html body #home.home .hTop .hNav {grid-template-columns:1fr .85fr 1fr 1fr 1.2fr}
}

/* Give the name and league their own column beside the portrait. */
@media (max-width:400px) {
  html body #home.home > .hTop {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "profile bonus" "wallet tools" "nav nav";
  }
  html body #home.home #hClaim { max-width:110px }
  html body #home.home #hProf {
    display:grid;
    grid-template-columns:32px minmax(0,1fr) auto;
    grid-template-areas:"portrait who edit" "portrait who level";
    column-gap:4px;
    row-gap:1px;
    border-radius:17px;
  }
  #home.home #hProf .hAva {grid-area:portrait}
  #home.home #hProf .pcEdit {grid-area:edit;justify-self:center}
  #home.home #hProf .lvOut {grid-area:level;justify-self:center}
  #home.home #hProf .hWho {grid-area:who}
  html body #home.home #hProf .hWho :is(b,small) {
    white-space:normal;
    overflow:visible;
    overflow-wrap:anywhere;
  }
}
@media (max-width:400px) {
  #rwReplays .rpTTL {grid-template-columns:minmax(0,1fr) max-content;justify-content:stretch}
  #rwReplays .rpTTL :is(label,small) {min-width:0;white-space:normal;overflow-wrap:anywhere}
  #rwReplays .rpTTL select {width:auto;min-width:0;max-width:100%}
  #rwReplays .quest {flex-wrap:wrap}
  #rwReplays .quest > div {min-width:0;max-width:100%;overflow-wrap:anywhere}
  #rwReplays .wEx {flex-wrap:wrap}
}
@media (max-width:400px) and (orientation:portrait) {
  html body #dlgSettings > .tabs {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
  html body #dlgSettings > .tabs > .tab {min-width:0;white-space:normal;line-height:1.15;padding-inline:3px!important}
}
@media (orientation:landscape) and (max-width:620px) and (max-height:400px) {
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pcard .pc-head {
    padding-top:11px!important;
  }
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pcard .pname {
    font-size:12px!important;
    padding-right:6px;
  }
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pcard .pc-grid {
    grid-template-columns:minmax(0,1fr);
  }
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pcard .pc-grid > div {
    padding:2px 3px;
  }
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pc-stat {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:0 2px;
  }
  body.phonePlayers.flankPlayers #gameTable #compactPlayers .pc-stat b {
    font:700 11px/1.2 system-ui,sans-serif!important;
    white-space:nowrap;
  }
}
