/* Install gate: every rule is scoped to its component or its active state. */
.ci-icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ci-entry { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid #fff; border-radius: 14px; background: linear-gradient(145deg, #fff1b5, #ffe0b2); box-shadow: 0 3px 0 #ddbb8730; color: #b78a40; }
.ci-entry[hidden] { display: none !important; }
.ci-entry > span:empty { display: none; }
.ci-entry .ci-icon { width: 21px; height: 21px; }
body.install-open { overflow: hidden; }
body.install-required .game-shell, body.install-required .topbar { pointer-events: none; }
dialog.ci-dialog { --ci-ink: #654476; --ci-muted: #94799f; position: fixed; inset: 0; width: min(470px, calc(100vw - 28px)); max-width: 470px; max-height: min(850px, calc(100svh - 28px)); min-height: 0; margin: auto; padding: 0; overflow: hidden; border: 1px solid #fff; border-radius: 29px; background: #fffaf9; color: var(--ci-ink); text-align: center; font-family: var(--font, 'Baloo 2', 'Trebuchet MS', sans-serif); font-weight: 600; box-shadow: 0 25px 100px #50305a46; }
dialog.ci-dialog:not([open]) { display: none; }
dialog.ci-dialog[open] { display: flex; flex-direction: column; }
.ci-dialog::backdrop { background: #4e315c88; backdrop-filter: blur(9px); }
.ci-dialog *, .ci-dialog *::before, .ci-dialog *::after { box-sizing: border-box; }
.ci-dialog button, .ci-dialog input { font: inherit; -webkit-tap-highlight-color: transparent; }
.ci-dialog button { cursor: pointer; }
.ci-dialog button:not(:disabled):hover { transform: none; filter: brightness(.99); }
.ci-dialog button:not(:disabled):active { transform: scale(.98); }
.ci-dialog button:focus-visible, .ci-dialog input:focus-visible, .ci-entry:focus-visible { outline: 3px solid #be95e7; outline-offset: 3px; }
.ci-dialog button:disabled { cursor: default; opacity: .65; }
.ci-dialog [hidden] { display: none !important; }
.ci-close { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #fff; border-radius: 14px; background: #fffc; color: #9a79ad; }
.ci-close > span { display: none; }
.ci-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #e4d1ec transparent; -webkit-overflow-scrolling: touch; }
.ci-hero { padding: 25px 24px 18px; background: radial-gradient(ellipse at 20% 5%, #fff2bf, transparent 58%), radial-gradient(ellipse at 95% 75%, #f5daff, transparent 62%), linear-gradient(145deg, #fff9eb, #ffeef4 60%, #eee1ff); }
.ci-eyebrow { display: block; color: #b395b0; font-size: 9px; line-height: 1.5; letter-spacing: 1.4px; font-weight: 800; }
.ci-art { position: relative; width: 90px; height: 90px; margin: 19px auto 17px; transform: rotate(-5deg); }
.ci-art::before { content: ''; position: absolute; z-index: -1; inset: -6px; border: 1px solid #fff; border-radius: 31px; transform: rotate(13deg); background: #fff6; }
.ci-app-icon { display: block; width: 90px; height: 90px; border: 3px solid #fff; border-radius: 26px; object-fit: cover; box-shadow: 0 5px 0 #b88aa235, 0 12px 25px #ad6b9e1c; }
.ci-art-badge { position: absolute; right: -12px; bottom: -5px; display: grid; place-items: center; width: 29px; height: 29px; border: 2px solid #fff; border-radius: 11px; background: #ffdc79; color: #ad7b26; transform: rotate(15deg); box-shadow: 0 3px 0 #cea24530; }
.ci-art-badge .ci-icon { width: 16px; height: 16px; }
.ci-dialog .ci-title { margin: 0; color: #8752ae; font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.9px; }
.ci-dialog .ci-description { max-width: 290px; margin: 9px auto 13px; color: #ab7e9f; font-size: 13px; line-height: 1.5; }
.ci-platform { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 12px; border: 1px solid #fff; border-radius: 20px; background: #fff9; color: #a181ad; font-size: 10px; line-height: 1.4; }
.ci-platform::before { content: ''; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: #baa0d0; }
.ci-journey { display: flex; justify-content: center; gap: 7px; margin: 17px 20px 0; padding-bottom: 16px; border-bottom: 1px solid #efe2ec; }
.ci-journey-step { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: center; gap: 5px; color: #a38aad; font-size: 10px; line-height: 1.4; white-space: nowrap; }
.ci-journey-step > b { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 7px; background: #f0e2f7; color: #b08ac5; font-size: 10px; font-weight: 800; }
.ci-journey-step:nth-child(2) > b { background: #ffe9ef; color: #d28daa; }
.ci-journey-step:nth-child(3) > b { background: #fff0cb; color: #c3a05b; }
.ci-guide { margin: 15px 21px 3px; padding: 16px 16px 5px; border: 1px solid #e8d9ee; border-radius: 19px; background: linear-gradient(135deg, #fbf5ff, #fff9fc); text-align: left; }
.ci-dialog .ci-guide-title { margin: 0; color: #9167a8; font-size: 17px; line-height: 1.35; font-weight: 800; }
.ci-dialog .ci-guide-intro { margin: 5px 0 12px; color: #ac8db5; font-size: 11px; line-height: 1.6; }
.ci-steps { list-style: none; counter-reset: ci-step; display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; }
.ci-step { position: relative; padding: 0 0 14px 30px; counter-increment: ci-step; }
.ci-step::before { content: counter(ci-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 21px; height: 22px; border: 1px solid #fff; border-radius: 8px; background: #e8d6f4; color: #a27abc; font-size: 11px; font-weight: 800; }
.ci-step > strong { display: block; color: #9572a4; font-size: 12px; line-height: 1.55; font-weight: 800; }
.ci-dialog .ci-step > p { margin: 3px 0 0; color: #ac91b5; font-size: 11px; line-height: 1.65; }
.ci-footer { position: relative; z-index: 1; flex: 0 0 auto; width: 100%; padding: 18px 25px max(19px, env(safe-area-inset-bottom)); background: #fffaf9; }
.ci-primary { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 52px; padding: 10px 15px; border: 1px solid #d8a4ed; border-radius: 17px; color: #fff; background: linear-gradient(115deg, #c477d9, #a15fc7 55%, #8653b8); box-shadow: 0 4px 0 #8151a233, inset 0 1px 0 #e4b9f4; font-size: 17px; font-weight: 800; line-height: 1.4; }
.ci-primary .ci-icon { width: 21px; height: 21px; color: #ffe6fb; }
.ci-dialog .ci-prompt-hint { margin: 10px 0 6px; color: #bc9cc3; font-size: 9px; line-height: 1.5; }
.ci-secondary { display: flex; gap: 7px; justify-content: center; align-items: stretch; }
.ci-copy, .ci-recheck { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 6px 9px; border: 0; border-radius: 12px; background: transparent; color: #aa87b9; font-size: 10px; line-height: 1.4; }
.ci-copy .ci-icon, .ci-recheck .ci-icon { width: 15px; height: 15px; }
.ci-recheck { color: #b59cbe; }
.ci-dialog .ci-status { min-height: 32px; margin: 6px 0 0; padding: 9px 11px; border: 1px solid #f1e5ec; border-radius: 12px; color: #b198bb; background: #fbf4f8; font-size: 10px; line-height: 1.6; }
.ci-link { display: block; width: 100%; min-height: 44px; padding: 7px 10px; margin-top: 3px; border: 1px solid #dcc8e8; border-radius: 11px; background: #fff; color: #9e7bad; font-size: 16px; }
.ci-install-success .ci-art-badge { background: #c8eedb; color: #69a98a; }
.ci-install-success .ci-primary { background: linear-gradient(115deg, #a584cf, #8760b6); }
@media (max-width: 650px) {
  .topbar:has(.ci-entry) .account-button { max-width: 110px; }
  .topbar:has(.ci-entry) .account-button b { max-width: 57px; }
  .topbar:has(.ci-entry) .offline-badge { display: none; }
  dialog.ci-dialog { width: min(430px, calc(100vw - 20px)); max-height: calc(100svh - max(20px, env(safe-area-inset-top)) - max(14px, env(safe-area-inset-bottom))); border-radius: 26px; }
  .ci-hero { padding: 23px 18px 17px; }
  .ci-eyebrow { font-size: 8px; letter-spacing: 1.1px; }
  .ci-art { width: 82px; height: 82px; margin: 18px auto 16px; }
  .ci-app-icon { width: 82px; height: 82px; border-radius: 24px; }
  .ci-dialog .ci-title { font-size: 29px; }
  .ci-dialog .ci-description { font-size: 12px; margin: 8px auto 12px; }
  .ci-journey { margin: 15px 16px 0; padding-bottom: 15px; gap: 4px; }
  .ci-journey-step { font-size: 9px; gap: 4px; }
  .ci-guide { margin: 13px 16px 1px; padding: 14px 13px 3px; }
  .ci-dialog .ci-guide-title { font-size: 16px; }
  .ci-footer { padding: 16px 20px max(15px, env(safe-area-inset-bottom)); }
  .ci-primary { font-size: 16px; min-height: 50px; border-radius: 16px; }
}
@media (max-width: 359px) {
  dialog.ci-dialog { width: calc(100vw - 16px); }
  .ci-hero { padding-left: 12px; padding-right: 12px; }
  .ci-dialog .ci-title { font-size: 26px; }
  .ci-dialog .ci-description { font-size: 11px; }
  .ci-journey { margin-left: 11px; margin-right: 11px; }
  .ci-journey-step { font-size: 8px; gap: 3px; }
  .ci-journey-step > b { width: 18px; height: 19px; flex-basis: 18px; font-size: 9px; }
  .ci-footer { padding-left: 15px; padding-right: 15px; }
  .ci-copy, .ci-recheck { font-size: 9px; gap: 4px; padding-left: 5px; padding-right: 5px; }
  .ci-guide { margin-left: 12px; margin-right: 12px; padding-left: 11px; padding-right: 11px; }
}
@media (max-height: 700px) {
  .ci-hero { padding-top: 17px; padding-bottom: 12px; }
  .ci-art { width: 62px; height: 62px; margin-top: 12px; margin-bottom: 12px; }
  .ci-app-icon { width: 62px; height: 62px; border-radius: 19px; }
  .ci-art::before { border-radius: 23px; }
  .ci-art-badge { width: 25px; height: 25px; border-radius: 9px; right: -9px; }
  .ci-dialog .ci-title { font-size: 26px; }
  .ci-dialog .ci-description { margin-top: 6px; margin-bottom: 9px; font-size: 11px; }
  .ci-journey { margin-top: 12px; padding-bottom: 11px; }
  .ci-footer { padding-top: 12px; padding-bottom: max(11px, env(safe-area-inset-bottom)); }
  .ci-dialog .ci-prompt-hint { margin-top: 8px; margin-bottom: 1px; }
  .ci-dialog .ci-status { padding: 7px 9px; margin-top: 2px; font-size: 9px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  dialog.ci-dialog { width: min(650px, calc(100vw - 24px)); max-width: 650px; max-height: calc(100svh - 16px); }
  .ci-hero { position: relative; min-height: 116px; padding: 15px 15px 12px 108px; text-align: left; }
  .ci-art { position: absolute; width: 64px; height: 64px; left: 23px; top: 20px; margin: 0; }
  .ci-app-icon { width: 64px; height: 64px; }
  .ci-dialog .ci-title { font-size: 25px; margin-top: 4px; }
  .ci-dialog .ci-description { max-width: none; margin: 5px 0 7px; font-size: 10px; }
  .ci-platform { padding-top: 3px; padding-bottom: 3px; font-size: 9px; }
  .ci-journey { display: none; }
  .ci-footer { padding: 9px 20px; }
  .ci-primary { min-height: 48px; font-size: 15px; }
  .ci-dialog .ci-prompt-hint { display: none; }
  .ci-secondary { margin-top: 3px; }
  .ci-dialog .ci-status { margin-top: 0; min-height: 0; padding: 5px 8px; font-size: 9px; }
  .ci-guide { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .ci-dialog button, .ci-entry { transition: none; } }
.reduced-motion .ci-dialog button, .reduced-motion .ci-entry { transition: none; }
