/* Residence geometry follows the fitted 16:9 phone stage. Typography is
   owned by rhythm.css and game-font.css, including all three text sizes. */
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] {
  --home-inset:clamp(7px,1.15cqw,12px);
  --home-nav-width:clamp(76px,12.5cqw,102px);
  --home-nav-height:clamp(28px,4.55cqw,36px);
  --home-gap:clamp(3px,.52cqw,5px);
  --home-bottom-space:clamp(46px,8cqw,64px);
}
/* The original compact rule leaves 48px-tall links, which makes half the
   menu scroll on a 350px-tall stage. Size and space each link independently. */
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] #tabs.home-menu {
  position:absolute;
  left:var(--home-inset);
  top:var(--home-inset);
  width:var(--home-nav-width);
  height:auto;
  max-height:calc(100% - 2 * var(--home-inset));
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:var(--home-gap);
  padding:2px;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:thin;
}
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] #tabs.home-menu > button:not(.player-avatar) {
  flex:none;
  width:100%;
  min-height:var(--home-nav-height);
  height:var(--home-nav-height);
  margin:0;
  padding:3px 5px;
  gap:3px;
  line-height:1.2;
  text-align:center;
  justify-content:center;
}
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] #tabs.home-menu > .player-avatar {
  flex:none;
  align-self:center;
  width:clamp(40px,6.8cqw,54px);
  height:clamp(40px,6.8cqw,54px);
  min-height:0;
  margin:0 0 2px;
  padding:0;
}
/* Top-right clock and scheduled events follow the same compact scale. */
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] .game-hud {
  position:absolute;
  left:auto;
  top:var(--home-inset);
  right:var(--home-inset);
  width:max-content;
  max-width:min(36cqw,calc(100% - var(--home-nav-width) - 3 * var(--home-inset)));
  max-height:calc(100% - 2 * var(--home-inset) - var(--home-bottom-space));
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:flex-start;
  gap:clamp(3px,.5cqw,6px);
  padding:0;
  overflow-x:hidden;
  overflow-y:auto;
}
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] .hud-clock {
  flex:none;
  width:max-content;
  max-width:100%;
  box-sizing:border-box;
  padding:5px 8px;
  line-height:1.35;
  text-align:right;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .hud-clock > strong {
  line-height:1.35;
  white-space:normal;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .hud-clock > small {
  line-height:1.4;
  white-space:normal;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .home-formal-events {
  max-width:min(33cqw,175px);
  gap:4px;
}
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] .home-formal-event {
  width:max-content;
  max-width:100%;
  margin-left:auto;
  padding:5px 8px;
  line-height:1.3;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .home-formal-event > :is(button,span) {
  line-height:1.35;
  min-height:0;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .formal-event-title {
  font-size:inherit;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .formal-event-detail {
  line-height:1.4;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .home-notice-count {
  margin-top:4px;
  padding-top:4px;
  white-space:normal;
  overflow-wrap:anywhere;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .formal-event-discovery {
  width:max-content;
  max-width:100%;
  box-sizing:border-box;
  margin:2px 0;
  padding:6px 22px 6px 8px;
  line-height:1.4;
}
/* The action ribbon keeps PC's bottom-center arrangement, but no longer
   occupies most of the phone. Actions are not replaced, disabled or hidden. */
html[data-mobile-device='true'] body[data-game='palace'].game-shell #game[data-page='home'] .home-life-controls {
  left:50%;
  right:auto;
  bottom:var(--home-inset);
  transform:translateX(-50%);
  width:max-content;
  max-width:calc(100% - 2 * var(--home-inset));
  box-sizing:border-box;
  padding:4px;
  gap:4px;
  display:flex;
  flex-wrap:nowrap;
  justify-content:center;
}
html[data-mobile-device='true'] body[data-game='palace'] #game[data-page='home'] .home-life-controls > button {
  flex:none;
  min-width:clamp(72px,12cqw,108px);
  min-height:clamp(30px,4.9cqw,41px);
  width:auto;
  margin:0;
  padding:3px 6px;
  line-height:1.2;
  white-space:nowrap;
}
