/* Shared by Telegram entry and authenticated shell, before game readiness. */
/* The card has a fixed size: status, retry and labels reserve their own space. */

/* Screen: light sky-to-peach backdrop with soft cloud shapes (pure CSS, no image files). */
html .splash-screen.fd-boot {
  position: fixed; inset: 0; z-index: 10000; display: grid; grid-template-columns: minmax(0, 1fr);
  place-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; overflow: auto; color: #352719;
  background:
    radial-gradient(ellipse 120px 34px at 16% 18%, #ffffffc0 70%, #fff0 72%),
    radial-gradient(ellipse 160px 44px at 86% 30%, #ffffff99 70%, #fff0 72%),
    radial-gradient(ellipse 140px 38px at 22% 84%, #ffffff8c 70%, #fff0 72%),
    radial-gradient(circle at 50% 40%, #fff7e0 0, #fff7e000 60%),
    linear-gradient(#bfe6ff, #dff1ff 45%, #ffe9d6);
  font-family: Nunito, system-ui, sans-serif; text-align: center;
  backdrop-filter: none; transform: none; transition: opacity 250ms ease;
}
html .fd-boot::before, html .fd-boot::after { display: none; }

/* Card: fixed 340px height so no state (step text, error, retry, progress) changes its size. */
.fd-boot-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  width: min(100%, 320px); height: 340px; margin-top: 64px; padding: 76px 22px 20px; box-sizing: border-box;
  border: 2px solid #edcba6; border-radius: 28px; background: linear-gradient(#fffdf8, #fff3e3);
  box-shadow: inset 0 1px 0 #fff, 0 16px 36px #8856272e, 0 3px 8px #8856271a; overflow: visible;
}
.fd-boot-card::before {
  content: ""; position: absolute; top: -58px; left: 50%; width: 132px; height: 132px; margin-left: -66px;
  border-radius: 50%; background: radial-gradient(circle, #ffe39a 0, #ffe39a80 45%, #ffe39a00 70%); pointer-events: none;
}

/* Doge: centred with margin, so transform stays free for the float animation. */
.fd-boot-doge {
  position: absolute; top: -64px; left: 50%; width: 128px; height: 128px; margin: 0 0 0 -64px; object-fit: contain;
  filter: drop-shadow(0 8px 10px #8856273d); animation: fd-boot-float 3.2s ease-in-out infinite; z-index: 1;
}
@keyframes fd-boot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fd-boot-doge { animation: none; }
}

html .fd-boot .splash-title {
  margin: 0; max-width: 100%; font-size: 32px; line-height: 38px; height: 38px; font-weight: 900; letter-spacing: 0;
  text-transform: none; color: #352719; background: none; -webkit-text-fill-color: currentColor; text-shadow: 0 2px 0 #ffe2b0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html .fd-boot .splash-tagline {
  margin: 2px 0 0; max-width: 100%; height: 20px; font-size: 13px; line-height: 20px; font-weight: 800; letter-spacing: .04em;
  color: #b07a3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html .fd-boot .splash-tip { margin: 10px 0; color: #785b44; font-size: 14px; line-height: 1.5; }

/* Status: always two lines of reserved height; longer text is clamped, never resizes the card. */
html .fd-boot .splash-subtitle {
  margin: 16px 0 0; width: 100%; height: 40px; font-size: 14px; line-height: 20px; font-weight: 600; color: #785b44;
  letter-spacing: 0; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}

html .fd-boot .splash-progress {
  width: 100%; height: 12px; margin: 14px 0 6px; padding: 2px; box-sizing: border-box; overflow: hidden; flex: none;
  border: 1px solid #edcba6; border-radius: 999px; background: #fff1dc; box-shadow: inset 0 1px 2px #8856271f;
}
/* No CSS width transition: the script animates the width itself. */
html .fd-boot .splash-progress-bar {
  height: 100%; width: 5%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg, #f9d77a, #f2a93b);
  box-shadow: inset 0 1px 0 #ffffff80; transition: none;
}
html .fd-boot .splash-progress-label {
  margin: 0; width: 100%; height: 18px; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0;
  color: #785b44; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Retry: hidden state keeps its box (visibility, not display) so revealing it does not resize the card. */
.fd-boot button {
  min-height: 44px; height: 44px; flex: none; margin-top: auto; padding: 0 24px; border: 1px solid #a87939; border-radius: 16px;
  background: #f6c453; color: #352719; font: inherit; font-weight: 800; box-shadow: 0 3px 0 #a87939; cursor: pointer;
}
html .fd-boot #splash-retry[hidden] { display: block; visibility: hidden; }

/* Error state: selectors beat the generic .splash-screen.splash-error rules in style.css. */
html .splash-screen.fd-boot.splash-error .splash-subtitle { color: #b3261e; font-weight: 700; }
html .splash-screen.fd-boot.splash-error .splash-progress-bar { background: #e8836f; }
html .splash-screen.fd-boot.splash-error .splash-progress-label { color: #b3261e; }

html .fd-boot.splash-hidden { opacity: 0; pointer-events: none; }

/* VPN/proxy guard (flydoge_proxy_guard.php): same sky and card, sized by its steps, above modals and toasts mid-session. */
html .splash-screen.fd-guard { z-index: 1000040; }
html .fd-guard .fd-boot-card { width: min(100%, 340px); height: auto; padding: 72px 20px 18px; }
.fd-guard-badge {
  position: absolute; top: 22px; left: 50%; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 24px;
  border: 3px solid #fffdf8; border-radius: 50%; background: #e8836f; color: #fff; box-shadow: 0 3px 8px #8856273d;
}
.fd-guard-badge .game-ui-icon { width: 22px; height: 22px; }
html .fd-guard .splash-title {
  height: auto; font-size: 24px; line-height: 30px; white-space: normal; overflow: visible; overflow-wrap: anywhere;
}
.fd-guard-message { margin: 8px 0 0; font-size: 14px; line-height: 20px; font-weight: 600; color: #785b44; overflow-wrap: anywhere; }
.fd-guard-steps {
  display: grid; gap: 10px; width: 100%; margin: 16px 0 0; padding: 12px 14px; box-sizing: border-box; list-style: none;
  counter-reset: fd-guard-step; border: 1px solid #f1d9bd; border-radius: 18px; background: #fff8ee; text-align: start;
}
.fd-guard-steps li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; counter-increment: fd-guard-step;
  font-size: 14px; line-height: 19px; font-weight: 700; color: #4a3826; overflow-wrap: anywhere;
}
.fd-guard-steps li::before {
  content: counter(fd-guard-step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #f6c453; color: #352719; font-size: 13px; font-weight: 900; box-shadow: 0 2px 0 #a87939;
}
.fd-guard-status {
  width: 100%; margin: 12px 0 0; padding: 8px 12px; box-sizing: border-box; border-radius: 12px;
  background: #fde8e3; color: #b3261e; font-size: 13px; line-height: 18px; font-weight: 700;
}
.fd-guard-status[hidden] { display: none; }
html .fd-guard button.fd-guard-retry { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; }
.fd-guard-retry .game-ui-icon { width: 18px; height: 18px; flex: none; }
.fd-guard-retry.is-loading .game-ui-icon { animation: fd-guard-spin 900ms linear infinite; }
.fd-guard-retry:disabled { opacity: .75; cursor: progress; }
@keyframes fd-guard-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .fd-guard-retry.is-loading .game-ui-icon { animation: none; }
}
.fd-guard-safe {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0;
  font-size: 12px; line-height: 16px; font-weight: 700; color: #3f7d61;
}
.fd-guard-safe .game-ui-icon { width: 16px; height: 16px; flex: none; }
