:root {
  --home-text: #14101f;
  --home-muted: #6d667c;
  --home-accent: #8c52d6;
}

#app.is-home {
  padding: 0 16px calc(110px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #f8f1ff 0%, #ede0fb 45%, #f3e8fc 100%);
  color: var(--home-text);
}
.home-screen { padding-top: max(12px, env(safe-area-inset-top)); }
.home-top { height: 57px; padding: 0; align-items: center; }
.home-brand { gap: 7px; font-size: 23px; letter-spacing: -.025em; }
.home-brand > span { font-size: inherit; color: inherit; filter: none; animation: none; }
.home-brand .ui-art { width: 29px; height: 29px; object-fit: contain; flex: none; }
.home-wallet { gap: 5px; }
.home-pill, .home-bell {
  height: 36px; border: 1px solid #ffffffb3; border-radius: 22px;
  background: #fffbfff0; box-shadow: 0 3px 11px #5f399d14; backdrop-filter: none;
}
.home-pill { gap: 3px; padding: 3px 9px 3px 5px; font-size: 12px; }
.home-pill .ui-art { width: 25px; height: 25px; object-fit: contain; }
.home-bell { width: 38px; display: grid; place-items: center; padding: 7px; }
.home-bell .ui-art { width: 24px; height: 24px; object-fit: contain; }
.home-bell i { right: 3px; top: 2px; }

.home-hero { height: 178px; margin: 0 -16px; isolation: isolate; overflow: visible; background: none; }
.home-hero::before {
  content: ""; position: absolute; z-index: -1; inset: -18px 0 -54px;
  background: url('/home-hero.jpg') center 36% / 100% auto no-repeat;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 60%, transparent 100%);
  pointer-events: none;
}
.home-hero::after { content: none; }
.home-welcome { width: 61%; padding: 18px 0 0 20px; }
.home-welcome h1 { font-size: clamp(30px, 8.3vw, 33px); line-height: 1.1; letter-spacing: -.025em; }
.home-welcome p {
  display: flex; align-items: center; gap: 3px; margin: 9px 0 0;
  color: #655e72; font-size: 14px; line-height: 1.35; white-space: nowrap;
}
.home-welcome p .ui-art { width: 16px; height: 16px; object-fit: contain; }

.home-actions {
  position: relative; z-index: 1; margin-top: -8px; padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; row-gap: 10px;
}
.home-action {
  display: grid; grid-template-columns: 41px minmax(0, 1fr) 11px; align-items: center; gap: 7px;
  min-height: 80px; height: auto; padding: 9px 10px;
  border: 1px solid #ffffff80; border-radius: 23px; background: #fffbffe5;
  box-shadow: 0 6px 18px #60399612; backdrop-filter: none; transition: transform .16s ease;
}
.home-action > .ui-art { width: 41px; height: 41px; object-fit: contain; justify-self: center; }
.home-action > span { min-width: 0; align-self: center; }
.home-action strong { font-size: 15px; line-height: 1.12; letter-spacing: -.025em; }
.home-action small { margin-top: 4px; color: #655e70; font-size: 11px; line-height: 1.18; font-weight: 500; }
.home-action > b { font-size: 21px; color: #1f1729; line-height: 1; text-align: right; }
.home-action:active, .home-game:active { transform: scale(.98); }

.home-section { margin: 22px 2px 10px; }
.home-section h2 { font-size: 20px; line-height: 1.1; letter-spacing: -.025em; }
.home-section button { font-size: 12px; color: #332b3c; }
.home-section button b { font-size: 17px; }
.home-games {
  grid-auto-columns: calc((100% - 20px) / 3); gap: 10px; padding: 1px 1px 8px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.home-game {
  min-width: 0; min-height: 126px; padding: 7px 8px 10px;
  border: 1px solid #ffffff80; border-radius: 22px; background: #fffbffdf;
  box-shadow: 0 5px 15px #60399610; transition: transform .15s ease;
}
.home-game::before {
  content: ""; position: absolute; inset: auto -10% -22% -10%; height: 42%;
  border-radius: 50% 50% 0 0; background: #ecddfd66; pointer-events: none;
}
.home-game > .art { position: relative; width: 53px; height: 53px; margin: 2px auto 0; }
.home-game > span { position: relative; z-index: 1; width: 100%; max-width: 100%; }
.home-game strong { font-size: 14px; line-height: 1.12; letter-spacing: -.025em; overflow-wrap: normal; }
.home-game small { font-size: 10px; line-height: 1.2; max-width: 100%; color: var(--home-muted); }
.home-game > i { display: none; }
.home-recommend { gap: 10px; }
.home-recommend .home-action { grid-template-columns: 39px minmax(0, 1fr) 11px; min-height: 74px; }
.home-recommend .home-action > .art { width: 39px; height: 39px; }
.home-recommend .home-action strong { font-size: 14px; }
.home-recommend .home-action small { font-size: 10px; }
.home-mission { margin-top: 24px; }

#app .bottom, #app.is-home .bottom {
  z-index: 100; height: calc(78px + env(safe-area-inset-bottom));
  padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid #ffffffd9; border-radius: 28px 28px 0 0;
  background: #fbf7ff; box-shadow: 0 -6px 19px #5f399d12; backdrop-filter: none;
}
.bottom button { transition: transform .18s ease, color .18s ease; }
.bottom button:active { transform: scale(.96); }
.bottom .nav-icon { display: block; width: 25px; height: 25px; object-fit: contain; margin: 2px auto 4px; }
.bottom button span, #app.is-home .bottom button { font-size: 11px; }
.bottom button[data-tab="pet"] .nav-icon {
  width: 60px; height: 60px; margin: -23px auto -2px; object-fit: contain; filter: none;
}
.bottom button[data-tab="pet"] { color: #211a2a; }
.bottom button.on { color: var(--home-accent); }
.bottom button[data-tab="pet"]:active .nav-icon { transform: scale(.96); }

@media (max-width: 370px) {
  #app.is-home { padding-inline: 12px; }
  .home-hero { margin-inline: -12px; height: 165px; }
  .home-welcome { padding-left: 16px; }
  .home-welcome h1 { font-size: 29px; }
  .home-welcome p { font-size: 12px; }
  .home-action { grid-template-columns: 36px minmax(0, 1fr) 10px; gap: 5px; min-height: 78px; padding: 8px; }
  .home-action > .ui-art { width: 36px; height: 36px; }
  .home-action strong { font-size: 14px; }
  .home-action small { font-size: 10px; }
  .home-games { grid-auto-columns: calc((100% - 16px) / 3); gap: 8px; }
  .home-game strong { font-size: 13px; }
  .home-game small { font-size: 10px; }
  .home-section h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-action, .home-game, .bottom button { transition: none; }
}
