/* Shared components, in the stage look: type on a dark house, gold hairlines, paper for what you can hold, a button with a red offset
   shadow, and bounce for rewards. One glow per screen: .card--glow or .card--ice is it. Blue is learning, gold is earned, coral is caution. */

.ic {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.ic--fill {
  fill: currentColor;
  stroke: none;
}

.eyebrow {
  font: 700 0.74rem/1.2 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.dim {
  color: var(--text-dim);
  font-size: 1rem;
}

.num {
  font-family: var(--font-display);
  font-weight: 700;
  /* A sturdier optical size, so the thin strokes of numerals do not vanish at everyday sizes. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 14;
  letter-spacing: -0.01em;
}

/* Sections sit straight on the ice with a hairline above them. Only panels (sheets, toasts) are a dark surface. */

.card {
  padding: var(--sp-4) 0 0;
  border-top: 1px solid var(--rule-gold);
}

/* The one glow: the rule above this section catches the low gold sun. */
.card--glow {
  border-top-color: rgba(255, 217, 138, 0.8);
  box-shadow: 0 -14px 28px -22px rgba(255, 200, 110, 0.9);
}

.card--ice {
  border-top-color: rgba(14, 35, 71, 0.75);
  box-shadow: 0 -14px 28px -22px rgba(14, 35, 71, 0.8);
}

/* A reminder that should not shout: a thin gold outline. */
.card.nudge {
  padding: var(--sp-4);
  border: 1px solid var(--rule-gold);
  border-radius: var(--r-md);
  box-shadow: none;
  background: rgba(4, 14, 36, 0.45);
}

.glass,
.sheet,
.toast {
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--rule-gold);
  box-shadow: var(--glass-shadow);
}

.split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* Buttons: cream with a red offset shadow that you press into, in Bodoni italic. Gold is for rewards, coral for ending or deleting, and an
   outline for everything else. */

.btn {
  --bg1: var(--cream);
  --bg2: var(--cream);
  --shade: var(--red);
  --fg: #3d0c1b;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--fg);
  font: 600 1.3rem/1.1 var(--font-display);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.3s var(--spring), box-shadow 0.2s, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--shade);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shade);
  transition-duration: 0.1s;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--gold {
  --bg1: #fff1c4;
  --bg2: #f5b64a;
  --shade: #8a5a12;
  --fg: var(--ink-gold);
}

.btn--coral {
  --bg1: #ef6a58;
  --bg2: #e0493a;
  --shade: #6a1a14;
  --fg: #fff;
}

.btn--glass {
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: none;
  color: var(--text);
  font: 600 1rem/1.1 var(--font-ui);
  box-shadow: none;
}

.btn--glass:hover {
  background: rgba(14, 35, 71, 0.08);
  box-shadow: none;
  transform: none;
}

.btn--glass:active {
  transform: scale(0.97);
  box-shadow: none;
}

.btn--small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1.05rem;
  box-shadow: 3px 3px 0 var(--shade);
}

.btn--small.btn--glass {
  font-size: 0.95rem;
  box-shadow: none;
}

/* Two buttons side by side, such as + Landed and + Missed. */

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.pair .btn {
  padding: 0 10px;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
  background: none;
  color: var(--cream);
  cursor: pointer;
  transition: transform 0.4s var(--spring), background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn .ic {
  width: 20px;
  height: 20px;
}

.icon-btn--sm {
  width: 40px;
  height: 40px;
}

/* Chips: outlined pills. A pressed chip fills with ice-white; a status chip is a quiet cyan outline. */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: none;
  color: var(--text-dim);
  font: 500 0.92rem/1.2 var(--font-ui);
  cursor: pointer;
  transition: transform 0.4s var(--spring), background 0.2s, color 0.2s;
}

.chip:active {
  transform: scale(0.92);
}

.chip[aria-pressed="true"] {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
}

.chip--on,
.chip--gold,
.chip--coral {
  cursor: default;
  font-weight: 600;
}

.chip--on {
  border-color: rgba(166, 241, 255, 0.6);
  background: rgba(95, 216, 230, 0.12);
  color: var(--ice-bright);
}

.chip--gold {
  border-color: rgba(255, 217, 138, 0.7);
  background: rgba(255, 200, 110, 0.12);
  color: var(--gold-hi);
}

.chip--coral {
  border-color: rgba(255, 150, 135, 0.8);
  background: rgba(255, 110, 95, 0.14);
  color: #ffb4a8;
}

/* Forms */

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-weight: 600;
}

.input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: rgba(3, 14, 40, 0.6);
  color: var(--text);
}

.input::placeholder {
  color: var(--text-faint);
}

