/* Home keeps the companion and one decision in view. Other modes live in their own sheet. */
body.pk-hub-simple[data-ui-screen="scr-menu"] #tickets-pill,
body.pk-hub-simple[data-ui-screen="scr-menu"] #user-pill > svg.pxi {
  display:none!important;
}
body.pk-hub-simple[data-ui-screen="scr-menu"] .topbar {
  gap:12px;
  background:linear-gradient(#102c3de8,#0c2432e8);
  box-shadow:none;
  border-bottom-color:#b7d4c426;
}
body.pk-hub-simple[data-ui-screen="scr-menu"] #user-pill {
  margin-left:auto;
}
body.pk-hub-simple[data-ui-screen="scr-menu"] #ui-tools-toggle {
  margin-left:0;
}

#scr-menu.pk-simple-home,
#scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) {
  padding:calc(var(--ui-safe-top) + var(--tp-header-height,var(--ui-bar)) + 24px) max(32px,var(--ui-safe-right)) calc(var(--ui-safe-bottom) + var(--ui-dock) + 24px) max(32px,var(--ui-safe-left));
  background-image:linear-gradient(90deg,#061d30c7,#082a34ad),url('../assets/encounters/forest-clearing.webp');
}
#scr-menu.pk-simple-home::before {
  background:radial-gradient(ellipse at 31% 43%,#9bc79424,transparent 48%),linear-gradient(0deg,#071c2ba8,transparent 70%);
}
#scr-menu.pk-simple-home .hub-layout {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);
  grid-template-rows:1fr;
  gap:clamp(36px,7vw,110px);
  width:min(1040px,100%);
  height:100%;
  max-height:760px;
  min-height:0;
  padding:0 4px 8px;
  align-items:center;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scroll-padding-block:12px;
}
#scr-menu.pk-simple-home :is(.hub-heading,.hub-shortcuts,.hub-stats,.hub-info,.nexus-mode-group) {
  display:none!important;
}
#scr-menu.pk-simple-home .menu-left {
  width:100%;
  height:auto;
  min-height:0;
  max-height:none;
  justify-content:center;
}
#scr-menu.pk-simple-home .logo {
  flex:none;
  margin:0 0 24px;
}
#scr-menu.pk-simple-home .logo .t1 {
  font-size:clamp(37px,4.5vw,58px);
  line-height:1;
  text-shadow:0 3px #99692f,0 6px #10273b;
}
#scr-menu.pk-simple-home .logo .t2 {
  display:none;
}
#scr-menu.pk-simple-home .partner-card,
#scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .partner-card {
  flex:initial;
  width:100%;
  min-height:0;
  max-height:none;
  padding:0 18px;
  border:0;
  border-radius:0;
  background:radial-gradient(ellipse at 50% 38%,color-mix(in srgb,var(--partner-color,#a4d59a) 12%,transparent),transparent 67%);
  box-shadow:none;
  overflow:visible;
}
#scr-menu.pk-simple-home .partner-card::before {
  display:none;
}
#scr-menu.pk-simple-home .ad-partner-tag {
  flex:none;
  min-height:44px;
  justify-content:flex-end;
  margin:0;
}
#scr-menu.pk-simple-home .ad-partner-tag > span {
  display:none;
}
#scr-menu.pk-simple-home .ad-partner-tag button {
  min-height:44px;
  padding:8px 0 8px 12px;
  font:600 12px/1.3 var(--ui-font);
  color:#d1ddcd;
}
#scr-menu.pk-simple-home #menu-partner,
#scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) #menu-partner {
  flex:none;
  width:min(100%,350px);
  height:clamp(135px,29dvh,265px);
  min-height:135px;
  max-height:265px;
  margin:0 auto 14px;
  object-fit:contain;
  filter:drop-shadow(0 15px 12px #001a2438);
}
#scr-menu.pk-simple-home .partner-card .nm {
  font:750 clamp(23px,2.8vw,31px)/1.2 var(--ui-font);
  letter-spacing:-.03em;
  text-shadow:0 2px 12px #031c2e66;
}
#scr-menu.pk-simple-home .partner-card .lv {
  flex:none;
  margin:9px 0 0;
  font:500 12px/1.5 var(--ui-font);
}
#scr-menu.pk-simple-home .ad-partner-region {
  display:none;
}
#scr-menu.pk-simple-home #pk-trainer-progress {
  flex:none;
  width:min(100%,310px);
  margin:12px auto 0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  overflow:visible;
}
#scr-menu.pk-simple-home .pk-trainer-progress-trigger {
  min-height:44px;
  justify-content:center;
  gap:7px;
  padding:8px 12px;
  border-radius:9px;
  color:#c9d8c9;
}
#scr-menu.pk-simple-home .pk-trainer-progress-copy {
  display:block;
  flex:initial;
}
#scr-menu.pk-simple-home .pk-trainer-progress-copy > b {
  font:600 12px/1.3 var(--ui-font);
}
#scr-menu.pk-simple-home :is(.pk-trainer-rank-mark,.pk-trainer-progress-copy > small,.pk-trainer-progress-xp,.pk-trainer-progress-bar) {
  display:none;
}
#scr-menu.pk-simple-home .pk-trainer-progress-arrow {
  font-size:18px;
  color:#b5c7b8;
}
#scr-menu.pk-simple-home .menu-right {
  display:flex;
  width:100%;
  min-height:0;
  gap:0;
  justify-content:center;
  overflow:visible;
}
#scr-menu.pk-simple-home .hub-actions {
  display:grid;
  width:100%;
  grid-template-columns:minmax(0,1fr);
  gap:17px;
}
#scr-menu.pk-simple-home .pk-hub-secondary-actions {
  display:grid;
  grid-template-columns:minmax(0,1fr) 76px;
  align-items:stretch;
  gap:12px;
  min-width:0;
}
#scr-menu.pk-simple-home .pk-hub-secondary-actions:has(> #pk-other-modes[hidden]) {
  grid-template-columns:minmax(0,1fr);
  justify-items:end;
}
#scr-menu.pk-simple-home .pk-hub-secondary-actions:has(> #pk-other-modes[hidden]) > #pk-home-ranking {
  flex-direction:row;
  gap:10px;
  width:auto;
  min-width:120px;
  padding:12px 18px;
}
#scr-menu.pk-simple-home #pk-home-ranking {
  --rank-accent:#e7d49a;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  width:100%;
  min-width:0;
  min-height:64px;
  padding:12px 6px;
  border:1px solid #d3c38d59;
  border-radius:14px;
  background:#193c417d;
  color:var(--rank-accent);
  box-shadow:none;
  text-shadow:none;
  font:600 12px/1.3 var(--ui-font);
  text-align:center;
  cursor:pointer;
}
#scr-menu.pk-simple-home #pk-home-ranking .mi-ico {
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  margin:0;
  color:var(--rank-accent);
}
#scr-menu.pk-simple-home #pk-home-ranking .mi-ico svg {
  width:26px;
  height:26px;
}
#scr-menu.pk-simple-home #pk-home-ranking:hover {
  border-color:#e5d29a99;
  background:#31514c;
  transform:none;
}
#scr-menu.pk-simple-home #pk-home-ranking:active {
  transform:translateY(1px);
}
#scr-menu.pk-simple-home .hub-actions > .exp-native-survival {
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:8px;
  min-height:132px;
  padding:22px 70px 22px 26px;
  border:1px solid #ffedb4;
  border-radius:18px;
  background:linear-gradient(115deg,#ffe6a0,#e7bd68);
  color:#342f22;
  box-shadow:0 4px #907341,0 12px 24px #021b2733;
  text-shadow:none;
}
#scr-menu.pk-simple-home .exp-native-survival > :is(.exp-primary-tag,small,.mi-ico) {
  display:none!important;
}
#scr-menu.pk-simple-home .pk-hub-play-label {
  font:700 clamp(35px,4vw,44px)/1 var(--ui-display);
  letter-spacing:-.5px;
}
#scr-menu.pk-simple-home .pk-hub-play-mode {
  font:600 13px/1.3 var(--ui-font);
  color:#62512f;
}
#scr-menu.pk-simple-home .exp-primary-arrow {
  right:24px;
  width:34px;
  height:34px;
  border:0;
  background:#775f2520;
  color:#645029;
}
#scr-menu.pk-simple-home #pk-other-modes.pk-other-modes {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:5px;
  min-height:80px;
  width:100%;
  padding:16px 24px;
  border:1px solid #c0d4c94d;
  border-radius:14px;
  background:#163b4370;
  color:#ebf0de;
  box-shadow:none;
  text-shadow:none;
  font:650 17px/1.2 var(--ui-font);
  cursor:pointer;
}
#scr-menu.pk-simple-home #pk-other-modes small {
  display:block;
  margin:0;
  font:400 11px/1.5 var(--ui-font);
  color:#adc6c1;
}
#scr-menu.pk-simple-home #pk-other-modes::after {
  content:'›';
  position:absolute;
  right:24px;
  top:50%;
  transform:translateY(-50%);
  font:400 27px/1 var(--ui-font);
  color:#bacbc1;
}
#scr-menu.pk-simple-home #pk-other-modes:hover {
  border-color:#c4daca8c;
  background:#28504b80;
}
.pk-hub-tool-links {
  display:grid;
  gap:8px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #a5c0b533;
}
.pk-hub-tool-links > button {
  min-height:44px;
  margin:0;
  font:600 13px/1.3 var(--ui-font);
  text-shadow:none;
}

