/* Installing the app (InstallPrompt.razor, InstallStrip.razor): the bottom sheet that offers it (Android/desktop with
   an Install button, iPhone with illustrated steps), the notifications ask after installing, the install reward's
   reveal, and the strip on the Badge. Motion is transform and opacity only. */

/* ---------- The sheet ---------- */
.sk-install-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 var(--sc-safe-bottom);
    background: rgba(2, 8, 22, 0.62);
    animation: sk-fade-in 200ms ease-out backwards;
}

.sk-install-backdrop.is-closing {
    animation: sk-fade-out 220ms ease-in forwards;
}

.sk-install-sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 22px 18px 18px;
    border: 1px solid rgba(var(--sc-primary-rgb), 0.28);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(var(--sc-primary-rgb), 0.2), transparent 70%),
        var(--sc-bg-elevated);
    box-shadow: var(--sc-shadow-lg);
    color: var(--sc-text);
    text-align: center;
    animation: sk-install-sheet-in 420ms var(--sc-ease-spring) backwards;
}

.sk-install-backdrop.is-closing .sk-install-sheet {
    animation: sk-install-sheet-out 220ms ease-in forwards;
}

@media (min-width: 700px) {
    .sk-install-backdrop { align-items: center; }
    .sk-install-sheet { border-bottom: 1px solid rgba(var(--sc-primary-rgb), 0.28); border-radius: 24px; }
}

@keyframes sk-install-sheet-in {
    from { transform: translateY(40px); opacity: 0; }
}

@keyframes sk-install-sheet-out {
    to { transform: translateY(40px); opacity: 0; }
}

@keyframes sk-fade-in { from { opacity: 0; } }
@keyframes sk-fade-out { to { opacity: 0; } }

.sk-install-x {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: var(--sc-text-muted);
    font-size: 20px;
}

.sk-install-sheet h2 {
    margin: 8px 0 6px;
    font-family: var(--sc-font-display);
    font-size: 22px;
    font-weight: 700;
}

.sk-install-lead {
    margin: 0 auto 12px;
    max-width: 320px;
    color: var(--sc-text-muted);
    font-size: 14px;
    line-height: 1.4;
}

/* The app icon, floating, with sparkles */
.sk-install-hero {
    position: relative;
    display: grid;
    place-items: center;
    height: 96px;
}

.sk-install-appicon {
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(var(--sc-primary-rgb), 0.35);
    animation: sk-install-bob 3.2s ease-in-out infinite;
}

@keyframes sk-install-bob {
    50% { transform: translateY(-5px) rotate(-2deg); }
}

.sk-install-spark {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffe17a;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: sk-install-twinkle 1.8s ease-in-out infinite;
}

.sk-install-spark.is-a { transform: translate(-62px, -26px); }
.sk-install-spark.is-b { transform: translate(60px, -10px) scale(0.75); animation-delay: 0.5s; background: #5ff5d0; }
.sk-install-spark.is-c { transform: translate(-48px, 30px) scale(0.6); animation-delay: 1s; }

@keyframes sk-install-twinkle {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .sk-install-appicon, .sk-install-spark { animation: none; }
}

/* The install bonus */
.sk-install-reward {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 14px;
    padding: 6px 10px;
    border: 1px dashed rgba(255, 201, 74, 0.45);
    border-radius: var(--sc-radius-pill);
    background: rgba(255, 201, 74, 0.08);
}

.sk-install-reward-label {
    color: #ffd46b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* What you get, as a short list */
.sk-install-perks {
    display: grid;
    gap: 8px;
    margin: 4px 0 14px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.sk-install-perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--sc-radius);
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
    line-height: 1.35;
    color: var(--sc-text-muted);
}

.sk-install-perks li b { color: var(--sc-text); }

.sk-install-perks img {
    flex: none;
    width: 36px;
    height: 36px;
}

.sk-install-perks ion-icon {
    flex: none;
    font-size: 20px;
    color: var(--sc-primary);
}

/* The iPhone steps: numbered, each with a little drawing of what to tap */
.sk-install-steps {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    counter-reset: step;
    text-align: left;
}

.sk-install-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 26px 92px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--sc-radius);
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
    line-height: 1.35;
    color: var(--sc-text-muted);
    counter-increment: step;
}

