:root {
  --ink: #eef7ff;
  --muted: #a9bee1;
  --blue-950: #02091f;
  --blue-900: #05143a;
  --blue-800: #092d73;
  --cyan: #39dcff;
  --cyan-soft: #9bf1ff;
  --gold: #ffc94d;
  --gold-bright: #ffe89a;
  --panel: rgba(5, 23, 65, .74);
  --line: rgba(116, 210, 255, .18);
  --shadow: 0 28px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 8%, rgba(19, 98, 220, .34), transparent 30%),
    linear-gradient(180deg, #02081d 0%, #061944 42%, #02071c 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

img, picture, video, canvas { display: block; max-width: 100%; color-scheme: light; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

#royal-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  opacity: .72;
}
.page-glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  right: -18vw;
  top: 18vh;
  border-radius: 50%;
  background: rgba(0, 174, 255, .12);
  filter: blur(100px);
  z-index: -3;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(116, 210, 255, .2);
  border-radius: 20px;
  background: rgba(2, 11, 34, .7);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 18px 60px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .06em; }
.brand img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(38, 184, 255, .4)); }
.site-header nav { display: flex; gap: 30px; color: #c5d8f7; font-size: 15px; }
.site-header nav a { transition: color .2s, transform .2s; }
.site-header nav a:hover { color: white; transform: translateY(-1px); }
.nav-cta {
  padding: 12px 21px;
  border-radius: 14px;
  color: #071534;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 24px rgba(255, 190, 44, .25), inset 0 1px white;
  font-weight: 700;
}

.section-shell { width: min(1240px, calc(100% - 40px)); margin-inline: auto; position: relative; }
.hero { min-height: 100svh; padding: 150px 0 90px; display: grid; grid-template-columns: .94fr 1.06fr; align-items: center; gap: 30px; }
.hero-backdrop {
  position: absolute;
  inset: 0 -14vw;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(2,8,29,.96) 0%, rgba(2,8,29,.4) 48%, rgba(2,8,29,.18) 100%),
    url("assets/backgrounds/palace-hero.webp") center/cover;
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
  opacity: .8;
}
.hero-copy { position: relative; z-index: 4; }
.eyebrow { color: var(--gold-bright); text-transform: uppercase; letter-spacing: .17em; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 30px; height: 2px; display: inline-block; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow.centered { justify-content: center; }
.eyebrow.centered span:last-child { transform: scaleX(-1); }
.hero-logo { width: min(520px, 87%); margin: 16px 0 18px; filter: drop-shadow(0 12px 25px rgba(0,0,0,.6)) drop-shadow(0 0 16px rgba(42, 180, 255, .24)); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: clamp(52px, 5.7vw, 84px); line-height: .98; letter-spacing: -.045em; text-shadow: 0 10px 40px rgba(0,0,0,.45); }
h1 em, h2 em { font-style: normal; color: var(--cyan-soft); text-shadow: 0 0 30px rgba(39, 208, 255, .3); }
.hero-lead { max-width: 600px; color: #c0d3f1; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.65; }
.store-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.store-button {
  min-width: 190px;
  min-height: 62px;
  padding: 9px 17px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(14,42,95,.95), rgba(2,10,31,.98));
  box-shadow: 0 13px 34px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.12);
  display: inline-flex;
  align-items: center;
  gap: 13px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.store-button:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 18px 42px rgba(0,110,255,.25), inset 0 1px rgba(255,255,255,.18); }
.store-button i { font-size: 31px; }
.store-button span { font-size: 21px; font-weight: 600; line-height: 1.05; }
.store-button small { display: block; font-size: 9px; letter-spacing: .08em; font-weight: 500; margin-bottom: 3px; }
.hero-metrics { margin-top: 34px; display: flex; gap: 30px; }
.hero-metrics div { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; }
.hero-metrics strong { font-size: 30px; color: var(--gold); }
.hero-metrics span { max-width: 70px; color: var(--muted); font-size: 12px; line-height: 1.2; }