/* Selecting a mode is a separate, focused decision with one scroll owner. */
#pk-mode-picker.pk-mode-picker {
  position:fixed;
  inset:0;
  width:min(700px,calc(100vw - 28px));
  max-width:none;
  max-height:calc(100dvh - 28px);
  margin:auto;
  padding:0;
  border:1px solid #b2c8b86b;
  border-radius:22px;
  background:radial-gradient(ellipse at 0 0,#54866820,transparent 62%),linear-gradient(145deg,#193e43,#0c2934);
  color:#f0ebd3;
  box-shadow:0 25px 90px #0009;
  font-family:var(--ui-font,system-ui);
  overflow:hidden;
  color-scheme:dark;
}
#pk-mode-picker.pk-mode-picker[open] {
  display:flex;
  flex-direction:column;
}
#pk-mode-picker.pk-mode-picker::backdrop {
  background:#04151ee8;
  backdrop-filter:blur(7px);
}
.pk-mode-picker-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex:none;
  gap:16px;
  padding:21px 24px;
  border-bottom:1px solid #aecbb62c;
}
.pk-mode-picker-head h2 {
  margin:0;
  font:750 24px/1.2 var(--ui-font);
  letter-spacing:-.03em;
  color:#f4ebcc;
}
.pk-mode-close {
  display:grid;
  place-items:center;
  flex:none;
  width:44px;
  min-height:44px;
  padding:0;
  border:1px solid #adc5b94a;
  border-radius:11px;
  background:#102e37;
  color:#d5e1d4;
  font:400 28px/1 var(--ui-font);
  cursor:pointer;
}
.pk-mode-picker-body {
  min-height:0;
  padding:20px 24px 24px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  touch-action:pan-y;
  scrollbar-width:thin;
  scrollbar-color:#587d72 #0b2732;
  scroll-padding:12px;
}
.pk-mode-picker-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.pk-mode-picker-grid[data-visible-count="1"] {
  grid-template-columns:minmax(0,1fr);
}
#pk-mode-picker .pk-mode-option[hidden],
#scr-menu.pk-simple-home #pk-other-modes[hidden] {
  display:none!important;
}
#pk-mode-picker .pk-mode-option {
  position:relative;
  display:grid;
  grid-template-columns:26px minmax(0,1fr) 14px;
  align-items:center;
  justify-content:start;
  gap:13px;
  width:100%;
  min-width:0;
  min-height:103px;
  padding:19px 15px;
  border:1px solid #b6d2c244;
  border-radius:12px;
  background:#24474b80;
  color:#eaf0df;
  box-shadow:none;
  text-shadow:none;
  text-align:left;
  font:500 14px/1.3 var(--ui-font);
  cursor:pointer;
}
#pk-mode-picker .pk-mode-option > .pk-mode-original[hidden] {
  display:none!important;
}
#pk-mode-picker .pk-mode-icon {
  display:grid;
  place-items:center;
  color:#c8d4b2;
  font-size:22px;
}
#pk-mode-picker .pk-mode-icon svg {
  width:24px;
  height:24px;
}
#pk-mode-picker .pk-mode-copy {
  display:grid;
  gap:7px;
  min-width:0;
}
#pk-mode-picker .pk-mode-title {
  font:700 16px/1.25 var(--ui-font);
  color:#f5edcf;
  letter-spacing:-.02em;
}
#pk-mode-picker .pk-mode-description {
  display:block;
  margin:0;
  color:#b7cec1;
  font:400 11px/1.5 var(--ui-font);
  white-space:normal;
}
#pk-mode-picker .pk-mode-unlock {
  color:#ead6a1;
  font:650 11px/1.4 var(--ui-font);
}
#pk-mode-picker .pk-mode-recovery {
  color:#c1dfc7;
  font:650 12px/1.4 var(--ui-font);
}
#pk-mode-picker :is(.pk-mode-unlock,.pk-mode-recovery,.pk-mode-lock,.pk-mode-chevron)[hidden] {
  display:none!important;
}
#pk-mode-picker .pk-mode-arrow {
  display:grid;
  place-items:center;
  font:400 25px/1 var(--ui-font);
  color:#aac3b9;
}
#pk-mode-picker .pk-mode-lock {
  display:grid;
  place-items:center;
  color:#c4caba;
}
#pk-mode-picker .pk-mode-lock svg {
  width:18px;
  height:18px;
}
#pk-mode-picker .pk-mode-option[data-locked="true"] {
  background:#17353e;
  border-color:#9cb5aa4d;
}
#pk-mode-picker .pk-mode-option:hover {
  background:#345e567d;
  border-color:#d1dec099;
  filter:none;
}
#pk-mode-picker .pk-mode-option:active {
  transform:translateY(1px);
}
#pk-mode-picker button:focus-visible,
#scr-menu.pk-simple-home :is(#pk-other-modes,#pk-home-ranking,.exp-native-survival,.ad-partner-tag button):focus-visible {
  outline:3px solid #ffe4a2;
  outline-offset:4px;
}

