/* Caytopia PWA install button + guide sheet (pwa.js). Shared by landing.html and the game. Self-contained tokens: no page vars required. */
.cay-inst, .cay-sheet-wrap { --ci-sea1: #3FDCE6; --ci-sea2: #10AFC0; --ci-sea3: #0A8A98; --ci-edge: #05616B; --ci-gold1: #FFE58A; --ci-gold2: #FFC531; --ci-gold3: #F29A00; --ci-ink: #0E2233;
  --ci-disp: 'Lilita One', var(--display, var(--nl-font-display, 'Arial Rounded MT Bold')), 'Trebuchet MS', system-ui, sans-serif;
  --ci-ui: var(--font, var(--nl-font, 'Inter')), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }

/* ---------------------------------------------------------------- the button */
.cay-inst { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 7px 10px 7px 7px; margin: 0;
  border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: #fff; font: 600 13px/1.2 var(--ci-ui); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  background: linear-gradient(180deg, var(--ci-sea1) 0%, var(--ci-sea2) 48%, var(--ci-sea3) 100%);
  box-shadow: 0 6px 0 var(--ci-edge), 0 16px 28px -10px rgba(3, 70, 80, .65), inset 0 1.5px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(0, 60, 70, .25), inset 0 0 0 1.5px rgba(255, 255, 255, .22);
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), box-shadow .14s ease, filter .2s ease; will-change: transform; }
.cay-inst::before { content: ""; position: absolute; z-index: -1; left: 6px; right: 6px; top: 3px; height: 44%; border-radius: 18px 18px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .04)); pointer-events: none; }
.cay-inst::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; overflow: hidden;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 45%, transparent 60%) -160% 0 / 60% 100% no-repeat; animation: ci-shine 5.5s ease-in-out 1.2s infinite; }
@keyframes ci-shine { 0%, 70% { background-position: -160% 0; } 100% { background-position: 260% 0; } }
.cay-inst:hover { transform: translateY(-2px); filter: brightness(1.05) saturate(1.06); box-shadow: 0 8px 0 var(--ci-edge), 0 20px 30px -10px rgba(3, 70, 80, .7), inset 0 1.5px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(0, 60, 70, .25), inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
.cay-inst:active, .cay-inst.press { transform: translateY(5px); transition-duration: .05s; box-shadow: 0 1px 0 var(--ci-edge), 0 5px 10px -6px rgba(3, 70, 80, .6), inset 0 1.5px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(0, 60, 70, .2), inset 0 0 0 1.5px rgba(255, 255, 255, .2); }
.cay-inst:focus-visible { outline: 3px solid var(--ci-gold2); outline-offset: 4px; }

/* glossy app-icon tile */
.ci-tile { position: relative; flex: none; width: 50px; height: 50px; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #7EE6F0, #0C8FA0);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .92), 0 3px 0 2px rgba(4, 80, 90, .55), 0 8px 14px -4px rgba(0, 40, 50, .55); transform: rotate(-4deg); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.cay-inst:hover .ci-tile { transform: rotate(0) scale(1.05); }
.ci-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ci-gloss { display: none; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 30% -10%, rgba(255, 255, 255, .75), rgba(255, 255, 255, .12) 48%, transparent 52%), linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, .14)); }
.ci-tile.sm { width: 40px; height: 40px; border-radius: 11px; transform: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9), 0 2px 0 1.5px rgba(4, 80, 90, .4), 0 5px 10px -3px rgba(0, 40, 50, .45); }
.ci-tile.lg { width: 64px; height: 64px; border-radius: 18px; transform: rotate(-5deg); }