select.input {
  padding-right: 8px;
}

.input--num {
  width: 92px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Tabs inside a screen: plain words with a gold line under the one you are on. */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}

.seg button {
  margin-bottom: -1px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text-dim);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}

.seg button[aria-pressed="true"] {
  border-bottom-color: var(--sun);
  color: #fff;
  font-weight: 600;
}

/* Bars: a hairline track, a fill whose color follows the job, and a bright bead at the end, like a blade catching the light.
   The fill warms from ice to gold as it nears done. Set --v (a percentage) and --vn (the same number, unitless). */

.bar {
  position: relative;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--track);
}

.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--v, 0%);
  border-radius: inherit;
  background-image: var(--bar-gradient, linear-gradient(90deg, var(--ice), var(--ice-bright) 52%, var(--sun)));
  background-size: calc(10000% / var(--vn, 100)) 100%;
  background-repeat: no-repeat;
  box-shadow: 0 0 12px var(--bar-glow, rgba(166, 241, 255, 0.5));
  transition: width 0.9s var(--spring-soft);
}

.bar > i::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px var(--bar-glow, rgba(166, 241, 255, 0.7));
}

.bar > i[style*="--v:0%"]::after {
  display: none;
}

.bar--xp {
  --bar-gradient: linear-gradient(90deg, rgba(255, 234, 176, 0.35), #ffe3a0 60%, #ffc35a);
  --bar-glow: rgba(255, 200, 110, 0.8);
}

.bar--blade {
  --bar-gradient: linear-gradient(90deg, var(--ice), var(--sun) 62%, var(--coral));
  --bar-glow: rgba(255, 200, 110, 0.55);
}

.bar--thin {
  height: 3px;
}

.bar--thin > i::after {
  right: -4px;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
}

/* Level medallion */

.level {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fff6d0, #ffd77a 38%, #f2a93a 72%, #c27d17);
  color: var(--ink-gold);
  font: 800 2.1rem/1 var(--font-display);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -6px 10px rgba(150, 80, 0, 0.35),
    0 0 0 4px rgba(255, 217, 138, 0.28),
    0 8px 24px rgba(255, 170, 70, 0.45);
}

.level::after {
  content: "";
  position: absolute;
  top: 7%;
  left: 14%;
  right: 24%;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.7), transparent);
  pointer-events: none;
}

.level--xl {
  width: 168px;
  height: 168px;
  font-size: 5.6rem;
}

.level.pop {
  animation: level-pop 0.8s var(--spring-soft);
}

@keyframes level-pop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.36) rotate(-8deg);
  }
  55% {
    transform: scale(0.92) rotate(3deg);
  }
  78% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.twinkle-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--c, var(--sun));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none;
  animation: star-pop 0.8s ease-out forwards;
}

@keyframes star-pop {
  0% {
    transform: translate(0, 0) scale(0.3);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(140deg) scale(1);
    opacity: 0;
  }
}

/* Skate rating: unearned skates are ghosts, earned skates are the real white-and-gold thing. */

.skate {
  display: block;
  width: 58px;
  height: 42px;
  overflow: visible;
}

.rating {
  display: inline-flex;
  gap: 2px;
}

.rating button {
  position: relative;
  padding: 3px 1px;
  border: 0;
  border-radius: 14px;
  background: none;
  line-height: 0;
  cursor: pointer;
}

/* Stars for a rating: an outline when it does not count, filled gold when it does. Big enough to hit with a glove on. */
.rating .star {
  width: 46px;
  height: 46px;
  fill: transparent;
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: transform 0.45s var(--spring), fill 0.2s, stroke 0.2s;
}

.rating button:hover .star {
  transform: translateY(-2px) scale(1.06);
}

.rating button[aria-pressed="true"] .star {
  fill: var(--gold-hi);
  stroke: var(--gold-hi);
}

.rating button.earn .star {
  animation: earn 0.7s var(--spring-soft) both;
  animation-delay: var(--i, 0s);
}