.sk-install-steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--sc-primary);
    color: #04201a;
    font-weight: 800;
    font-size: 14px;
}

.sk-install-steps b { color: var(--sc-text); }

.sk-install-step-art {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    border-radius: 10px;
    background: #e9eef8;
    color: #1a73e8;
    overflow: hidden;
}

/* Safari's bottom toolbar, the Share button lit */
.sk-install-step-art.is-toolbar > span:not(.sk-install-share) {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    background: #b9c3d6;
}

.sk-install-share {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 0 2px #1a73e8;
    animation: sk-install-pulse 1.6s ease-in-out infinite;
}

@keyframes sk-install-pulse {
    50% { transform: scale(1.12); }
}

/* The share sheet's menu, the right row lit */
.sk-install-step-art.is-menu {
    flex-direction: column;
    gap: 2px;
    padding: 3px;
    color: #1c2333;
}

.sk-install-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    padding: 1px 5px;
    border-radius: 5px;
    background: #fff;
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.55;
}

.sk-install-menu-row.is-on {
    padding: 3px 5px;
    box-shadow: 0 0 0 1.5px #1a73e8;
    opacity: 1;
}

.sk-install-step-art.is-menu:has(> .sk-install-menu-row:only-child) .sk-install-menu-row { font-size: 10px; }

/* A home screen with the icon on it */
.sk-install-step-art.is-home {
    background: linear-gradient(160deg, #3b5bdb, #7048e8);
}

.sk-install-step-art.is-home > span {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.45);
}

.sk-install-step-art.is-home img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 0 0 2px #fff;
}

.sk-install-step-art.is-dots {
    font-size: 26px;
    color: #1c2333;
}

.sk-install-steps.is-manual li { grid-template-columns: 26px 92px 1fr; }

.sk-install-fine {
    margin: 0 0 12px;
    color: var(--sc-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.sk-install-error {
    margin: 0 0 10px;
    color: #ff9b9b;
    font-size: 13px;
}

.sk-install-buttons {
    display: flex;
    gap: 10px;
}

.sk-install-buttons .btn {
    flex: 1;
    min-height: 46px;
    font-weight: 700;
}

/* The notifications ask */
.sk-install-hero.is-push { height: 92px; }

.sk-install-note-art {
    width: 78px;
    height: 78px;
}

.sk-install-bell {
    position: absolute;
    top: 6px;
    left: calc(50% + 18px);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff5a4f;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 0 0 3px var(--sc-bg-elevated);
    animation: sk-install-ring 2.4s ease-in-out infinite;
    transform-origin: 50% 10%;
}

@keyframes sk-install-ring {
    0%, 60%, 100% { transform: rotate(0); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-12deg); }
    30% { transform: rotate(8deg); }
    40% { transform: rotate(-5deg); }
}

@media (prefers-reduced-motion: reduce) {
    .sk-install-share, .sk-install-bell { animation: none; }
}

/* The install reward's reveal */
.sk-install-reveal {
    display: grid;
    justify-items: center;
    gap: 14px;
}

.sk-install-reveal-icon {
    border-radius: 28px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 225, 122, 0.5);
}

/* ---------- The strip on the Badge ---------- */
.hq-grid > .hq-install {
    order: -1;
    grid-column: 1 / -1;
}

.hq-install {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(var(--sc-primary-rgb), 0.35);
    border-radius: var(--sc-radius-lg);
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(var(--sc-primary-rgb), 0.18), transparent 60%),
        var(--sc-surface-2, rgba(255, 255, 255, 0.04));
    overflow: hidden;
}

.hq-install-main {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 4px 9px 10px;
    border: 0;
    background: none;
    color: var(--sc-text);
    text-align: left;
}

.hq-install-main img {
    flex: none;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.hq-install-text {
    display: grid;
    flex: 1;
    min-width: 0;
}

.hq-install-text b {
    font-family: var(--sc-font-display);
    font-size: 15px;
}

.hq-install-text small {
    overflow: hidden;
    color: var(--sc-text-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hq-install-bonus {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: var(--sc-radius-pill);
    background: rgba(255, 201, 74, 0.14);
    color: #ffd46b;
    font-size: 13px;
    font-weight: 800;
}

.hq-install-x {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    border: 0;
    background: none;
    color: var(--sc-text-muted);
    font-size: 18px;
}