.ci-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ci-tx b { font: 400 22px/1 var(--ci-disp); letter-spacing: .01em; white-space: nowrap;
  color: var(--ci-gold2); background: linear-gradient(180deg, #FFF6C8 0%, var(--ci-gold1) 30%, var(--ci-gold2) 62%, var(--ci-gold3) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1.5px 0 #6B3A00) drop-shadow(0 3px 3px rgba(0, 40, 50, .4)); padding: 1px 2px 2px; }
.ci-tx small { font: 700 11.5px/1.2 var(--ci-ui); letter-spacing: .02em; color: rgba(255, 255, 255, .95); text-shadow: 0 1px 1px rgba(0, 50, 60, .45); white-space: nowrap; }
.ci-go { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 4px; border-radius: 50%; color: #5A3300;
  background: radial-gradient(circle at 35% 28%, #FFF6C8, var(--ci-gold2) 55%, var(--ci-gold3)); box-shadow: 0 3px 0 #B86E00, inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 10px -4px rgba(0, 0, 0, .35); }
.ci-go svg { width: 22px; height: 22px; animation: ci-bob 2.2s ease-in-out infinite; }
.ci-go.sm { width: 34px; height: 34px; }
.ci-go.sm svg { width: 18px; height: 18px; }
@keyframes ci-bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(2.5px); } }

/* placements */
[data-cay-install] { display: flex; }
[data-cay-install][hidden] { display: none !important; }
[data-cay-install="final"] { justify-content: center; margin-top: 14px; }
[data-cay-install="hero"] { justify-content: center; margin: 12px 0 2px; }
@media (max-height: 500px) and (orientation: landscape) { [data-cay-install="hero"] { margin: 6px 0 0; } [data-cay-install="hero"] .cay-inst { min-height: 52px; } }
.cay-inst.ci-v-final { width: 100%; max-width: 360px; }
.cay-inst.ci-v-title { min-height: 52px; border-radius: 18px; padding: 5px 8px 5px 5px; gap: 10px; }
.cay-inst.ci-v-title .ci-tile { width: 40px; height: 40px; border-radius: 11px; }
.cay-inst.ci-v-title .ci-tx b { font-size: 18px; }
.cay-inst.ci-v-title .ci-go { width: 32px; height: 32px; }

/* in-game Settings row (inside the phone list) */
.cay-inst-row .ci-tile.sm { margin-right: 2px; }
.cay-inst-row .tx b { color: inherit; }
.cay-inst-row .ci-go { margin-left: auto; }

/* ---------------------------------------------------------------- guide sheet */
.cay-sheet-wrap { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; font: 400 15px/1.45 var(--ci-ui); color: var(--ci-ink); }
.cay-sheet-bg { position: absolute; inset: 0; background: rgba(6, 26, 38, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
.cay-sheet { position: relative; width: 100%; max-width: 480px; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF8EC 60%, #FBEFD9 100%); box-shadow: 0 -20px 50px -10px rgba(0, 30, 45, .45), inset 0 1px 0 #fff;
  transform: translateY(105%); transition: transform .42s cubic-bezier(.22, 1.2, .36, 1); }
.cay-sheet-wrap.open .cay-sheet-bg { opacity: 1; }
.cay-sheet-wrap.open .cay-sheet { transform: none; }
@media (min-width: 700px) and (min-height: 560px) { .cay-sheet-wrap { align-items: center; } .cay-sheet { border-radius: 28px; transform: translateY(30px) scale(.96); opacity: 0; transition: transform .35s cubic-bezier(.22, 1.2, .36, 1), opacity .25s ease; } .cay-sheet-wrap.open .cay-sheet { opacity: 1; } }
.cay-grab { display: block; width: 44px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: #DCCDAE; }
.cay-x { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(14, 34, 51, .06); color: #26394A; font: 400 26px/1 system-ui; cursor: pointer; }
.cay-x:hover { background: rgba(14, 34, 51, .12); }
.cay-sh-head { display: flex; align-items: center; gap: 16px; padding: 6px 44px 14px 2px; }
.cay-sh-head h2 { margin: 0 0 4px; font: 400 23px/1.1 var(--ci-disp); color: var(--ci-ink); letter-spacing: .005em; }
.cay-sh-head p { margin: 0; color: #546575; font-size: 14px; }
.cay-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cay-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 #EDE2CC, 0 10px 20px -14px rgba(70, 48, 10, .35);
  opacity: 0; transform: translateY(14px); }
.cay-sheet-wrap.open .cay-steps li { animation: cs-in .5s cubic-bezier(.22, 1.2, .36, 1) both; animation-delay: calc(.12s + var(--i) * .11s); }
@keyframes cs-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cs-ic { position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff;
  background: linear-gradient(180deg, #3FDCE6, #0A8A98); box-shadow: 0 3px 0 #05616B, inset 0 1px 0 rgba(255, 255, 255, .6); }
.cs-ic svg { width: 26px; height: 26px; }
.cay-sheet-wrap.open .cay-steps li:first-child .cs-ic svg { animation: cs-tap 1.8s ease-in-out .9s infinite; }
@keyframes cs-tap { 0%, 55%, 100% { transform: none; } 20% { transform: translateY(-3px) scale(1.08); } 35% { transform: scale(.94); } }
.cs-ic em { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font: 800 11.5px/20px var(--ci-ui); font-style: normal; text-align: center; color: #5A3300;
  background: linear-gradient(180deg, #FFE58A, #FFC531); box-shadow: 0 2px 0 #C27400; }
.cs-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-tx b { font-weight: 600; font-size: 15.5px; color: var(--ci-ink); }
.cs-tx b b { font-weight: 800; }
.cs-tx small { font-size: 13px; color: #546575; }
.cay-sh-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cay-btn { flex: 1 1 auto; min-height: 50px; padding: 0 18px; border: 0; border-radius: 16px; cursor: pointer; font: 700 16px/1 var(--ci-ui); transition: transform .1s ease, box-shadow .1s ease; }
.cay-btn.gold { flex-basis: 60%; color: #4A2A00; background: linear-gradient(180deg, #FFE58A, #FFC531 55%, #FFAA00); box-shadow: 0 4px 0 #C27400, inset 0 1px 0 rgba(255, 255, 255, .7); font: 400 19px/1 var(--ci-disp); letter-spacing: .02em; }
.cay-btn.sea { color: #fff; background: linear-gradient(180deg, #2CC4D2, #0A8A98); box-shadow: 0 4px 0 #05616B, inset 0 1px 0 rgba(255, 255, 255, .5); }
.cay-btn.ghost { flex: 0 1 auto; color: #546575; background: transparent; font-weight: 600; font-size: 14px; }
.cay-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #C27400; }
.cay-btn.ghost:active, .cay-btn.sea:active { box-shadow: none; }
.cay-btn:focus-visible, .cay-x:focus-visible { outline: 3px solid #0A8A98; outline-offset: 2px; }
/* iPhone Safari: a bouncing pointer toward the Share button in the bottom toolbar */
.cay-sheet-wrap.has-arrow .cay-sheet { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
.cay-point { position: absolute; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 2; width: 48px; height: 48px; margin-left: -24px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: linear-gradient(180deg, #3FDCE6, #0A8A98); box-shadow: 0 4px 0 #05616B, 0 10px 18px -6px rgba(0, 50, 60, .6); opacity: 0; transition: opacity .3s ease .5s; }
.cay-point span { display: grid; } .cay-point svg { width: 26px; height: 26px; }
.cay-point::after { content: ""; position: absolute; bottom: -9px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #0A8A98; }
.cay-sheet-wrap.open .cay-point { opacity: 1; animation: cp-bounce 1.4s ease-in-out .6s infinite; }
@keyframes cp-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

@media (max-width: 400px) {
  .cay-inst { gap: 10px; }
  .ci-tx b { font-size: 20px; }
  .ci-tile { width: 46px; height: 46px; }
  .cay-sheet { padding-left: 16px; padding-right: 16px; }
  .cay-sh-head h2 { font-size: 21px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cay-sheet { max-width: 620px; padding-top: 8px; }
  .cay-sh-head { padding-bottom: 8px; } .ci-tile.lg { width: 48px; height: 48px; border-radius: 14px; }
  .cay-steps { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cay-steps li { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; }
  .cay-sh-act { margin-top: 10px; }
  .cay-sheet-wrap.has-arrow .cay-sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .cay-point { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cay-inst::after, .ci-go svg, .cay-point, .cs-ic svg { animation: none !important; }
  .cay-sheet, .cay-sheet-bg { transition-duration: .01s; }
  .cay-steps li { animation: none !important; opacity: 1; transform: none; }
}
