:root {
  color-scheme: dark;
  --kg-progress: 6%;
}

html {
  width: 100%;
  height: 100%;
  -ms-touch-action: none;
  background: #080315;
}

body,
canvas,
div,
section {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  cursor: default;
  color: #f7f0df;
  background: #080315;
  text-align: center;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    Helvetica, Arial, sans-serif;
}

#Cocos2dGameContainer {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
}

canvas {
  background: #080315;
}

#splash {
  position: fixed;
  z-index: 2147483000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block !important;
  overflow: hidden;
  opacity: 1;
  background-color: #080315;
  isolation: isolate;
  transition: opacity 240ms ease;
}

.kg-startup-backdrop,
.kg-startup-backdrop img {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.kg-startup-backdrop img {
  object-fit: cover;
}

#splash::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 31%, rgba(178, 79, 221, 0.10), transparent 30%),
    radial-gradient(circle at 50% 66%, rgba(74, 25, 118, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(7, 2, 22, 0.84) 0%, rgba(10, 3, 30, 0.87) 48%, rgba(5, 1, 18, 0.95) 100%);
}

#splash.kg-splash--exiting {
  opacity: 0;
  pointer-events: none;
}

#splash.kg-splash--hidden {
  display: none !important;
}

.kg-stage {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

.kg-stage--health {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 180ms ease,
    transform 240ms ease;
}

.kg-stage--brand {
  transition:
    opacity 320ms ease 180ms,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1) 180ms;
}

#splash.kg-splash--brand .kg-stage--health {
  opacity: 0;
  transform: scale(0.985);
}

#splash.kg-splash--brand .kg-stage--brand {
  opacity: 1;
  transform: scale(1);
}

.kg-health-card {
  position: absolute;
  top: 20.8vh;
  top: clamp(102px, 20.8vh, 228px);
  left: 50%;
  box-sizing: border-box;
  width: 88vw;
  max-width: 560px;
  width: min(88vw, 560px);
  transform: translateX(-50%);
}

.kg-health-icon {
  display: block;
  width: 40vw;
  min-width: 142px;
  max-width: 200px;
  width: clamp(142px, 40vw, 200px);
  height: auto;
  margin: 0 auto 3.5vh;
  margin: 0 auto clamp(24px, 3.5vh, 38px);
  filter: drop-shadow(0 0 18px rgba(236, 194, 87, 0.18));
}

.kg-health-icon img {
  display: block;
  width: 100%;
  height: auto;
}

.kg-health-title {
  margin: 0;
  color: #f1ce75;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 8vw;
  font-size: clamp(29px, 8vw, 45px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.08em;
  text-shadow:
    0 1px 0 rgba(255, 248, 205, 0.42),
    0 4px 16px rgba(218, 159, 54, 0.24);
}

.kg-health-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72vw;
  max-width: 420px;
  width: min(72vw, 420px);
  margin: 1.8vh auto 3.2vh;
  margin: clamp(13px, 1.8vh, 20px) auto clamp(22px, 3.2vh, 35px);
  color: rgba(232, 190, 92, 0.72);
  font-size: 8px;
  gap: 9px;
}

.kg-health-rule::before,
.kg-health-rule::after {
  width: 20vw;
  max-width: 104px;
  width: min(20vw, 104px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(232, 190, 92, 0.78));
}

.kg-health-rule::after {
  transform: scaleX(-1);
}

.kg-copy-viewport {
  position: relative;
  height: 10.5vh;
  height: clamp(68px, 10.5vh, 96px);
}

.kg-copy-group {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 340ms ease,
    transform 400ms ease;
}

.kg-copy-group:first-child,
#splash.kg-copy--second .kg-copy-group:last-child {
  opacity: 1;
  transform: translateY(0);
}

#splash.kg-copy--second .kg-copy-group:first-child {
  opacity: 0;
  transform: translateY(-7px);
}

.kg-copy-line {
  margin: 0;
  color: #f8f2e8;
  font-size: 4.6vw;
  font-size: clamp(17px, 4.6vw, 24px);
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.045em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

html[lang^="fr"] .kg-health-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 6.7vw;
  font-size: clamp(25px, 6.7vw, 39px);
  letter-spacing: 0.025em;
}

html[lang^="fr"] .kg-copy-line {
  font-size: 3.9vw;
  font-size: clamp(15px, 3.9vw, 21px);
  line-height: 1.52;
  letter-spacing: 0.005em;
}

.kg-brand-card {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 76vw;
  max-width: 420px;
  width: min(76vw, 420px);
  transform: translate(-50%, -50%);
}