@media(max-width:700px) and (min-height:521px),(max-width:1000px) and (orientation:portrait) {
  #scr-menu.pk-simple-home,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) {
    padding:calc(var(--ui-safe-top) + var(--tp-header-height,var(--ui-bar)) + 17px) max(22px,var(--ui-safe-right)) calc(var(--ui-safe-bottom) + var(--ui-dock) + 21px) max(22px,var(--ui-safe-left));
  }
  #scr-menu.pk-simple-home .hub-layout {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(min-content,1fr) auto;
    width:min(460px,100%);
    max-height:none;
    gap:26px;
    align-items:center;
    padding-inline:0;
  }
  #scr-menu.pk-simple-home .menu-left {
    height:auto;
    align-self:center;
    justify-content:center;
  }
  #scr-menu.pk-simple-home .logo,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .logo {
    margin:0 0 10px;
  }
  #scr-menu.pk-simple-home .logo .t1 {
    font-size:clamp(31px,8.5vw,42px);
  }
  #scr-menu.pk-simple-home .partner-card,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .partner-card {
    padding:0 10px;
  }
  #scr-menu.pk-simple-home #menu-partner,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) #menu-partner {
    width:min(100%,320px);
    height:clamp(124px,26dvh,240px);
    min-height:124px;
    max-height:240px;
    margin-bottom:10px;
  }
  #scr-menu.pk-simple-home .partner-card .nm {
    font-size:25px;
  }
  #scr-menu.pk-simple-home #pk-trainer-progress {
    margin-top:4px;
  }
  #scr-menu.pk-simple-home .hub-actions {
    gap:13px;
  }
  #scr-menu.pk-simple-home .pk-hub-secondary-actions {
    grid-template-columns:minmax(0,1fr) 72px;
    gap:10px;
  }
  #scr-menu.pk-simple-home .hub-actions > .exp-native-survival {
    min-height:105px;
    padding:19px 65px 19px 23px;
    gap:6px;
    border-radius:16px;
  }
  #scr-menu.pk-simple-home .pk-hub-play-label {
    font-size:36px;
  }
  #scr-menu.pk-simple-home .pk-hub-play-mode {
    font-size:12px;
  }
  #scr-menu.pk-simple-home #pk-other-modes.pk-other-modes {
    min-height:71px;
    padding:14px 22px;
    font-size:16px;
  }
  #scr-menu.pk-simple-home #pk-other-modes small {
    font-size:10px;
  }
}

