:root {
  --bg: #041226;
  --navy: #061a38;
  --navy2: #092a5f;
  --panel: #082452;
  --panel2: #0b316b;
  --gold: #f4c84d;
  --gold2: #b77b18;
  --gold3: #ffe680;
  --sand: #f4dc98;
  --paper: #f3d894;
  --paper2: #d8a958;
  --ink: #2f2109;
  --text: #fff0b8;
  --muted: #c9d5e8;
  --green: #62c960;
  --red: #d9665c;
  --blue: #4aa4ff;
  --purple: #b05cff;
  --orange: #ee9d31;
  --shadow: 0 12px 30px rgba(0, 0, 0, .42);
  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --nav-height: 76px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%
}

body {
  font-family: var(--font);
  background: #041226;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden
}

a {
  text-decoration: none;
  color: inherit
}

button,
input,
select {
  font-family: inherit
}

button {
  cursor: pointer
}

.bgk-page {
  min-height: 100dvh;
  position: relative;
  background:
    linear-gradient(180deg, rgba(4, 18, 40, .04), rgba(4, 13, 29, .70) 46%, rgba(4, 13, 29, .96)),
    url('../assets/sliced/hero/hero-bg-top.png') center top/cover no-repeat,
    #041226;
  overflow-x: hidden;
}

.bgk-page::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 245px;
  background: url('../assets/sliced/hero/palace-bottom.png') center bottom/cover no-repeat;
  opacity: .46;
  pointer-events: none;
  z-index: 0;
}

.bgk-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 18px 28px
}

.has-nav {
  padding-bottom: calc(var(--nav-height) + 22px)
}

.bgk-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px
}

.bgk-top-left {
  display: flex;
  align-items: center;
  gap: 10px
}

.bgk-back,
.bgk-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(244, 200, 77, .72);
  background: rgba(3, 16, 36, .76);
  color: var(--gold3);
  display: grid;
  place-items: center;
  font-size: 25px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25)
}

.bgk-title {
  font-size: 23px;
  font-weight: 900;
  color: var(--gold3);
  letter-spacing: .06em;
  text-shadow: 0 2px 0 #4a2d09
}

.bgk-logo {
  width: 250px;
  height: 138px;
  margin: 0 auto 8px;
  background: url('../assets/sliced/hero/logo-full.png') center/contain no-repeat
}

.bgk-logo.compact {
  width: 210px;
  height: 105px;
  margin-top: 4px;
  margin-bottom: 0
}

.bgk-panel {
  border: 2px solid rgba(244, 200, 77, .58);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(8, 38, 84, .88), rgba(5, 25, 56, .94));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .06);
  margin-bottom: 14px;
  overflow: hidden;
}

.bgk-panel-inner {
  padding: 16px
}

.bgk-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 8px 18px;
  margin: 0 0 12px;
  border-radius: 4px 4px 10px 10px;
  border: 1px solid rgba(244, 200, 77, .8);
  background: linear-gradient(180deg, #1e72a8, #0c3a68);
  color: #fff6bb;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .24);
}

.bgk-ribbon.green {
  background: linear-gradient(180deg, #1d7a4d, #0a4a30)
}

.bgk-ribbon.purple {
  background: linear-gradient(180deg, #8d2bb5, #4b1a71)
}

.bgk-ribbon.red {
  background: linear-gradient(180deg, #bd3e35, #72201b)
}

.bgk-ribbon.gold {
  background: linear-gradient(180deg, #ffe377, #c48720);
  color: #352309
}

.bgk-label {
  display: block;
  color: var(--gold3);
  font-weight: 900;
  font-size: 14px;
  margin: 14px 0 8px
}

.bgk-input,
.bgk-select {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 2px solid rgba(159, 122, 46, .86);
  background: rgba(2, 13, 30, .74);
  color: #fff;
  padding: 0 16px;
  font-size: 18px;
  outline: none;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .35)
}

.bgk-input:focus,
.bgk-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 200, 77, .16)
}

.bgk-input-wrap {
  position: relative
}

.bgk-input-wrap .ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--gold3)
}

.bgk-input-wrap .bgk-input {
  padding-left: 50px
}

.bgk-eye {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--gold3);
  font-size: 20px
}

.bgk-btn {
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe377 0%, #e3b234 58%, #9f6415 100%);
  color: #392608;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 6px 0 #71450c, 0 9px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .45)
}

