.app.ascent, .ascent-show, .pt-ascent, .pt-ascent-gates, .pt-ascent-jackpots, .paytable .ascent-orb, .paytable .ascent-pyramid {
  --ascent-night: #070a2c;
  --ascent-lapis: #15237a;
  --ascent-lapis-light: #2c44b8;
  --ascent-lapis-deep: #060a24;
  --ascent-turquoise: #2fd8d0;
  --ascent-turquoise-deep: #0b5a66;
  --ascent-ruby: #e0234e;
  --ascent-ruby-deep: #5e0a20;
  --ascent-sand: #c99a4e;
  --ascent-sand-light: #ecc983;
  --ascent-sand-deep: #4a3212;
  --ascent-stone: #3a2a14;
  --ascent-stone-deep: #1a1206;
  --ascent-veil: #05071ceb;
  --ascent-go-light: #79ed8d;
  --ascent-go: #28a34b;
  --ascent-go-deep: #124b28;
}

.app.ascent::before {
  background:
    linear-gradient(#070a2c99, transparent 18%, #05071c66 52%, var(--ascent-night) 78%, var(--bg-deep)),
    radial-gradient(ellipse 70% 30% at 30% 14%, #ffb43a33, transparent 70%),
    linear-gradient(var(--ascent-night), var(--ascent-lapis-deep) 48%, var(--bg-deep));
}

.app.ascent {
  --reel-frame: url("../art/kits/pharaoh/frame.webp");
  --cell: calc((min(100vw, 520px) - 32px - 34px - 24px) / 5);
  --ascent-cell-h: min(var(--cell), calc((var(--cabinet-height) - var(--safe-top) - var(--safe-bottom) - 410px) / 3));
}
.app.ascent.chamber {
  --ascent-cell-h: min(var(--cell), calc((var(--cabinet-height) - var(--safe-top) - var(--safe-bottom) - 330px) / 6));
}
.app.ascent .grid { --reel-rows: 3; }
.app.ascent.chamber .grid { --reel-rows: 6; }
.ascent .reel {
  height: calc(var(--ascent-cell-h) * var(--reel-rows));
  background:
    linear-gradient(180deg, #0009, transparent 22%, #ffffff0d 50%, transparent 78%, #0009),
    radial-gradient(ellipse at 50% 50%, var(--ascent-lapis), var(--ascent-lapis-deep) 82%);
}
.ascent .cell { height: var(--ascent-cell-h); }
.ascent .sym-img { max-height: var(--ascent-cell-h); }
.app.ascent.ascent-grow .reel, .app.ascent.ascent-grow .cell { transition: height .7s cubic-bezier(.3, .8, .3, 1); }

.cell.as-queen { --glow: #ffd86acc; }
.cell.as-sphinx { --glow: #2fd8d099; }
.cell.as-beetle { --glow: #4a8aff99; }
.cell.as-ankh { --glow: #ffb43a80; }
.cell.as-eye { --glow: #2fd8d080; }
.cell.as-vase { --glow: #b46aff80; }
.cell.as-wild { --glow: #ffe38acc; }
.cell.ascent-pyramid { --glow: #ffb43a; }

.ascent-tag {
  position: absolute;
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%);
  padding: 0 .3em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ascent-lapis-light), var(--ascent-lapis-deep));
  box-shadow: 0 0 0 1.5px var(--gold-light);
  color: var(--gold-light);
  font: max(11px, calc(var(--ascent-cell-h, var(--cell)) * .16))/1.15 var(--display);
  letter-spacing: .05em;
  white-space: nowrap;
}

.cell.ascent-empty {
  background: radial-gradient(circle at 50% 50%, #ffffff0a, transparent 70%);
}
.cell.ascent-locked {
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(50% - 1px), #0006 calc(50% - 1px) 50%, transparent 50%),
    linear-gradient(180deg, transparent calc(50% - 1px), #0006 calc(50% - 1px) 50%, transparent 50%),
    linear-gradient(160deg, var(--ascent-stone), var(--ascent-stone-deep));
}

.ascent-orb { --orb-glow: transparent; }
.ascent-orb.kind-collector { --orb-glow: #ff3a5ab3; }
.ascent-orb.kind-boost { --orb-glow: #2fd8d0b3; }
.ascent-orb.kind-jackpot { --orb-glow: #ffd86a80; }
.cell.ascent-orb::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-glow), transparent 70%);
  pointer-events: none;
}
.ascent-orb .sym-face { position: relative; }
.ascent-orb-art {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72%, calc(var(--ascent-cell-h, var(--cell)) * .72));
  aspect-ratio: 1;
  transform: translate(-50%, -54%);
  border-radius: 50%;
  background: center / cover no-repeat;
  pointer-events: none;
}
.kind-collector .ascent-orb-art {
  background-image: url("../art/kits/pharaoh/premium1-star-queen.webp");
  background-size: 120%;
  background-position: 50% 30%;
  box-shadow: 0 0 0 2px var(--ascent-ruby), 0 0 8px var(--ascent-ruby);
}
.kind-boost .ascent-orb-art {
  background-image: url("../art/kits/pharaoh/upgrade-star-seal.webp");
  background-size: 92%;
  border-radius: 0;
  box-shadow: none;
}
.ascent-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font: max(11px, calc(var(--ascent-cell-h, var(--cell)) * .3))/1 var(--display);
  letter-spacing: .02em;
  white-space: nowrap;
  -webkit-text-stroke: 2px var(--bg-deep);
  paint-order: stroke fill;
  pointer-events: none;
}
.ascent-value.jp { font-size: max(11px, calc(var(--ascent-cell-h, var(--cell)) * .24)); }
.ascent-value.jp.mini { color: var(--jp-mini); }
.ascent-value.jp.minor { color: var(--jp-minor); }
.ascent-value.jp.major { color: var(--jp-major); }
.kind-collector .ascent-value, .kind-boost .ascent-value {
  inset: auto 4% 0;
  padding: 1px 2px;
  border-radius: 6px;
  font-size: max(11px, calc(var(--ascent-cell-h, var(--cell)) * .22));
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 #000;
}
.kind-collector .ascent-value { background: linear-gradient(var(--ascent-ruby), var(--ascent-ruby-deep)); box-shadow: 0 0 0 1px var(--gold-light); }
.kind-boost .ascent-value { background: linear-gradient(var(--ascent-turquoise-deep), var(--ascent-lapis-deep)); box-shadow: 0 0 0 1px var(--ascent-turquoise); }
.ascent-orb-decor { opacity: .55; }

.app.ascent .grid.hold-intro .cell:not(.ascent-orb) { opacity: .35; transition: opacity .3s; }
.app.ascent .cell.ascent-orb.locked { box-shadow: inset 0 0 0 1px #ffe38a66; }
.app.ascent .cell.ascent-orb.collecting { box-shadow: inset 0 0 0 3px var(--ascent-ruby), inset 0 0 14px var(--ascent-ruby); }
.app.ascent .cell.ascent-orb.collected .sym-face { filter: brightness(.55) saturate(.6); }
.app.ascent .cell.ascent-orb.absorbed .ascent-value { animation: ascent-absorb .4s ease-out; }
.app.ascent .cell.ascent-orb.charged, .app.ascent .cell.ascent-orb.boosted { animation: ascent-charge .5s ease-out; }
.app.ascent .cell.ascent-orb.boosting { animation: ascent-charge .7s ease-out; box-shadow: inset 0 0 0 3px var(--ascent-turquoise); }
@keyframes ascent-absorb { 40% { transform: scale(1.25); color: #fff; } }
@keyframes ascent-charge { 35% { transform: scale(1.14); filter: brightness(1.5); } }
.ascent-beam.boost { background: linear-gradient(180deg, #fff, var(--ascent-turquoise) 30%, var(--ascent-lapis-light)); box-shadow: 0 0 12px var(--ascent-turquoise); }
.float-text.ascent-pop {
  color: var(--ascent-turquoise);
  font: 16px/1 var(--display);
  -webkit-text-stroke: 2px var(--bg-deep);
  paint-order: stroke fill;
}
.float-text.free-pop.ascent-open { color: var(--ascent-sand-light); }

.ascent-gates { display: none; }
.app.ascent.chamber .ascent-gates {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.ascent-gate {
  position: absolute;
  left: 6px;
  right: 6px;
  top: calc(6px + var(--gate-row) * var(--ascent-cell-h));
  height: var(--ascent-cell-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--ascent-sand-light);
  background:
    linear-gradient(180deg, #ffe38a33, transparent 18%, transparent 82%, #0008),
    linear-gradient(160deg, var(--ascent-stone), var(--ascent-stone-deep));
  border-top: 2px solid var(--ascent-sand);
  opacity: .82;
  transition: opacity .3s, visibility .3s;
}
.ascent-gate.next { opacity: 1; border-top-color: var(--gold-light); }
.ascent-gate.met { box-shadow: inset 0 0 14px var(--gold); }
.ascent-gate.open { opacity: 0; visibility: hidden; }
.ascent-gate.opening { visibility: visible; animation: ascent-gate-open var(--ascent-unlock, 1.1s) ease-in both; }
@keyframes ascent-gate-open {
  0% { opacity: 1; filter: brightness(1); }
  30% { opacity: 1; filter: brightness(1.8); box-shadow: inset 0 0 24px var(--gold-light); }
  100% { opacity: 0; translate: 0 -40%; filter: brightness(1.4); }
}
.ascent-gate-need { flex: none; display: flex; align-items: center; gap: 4px; }
.ascent-gate-mark {
  width: min(24px, calc(var(--ascent-cell-h) * .62));
  aspect-ratio: 1;
  background: url("../art/kits/pharaoh/bonus-sun-disc.webp") center / contain no-repeat;
}
.ascent-gate-count { font: max(13px, calc(var(--ascent-cell-h) * .4))/1 var(--display); color: var(--gold-light); text-shadow: 0 1px 0 #000; }
.ascent-gate-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: #0009;
  box-shadow: 0 0 0 1px var(--ascent-sand-deep);
}
.ascent-gate-fill {
  display: block;
  height: 100%;
  transform-origin: left;
  background: linear-gradient(90deg, var(--ascent-sand), var(--gold-light));
  transition: transform .3s;
}
.ascent-gate-progress { flex: none; min-width: 3.4em; text-align: right; font: 13px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .03em; text-shadow: 0 1px 0 #000; }

.ascent-sign {
  flex: 1;
  min-height: 134px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 4px;
  position: relative;
  margin: 5px 0 22px;
  container: ascent-sign / size;
}
.app.ascent.chamber .ascent-sign { min-height: 72px; }
.ascent-sign[hidden] { display: none; }
.ascent-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--radius);
  background: var(--ascent-night);
  mask-image: linear-gradient(#000 80%, transparent);
  -webkit-mask-image: linear-gradient(#000 80%, transparent);
}
.ascent-scene > [data-parallax] { position: absolute; inset: calc(-1 * var(--parallax-bleed)); }
.ascent-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, #05071c40 74%, #05071ca6);
}
.ascent-scene-art { position: absolute; inset: 0; background: 50% 62% / cover no-repeat; }
.ascent-scene-art.far { background-image: url("../art/kits/pharaoh/scene.webp"); }
.ascent-scene-art.mid { background-image: url("../art/scene-layers/pharaoh/mid.webp"); }
.ascent-scene-art.frame { background-image: url("../art/scene-layers/pharaoh/frame.webp"); }
.ascent-scene-sun {
  position: absolute;
  width: 70%;
  height: 50%;
  left: 2%;
  top: 14%;
  background: radial-gradient(ellipse, #ffd86a40, transparent 68%);
  animation: ascent-sun 12s ease-in-out infinite alternate;
}
.ascent-obelisk {
  position: absolute;
  bottom: calc(var(--parallax-bleed) + 2%);
  width: 22%;
  aspect-ratio: 1;
  background: url("../art/kits/pharaoh/decor-obelisk.webp") center bottom / contain no-repeat;
  filter: drop-shadow(0 4px 6px #000a) brightness(.85);
}
.ascent-obelisk.left { left: calc(var(--parallax-bleed) - 6%); }
.ascent-obelisk.right { right: calc(var(--parallax-bleed) - 6%); }
.ascent-heat {
  --loop-tile: url("../art/scene-loops/ascent-sand-tile.webp");
  --loop-tile-w: 192px;
  --loop-tile-h: 64px;
  --loop-period: 24s;
  --loop-mask: url("../art/scene-layers/pharaoh/mid.webp") 50% 62% / cover no-repeat;
  opacity: .3;
}
.ascent-scene-stars {
  position: absolute;
  inset: 0 0 55%;
  background:
    radial-gradient(circle at 14% 26%, #fff2cd 0 1px, transparent 1.6px),
    radial-gradient(circle at 38% 10%, #fff2cd 0 .8px, transparent 1.4px),
    radial-gradient(circle at 62% 30%, #fff2cd 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 12%, #fff2cd 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 90% 36%, #fff2cd 0 .8px, transparent 1.4px);
  opacity: .6;
  animation: ascent-stars 7s ease-in-out infinite alternate;
}
.ascent-scene-dust {
  position: absolute;
  inset: 52% -10% 10%;
  background: radial-gradient(ellipse 40% 30% at 30% 60%, #ecc98326, transparent 70%),
    radial-gradient(ellipse 35% 25% at 75% 50%, #ecc9831f, transparent 70%);
  animation: ascent-dust 16s ease-in-out infinite alternate;
}
@keyframes ascent-stars { from { opacity: .3; } to { opacity: .85; } }
@keyframes ascent-dust { from { transform: translateX(-5%); opacity: .5; } to { transform: translateX(5%); opacity: 1; } }
@keyframes ascent-sun { from { transform: translateX(-4%) scale(.95); opacity: .5; } to { transform: translateX(5%) scale(1.06); opacity: .95; } }
body.scene-motion-paused :is(.ascent-scene-sun, .ascent-scene-stars, .ascent-scene-dust),
.ascent-sign[hidden] :is(.ascent-scene-sun, .ascent-scene-stars, .ascent-scene-dust) { animation-play-state: paused; }

.ascent-title { flex: none; font: 22px/1.05 var(--display); letter-spacing: .06em; text-align: center; }
.ascent-title, .ascent-show-panel h2, .ascent-show-main {
  color: transparent;
  background: var(--gold-bevel);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 1px 0 var(--gold-deep)) drop-shadow(0 2px 1px #000b);
}
.ascent-status { flex: none; text-align: center; color: var(--text); font: 11px/1.2 var(--display); letter-spacing: .03em; text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ascent-meter {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  padding: 3px 10px;
  border: 2px solid var(--ascent-sand);
  border-radius: 8px;
  background: linear-gradient(var(--ascent-lapis), var(--bg-deep));
  font-family: var(--display);
  white-space: nowrap;
  overflow: hidden;
}
.ascent-meter-name { color: var(--ascent-turquoise); font-size: 14px; letter-spacing: .05em; text-shadow: 0 1px 0 #000; }
.ascent-meter-name.reset { animation: ascent-reset .6s ease-out; }
@keyframes ascent-reset { 40% { transform: scale(1.18); color: #fff; } }
.ascent-meter-value { color: var(--gold-light); font-size: 14px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #000; overflow: hidden; text-overflow: ellipsis; }

.ascent-jackpots { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ascent-jackpot {
  position: relative;
  min-width: 0;
  padding: 4px 6px;
  text-align: center;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(var(--ascent-lapis-light), var(--bg-deep));
  box-shadow: inset 0 1px 0 #fff3, 0 2px 0 var(--gold-deep);
}
.ascent-jackpot.grand { grid-column: 1 / -1; display: flex; justify-content: center; align-items: baseline; gap: 10px; border-width: 3px; border-color: var(--gold-light); }
.ascent-jackpot-name { display: block; font: 12px/1.05 var(--display); letter-spacing: .05em; text-shadow: 0 1px 0 #000; }
.ascent-jackpot.grand .ascent-jackpot-name { color: var(--cabinet-grand-ink); font-size: 13px; }
.ascent-jackpot.major .ascent-jackpot-name { color: var(--jp-major); }
.ascent-jackpot.minor .ascent-jackpot-name { color: var(--cabinet-minor-ink); }
.ascent-jackpot.mini .ascent-jackpot-name { color: var(--jp-mini); }
.ascent-jackpot-value { display: block; font: 15px/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--gold-light); text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; }
.ascent-jackpot.grand .ascent-jackpot-value { min-width: 0; font-size: var(--type-lead); }
.ascent-jackpot::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 14px 4px var(--gold-light); opacity: 0; pointer-events: none; }
.ascent-jackpot.flare { animation: ascent-flare 1s ease-out; }
.ascent-jackpot.flare::after { animation: ascent-flare-glow 1s ease-out; }
@keyframes ascent-flare { 30% { transform: scale(1.08); } }
@keyframes ascent-flare-glow { 30% { opacity: 1; } }

@container ascent-sign (max-height: 211px) {
  .ascent-jackpots { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
  .ascent-jackpot.grand { grid-column: auto; display: block; padding: 4px 6px; border-width: 2px; }
  .ascent-jackpot.grand .ascent-jackpot-name { font-size: 12px; }
  .ascent-jackpot.grand .ascent-jackpot-value { font-size: var(--type-readout); }
}
@container ascent-sign (max-height: 170px) {
  .ascent-title { display: none; }
}
@container ascent-sign (max-height: 110px) {
  .ascent-status { display: none; }
  .ascent-jackpot { padding: 2px 4px; }
  .ascent-jackpot-name { display: inline; margin-right: 4px; font-size: 11px; }
  .ascent-jackpot-value, .ascent-jackpot.grand .ascent-jackpot-value { font-size: 13px; }
  .ascent-meter { padding: 1px 8px; }
}

.app.ascent .win-plate {
  bottom: -17px;
  padding-block: 1px 0;
}

.ascent-show {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(20px, var(--safe-top)) 16px max(20px, var(--safe-bottom));
  z-index: 25;
  background: var(--ascent-veil);
}
.ascent-show.show { display: flex; }
.ascent-show-panel {
  width: min(100%, 380px);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 12px;
  text-align: center;
  color: var(--text);
  animation: ascent-panel-in .35s ease-out both;
}
@keyframes ascent-panel-in { from { transform: scale(.88); opacity: 0; } }
.ascent-show-panel h2 { margin: 0 0 6px; font: 30px/1.1 var(--display); letter-spacing: .04em; }
.ascent-show-hero { display: block; width: 120px; height: 120px; margin: 4px auto 8px; object-fit: contain; filter: drop-shadow(0 0 14px #ffd86a99); }
.ascent-show-main { font: 40px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.ascent-show-sub { margin: 12px auto 12px; max-width: 300px; font: 400 13px/1.4 var(--body); color: var(--muted); }
.ascent-show-jackpots:empty { display: none; }
.ascent-show-jackpots { margin: 0 auto 14px; max-width: 300px; }
.ascent-show-panel button {
  display: block;
  width: min(100%, 240px);
  min-height: 56px;
  margin: 0 auto 4px;
  padding: 8px 20px;
  color: var(--text);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(var(--ascent-go-light), var(--ascent-go));
  box-shadow: 0 0 0 1px var(--gold-deep), 0 4px 0 var(--ascent-go-deep), inset 0 1px 0 #fff6;
  font: 20px/1 var(--display);
  letter-spacing: .08em;
  text-shadow: 0 1px 0 #000;
}

.pt-ascent-gates .pt-row, .pt-ascent-jackpots .pt-row { grid-template-columns: 1fr 1fr 1fr; }
.pt-ascent-jackpots .pt-row { grid-template-columns: 1fr 1.4fr; }
.pt-ascent-jackpot.grand .pt-ascent-jackpot-name { color: var(--jp-grand); }
.pt-ascent-jackpot.major .pt-ascent-jackpot-name { color: var(--jp-major); }
.pt-ascent-jackpot.minor .pt-ascent-jackpot-name { color: var(--jp-minor); }
.pt-ascent-jackpot.mini .pt-ascent-jackpot-name { color: var(--jp-mini); }
.paytable .pt-scatter-faces .cell.ascent-orb { --cell: 64px; --ascent-cell-h: 64px; width: 64px; height: 64px; }
.paytable .pt-scatter-faces .cell.ascent-orb .sym-img { max-height: 64px; }

@media (max-height: 700px) {
  .ascent-show-panel h2 { font-size: 26px; }
  .ascent-show-hero { width: 92px; height: 92px; }
  .ascent-show-main { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .ascent-scene-sun, .ascent-scene-stars, .ascent-scene-dust, .ascent-jackpot.flare, .ascent-jackpot.flare::after, .ascent-show-panel,
  .ascent-gate.opening, .ascent-meter-name.reset,
  .app.ascent .cell.ascent-orb.absorbed .ascent-value, .app.ascent .cell.ascent-orb.charged,
  .app.ascent .cell.ascent-orb.boosted, .app.ascent .cell.ascent-orb.boosting { animation: none; }
  .app.ascent.ascent-grow .reel, .app.ascent.ascent-grow .cell, .ascent-gate, .ascent-gate-fill { transition: none; }
}

.app.ascent {
  --machine-accent: #ffe38a;
  --machine-accent-2: #2fd8d0;
}