@keyframes earn {
  0% {
    transform: scale(0.55) rotate(-16deg);
  }
  50% {
    transform: scale(1.28) rotate(6deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.mini {
  display: inline-flex;
  gap: 1px;
}

.mini .skate {
  width: 29px;
  height: 21px;
}

.mini .skate.off {
  filter: grayscale(1) brightness(0.62);
  opacity: 0.42;
}

.mini .star {
  width: 17px;
  height: 17px;
  fill: transparent;
  stroke: var(--text-faint);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.mini .star.on {
  fill: var(--gold-hi);
  stroke: var(--gold-hi);
}

/* Sections with a job. A tile is just a section that holds a number, a picture, and a button. */

.tile {
  position: relative;
  display: grid;
  gap: var(--sp-3);
}

.tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.hours {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.hours .num {
  font-size: 2.8rem;
  line-height: 1;
}

/* The all-time total on the skates, under the blade life: it never starts over when the blades are sharpened. */
.alltime {
  display: grid;
  gap: var(--sp-1);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule-gold);
}

/* 10 hrs 14 mins 13 secs: the numbers big, the units small. */
.alltime__n {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}

.alltime .num {
  font-size: 1.9rem;
  line-height: 1;
}

.alltime .dim {
  margin-right: 6px;
}

/* The hours and minutes boxes in the blade editor */
.hm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.hm .input {
  width: 5.5rem;
  min-width: 0;
}

.blade {
  position: relative;
  width: 100%;
  aspect-ratio: 250 / 44;
  margin: 4px 0 2px;
}

.blade svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.blade__dull {
  filter: grayscale(1) brightness(0.5) contrast(0.85);
  opacity: 0.85;
}

.blade__fresh {
  clip-path: inset(0 calc(100% - var(--p, 50%)) 0 0);
  filter: drop-shadow(0 0 10px rgba(166, 241, 255, 0.5));
  transition: clip-path 0.9s var(--spring-soft);
}

.blade__mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: var(--p, 50%);
  width: 2px;
  border-radius: 2px;
  background: var(--sun);
  box-shadow: 0 0 8px var(--sun);
  transition: left 0.9s var(--spring-soft);
}

.edit {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: rgba(3, 14, 40, 0.6);
}

.edit[hidden] {
  display: none;
}

.limit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.weekbars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 44px;
}

.weekbars i {
  flex: 1;
  height: var(--h, 30%);
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #ffeab0, #f5a742);
  opacity: 0.85;
}

.weekbars i.today {
  opacity: 1;
  box-shadow: 0 0 12px rgba(255, 190, 100, 0.7);
}

.datebox {
  display: grid;
  place-items: center;
  width: 68px;
  height: 72px;
  flex: none;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-md);
  text-align: center;
  line-height: 1;
}

.datebox .eyebrow {
  color: var(--sun);
}

.datebox .num {
  font-size: 2rem;
}

/* Skill rows */

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--glass-edge-soft);
}

.row:first-child {
  border-top: 0;
}

.row .grow {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  line-height: 1.3;
}

.cat {
  --c: var(--cat-skills);
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 9px var(--c);
}

.cat--jumps {
  --c: var(--cat-jumps);
}

.cat--spins {
  --c: var(--cat-spins);
}

.tick {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.4s var(--spring), background 0.2s;
}

.tick .ic {
  width: 16px;
  height: 16px;
  stroke-width: 3;
  opacity: 0;
}

.tick[aria-checked="true"] {
  background: linear-gradient(180deg, #ffffff, var(--ice));
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.08);
}

.tick[aria-checked="true"] .ic {
  opacity: 1;
}

/* Jump counter */

.pips {
  display: flex;
  gap: 6px;
  margin: var(--sp-3) 0;
}

.pip {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 1.5px solid var(--glass-edge);
}

.pip.on {
  background: linear-gradient(180deg, #ffffff, var(--ice));
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 8px rgba(166, 241, 255, 0.5);
}

/* Tabs: words only, along the foot of the stage. The one you are on is cream with a gold line under it. */

.tabbar {
  position: relative;
  display: flex;
  gap: 0;
  padding: 0;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: rgba(14, 35, 71, 0.62);
  font: 600 0.74rem/1 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}

.tab .ic {
  display: none;
}

.tab[aria-current="page"] {
  color: var(--cream);
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* Placeholders and people */

.placeholder {
  padding: var(--sp-5);
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--r-md);
  color: var(--text-dim);
  font: 500 0.95rem/1.4 var(--font-ui);
  text-align: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  background: linear-gradient(150deg, var(--af, rgba(255, 255, 255, 0.3)), var(--at, rgba(255, 255, 255, 0.08)));
  color: var(--ai, var(--ice-white));
  font: 600 0.84rem/1 var(--font-ui);
}

.row--you {
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: var(--r-md);
  border-top-color: transparent;
  background: rgba(255, 217, 138, 0.1);
  box-shadow: inset 3px 0 0 var(--sun);
}

/* Sheets: first-run setup and device connect */

.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border-radius: var(--r-xl);
  color: var(--text);
  overflow: auto;
}

