@font-face {
  font-family: "Noto Sans SC Local";
  src: url("./assets/NotoSansCJKsc-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Noto Sans SC Local", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: #303745;
  background: #dfe4ea;
  --blue: #288bea;
  --blue-dark: #176fca;
  --orange: #ff8a1f;
  --red: #dd1c0d;
  --muted: #9ca3ad;
  --line: #e7ebf0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  background: #dfe4ea;
  overflow-x: hidden;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100vw, 390px);
  min-height: 100dvh;
  padding-bottom: calc(50px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: #f5f7fa;
  box-shadow: 0 0 28px rgba(31, 41, 55, .16);
}

.crop {
  display: block;
  width: 100%;
  height: 100%;
}

.promo {
  position: relative;
  height: clamp(138px, 38.8vw, 151px);
  overflow: hidden;
  background: #1763a9;
  transition: height .24s ease, opacity .24s ease;
}

.promo.closed {
  height: 0;
  opacity: 0;
}

.promo-download {
  position: absolute;
  top: 10px;
  right: 38px;
  width: 78px;
  height: 27px;
  border-radius: 15px;
  color: #0574d5;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
}

.promo-close {
  position: absolute;
  top: 11px;
  right: 8px;
  color: #60758a;
  background: rgba(255, 255, 255, .94);
  font-size: 24px;
  line-height: 1;
}

.account-bar {
  display: flex;
  height: 80px;
  padding: 7px 8px 5px 15px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.account-main {
  flex: 1;
  min-width: 0;
}

.username {
  display: block;
  height: 20px;
  font-size: 14px;
  font-weight: 400;
}

.vip-pill {
  display: flex;
  align-items: center;
  width: 87px;
  height: 23px;
  padding: 0 5px;
  border: 1px solid #1f8fff;
  border-radius: 12px;
  color: #087be8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.vip-gem {
  margin-right: 3px;
  color: #ff8b23;
  font-size: 16px;
}

.balance {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  color: #3d5269;
  font-size: 16px;
}

.balance-mark {
  color: #708498;
  font-size: 20px;
}

.account-actions {
  display: flex;
  align-items: flex-start;
  height: 100%;
}

.account-actions > button:not(.wheel-button) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 58px;
  color: #adb4be;
  font-size: 13px;
}

.account-actions svg {
  width: 29px;
  height: 29px;
  color: #4ca6ef;
  stroke-width: 1.7;
}

.wheel-button {
  position: relative;
  width: 61px;
  height: 73px;
}

.wheel,
.modal-wheel {
  position: relative;
  display: block;
  border: 7px solid #ffbc3e;
  border-radius: 50%;
  background: conic-gradient(#e94827 0 45deg, #fff4d5 45deg 90deg, #e94827 90deg 135deg, #fff4d5 135deg 180deg, #e94827 180deg 225deg, #fff4d5 225deg 270deg, #e94827 270deg 315deg, #fff4d5 315deg);
  box-shadow: 0 2px 4px rgba(76, 55, 17, .22);
}

.wheel {
  width: 57px;
  height: 57px;
}

.wheel::after,
.modal-wheel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 4px solid #ffc44f;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.wheel-button b {
  position: absolute;
  right: -1px;
  bottom: 1px;
  min-width: 58px;
  padding: 2px 3px;
  border-radius: 9px;
  color: #fff;
  background: #e44825;
  font-size: 12px;
  white-space: nowrap;
}

.product-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 43px;
  padding-right: 26px;
  border-bottom: 1px solid #eef1f4;
  background: #fff;
}

.product-tabs > button:not(.tab-close) {
  position: relative;
  color: #334054;
  font-size: 14px;
}

.product-tabs > button.active {
  color: #1686eb;
}

.product-tabs > button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #2994f2;
}

.tab-close {
  position: absolute;
  top: 9px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #c3cad2;
  background: #f0f3f6;
  font-size: 20px;
  line-height: 20px;
}

.lottery-ticker {
  position: relative;
  display: block;
  width: 100%;
  height: 40px;
  overflow: hidden;
  border-bottom: 1px solid #f2e2ce;
  background: #fff8ef;
}

.ticker-arrow {
  position: absolute;
  top: 6px;
  right: 63px;
  color: #76818d;
  font-size: 28px;
  line-height: 24px;
}