.bgk-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 #71450c, 0 6px 12px rgba(0, 0, 0, .25)
}

.bgk-btn.full {
  width: 100%
}

.bgk-btn.small {
  min-height: 38px;
  font-size: 14px;
  border-radius: 11px;
  padding: 0 14px
}

.bgk-btn.secondary {
  background: rgba(6, 31, 70, .85);
  color: var(--gold3);
  border: 1px solid rgba(244, 200, 77, .55);
  box-shadow: none
}

.bgk-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .16);
  font-size: 15px
}

.bgk-stat-row:last-child {
  border-bottom: 0
}

.bgk-stat-row strong {
  color: var(--gold3)
}

.bgk-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px
}

.bgk-mini-card {
  border: 1px solid rgba(244, 200, 77, .38);
  border-radius: 16px;
  background: rgba(6, 31, 70, .78);
  padding: 13px;
  text-align: center
}

.bgk-mini-card .num {
  font-size: 25px;
  font-weight: 900;
  color: var(--gold3)
}

.bgk-mini-card .cap {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px
}

.bgk-alert {
  border: 2px solid rgba(244, 200, 77, .42);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(5, 24, 54, .84);
  color: #dce5f5;
  line-height: 1.7;
  font-size: 14px
}

.bgk-alert.warn {
  border-color: rgba(238, 157, 49, .55);
  background: rgba(60, 32, 8, .65);
  color: #ffd493
}

.bgk-alert.good {
  border-color: rgba(98, 201, 96, .55);
  background: rgba(11, 63, 36, .48);
  color: #c8ffd2
}

.bgk-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 20;
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border: 2px solid rgba(244, 200, 77, .34);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: rgba(5, 24, 54, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, .35)
}

.bgk-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #c4b994;
  font-size: 12px;
  font-weight: 800
}

.bgk-nav-item .ico {
  font-size: 25px
}

.bgk-nav-item.active {
  color: var(--gold3);
  text-shadow: 0 0 10px rgba(244, 200, 77, .5)
}

.bgk-nav-item.active .ico {
  width: 48px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(244, 200, 77, .12);
  border: 1px solid rgba(244, 200, 77, .5)
}

.bgk-paper {
  border: 2px solid #b78932;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 246, 207, .98), rgba(236, 210, 145, .98));
  color: #2f2109;
  box-shadow: 0 8px 0 rgba(80, 48, 12, .55), 0 12px 22px rgba(0, 0, 0, .28);
  padding: 16px;
  margin-bottom: 14px
}

.bgk-paper h2,
.bgk-paper h3 {
  color: #2f2109
}

.bgk-hero-card {
  min-height: 150px;
  padding: 18px;
  border: 2px solid rgba(244, 200, 77, .62);
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(9, 35, 78, .92), rgba(9, 35, 78, .68)), url('../assets/ui/props/prop-chest-open.png') right 16px center/112px auto no-repeat;
  box-shadow: var(--shadow);
  margin-bottom: 14px
}

.bgk-hero-card .amount {
  font-size: 42px;
  font-weight: 900;
  color: var(--gold3);
  margin: 8px 0;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .26)
}

.bgk-filter {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 0 0 14px;
  padding-bottom: 4px
}

.bgk-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(244, 200, 77, .55);
  border-radius: 999px;
  background: rgba(5, 24, 54, .78);
  color: #dfd7bd;
  font-weight: 900;
  padding: 8px 14px
}

.bgk-chip.active {
  background: linear-gradient(180deg, #ffe377, #d89e23);
  color: #2b1d08
}

.bgk-history-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .16)
}

.bgk-history-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(244, 200, 77, .12);
  border: 1px solid rgba(244, 200, 77, .4);
  display: grid;
  place-items: center;
  font-size: 22px
}

.plus {
  color: var(--green)
}

.minus {
  color: var(--red)
}

.gold {
  color: var(--gold3)
}

.bgk-fixed-action {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(4, 18, 40, .95) 30%)
}

.bgk-fixed-action .inner {
  max-width: 430px;
  margin: 0 auto
}

.bgk-reveal-page {
  height: 100dvh;
  overflow: hidden;
  background: #020817;
  display: grid;
  place-items: center
}

.bgk-reveal-card {
  width: 290px;
  height: 405px;
  perspective: 900px
}