.sheet::backdrop {
  background: rgba(3, 10, 40, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sheet[open] {
  animation: rise 0.55s var(--spring-soft) both;
}

.sheet__body {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-5);
}

.sheet [data-step] {
  display: grid;
  gap: var(--sp-3);
}

.sheet__title {
  font: 800 clamp(2rem, 7vw, 2.6rem) / 1.05 var(--font-display);
}

.sheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--glass-edge);
  transition: width 0.4s var(--spring), background 0.3s;
}

.dots i.on {
  width: 24px;
  background: var(--sun);
  box-shadow: 0 0 10px var(--sun);
}

.choice {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.4s var(--spring), border-color 0.2s, background 0.2s;
}

.choice:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

.choice:active {
  transform: scale(0.97);
}

.choice strong {
  font-size: 1.1rem;
  font-weight: 600;
}

.choice--primary {
  border-color: rgba(255, 217, 138, 0.8);
  box-shadow: 0 0 36px rgba(255, 186, 96, 0.25);
}

.note {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.status {
  min-height: 1.5em;
  font-weight: 500;
}

.status--ok {
  color: var(--ice-bright);
}

.status--warn {
  color: #ffb4a8;
}

.qr {
  width: min(260px, 72%);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 14px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18), var(--glass-shadow);
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.camera {
  position: relative;
  width: min(260px, 72%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: var(--r-lg);
  background: rgba(3, 14, 48, 0.55);
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--sp-5);
  color: var(--text-dim);
}

.camera i {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 4px solid var(--ice-bright);
  border-radius: 10px;
}

.camera i:nth-of-type(1) {
  top: 12px;
  left: 12px;
  border-right: 0;
  border-bottom: 0;
}

.camera i:nth-of-type(2) {
  top: 12px;
  right: 12px;
  border-left: 0;
  border-bottom: 0;
}

.camera i:nth-of-type(3) {
  bottom: 12px;
  left: 12px;
  border-right: 0;
  border-top: 0;
}

.camera i:nth-of-type(4) {
  bottom: 12px;
  right: 12px;
  border-left: 0;
  border-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: var(--r-pill);
  font-weight: 500;
  translate: -50% 0;
  animation: toast-in 0.5s var(--spring-soft) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
  }
}

/* XP feedback and the level-up celebration */

.xp-float {
  position: absolute;
  z-index: 5;
  font: 800 1.3rem/1 var(--font-display);
  color: var(--sun);
  text-shadow: 0 0 14px rgba(255, 190, 100, 0.8);
  pointer-events: none;
  animation: float-up 1.1s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes float-up {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  25% {
    transform: translateY(-14px) scale(1.25);
    opacity: 1;
  }
  100% {
    transform: translateY(-58px) scale(1);
    opacity: 0;
  }
}

.cele {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  text-align: center;
  background: radial-gradient(62% 52% at 50% 42%, rgba(255, 200, 110, 0.38), rgba(3, 10, 40, 0.8) 72%);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  animation: fade-in 0.3s ease both;
}

.cele.out {
  animation: fade-out 0.25s ease forwards;
}

.cele__rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(130vw, 960px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 150, 0.3) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 62%);
  mask-image: radial-gradient(circle, #000 10%, transparent 62%);
  animation: spin-slow 26s linear infinite;
}

.cele .level {
  animation: badge-in 1s var(--spring-soft) both;
}

.cele__title {
  position: relative;
  font: 800 clamp(2.6rem, 10vw, 4rem) / 1 var(--font-display);
  text-shadow: 0 0 30px rgba(255, 190, 100, 0.7);
  animation: rise 0.7s 0.25s var(--spring-soft) both;
}

.cele__sub,
.cele .btn {
  position: relative;
}

.cele__sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  animation: rise 0.7s 0.4s var(--spring-soft) both;
}

.cele .btn {
  margin-top: var(--sp-2);
  animation: rise 0.7s 0.55s var(--spring-soft) both;
}

.cele__burst {
  position: absolute;
  left: 50%;
  top: 42%;
}

.cele__burst i {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s, 10px);
  height: var(--s, 10px);
  margin: calc(var(--s, 10px) / -2) 0 0 calc(var(--s, 10px) / -2);
  background: var(--c);
  opacity: 0;
  animation: burst var(--t, 1.6s) cubic-bezier(0.12, 0.8, 0.3, 1) var(--dl, 0.1s) both;
}

.cele__burst i.star {
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

@keyframes burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(0.2);
  }
  55% {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x) * 1.15), calc(var(--y) + 170px)) rotate(calc(var(--r) * 2)) scale(0.8);
  }
}

@keyframes badge-in {
  0% {
    transform: scale(0) rotate(-30deg);
  }
  55% {
    transform: scale(1.28) rotate(8deg);
  }
  78% {
    transform: scale(0.94) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}
