/* Home-only composition and icon polish. No flow or interaction overrides. */

.home-screen.is-on {
  grid-template-columns: clamp(96px, 17vw, 300px) minmax(360px, 1fr) clamp(300px, 26vw, 440px);
  grid-template-rows: auto clamp(126px, 18vh, 178px) minmax(0, 1fr) auto;
  column-gap: clamp(12px, 1.4vw, 22px);
}

.home-topbar {
  align-self: start;
}

.home-brand {
  align-self: center;
  width: min(100%, 520px);
  padding: 0 0 clamp(7px, 1vh, 12px);
}

.home-crest {
  top: 0;
  width: min(58%, 300px);
  max-height: clamp(50px, 7.4vh, 76px);
  margin-bottom: -4px;
  object-fit: contain;
  object-position: center;
}

.home-title-km {
  font-size: clamp(2.45rem, 6.5vh, 4.3rem);
  line-height: 0.96;
}

.home-title-en {
  margin-top: 5px;
  font-size: clamp(0.78rem, 1.9vh, 1.12rem);
}

.home-tag {
  margin-top: clamp(5px, 0.8vh, 9px);
  padding-top: 3px;
  font-size: clamp(0.66rem, 1.45vh, 0.86rem);
}

.home-center {
  isolation: isolate;
  overflow: hidden;
}

.home-bowl {
  width: min(100%, 760px);
  overflow: visible;
}

.home-pedestal {
  bottom: 0;
  width: min(98%, 760px);
}

.home-plate {
  bottom: 17%;
  width: min(76%, 590px);
}

.home-cover {
  bottom: 31%;
  width: min(52%, 410px);
}

.home-play {
  width: min(72%, 530px);
  min-height: clamp(66px, 9.2vh, 92px);
  margin-bottom: clamp(6px, 1.7vh, 16px);
}

.home-play-km {
  font-size: clamp(1.05rem, 2.8vh, 1.65rem);
}

.home-menu {
  align-self: stretch;
  justify-content: center;
  gap: clamp(7px, 1vh, 11px);
  margin: clamp(12px, 1.8vh, 20px) 0 clamp(6px, 1vh, 12px);
  transform: none;
}

.menu-row {
  position: relative;
  display: grid;
  grid-template-columns: clamp(48px, 4.6vw, 60px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 1vw, 15px);
  min-height: clamp(62px, 9.1vh, 86px);
  padding: 8px clamp(14px, 1.5vw, 22px);
  overflow: visible;
}

