html {
  -ms-touch-action: none;
}

body, canvas, div {
  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;
  -khtml-user-select: none;
}

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

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #1e2a25;
  background-color: #eaf5ef;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#Cocos2dGameContainer {
  position: absolute;
  margin: 0;
  left: 0;
  top: 0;

  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

a:link, a:visited,
a:active, a:hover {
  color: #586a61;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #58b755 0%, #8ecb47 52%, #4d9b35 100%);
}

.launch-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  user-select: none;
}

#splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 68%, rgba(255, 244, 180, .18), rgba(255, 244, 180, 0) 34%),
              linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(24, 78, 35, .12));
  pointer-events: none;
}

.launch-loader {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(8vh + env(safe-area-inset-bottom));
  width: 104px;
  height: 104px;
  transform: translateX(-50%);
}

.progress-bar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.progress-bar span {
  display: block;
  height: 100%;
}

.launch-loader__ring {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 206, .96) 0%, rgba(255, 239, 151, .92) 50%, rgba(255, 188, 50, .84) 100%);
  box-shadow: 0 0 22px rgba(255, 221, 89, .9),
              0 0 46px rgba(255, 186, 29, .62),
              0 8px 24px rgba(71, 44, 9, .28),
              inset 0 2px 8px rgba(255, 255, 255, .82);
  animation: launch-loader-glow 1.5s ease-in-out infinite;
}

.launch-loader__ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.launch-loader__track,
.launch-loader__progress {
  fill: none;
  stroke-width: 9;
}

.launch-loader__track {
  stroke: rgba(131, 86, 20, .22);
}

.launch-loader__progress {
  stroke: #fff7b8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 255, 205, .95));
  transition: stroke-dashoffset .32s ease-out;
}

.launch-loader__percent {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #8f4f00;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .72);
}

.platform-loading {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(16, 26, 21, .62);
}

.platform-loading.is-visible {
  display: flex;
}

.platform-loading__spinner {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff7b8;
  border-radius: 50%;
  animation: platform-loading-spin .8s linear infinite;
}

.platform-loading__text {
  margin-top: 14px;
  color: #fff7b8;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .5);
}

@keyframes platform-loading-spin {
  to { transform: rotate(360deg); }
}

.platform-actions {
  position: absolute;
  z-index: 1000;
  top: calc(env(safe-area-inset-top) + 58px);
  left: 39%;
  display: none;
  gap: 5px;
  width: min(36vw, 238px);
  transform: translateX(-50%);
}

.platform-actions.is-visible {
  display: flex;
}

.platform-actions__button,
.purchase-dialog__button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #fffdf4;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(75, 54, 10, .3);
}

.platform-actions__button {
  flex: 1;
  min-height: 30px;
  padding: 4px 3px;
  box-shadow: 0 2px 0 rgba(78, 58, 17, .38), 0 4px 8px rgba(57, 66, 32, .2);
  font-size: 11px;
}

.platform-actions__button--ad {
  background: linear-gradient(180deg, #f6ae35, #d97d10);
}

.platform-actions__button--buy,
.purchase-dialog__button--confirm {
  background: linear-gradient(180deg, #5fae58, #2d8136);
}

.platform-actions__button:disabled {
  opacity: .65;
}

.purchase-dialog {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 29, 20, .58);
}

.purchase-dialog.is-visible {
  display: flex;
}

.purchase-dialog__panel {
  box-sizing: border-box;
  width: min(86vw, 340px);
  padding: 22px;
  border: 1px solid rgba(255, 248, 191, .9);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9dc, #f7d887);
  box-shadow: 0 14px 42px rgba(23, 36, 20, .36);
}

.purchase-dialog__title {
  color: #67410b;
  font-size: 22px;
  font-weight: 800;
}

.purchase-dialog__body {
  margin-top: 10px;
  color: #705522;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.purchase-dialog__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.purchase-dialog__button {
  flex: 1;
}

.purchase-dialog__button--cancel {
  color: #654e23;
  background: #e5d3a0;
}

.platform-message {
  position: absolute;
  z-index: 1200;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 34px);
  max-width: min(86vw, 360px);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fffdf0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  background: rgba(31, 53, 33, .9);
  box-shadow: 0 6px 20px rgba(11, 26, 14, .26);
  transition: opacity .18s ease, transform .18s ease;
}

.platform-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes launch-loader-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 22px rgba(255, 221, 89, .9),
                0 0 46px rgba(255, 186, 29, .62),
                0 8px 24px rgba(71, 44, 9, .28),
                inset 0 2px 8px rgba(255, 255, 255, .82);
  }
  50% {
    transform: scale(1.045);
    box-shadow: 0 0 30px rgba(255, 237, 129, 1),
                0 0 64px rgba(255, 193, 42, .8),
                0 8px 24px rgba(71, 44, 9, .28),
                inset 0 2px 10px rgba(255, 255, 255, .94);
  }
}

@media (max-height: 420px) {
  .launch-loader {
    bottom: calc(5vh + env(safe-area-inset-bottom));
    transform: translateX(-50%) scale(.82);
  }
}
