@import url("https://cdn.jsdelivr.net/npm/@fontsource/cairo@5.0.8/index.css");
:root {
  --gold: #cbb69e;
  --orange: #af8e6a;
  --ink: #170b31;
  --glass: rgba(18, 7, 42, 0.78);
  --line: rgba(203,182,158, 0.45);
  --safeT: env(safe-area-inset-top, 0px);
  --safeB: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: Cairo, system-ui, sans-serif;
  background: #100622;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
button,
a {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
a {
  text-decoration: none;
  color: inherit;
}
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.hidden {
  display: none !important;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(22px + var(--safeT)) 20px calc(22px + var(--safeB));
  background: radial-gradient(circle at 50% 10%, #51307e, #16092f 70%);
  overflow: hidden;
}
.screen h1 {
  font-size: clamp(38px, 9vw, 82px);
  line-height: 1.15;
  color: var(--gold);
  text-shadow:
    0 5px #4f3e2b,
    0 0 30px #ffd76a66;
}
.screen p {
  font-weight: 700;
  color: #e6e0d9;
  text-align: center;
}
.screen button,
.main,
.play {
  min-width: 220px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(#dfd2c3, var(--orange));
  color: #2f2519;
  font-weight: 900;
  box-shadow: 0 5px #644f36;
  transition: 0.12s;
}
.screen button:active,
.main:active,
.play:active {
  transform: translateY(4px);
  box-shadow: 0 1px #644f36;
}
.screen .sub {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0005;
}
.title-icon {
  font-size: clamp(70px, 17vw, 145px);
  filter: drop-shadow(0 12px 22px #0008);
  animation: float 3s ease-in-out infinite;
}
.menu-one {
  background:
    linear-gradient(#16092f77, #16092fee),
    url("https://image.qwenlm.ai/public_source/4c1f56dd-3dda-44d1-969e-38560aae6866/18c435119-bdc5-435c-b21d-47a46b45eb75.png")
      center/cover;
}
.menu-two {
  background:
    linear-gradient(#16092f77, #16092fee),
    url("https://image.qwenlm.ai/public_source/4c1f56dd-3dda-44d1-969e-38560aae6866/19b03cc78-8ef1-4546-a772-6ded6332d5bf.png")
      center/cover;
}
@keyframes float {
  50% {
    transform: translateY(-12px) rotate(4deg);
  }
}
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safeT)) 14px 10px;
  background: #090319bb;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
header h2 {
  color: var(--gold);
  font-size: clamp(16px, 4vw, 26px);
  flex: 1;
}
header button {
  min-width: auto !important;
  padding: 7px 13px !important;
  box-shadow: none !important;
}
.scroll {
  position: absolute;
  inset: calc(62px + var(--safeT)) 0 0;
  overflow: auto;
  padding: 15px 15px calc(28px + var(--safeB));
  width: 100%;
  touch-action: pan-y;
}
.world {
  max-width: 980px;
  margin: 0 auto 18px;
}
.world-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff10;
  font-weight: 900;
}
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 9px;
}
.level {
  min-width: auto !important;
  aspect-ratio: 1;
  padding: 5px !important;
  border-radius: 15px !important;
  background: linear-gradient(#fff, #dcd4ff) !important;
  color: #332574 !important;
  box-shadow: 0 4px #9e8fe7 !important;
}
.level.done {
  background: linear-gradient(#7df0a0, #32ac58) !important;
  color: #073a1a !important;
}
.level.lock {
  filter: grayscale(1);
  opacity: 0.45;
}
.shop-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.card {
  background: #ffffff0e;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  text-align: center;
}
.card .emoji {
  font-size: 43px;
}
.card h3 {
  font-size: 15px;
}
.card p {
  font-size: 12px;
  margin: 6px 0;
}
.card button {
  min-width: 0 !important;
  width: 100%;
  padding: 7px !important;
  box-shadow: 0 3px #644f36 !important;
}
.selected {
  outline: 3px solid #55efc4;
}
.locked {
  filter: grayscale(1);
  opacity: 0.45;
}
#hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.hud-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: calc(9px + var(--safeT)) 10px 5px;
  background: linear-gradient(#0a031acc, transparent);
}
.chip,
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #070215aa;
  color: #fff;
  font-weight: 800;
  font-size: clamp(11px, 2.5vw, 15px);
  white-space: nowrap;
}
.icon {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
}
.grow {
  flex: 1;
}
.hearts {
  font-size: clamp(13px, 3vw, 22px);
}
.progress {
  margin: 3px 12px;
  height: 8px;
  background: #0008;
  border-radius: 99px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), #b59876);
}
#powers {
  position: absolute;
  right: 10px;
  bottom: calc(12px + var(--safeB));
  display: flex;
  gap: 7px;
  pointer-events: auto;
}
.power {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #09031ccc;
  color: #fff;
  font-size: 23px;
}
.power b {
  position: absolute;
  top: -6px;
  right: -5px;
  background: var(--gold);
  color: #2a2116;
  border-radius: 99px;
  font-size: 10px;
  padding: 1px 6px;
}
.touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.touch button {
  position: absolute;
  bottom: calc(75px + var(--safeB));
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff2c;
  border: 2px solid #ffffff77;
  color: #fff;
  font-size: 26px;
  pointer-events: auto;
  touch-action: none;
}
.touch [data-key="left"] {
  left: 18px;
}
.touch [data-key="right"] {
  left: 96px;
}
.touch [data-key="down"] {
  right: 105px;
  width: 55px;
  height: 55px;
}
.touch .jump {
  right: 18px;
  background: #ffd76a66;
}
.jump-touch [data-key="left"] {
  left: 18px;
}
.jump-touch [data-key="right"] {
  left: auto;
  right: 18px;
}
.modal {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #08031ccc;
  backdrop-filter: blur(6px);
}
.box {
  width: min(92%, 520px);
  max-height: 90%;
  overflow: auto;
  background: linear-gradient(#392064, #1c0d3c);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 23px;
  text-align: center;
}
.box h2 {
  color: var(--gold);
  font-size: 28px;
}
.box p {
  margin: 10px 0;
}
.box button {
  margin: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(#dfd2c3, var(--orange));
  color: #2f2519;
  font-weight: 900;
}
.big-stars {
  font-size: 45px;
}
.wheel {
  width: 230px;
  height: 230px;
  margin: 15px auto;
  border-radius: 50%;
  border: 10px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 62px;
  background: conic-gradient(
    #b79b7a 0 12.5%,
    #e55039 0 25%,
    #6c5ce7 0 37.5%,
    #00b894 0 50%,
    #0984e3 0 62.5%,
    #fd79a8 0 75%,
    #74b9ff 0 87.5%,
    #dcd4ca 0
  );
  box-shadow: 0 0 30px #ffd76a66;
}
.wheel.spin {
  animation: spin 2.4s cubic-bezier(0.15, 0.75, 0.1, 1);
}
@keyframes spin {
  to {
    transform: rotate(1800deg);
  }
}
#toast {
  position: absolute;
  z-index: 12;
  top: 90px;
  left: 50%;
  transform: translate(-50%, -15px);
  opacity: 0;
  transition: 0.25s;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #08031cee;
  font-weight: 800;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.hub {
  min-height: 100%;
  overflow: auto;
  background: radial-gradient(circle at 50% 0, #5d2a72, #170a30 52%, #0c051c);
  padding: 35px 18px;
}
.hub-wrap {
  max-width: 1050px;
  margin: auto;
  text-align: center;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.3em;
  font-weight: 900;
}
.hub h1 {
  font-size: clamp(38px, 7vw, 72px);
  color: #fff4ce;
  margin: 5px;
}
.lead {
  color: #e8dff5;
  margin: 0 auto 28px;
  max-width: 620px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.game-card {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: right;
  box-shadow: 0 25px 65px #0008;
}
.game-card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, #130826 73%);
  z-index: 0;
}
.game-card > div,
.game-card .art {
  position: relative;
  z-index: 1;
}
.game-card .art {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 110px;
  filter: drop-shadow(0 14px 20px #0008);
}
.game-card h2 {
  font-size: 31px;
  color: var(--gold);
}
.game-card small {
  font-weight: 900;
  letter-spacing: 0.18em;
}
.game-card p {
  color: #e7def5;
}
.game-card ul {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  margin: 12px 0;
}
.game-card li {
  background: #0006;
  border: 1px solid #ffffff25;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
}
.game-card .play {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  text-align: center;
}
.kingdom {
  background:
    linear-gradient(#522a8a99, #16092f),
    url("https://image.qwenlm.ai/public_source/4c1f56dd-3dda-44d1-969e-38560aae6866/18c435119-bdc5-435c-b21d-47a46b45eb75.png")
      center/cover;
}
.jump {
  background:
    linear-gradient(#522a8a99, #16092f),
    url("https://image.qwenlm.ai/public_source/4c1f56dd-3dda-44d1-969e-38560aae6866/19b03cc78-8ef1-4546-a772-6ded6332d5bf.png")
      center/cover;
}
.gates,
.menu-three {
  background:
    linear-gradient(#522a8a99, #16092fee),
    url("https://image.qwenlm.ai/public_source/4c1f56dd-3dda-44d1-969e-38560aae6866/1c025687a-27cb-4ff8-9a43-435148bc5855.png")
      center/cover;
}
.lastlight,
.menu-four {
  background: radial-gradient(circle at 50% 35%, #38235f, #090416 70%);
}
.nova {
  position: absolute;
  left: 18px;
  bottom: calc(20px + var(--safeB));
  width: 78px;
  height: 78px;
  border-radius: 50%;
  pointer-events: auto;
  background: #150b2ddd;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 30px;
  box-shadow: 0 0 28px #ffd76a55;
}
.nova.ready {
  animation: pulse 1s infinite;
  box-shadow: 0 0 42px #ffd76aaa;
}
@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}
.maze-touch {
  position: absolute;
  left: 20px;
  bottom: calc(20px + var(--safeB));
  width: 150px;
  height: 150px;
  pointer-events: auto;
}
.maze-touch button {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: #ffffff2c;
  border: 1px solid #ffffff66;
  color: #fff;
  font-size: 20px;
  touch-action: none;
}
.maze-touch [data-key="up"] {
  left: 50px;
}
.maze-touch [data-key="left"] {
  top: 50px;
}
.maze-touch [data-key="down"] {
  left: 50px;
  top: 100px;
}
.maze-touch [data-key="right"] {
  left: 100px;
  top: 50px;
}
.hub footer {
  margin: 30px;
  color: #cbbde0;
}
@media (pointer: fine) {
  .touch {
    display: none;
  }
}
@media (max-width: 650px) {
  .hud-row {
    gap: 4px;
  }
  .hud-row .chip {
    padding: 4px 7px;
  }
  .worldChip {
    display: none;
  }
  .shop-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