.hero-visual { min-height: 680px; position: relative; }
.hero-king { position: absolute; width: 68%; right: -5%; top: -2%; z-index: 1; filter: drop-shadow(0 35px 40px rgba(0,0,0,.55)); }
.phone {
  position: relative;
  padding: 9px;
  border: 2px solid rgba(255, 216, 111, .85);
  border-radius: 38px;
  background: linear-gradient(145deg, #f7d978, #7d4700 28%, #ffe89a 52%, #704000 75%, #f9d36a);
  box-shadow: 0 45px 80px rgba(0,0,0,.55), 0 0 45px rgba(29, 184, 255, .18), inset 0 0 0 3px #07143a;
  overflow: hidden;
}
.phone::before { content: ""; position: absolute; inset: 6px; z-index: 2; border: 2px solid rgba(90,218,255,.38); border-radius: 30px; pointer-events: none; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 27px; }
.phone-hero { position: absolute; width: 41%; left: 10%; top: 24%; aspect-ratio: 1 / 2; z-index: 3; transform: rotate(-4deg); }
.phone-speaker { position: absolute; z-index: 6; width: 28%; height: 6px; top: 16px; left: 36%; border-radius: 9px; background: rgba(0,0,0,.7); }
.phone-shine { position: absolute; inset: 0; z-index: 5; background: linear-gradient(115deg, transparent 28%, rgba(255,255,255,.19) 42%, transparent 54%); transform: translateX(-120%); pointer-events: none; }
.aura { position: absolute; border-radius: 50%; filter: blur(35px); }
.aura-one { width: 420px; height: 420px; right: 4%; top: 13%; background: rgba(25,144,255,.26); }
.aura-two { width: 280px; height: 280px; left: 4%; bottom: 8%; background: rgba(255,188,47,.15); }
.floating-block { position: absolute; width: 78px; z-index: 5; filter: drop-shadow(0 18px 22px rgba(0,0,0,.45)); }
.block-a { left: 0; top: 15%; transform: rotate(-13deg); }
.block-b { right: 0; bottom: 22%; transform: rotate(16deg); }
.block-c { left: 47%; bottom: 0; transform: rotate(-8deg); }
.block-d { right: 8%; top: 6%; transform: rotate(9deg); }

.story { padding: 150px 0 110px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 80px; }
.story-art { min-height: 660px; position: relative; }
.story-art::before { content: ""; position: absolute; inset: 13% 7%; border-radius: 50%; background: radial-gradient(circle, rgba(35,181,255,.28), transparent 68%); filter: blur(24px); }
.story-king { position: absolute; height: 670px; left: 50%; bottom: 0; transform: translateX(-50%); filter: drop-shadow(0 30px 50px rgba(0,0,0,.55)); }
.crest-halo { position: absolute; width: 400px; left: 50%; top: 0; transform: translateX(-50%); opacity: .65; filter: drop-shadow(0 0 36px rgba(36,197,255,.35)); }
.sparkle-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .75; }
.story-copy h2, .section-heading h2, .gameplay-copy h2, .final-copy h2 { font-size: clamp(42px, 5.3vw, 72px); line-height: 1.03; letter-spacing: -.04em; margin-bottom: 24px; }
.story-copy > p, .gameplay-copy > p, .section-heading > p, .final-copy > p { color: var(--muted); line-height: 1.75; font-size: 18px; }
blockquote { margin: 35px 0 0; padding: 20px 24px; border-left: 3px solid var(--gold); background: rgba(9,41,103,.42); color: #e8f4ff; border-radius: 0 16px 16px 0; font-size: 18px; }

.heroes { padding: 130px 0; }
.section-heading { max-width: 780px; margin: 0 auto 65px; text-align: center; }
.section-heading > p:last-child { max-width: 650px; margin-inline: auto; }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; perspective: 1200px; }
.character-card {
  --card-accent: #52d9ff;
  position: relative;
  min-height: 480px;
  padding: 16px 20px 24px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 42%, transparent);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(10,43,105,.72), rgba(3,13,42,.92));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08);
  overflow: hidden;
  transform-style: preserve-3d;
}
.character-card::after { content: ""; position: absolute; width: 170px; height: 170px; top: 20%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; background: var(--card-accent); filter: blur(85px); opacity: .24; }
.avatar-stage { height: 240px; position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-end; }
.avatar-stage img { height: 235px; width: auto; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(0,0,0,.45)); transition: transform .35s; }
.character-card:hover .avatar-stage img { transform: translateY(-6px) scale(1.03); }
.role { color: var(--card-accent); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; font-weight: 600; }
.character-card h3 { font-size: 28px; margin: 7px 0 10px; }
.character-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.trait { display: inline-block; margin-top: 5px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.07); color: #dfefff; font-size: 11px; }

