/* Rumpus on the Home Screen: the lobby bar and the steps sheet. See install.js. */

/* The bar sits above the lobby and gives the lobby its height back, so nothing below moves off screen. */
#install-bar {
  display: flex; align-items: stretch; gap: 4px;
  max-width: 520px; margin: 0 auto;
  padding: calc(8px + var(--controller-safe-top, 0px)) 8px 0 14px;
}
#screen:has(> #install-bar) #app { min-height: calc(100cqh - var(--install-h, 80px)); padding-top: 8px; }
#install-bar button { font: inherit; color: inherit; border: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
.install-open {
  flex: 1; min-width: 0; min-height: 64px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px; border-radius: 18px; text-align: left;
  background: var(--card, rgba(255, 255, 255, 0.09)); box-shadow: inset 0 0 0 1.5px var(--line, rgba(255, 255, 255, 0.16));
}
.install-open img { flex: none; width: 44px; height: 44px; border-radius: 11px; }
.install-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.install-text b { font-size: 16px; font-weight: 800; line-height: 1.15; }
.install-text small { font-size: 13.5px; font-weight: 600; color: var(--dim, rgba(255, 255, 255, 0.62)); line-height: 1.2; }
.install-go {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow, #ffd23f); color: var(--dark, #141227);
}
.install-x {
  flex: none; width: 64px; min-height: 64px; display: grid; place-items: center;
  background: none; border-radius: 18px; color: var(--dim, rgba(255, 255, 255, 0.62));
}
.install-open:active, .install-x:active { filter: brightness(1.3); }
#install-bar button:focus-visible, .install-btn:focus-visible { outline: 3px solid var(--yellow, #ffd23f); outline-offset: 2px; }

/* The steps. #screen is the containing block (it has container-type), so this turns with a turned phone. */
#install-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 8, 24, 0.72);
  animation: install-fade 0.16s ease-out;
}
.install-card {
  width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px calc(14px + var(--controller-safe-bottom, 0px));
  background: #221a4a; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: install-rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.install-icon { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
.install-card h2 { margin: 10px 0 4px; font-size: 24px; font-weight: 900; line-height: 1.1; text-wrap: balance; }
.install-why { margin: 0 auto 14px; max-width: 19em; font-size: 16px; font-weight: 600; color: #e2dfee; line-height: 1.3; text-wrap: balance; }
.install-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.install-steps li {
  display: flex; align-items: center; gap: 12px; min-height: 76px;
  padding: 10px 10px 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.09);
}
.install-n {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow, #ffd23f); color: var(--dark, #141227); font-size: 17px; font-weight: 900;
}
.install-what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.install-what b { font-size: 18px; font-weight: 800; line-height: 1.15; }
.install-what small { font-size: 14px; font-weight: 600; color: var(--dim, rgba(255, 255, 255, 0.62)); line-height: 1.25; }
.install-art { flex: none; display: grid; place-items: center; }
.install-what .install-art { justify-content: start; margin: 5px 0 3px; }
.install-what .install-art svg { height: 44px; }
.install-art svg { display: block; height: 48px; width: auto; border-radius: 12px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
.install-keep { margin: 12px 0 2px; font-size: 14px; font-weight: 600; color: var(--dim, rgba(255, 255, 255, 0.62)); }
.install-btn {
  display: block; width: 100%; min-height: 64px; margin: 10px 0 0; padding: 12px 16px;
  border: 0; border-radius: 16px; font: inherit; font-size: 19px; font-weight: 900; cursor: pointer;
  background: var(--yellow, #ffd23f); color: var(--dark, #141227);
}
.install-btn.install-later { background: none; color: var(--dim, rgba(255, 255, 255, 0.62)); margin-top: 2px; }
.install-btn:active { filter: brightness(1.15); }

/* A turned or short phone: steps beside the title, so the sheet still fits without scrolling far. */
@container (max-height: 520px) {
  .install-card { max-width: 760px; display: grid; grid-template-columns: 1fr 1.4fr; column-gap: 16px; align-items: start; text-align: left; padding-top: 14px; }
  .install-icon { width: 56px; height: 56px; }
  .install-steps { grid-column: 2; grid-row: 1 / span 6; }
  .install-steps li { min-height: 64px; }
  .install-why { margin: 0 0 8px; }
  .install-keep { margin: 0; }
}
@keyframes install-fade { from { opacity: 0; } }
@keyframes install-rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #install-sheet, .install-card { animation: none; } }
