#town-friend-notice {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  color: #23354d;
  background: #fff0b9;
  border-bottom: 1px solid #d9b85a;
  text-decoration: none;
}
#town-friend-notice[hidden] { display: none; }
#town-friend-notice:focus-visible { outline: 3px solid #274d78; outline-offset: -4px; }
#town-friend-notice > svg, .friend-notice-action { flex: none; }
.friend-notice-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
#town-friend-sender { font-size: 12px; overflow-wrap: anywhere; }
.friend-notice-action { margin-left: 4px; font-weight: 700; text-decoration: underline; }

#scene-main-menu .friendly-heading { margin-bottom: 10px; }
.gamepad-status {
  position: absolute;
  z-index: 8;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid #afcfdb;
  border-radius: 999px;
  color: #fff2d2;
  background: #12344bea;
  font: 650 12px system-ui;
}
.gamepad-status[hidden], .gamepad-help [hidden] { display: none; }
.gamepad-help dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; }
.gamepad-help dt { font-weight: 700; }
.gamepad-help dd { margin: 0; }
.using-gamepad dialog :focus { outline: 3px solid #ffdf8b; outline-offset: 2px; }
@media (max-width: 480px) {
  .gamepad-status { top: 1px; padding-inline: 6px; min-height: 26px; font-size: 10px; }
}
#scene-menu-search {
  width: 100%;
  margin: 7px 0 14px;
  padding: 9px 12px;
  min-height: 44px;
  border: 1px solid #86b0c1;
  border-radius: 9px;
  background: #0a2a46;
  color: #fff2d2;
  font: inherit;
  font-size: 16px;
}
#scene-menu-search::placeholder { color: #bfcedd; }
.scene-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scene-menu-grid a { display: block; text-decoration: none; }

#chat-minimize { width: auto; min-height: 28px; padding: 3px 6px; font: 600 12px system-ui; }
#world.town-chat-open > #beginner-guide { top: 150px; bottom: auto; max-height: min(25dvh, 215px); }
#tea-chat-toggle[hidden] { display: none; }
#home-people { max-width: min(44ch, 62vw); overflow-wrap: anywhere; }
#home-people[hidden] { display: none; }
.food-art {
  display: block;
  width: 48px;
  aspect-ratio: 1;
  background: url("assets/fridge-food-v1.png") 0 center / 300% 100% no-repeat;
}
.pouch-capacity { font-weight: 700; }
.pouch-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding-block: 6px; border-top: 1px solid #7294a64d; }
.pouch-item .hub-action { padding-inline: 8px; font-size: 13px; }
.player-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px 12px; }
.player-stat-grid div { display:grid; }
.player-stat-grid span { color:#e7d8a9; font-size:10px; font-weight:650; }
.player-stat-grid strong { font-size:12px; white-space:nowrap; }
.community-home-page > .player-stats {
  position: static;
  flex: none;
  width: auto;
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
  border-width: 1px 0 0;
  border-radius: 0;
  background: #082c4e;
}
.community-home-page > .player-stats .player-stat-grid {
  width: min(100%, 480px);
  margin-inline: auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  text-align: center;
}
.community-home-page > .player-stats strong {
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 340px) {
  .community-home-page > .player-stats .player-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.friendly-tea #world .player-stats { top:82px; right:12px; bottom:auto; }
.friendly-town #world #town-weather { top:104px; }
#field-combat { position:absolute; z-index:8; right:14px; top:145px; display:grid; gap:5px; width:min(235px,46vw); padding:10px; border:1px solid #e1b880; border-radius:12px; background:#192b40f2; color:#fff1d4; }
#field-combat[hidden] { display:none; }
#field-target,#field-message { font-size:12px; }
#field-message:empty { display:none; }
#field-strike { min-height:42px; }
.in-thought-field #world > #beginner-guide { display:none; }

@media (max-width: 700px) {
  #world.town-chat-open { --town-chat-height: clamp(142px, 24dvh, 195px); --town-chat-offset: 193px; }
  .friendly-town #world.town-chat-open #hub-chat { bottom: var(--town-chat-offset); height: var(--town-chat-height); }
  .friendly-town #world.town-chat-open > :is(#beginner-guide, #house-entry) {
    top: 114px;
    bottom: auto;
    max-height: max(54px, calc(100% - var(--town-chat-height) - var(--town-chat-offset) - 122px));
    overflow: auto;
    overscroll-behavior: contain;
  }
  .friendly-town #world.town-chat-open > #beginner-guide { left: 12px; right: auto; width: min(350px, calc(100% - 24px)); }
  .friendly-town #world.town-chat-open:has(> #house-entry:not([hidden])) > #beginner-guide { width: calc(50% - 16px); padding: 9px; }
  .friendly-town #world.town-chat-open > #house-entry { right: 12px; width: calc(50% - 16px); min-width: 0; padding: 9px; }
  #world.town-chat-open .beginner-actions .hub-action { flex-basis: 100%; }
  .friendly-town .touch-pad.chat-is-open { display: block; }
  .friendly-tea #tea-chat { height: clamp(144px, 24dvh, 195px); }
  .player-stat-grid { gap:3px 7px; }
  .player-stat-grid strong { font-size:10px; }
  .friendly-town #world #town-weather { top:99px; }
  #field-combat { top:128px; right:12px; }
  .friend-notice-text { display: grid; }
  #town-friend-notice { justify-content: flex-start; }
  .friend-notice-action { margin-left: auto; }
}
@media (max-width: 450px) {
  .scene-menu-grid { grid-template-columns: 1fr; }
}