.menu-row::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  width: clamp(43px, 4.2vw, 56px);
  aspect-ratio: 1;
  border: 1px solid rgba(242, 202, 104, 0.62);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, rgba(89, 57, 24, 0.88), rgba(19, 11, 6, 0.96) 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 163, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.menu-row .menu-ico {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  width: clamp(28px, 2.6vw, 36px);
  height: clamp(28px, 2.6vw, 36px);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.menu-row .menu-ico-friends {
  width: clamp(48px, 4.5vw, 60px);
  height: clamp(48px, 4.5vw, 60px);
}

.menu-row > span {
  grid-column: 2;
  min-width: 0;
}

.menu-row b {
  font-size: clamp(0.86rem, 1.9vh, 1.12rem);
  line-height: 1.2;
}

.menu-row small {
  margin-top: 3px;
  font-size: clamp(0.56rem, 1.15vh, 0.72rem);
}

.menu-row em {
  z-index: 4;
}

.home-foot {
  grid-template-columns: minmax(230px, 1fr) auto minmax(210px, 1fr);
  min-height: clamp(64px, 9.5vh, 92px);
  gap: clamp(8px, 1vw, 14px);
  transform: translateY(-3px);
}

.fun-only {
  padding: 8px 12px;
}

.home-control {
  width: clamp(64px, 8.8vh, 86px);
}

.home-control img {
  width: clamp(23px, 3vh, 30px);
  height: clamp(23px, 3vh, 30px);
  object-fit: contain;
  object-position: center;
}

.home-social button {
  width: clamp(36px, 4.8vh, 46px);
  height: clamp(36px, 4.8vh, 46px);
}

@media (min-width: 933px) and (max-height: 820px) {
  .home-screen.is-on {
    grid-template-rows: auto clamp(104px, 15vh, 120px) minmax(0, 1fr) 64px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(7px, env(safe-area-inset-bottom));
  }

  .home-brand {
    padding-bottom: 3px;
  }

  .home-crest {
    max-height: 42px;
    margin-bottom: -2px;
  }

  .home-title-km {
    font-size: clamp(2.15rem, 6.1vh, 3rem);
  }

  .home-title-en {
    font-size: 0.76rem;
  }

  .home-tag {
    margin-top: 2px;
    font-size: 0.62rem;
  }

  .home-cover {
    bottom: 29%;
    width: min(48%, 350px);
  }

  .home-plate {
    width: min(70%, 520px);
  }

  .home-pedestal {
    width: min(92%, 690px);
  }

  .home-menu {
    gap: 6px;
    margin-block: 8px 5px;
  }

  .menu-row {
    min-height: clamp(50px, 7.8vh, 60px);
    padding-block: 5px;
  }

  .home-play {
    min-height: 62px;
    margin-bottom: 5px;
  }

}

@media (max-width: 932px) and (orientation: landscape) {
  .home-screen.is-on {
    grid-template-columns: minmax(0, 1fr) clamp(180px, 29vw, 250px);
    grid-template-rows: 44px clamp(54px, 15vh, 66px) minmax(0, 1fr) 48px;
  }

  .home-brand {
    align-self: center;
  }

  .home-crest {
    width: min(42%, 145px);
    max-height: 22px;
    margin-bottom: -2px;
  }

  .home-title-km {
    font-size: clamp(1.25rem, 5.8vh, 1.55rem);
  }

  .home-title-en {
    margin-top: 1px;
    font-size: 0.48rem;
  }

  .home-tag {
    display: none;
  }

  .home-cover {
    bottom: 28%;
    width: min(43%, 175px);
  }

  .home-plate {
    bottom: 15%;
    width: min(64%, 270px);
  }

  .home-pedestal {
    width: min(88%, 380px);
  }

  .home-play {
    width: min(70%, 270px);
    min-height: 48px;
    margin-bottom: 2px;
  }

  .home-menu {
    gap: 3px;
    margin: 3px 0 2px;
  }

  .menu-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    padding: 3px 8px;
  }

  .menu-row::before {
    width: 30px;
  }

  .menu-row .menu-ico {
    width: 19px;
    height: 19px;
  }

  .menu-row .menu-ico-friends {
    width: 31px;
    height: 31px;
  }

  .menu-row b {
    font-size: clamp(0.58rem, 2.5vh, 0.68rem);
  }

  .menu-row small {
    margin-top: 0;
    font-size: clamp(0.42rem, 1.7vh, 0.46rem);
  }

  .home-foot {
    grid-template-columns: minmax(120px, 1fr) auto minmax(92px, 1fr);
    min-height: 48px;
    height: 48px;
    gap: 4px;
  }

  .fun-only {
    max-width: 166px;
    padding: 4px 6px;
    gap: 5px;
  }

  .fun-only img {
    width: 28px;
    height: 28px;
  }

  .fun-only b {
    font-size: 7px;
  }

  .fun-only small {
    display: none;
  }

  .home-controls {
    gap: 3px;
  }

  .home-control {
    width: 42px;
    min-height: 42px;
    gap: 0;
  }

  .home-control img {
    width: 18px;
    height: 18px;
  }

  .home-control span {
    font-size: 5px;
  }

  .home-social {
    gap: 3px;
    padding: 3px 4px;
  }

  .home-social > span {
    display: none;
  }

  .home-social button {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
  }
}