.gameplay { padding: 150px 0; display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 80px; }
.step-list { margin-top: 38px; display: grid; gap: 12px; }
.step { padding: 15px; display: flex; align-items: center; gap: 16px; border: 1px solid transparent; border-radius: 18px; cursor: pointer; transition: .25s; }
.step:hover, .step.active { background: rgba(9,45,110,.65); border-color: rgba(71,210,255,.28); transform: translateX(5px); }
.step b { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #08224f; background: linear-gradient(145deg, var(--gold-bright), var(--gold)); }
.step span { color: var(--muted); font-size: 14px; }
.step strong { display: block; color: white; font-size: 18px; margin-bottom: 3px; }
.gameplay-visual { min-height: 740px; position: relative; display: grid; place-items: center; }
.phone-game { width: 345px; aspect-ratio: 1 / 2; z-index: 4; }
.game-glow { position: absolute; width: 700px; opacity: .5; z-index: 0; animation: spinSlow 24s linear infinite; }
.score-orbit { position: absolute; z-index: 5; top: 18%; right: 1%; width: 150px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: rgba(6,28,78,.88); border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(30,184,255,.3); }
.score-orbit img { width: 48px; position: absolute; top: -24px; }
.score-orbit strong { color: var(--cyan-soft); font-size: 36px; line-height: 1; margin-top: 14px; }
.score-orbit span { color: var(--gold-bright); font-size: 11px; position: absolute; bottom: 23px; }

.jewels { padding: 80px 0 140px; }
.jewel-track { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.jewel { padding: 22px 12px 17px; text-align: center; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; background: rgba(4,18,56,.65); box-shadow: inset 0 1px rgba(255,255,255,.06); transition: transform .3s, border-color .3s; }
.jewel:hover { transform: translateY(-10px); border-color: rgba(113,221,255,.4); }
.jewel img { width: 110px; margin: 0 auto 5px; filter: drop-shadow(0 16px 18px rgba(0,0,0,.42)); }
.jewel span { color: #c5d8f7; font-size: 13px; }

.screens { padding: 130px 0 170px; }
.screen-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; align-items: center; }
.screen-card { margin: 0; position: relative; padding: 10px; border: 1px solid rgba(255,211,84,.55); border-radius: 32px; background: linear-gradient(135deg,#f5d06a,#704000,#f6df91); box-shadow: var(--shadow); overflow: hidden; transform: translateY(20px) rotate(-2deg); }
.screen-card:nth-child(3) { transform: translateY(20px) rotate(2deg); }
.screen-card.featured { transform: scale(1.06); z-index: 2; box-shadow: 0 35px 90px rgba(0,0,0,.6), 0 0 60px rgba(30,181,255,.18); }
.screen-card img { border-radius: 23px; }
.screen-card figcaption { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); white-space: nowrap; padding: 9px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(1,8,26,.78); backdrop-filter: blur(12px); font-size: 12px; }

.final-cta { min-height: 660px; margin-bottom: 90px; display: grid; place-items: center; text-align: center; border: 1px solid rgba(95,205,255,.18); border-radius: 38px; overflow: hidden; box-shadow: var(--shadow); }
.final-bg { position: absolute; inset: 0; z-index: -2; background: linear-gradient(rgba(0,9,33,.35), rgba(0,9,33,.85)), url("assets/backgrounds/palace-hero.webp") center 30%/cover; }
.final-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 35%, rgba(33,179,255,.18), transparent 46%); }
.final-crest { position: absolute; width: 520px; opacity: .13; filter: blur(.2px); }
.final-copy { max-width: 850px; padding: 70px 20px; }
.final-copy p { font-size: 18px; }
.centered-row { justify-content: center; }

.faq { padding: 40px 0 90px; }
.faq-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.faq-item { background: rgba(8, 24, 62, .55); border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px; }
.faq-item h3 { font-size: 22px; margin-bottom: 10px; }
.faq-item p { color: var(--muted); font-size: 16px; }

footer { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 45px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; color: #8399bb; font-size: 12px; }
.footer-brand img { width: 38px; height: 38px; }
.footer-meta { text-align: center; }
.powered-by { margin-top: 6px; }
.powered-by a { color: #9fd8ff; text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
footer a:hover { color: white; }

@keyframes spinSlow { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 135px; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-lead { max-width: 720px; }
  .hero-visual { min-height: 650px; }
  .hero-king { width: 54%; right: 8%; }
  .phone-hero { width: 31%; left: 21%; }
  .story, .gameplay { grid-template-columns: 1fr; gap: 30px; }
  .story-copy { text-align: center; }
  .story-copy .eyebrow, .gameplay-copy .eyebrow { justify-content: center; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .gameplay-copy { max-width: 720px; margin: auto; text-align: center; }
  .step { text-align: left; }
  .jewel-track { grid-template-columns: repeat(3, 1fr); }
  .faq-list { grid-template-columns: 1fr; }
  .store-row { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .section-shell { width: min(100% - 24px, 1240px); }
  .site-header { top: 10px; width: calc(100% - 20px); }
  .site-header .brand span { display: none; }
  .nav-cta { padding-inline: 15px; }
  .hero { padding-top: 115px; }
  .hero-logo { width: 90%; }
  h1 { font-size: 48px; }
  .store-row { justify-content: center; }
  .store-button { min-width: 170px; }
  .hero-metrics { gap: 17px; }
  .hero-visual { min-height: 520px; }
  .hero-king { width: 70%; right: -2%; top: 4%; }
  .phone-hero { width: 43%; left: 9%; top: 24%; }
  .floating-block { width: 56px; }
  .story { padding-top: 80px; }
  .story-art { min-height: 520px; }
  .story-king { height: 530px; }
  .hero-grid { grid-template-columns: 1fr; }
  .character-card { min-height: 430px; }
  .gameplay { padding: 90px 0; }
  .gameplay-visual { min-height: 640px; }
  .phone-game { width: 290px; }
  .score-orbit { right: -1%; width: 120px; }
  .jewel-track { grid-template-columns: repeat(2, 1fr); }
  .screen-gallery { grid-template-columns: 1fr; gap: 25px; padding-inline: 18px; }
  .screen-card, .screen-card:nth-child(3), .screen-card.featured { transform: none; }
  .final-cta { border-radius: 26px; }
  footer { flex-direction: column; gap: 18px; text-align: center; }
  .footer-links { justify-content: center; }
  .faq-list { grid-template-columns: 1fr; }
}

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