.bgk-reveal-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: flip 1.2s ease .7s forwards
}

@keyframes flip {
  to {
    transform: rotateY(180deg)
  }
}

.bgk-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  backface-visibility: hidden;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 45px rgba(244, 200, 77, .35)
}

.bgk-backface {
  background: linear-gradient(180deg, #092a5f, #041226);
  display: grid;
  place-items: center
}

.bgk-frontface {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #ffe9a5, #d7a24b);
  color: #2f2109;
  padding: 22px;
  text-align: center
}

.bgk-character {
  width: 125px;
  height: 125px;
  margin: 8px auto 10px;
  border-radius: 20px;
  background: url('../assets/characters/main/char-pink-girl.png') center/cover no-repeat
}

@media(max-width:360px) {
  .bgk-shell {
    padding-left: 14px;
    padding-right: 14px
  }

  .bgk-logo {
    width: 210px
  }

  .bgk-title {
    font-size: 21px
  }

  .bgk-hero-card .amount {
    font-size: 35px
  }
}


/* ===== Fixed profile/wallet/settings pages ===== */
:root {
  --bg: #041226;
  --navy: #061a38;
  --navy2: #092a5f;
  --panel: #082452;
  --panel2: #0b316b;
  --gold: #f4c84d;
  --gold2: #b77b18;
  --gold3: #ffe680;
  --sand: #f4dc98;
  --paper: #f3d894;
  --paper2: #d8a958;
  --ink: #2f2109;
  --text: #fff0b8;
  --muted: #c9d5e8;
  --green: #62c960;
  --red: #d9665c;
  --blue: #4aa4ff;
  --purple: #b05cff;
  --orange: #ee9d31;
  --shadow: 0 12px 30px rgba(0, 0, 0, .42);
  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --nav-height: 76px;
}

.bgk-menu-list {
  border: 2px solid rgba(244, 200, 77, .58);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 38, 84, .88), rgba(5, 25, 56, .94));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .06);
  margin-bottom: 14px
}

.bgk-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, .14);
  color: var(--text)
}

.bgk-menu-row:last-child {
  border-bottom: 0
}

.bgk-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0
}

.bgk-menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(244, 200, 77, .12);
  border: 1px solid rgba(244, 200, 77, .44);
  font-size: 22px;
  flex: 0 0 auto
}

.bgk-menu-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold3)
}

.bgk-menu-desc {
  font-size: 12px;
  color: #dce5f5;
  margin-top: 3px;
  line-height: 1.45
}

.bgk-arrow {
  font-size: 22px;
  color: var(--gold3);
  opacity: .85
}

.bgk-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto
}

.bgk-toggle input {
  opacity: 0;
  width: 0;
  height: 0
}

.bgk-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(2, 13, 30, .78);
  border: 1px solid rgba(244, 200, 77, .35)
}

.bgk-toggle span:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #dce5f5;
  transition: .25s
}

.bgk-toggle input:checked+span {
  background: var(--green)
}

.bgk-toggle input:checked+span:before {
  transform: translateX(22px)
}

.bgk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 200, 77, .13);
  border: 1px solid rgba(244, 200, 77, .42);
  color: var(--gold3);
  font-size: 12px;
  font-weight: 900
}

.bgk-profile-hero {
  text-align: center;
  padding: 20px 12px 18px
}

.bgk-profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--gold);
  background: url('../assets/characters/main/char-pink-girl.png') center/cover no-repeat, radial-gradient(circle, #173a7a, #071b3a);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .18), 0 0 24px rgba(244, 200, 77, .22)
}

.bgk-profile-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold3);
  text-shadow: 0 2px 0 #4a2d09
}

.bgk-profile-email {
  font-size: 13px;
  color: #dce5f5;
  margin-top: 3px
}