.game-area {
  display: flex;
  min-height: 332px;
  background: #fff;
}

.game-types {
  flex: 0 0 53px;
  padding-top: 3px;
  background: #fafbfc;
}

.game-types button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 53px;
  height: 51px;
  color: #abb0b7;
  font-size: 14px;
}

.game-types button.active {
  color: #3299ef;
  background: #eef7ff;
}

.game-types svg {
  width: 27px;
  height: 27px;
  padding: 4px;
  border-radius: 7px;
  color: #52aaee;
  background: #d9efff;
}

.games-panel {
  flex: 1;
  min-width: 0;
  padding: 0 15px 14px 0;
}

.section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 11px;
  height: 31px;
  color: #afb3b8;
  font-size: 14px;
  font-weight: 400;
}

.section-title span {
  height: 1px;
  background: linear-gradient(90deg, transparent, #edd8bd);
}

.section-title span:last-child {
  background: linear-gradient(90deg, #edd8bd, transparent);
}

.section-title b {
  font-weight: 400;
}

.section-title.secondary {
  height: 32px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 13px;
}

.game-grid.lower {
  padding-bottom: 2px;
}

.game-card {
  aspect-ratio: 153 / 78;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #eef6ff;
  box-shadow: 0 1px 2px rgba(29, 84, 130, .06);
}

.game-card:active {
  transform: scale(.98);
}

.service-tab {
  position: fixed;
  z-index: 6;
  top: 307px;
  left: calc(50% + min(50vw, 195px) - 27px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 83px;
  padding: 5px 5px;
  border-radius: 4px 0 0 4px;
  color: #fff;
  background: #087fe0;
  font-size: 13px;
  line-height: 17px;
  writing-mode: vertical-rl;
}

.service-tab svg {
  width: 15px;
  height: 15px;
}

.red-packet {
  position: fixed;
  z-index: 5;
  top: 448px;
  left: calc(50% + min(50vw, 195px) - 81px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 73px;
  height: 111px;
  padding-top: 10px;
  border-radius: 13px 13px 18px 18px;
  color: #fff;
  background: linear-gradient(#ff4929 0 19px, #df1007 19px 100%);
  box-shadow: 0 3px 10px rgba(164, 16, 4, .25);
}

.packet-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 3px;
  border-radius: 50%;
  color: #f1721f;
  background: radial-gradient(circle at 44% 35%, #fff9d4, #ffbf5a);
  font-size: 31px;
  font-weight: 700;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .45);
}

.red-packet b,
.red-packet time {
  font-size: 12px;
  line-height: 18px;
}

.bottom-nav {
  position: fixed;
  z-index: 8;
  right: max(0px, calc((100vw - 390px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 390px) / 2));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(50px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #e3e7eb;
  background: rgba(255, 255, 255, .98);
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  color: #929aa7;
  font-size: 12px;
}

.bottom-nav button.active {
  color: #178de9;
}

.bottom-nav svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 29, 40, .54);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(310px, 90vw);
  padding: 27px 26px 25px;
  border-radius: 8px;
  text-align: center;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #707984;
  background: #f0f2f5;
  font-size: 21px;
}

.modal-wheel {
  width: 104px;
  height: 104px;
  margin: 0 auto 16px;
  border-width: 10px;
}

.modal-card h2 {
  margin: 0 0 7px;
  color: #232a35;
  font-size: 21px;
}

.modal-card p {
  margin: 0 0 20px;
  color: #727b87;
  font-size: 14px;
}

.modal-card p b {
  color: var(--orange);
}

.primary-button {
  width: 100%;
  height: 42px;
  border-radius: 5px;
  color: #fff;
  background: #1689e8;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 30;
  bottom: 70px;
  left: 50%;
  max-width: min(320px, 80vw);
  padding: 9px 14px;
  border-radius: 5px;
  color: #fff;
  background: rgba(28, 34, 42, .88);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 350px) {
  .account-main {
    flex-basis: 115px;
  }

  .account-actions > button:not(.wheel-button) {
    width: 42px;
  }

  .game-grid {
    gap: 8px;
  }
}

@media (min-height: 760px) {
  .game-area {
    min-height: 390px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