.kg-brand-logo {
  display: block;
  width: 58vw;
  min-width: 200px;
  max-width: 330px;
  width: clamp(200px, 58vw, 330px);
  height: auto;
  margin: 0 auto;
  filter:
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36))
    drop-shadow(0 0 24px rgba(240, 173, 42, 0.15));
}

.kg-brand-logo img {
  display: block;
  width: 100%;
  height: auto;
}

#splash.kg-splash--brand .kg-brand-logo {
  animation: kg-brand-arrive 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kg-progress-shell {
  position: absolute;
  z-index: 4;
  top: 78.2%;
  left: 50%;
  box-sizing: border-box;
  width: 66vw;
  max-width: 430px;
  width: min(66vw, 430px);
  transform: translateX(-50%);
}

.progress-bar {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 9px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid rgba(197, 139, 228, 0.48);
  border-radius: 999px;
  background: rgba(19, 7, 39, 0.70);
  box-shadow:
    inset 0 1px 5px rgba(0, 0, 0, 0.72),
    0 0 10px rgba(132, 57, 180, 0.12);
}

.progress-bar span {
  position: relative;
  display: block;
  width: var(--kg-progress) !important;
  min-width: 7px;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #d89c17 0%, #f5c343 55%, #ffe27b 100%);
  box-shadow:
    0 0 8px rgba(247, 193, 57, 0.64),
    0 0 16px rgba(247, 193, 57, 0.28);
  transition: width 260ms ease-out;
}

.progress-bar span::after {
  position: absolute;
  top: -3px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  content: "";
  background: #ffe99c;
  box-shadow: 0 0 12px 3px rgba(255, 218, 98, 0.60);
}

.progress-bar::after {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: -30%;
  width: 24%;
  content: "";
  opacity: 0.32;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  animation: kg-progress-shimmer 1.8s ease-in-out infinite;
}

.kg-progress-label {
  margin: 17px 0 0;
  color: rgba(230, 211, 236, 0.72);
  font-size: 3.4vw;
  font-size: clamp(12px, 3.4vw, 17px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.kg-retry {
  display: none;
  box-sizing: border-box;
  min-height: 44px;
  margin: 14px auto 0;
  padding: 10px 18px;
  border: 1px solid rgba(235, 198, 102, 0.55);
  border-radius: 999px;
  color: #edd078;
  background: rgba(18, 7, 39, 0.55);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

#splash.kg-splash--retry .kg-retry {
  display: block;
}

@keyframes kg-brand-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes kg-progress-shimmer {
  0%,
  18% {
    left: -30%;
  }

  72%,
  100% {
    left: 112%;
  }
}

@media (max-height: 700px) {
  .kg-health-card {
    top: 12vh;
    top: clamp(58px, 12vh, 92px);
  }

  .kg-health-icon {
    width: 25vw;
    min-width: 86px;
    max-width: 126px;
    width: clamp(86px, 25vw, 126px);
    margin-bottom: 15px;
  }

  .kg-health-rule {
    margin-top: 9px;
    margin-bottom: 13px;
  }

  .kg-copy-viewport {
    height: 64px;
  }

  .kg-progress-shell {
    top: 80.5%;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .kg-health-card {
    top: 46%;
    display: grid;
    grid-template-columns: 132px minmax(310px, 1fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    width: 82vw;
    max-width: 720px;
    width: min(82vw, 720px);
    transform: translate(-50%, -50%);
    column-gap: 34px;
  }

  .kg-health-icon {
    grid-row: 1 / 4;
    width: 126px;
    margin: 0;
  }

  .kg-health-title,
  .kg-health-rule,
  .kg-copy-viewport {
    grid-column: 2;
  }

  .kg-health-title {
    font-size: 31px;
  }

  .kg-health-rule {
    margin: 8px auto 12px;
  }

  .kg-copy-line {
    font-size: 16px;
    line-height: 1.5;
  }

  .kg-brand-card {
    top: 42%;
  }

  .kg-brand-logo {
    width: 210px;
  }

  .kg-progress-shell {
    top: auto;
    bottom: 8%;
    bottom: max(8%, env(safe-area-inset-bottom));
    width: 46vw;
    max-width: 390px;
    width: min(46vw, 390px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #splash,
  .kg-stage,
  .kg-copy-group,
  .progress-bar span {
    transition-duration: 80ms;
  }

  .progress-bar::after,
  #splash.kg-splash--brand .kg-brand-logo {
    animation: none;
  }
}