.bgk-qr-box {
  width: 128px;
  height: 128px;
  background: repeating-conic-gradient(#222 0% 25%, #fff 0% 50%) 50%/8px 8px;
  margin: 8px auto 10px;
  border-radius: 10px;
  display: grid;
  place-items: center
}

.bgk-qr-box:after {
  /* content: "👑"; */
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 22px
}

.bgk-lang-item.is-disabled {
  opacity: .45;
  pointer-events: none
}

.bgk-danger {
  color: #ffb1a8 !important
}


/* ===== v3 unified clean filename navigation ===== */
:root {
  --bg: #041226;
  --navy: #061a38;
  --navy2: #092a5f;
  --panel: #082452;
  --panel2: #0b316b;
  --gold: #f4c84d;
  --gold2: #b77b18;
  --gold3: #ffe680;
  --sand: #f4dc98;
  --paper: #f3d894;
  --ink: #2f2109;
  --text: #fff0b8;
  --muted: #c9d5e8;
  --green: #62c960;
  --red: #d9665c;
  --blue: #4aa4ff;
  --purple: #b05cff;
  --orange: #ee9d31;
  --shadow: 0 12px 30px rgba(0, 0, 0, .42);
  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --nav-height: 76px
}

.bgk-menu-list {
  border: 2px solid rgba(244, 200, 77, .58);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 38, 84, .88), rgba(5, 25, 56, .94));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .06);
  margin-bottom: 14px
}

.bgk-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, .14);
  color: var(--text)
}

.bgk-menu-row:last-child {
  border-bottom: 0
}

.bgk-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0
}

.bgk-menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(244, 200, 77, .12);
  border: 1px solid rgba(244, 200, 77, .44);
  font-size: 22px;
  flex: 0 0 auto
}

.bgk-menu-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold3)
}

.bgk-menu-desc {
  font-size: 12px;
  color: #dce5f5;
  margin-top: 3px;
  line-height: 1.45
}

.bgk-arrow {
  font-size: 22px;
  color: var(--gold3);
  opacity: .85
}

.bgk-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto
}

.bgk-toggle input {
  opacity: 0;
  width: 0;
  height: 0
}

.bgk-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(2, 13, 30, .78);
  border: 1px solid rgba(244, 200, 77, .35)
}

.bgk-toggle span:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #dce5f5;
  transition: .25s
}

.bgk-toggle input:checked+span {
  background: var(--green)
}

.bgk-toggle input:checked+span:before {
  transform: translateX(22px)
}

.bgk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 200, 77, .13);
  border: 1px solid rgba(244, 200, 77, .42);
  color: var(--gold3);
  font-size: 12px;
  font-weight: 900
}

.bgk-profile-hero {
  text-align: center;
  padding: 20px 12px 18px
}

.bgk-profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--gold);
  background: url('../assets/characters/main/char-pink-girl.png') center/cover no-repeat, radial-gradient(circle, #173a7a, #071b3a);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .18), 0 0 24px rgba(244, 200, 77, .22)
}

.bgk-profile-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold3);
  text-shadow: 0 2px 0 #4a2d09
}

.bgk-profile-email {
  font-size: 13px;
  color: #dce5f5;
  margin-top: 3px
}

.bgk-qr-box {
  width: 128px;
  height: 128px;
  background: repeating-conic-gradient(#222 0% 25%, #fff 0% 50%) 50%/8px 8px;
  margin: 8px auto 10px;
  border-radius: 10px;
  display: grid;
  place-items: center
}

.bgk-qr-box:after {
  /* content: "👑"; */
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 22px
}

.bgk-lang-item.is-disabled {
  opacity: .45;
  pointer-events: none
}

.bgk-danger {
  color: #ffb1a8 !important
}



/* v3.4 clickability + clean reward chest asset */
.bgk-topbar,
.bgk-profile-strip,
.bgk-icon-actions {
  position: relative;
  z-index: 30;
}

.bgk-circle,
.bgk-circle-btn {
  position: relative;
  z-index: 35;
  pointer-events: auto;
}

.bgk-icon-actions a {
  pointer-events: auto;
  touch-action: manipulation;
}

.bgk-filter {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bgk-filter .bgk-chip {
  position: relative;
  z-index: 21;
  pointer-events: auto;
  touch-action: manipulation;
}

.bgk-history-item[hidden],
.history-group[hidden] {
  display: none !important;
}

.bgk-hero-card {
  background: linear-gradient(90deg, rgba(9, 35, 78, .95), rgba(9, 35, 78, .72)),
    url('../assets/ui/props/prop-chest-open.png') right 18px center/130px auto no-repeat !important;
}

.bgk-task {
  background: linear-gradient(90deg, rgba(8, 38, 84, .94), rgba(8, 38, 84, .70)),
    url('../assets/ui/props/prop-chest-open.png') right 16px center/108px auto no-repeat !important;
}