@media(max-width:540px) and (orientation:portrait) {
  #pk-mode-picker.pk-mode-picker {
    width:calc(100vw - 24px);
    max-height:calc(100dvh - 24px);
    border-radius:18px;
  }
  .pk-mode-picker-head {
    padding:15px 17px;
  }
  .pk-mode-picker-head h2 {
    font-size:22px;
  }
  .pk-mode-picker-body {
    padding:14px 17px 19px;
  }
  .pk-mode-picker-grid {
    grid-template-columns:minmax(0,1fr);
    gap:9px;
  }
  #pk-mode-picker .pk-mode-option {
    grid-column:auto;
    min-height:87px;
    padding:15px 13px;
    gap:12px;
  }
  #pk-mode-picker .pk-mode-copy {
    gap:5px;
  }
}

/* Preserve comfortable controls; use scrolling when text or the viewport needs more room. */
@media(max-height:740px) and (orientation:portrait) {
  #scr-menu.pk-simple-home .hub-layout,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .hub-layout {
    grid-template-rows:auto auto;
    align-content:start;
    align-items:center;
    gap:17px;
    overflow-y:auto;
  }
  #scr-menu.pk-simple-home .menu-left,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .menu-left {
    height:auto;
  }
  #scr-menu.pk-simple-home #menu-partner,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) #menu-partner {
    height:clamp(100px,19dvh,140px);
    min-height:100px;
    max-height:140px;
  }
  #scr-menu.pk-simple-home .logo .t1 {
    font-size:31px;
  }
  #scr-menu.pk-simple-home .hub-actions > .exp-native-survival {
    min-height:94px;
  }
}
@media(max-height:620px) and (orientation:portrait) {
  #scr-menu.pk-simple-home .hub-layout,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .hub-layout {
    align-content:start;
  }
}
@media(max-height:520px) and (min-width:560px) {
  #scr-menu.pk-simple-home,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) {
    padding:calc(var(--ui-safe-top) + var(--tp-header-height,var(--ui-bar)) + 10px) max(22px,var(--ui-safe-right)) max(12px,var(--ui-safe-bottom)) calc(var(--ui-safe-left) + var(--ad-rail,64px) + 22px);
  }
  #scr-menu.pk-simple-home .hub-layout {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:1fr;
    align-items:center;
    gap:30px;
    max-height:none;
    padding-bottom:4px;
  }
  #scr-menu.pk-simple-home .logo,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .logo {
    margin:0 0 2px;
  }
  #scr-menu.pk-simple-home .logo .t1 {
    font-size:clamp(25px,3.5vw,35px);
  }
  #scr-menu.pk-simple-home .partner-card,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) .partner-card {
    padding:0;
    overflow:visible;
  }
  #scr-menu.pk-simple-home .ad-partner-tag {
    min-height:44px;
  }
  #scr-menu.pk-simple-home .ad-partner-tag button {
    font-size:11px;
  }
  #scr-menu.pk-simple-home #menu-partner,
  #scr-menu.pk-simple-home:has(#pk-trainer-progress:not([hidden])) #menu-partner {
    width:min(100%,230px);
    height:clamp(66px,21dvh,105px);
    min-height:66px;
    max-height:105px;
    margin:0 auto 3px;
  }
  #scr-menu.pk-simple-home .partner-card .nm {
    font-size:21px;
  }
  #scr-menu.pk-simple-home .partner-card .lv {
    margin-top:5px;
    font-size:10px;
  }
  #scr-menu.pk-simple-home #pk-trainer-progress {
    margin-top:0;
  }
  #scr-menu.pk-simple-home .hub-actions {
    gap:12px;
  }
  #scr-menu.pk-simple-home .hub-actions > .exp-native-survival {
    min-height:106px;
    padding:19px 54px 19px 21px;
    gap:7px;
    border-radius:14px;
  }
  #scr-menu.pk-simple-home .pk-hub-play-label {
    font-size:35px;
  }
  #scr-menu.pk-simple-home .pk-hub-play-mode {
    font-size:12px;
  }
  #scr-menu.pk-simple-home .exp-primary-arrow {
    right:16px;
  }
  #scr-menu.pk-simple-home #pk-other-modes.pk-other-modes {
    min-height:70px;
    padding:14px 20px;
    font-size:16px;
  }
  #scr-menu.pk-simple-home #pk-other-modes small {
    font-size:10px;
  }
  #pk-mode-picker.pk-mode-picker {
    width:min(760px,calc(100vw - 28px));
    max-height:calc(100dvh - 20px);
    border-radius:16px;
  }
  .pk-mode-picker-head {
    padding:11px 18px;
  }
  .pk-mode-picker-head h2 {
    font-size:22px;
  }
  .pk-mode-picker-body {
    padding:13px 18px 18px;
  }
  .pk-mode-picker-grid {
    gap:9px;
  }
  #pk-mode-picker .pk-mode-option {
    min-height:77px;
    padding:12px 13px;
  }
  #pk-mode-picker .pk-mode-copy {
    gap:5px;
  }
  #pk-mode-picker .pk-mode-title {
    font-size:15px;
  }
}
@media(prefers-reduced-motion:reduce) {
  #scr-menu.pk-simple-home .hub-layout,
  .pk-mode-picker-body {
    scroll-behavior:auto;
  }
}
