/* The rep calculator (/reps). Linked after styles.css and companion.css: every color, curve and
   the yellow commit key come from there; this file adds only the calculator's own parts, all
   under the rp- prefix. Phone first: the reader arrives from TikTok, in the in-app browser. */

.rp-body { padding-bottom: 0; }

/* the landing's candy trios, as the key variables a keycap reads */
[data-color="pink"]   { --c: var(--pink);   --cl: var(--pink-light);   --cs: var(--pink-shade);   --ti: #FFFFFF; }
[data-color="mint"]   { --c: var(--mint);   --cl: var(--mint-light);   --cs: var(--mint-shade);   --ti: var(--ink-fixed); }
[data-color="lime"]   { --c: var(--lime);   --cl: var(--lime-light);   --cs: var(--lime-shade);   --ti: var(--ink-fixed); }
[data-color="orange"] { --c: var(--orange); --cl: var(--orange-light); --cs: var(--orange-shade); --ti: var(--ink-fixed); }
[data-color="purple"] { --c: var(--purple); --cl: var(--purple-light); --cs: var(--purple-shade); --ti: #FFFFFF; }
[data-color="coral"]  { --c: var(--coral);  --cl: var(--coral-light);  --cs: var(--coral-shade);  --ti: #FFFFFF; }

/* ---------- The sentence ---------- */

.rp {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.rp-build {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 6px;
}

.rp-seat {
  width: 150px;
  height: 150px;
  margin: 0 auto;
}
.rp-seat .av { --size: 150px; }
/* in the builder the bubble would cover the sentence: it hangs on the right, over the air */
.rp-build .av__say { max-width: min(190px, 46vw); }

.rp-kicker {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rp-sentence {
  margin: 10px 0 0;
  font: 800 clamp(31px, 8.6vw, 54px)/1.32 var(--font-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.rp-sentence > span { white-space: nowrap; }
.rp-ellipsis { margin-left: .04em; }

/* a word you can change is a paper key; the exercise is a key in its own hue (a picker key) */
.rp-slot {
  --c: var(--paper);
  --cl: var(--paper);
  --cs: var(--paper-3);
  --ti: var(--ink);
  position: relative;
  z-index: 0;
  display: inline-block;
  margin: 0 .04em;
  padding: .02em .28em .16em;
  border: 0;
  border-radius: .3em;
  corner-shape: squircle;
  font: inherit;
  letter-spacing: inherit;
  color: var(--ti);
  background: linear-gradient(180deg, var(--cl) 0%, var(--c) 30%, var(--cs) 100%);
  box-shadow: 0 .16em .22em -.1em rgba(var(--shadow-rgb), .4), inset 0 1px 0 rgba(255, 255, 255, .5);
  cursor: pointer;
  vertical-align: baseline;
  transform-origin: 50% 100%;
  transition: transform var(--t-spring) var(--ease-spring);
}
.rp-slot::before {
  content: "";
  position: absolute;
  inset: .05em .07em .14em;
  z-index: -1;
  border-radius: .25em;
  corner-shape: squircle;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c) 55%);
  pointer-events: none;
  transition: inset var(--t-spring) var(--ease-spring);
}
.rp-slot:active {
  transform: translateY(.08em) scale(1.03, .95);
  transition: transform var(--t-drop) var(--ease-drop);
}
.rp-slot:active::before { inset: .05em .07em .05em; transition: inset var(--t-drop) var(--ease-drop); }
.rp-slot--ex { --c: var(--pink); --cl: var(--pink-light); --cs: var(--pink-shade); --ti: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .rp-slot:not(.rp-slot--ex) { --c: var(--paper-2); --cl: #3A3B58; --cs: var(--paper-3); }
}

/* the word you are changing: the wall-tab scribble, the one yellow that is not a target */
.rp-slot[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -.2em;
  height: .13em;
  border-radius: 99px;
  background: var(--yellow);
  transform: rotate(-1.5deg);
}

.rp-slot.is-bumped { animation: rp-bump var(--t-rubber) var(--ease-rubber); }
@keyframes rp-bump { 0% { transform: scale(.86, .92); } 100% { transform: scale(1); } }

/* ---------- The drawer: the control for the word you tapped ----------
   A <dialog> that fills the screen; its empty top is the scrim, its paper sits on the bottom.
   The backdrop is light so the sentence above stays readable while it changes. */

.rp-drawer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
}
.rp-drawer[open] { display: flex; align-items: flex-end; justify-content: center; }
.rp-drawer::backdrop { background: rgba(8, 8, 20, .28); animation: rp-fade .28s var(--ease-out); }
.rp-drawer.is-leaving::backdrop { animation: rp-fade-out .24s var(--ease-out) forwards; }
@keyframes rp-fade-out { to { opacity: 0; } }
html.rp-drawer-open { overflow: hidden; }

.rp-drawer__paper {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px calc(20px + var(--safe-bottom));
  border-radius: 30px 30px 0 0;
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .45);
  animation: rp-sheet-in .46s var(--ease-pop);
}
.rp-drawer.is-leaving .rp-drawer__paper { animation: rp-drawer-out .24s var(--ease-out) forwards; }
.rp-drawer.is-flung .rp-drawer__paper { animation: none; }
@keyframes rp-drawer-out { to { transform: translateY(100%); } }

/* the head is the handle: drag it down to put the drawer away */
.rp-drawer__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0 -16px 10px;
  padding: 18px 12px 8px 20px;
  background: var(--paper);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.rp-drawer__grip {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 5px;
  margin-left: -20px;
  border-radius: 99px;
  background: var(--paper-3);
}
.rp-drawer__title { margin: 0; text-align: left; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.rp-drawer__done { background: var(--paper-2); color: var(--ink); cursor: pointer; }

.rp-panel[hidden] { display: none; }
.rp-panel { animation: rp-panel-in .28s var(--ease-pop); }
@keyframes rp-panel-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.rp-stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 8px;
}
.rp-numeral {
  font: 800 64px/1 var(--font-display);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

/* a paper key: the landing's key construction on paper */
.rp-key {
  --c: var(--paper);
  --cl: #FFFFFF;
  --cs: var(--paper-3);
  --ti: var(--ink);
  position: relative;
  z-index: 0;
  min-height: 48px;
  padding: 0 14px 5px;
  border: 0;
  border-radius: 16px;
  corner-shape: squircle;
  font: 800 16px/1 var(--font-display);
  color: var(--ti);
  background: linear-gradient(180deg, var(--cl) 0%, var(--c) 30%, var(--cs) 100%);
  box-shadow: 0 8px 12px -8px rgba(var(--shadow-rgb), .45), 0 0 0 1px rgba(var(--shadow-rgb), .04);
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform var(--t-spring) var(--ease-spring);
  -webkit-user-select: none;
  user-select: none;
}
.rp-key::before {
  content: "";
  position: absolute;
  inset: 3px 4px 8px;
  z-index: -1;
  border-radius: 12px;
  corner-shape: squircle;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%);
  pointer-events: none;
  transition: inset var(--t-spring) var(--ease-spring);
}
.rp-key:active { transform: translateY(4px) scale(1.02, .95); transition: transform var(--t-drop) var(--ease-drop); }
.rp-key:active::before { inset: 3px 4px 3px; transition: inset var(--t-drop) var(--ease-drop); }
.rp-key[aria-checked="true"] { --c: var(--ink-fixed); --cl: #34325A; --cs: #0E0D22; --ti: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .rp-key { --c: var(--paper-2); --cl: #3A3B58; --cs: var(--paper-3); }
  .rp-key[aria-checked="true"] { --c: #FFFFFF; --cl: #FFFFFF; --cs: #C9CBDA; --ti: var(--ink-fixed); }
}
.rp-key--round { min-height: 56px; padding: 0 0 5px; font-size: 30px; border-radius: 20px; }
.rp-key--round::before { border-radius: 16px; }

.rp-range {
  width: 100%;
  margin: 14px 0 4px;
  accent-color: var(--yellow);
  height: 32px;
}

.rp-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.rp-chips--wide .rp-key { flex: 1 1 40%; }

.rp-exgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* an exercise key: a candy keycap with its word, the way a tile is built */
.rp-ex {
  position: relative;
  z-index: 0;
  aspect-ratio: 1.15;
  border: 0;
  border-radius: 20px;
  corner-shape: squircle;
  background: linear-gradient(180deg, var(--cl) 0%, var(--c) 30%, var(--cs) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 12px 16px -10px rgba(var(--shadow-rgb), .45);
  color: var(--ti);
  cursor: pointer;
  text-align: left;
  transform-origin: 50% 100%;
  transition: transform var(--t-spring) var(--ease-spring);
}
.rp-ex::before {
  content: "";
  position: absolute;
  inset: 4px 6px 11px;
  z-index: -1;
  border-radius: 16px;
  corner-shape: squircle;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, #fff) 0%, var(--c) 40%, color-mix(in srgb, var(--c) 92%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: inset var(--t-spring) var(--ease-spring);
}
.rp-ex:active { transform: translateY(6px) scale(1.04, .95); transition: transform var(--t-drop) var(--ease-drop); }
.rp-ex:active::before { inset: 4px 6px 4px; transition: inset var(--t-drop) var(--ease-drop); }
.rp-ex__word {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  opacity: .9;
}
.rp-ex__name {
  position: absolute;
  left: 12px;
  bottom: 17px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}
/* the chosen exercise: the record badge's yellow check, pinned on the corner */
.rp-ex[aria-checked="true"]::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B33' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: 0 4px 8px -3px rgba(var(--shadow-rgb), .5);
  transform: rotate(8deg);
}

.rp-go {
  min-height: 66px;
  min-width: min(340px, 100%);
  padding: 0 30px 8px;
  margin-top: 24px;
  font-size: 22px;
}

/* ---------- About ---------- */

.rp-about {
  max-width: 560px;
  margin: 96px auto 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink-soft);
}
.rp-about__title {
  margin: 0 0 10px;
  font: 800 clamp(24px, 6vw, 32px)/1.1 var(--font-display);
  letter-spacing: -.025em;
  color: var(--ink);
}
.rp-about h3 { margin: 26px 0 6px; font-size: 17px; font-weight: 800; color: var(--ink); }
.rp-about ul { padding-left: 20px; margin: 0; }
.rp-about li + li { margin-top: 6px; }
.rp-about b { color: var(--ink); }
.rp-about a { color: var(--ink); font-weight: 800; }
.rp-body .footer { padding-bottom: calc(40px + var(--safe-bottom)); }

/* ---------- The hue world: the builder stands alone, in the chosen exercise's color ----------
   The whole page takes the exercise's candy trio (body[data-color], set by reps.js), and fades
   to the next one when you pick another. Text is white on the dark hues and ink on the light
   ones: that is the trio's own --ti. Behind it, rep squares fall at the rate of your plan. */

@property --bg-top { syntax: "<color>"; inherits: true; initial-value: #FF7AB0; }
@property --bg-mid { syntax: "<color>"; inherits: true; initial-value: #E2105B; }
@property --bg-low { syntax: "<color>"; inherits: true; initial-value: #B30D48; }

.rp-body {
  --bg-top: var(--cl);
  --bg-mid: var(--c);
  --bg-low: var(--cs);
  /* the text color of this hue, kept for the parts that set their own --ti */
  --on: var(--ti);
  color: var(--ti);
  background: var(--bg-low);
  transition: --bg-top .7s var(--ease-out), --bg-mid .7s var(--ease-out), --bg-low .7s var(--ease-out), color .3s var(--ease-out);
}
/* a fixed layer, not background-attachment: fixed, which iOS ignores */
.rp-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(90% 55% at 50% 12%, color-mix(in srgb, #fff 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-low) 100%);
}
.rp-rain {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rp-body .topbar__mark,
.rp-body .topbar__link,
.rp-body .footer p { color: inherit; }
.rp-body .topbar__link { opacity: .8; }
.rp-body .topbar__link[aria-current="page"] { opacity: 1; }
.rp-body .footer__nav a { color: inherit; opacity: .8; }
.rp-body .footer__nav a:hover { opacity: 1; }

.rp-build { position: relative; }
.rp-kicker {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--ink-fixed);
  color: #FFFFFF;
  font-size: 12px;
  letter-spacing: .1em;
  transform: rotate(-2deg);
  box-shadow: 0 8px 14px -8px rgba(0, 0, 0, .5);
}
.rp-sentence { text-shadow: 0 2px 0 rgba(0, 0, 0, .06); }
.rp-slot { text-shadow: none; }

/* the exercise word: an ink key, so it shows on every hue, its own included */
.rp-slot.rp-slot--ex { --c: var(--ink-fixed); --cl: #3A3862; --cs: #0B0A1C; --ti: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .rp-slot:not(.rp-slot--ex) { --c: #FFFFFF; --cl: #FFFFFF; --cs: #C9CBDA; --ti: var(--ink-fixed); }
}
/* the scribble under the word you are changing, in this hue's text color */
.rp-slot[aria-expanded="true"]::after { background: var(--on); height: .1em; bottom: -.24em; }


/* Show me!: the yellow key, with a hard ink shadow so it holds on yellow-ish hues too */
.rp-go {
  box-shadow: 0 0 0 3px var(--ink-fixed), 0 8px 0 3px var(--ink-fixed), 0 22px 30px -10px rgba(0, 0, 0, .45);
  animation: rp-go-breathe 2.4s var(--ease-out) infinite;
}
@keyframes rp-go-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.rp-go:active { animation: none; }
.rp-body .hero__fine { color: inherit; opacity: .78; }

/* stickers floating round Cap: what your year could turn into */
.rp-floaters { position: absolute; inset: 0 0 auto; height: 200px; pointer-events: none; }
.rp-float {
  position: absolute;
  width: var(--s, 64px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25));
  animation: rp-float var(--d, 5s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
@keyframes rp-float {
  from { transform: translateY(-6px) rotate(calc(var(--r, 0deg) - 5deg)); }
  to { transform: translateY(8px) rotate(calc(var(--r, 0deg) + 5deg)); }
}

/* how it counts: a paper card on the hue, so the long text reads in ink */
.rp-about {
  margin-top: 80px;
  padding: 24px 22px 26px;
  border-radius: 28px;
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .5);
}
.rp-body .footer { color: var(--on); }

/* ---------- The stage: the reveal ---------- */

.rp-stage {
  --stage: #14132A;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 18%, color-mix(in srgb, var(--hue, var(--pink)) 30%, transparent), transparent 70%),
    var(--stage);
  color: #FFFFFF;
  animation: rp-stage-in .42s var(--ease-pop);
}
.rp-stage[hidden] { display: none; }
.rp-stage.is-leaving { animation: rp-stage-out .26s var(--ease-out) forwards; }
@keyframes rp-stage-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes rp-stage-out { to { opacity: 0; transform: translateY(24px); } }

.rp-stage__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
}

.rp-stage__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--gutter) calc(40px + var(--safe-bottom));
}
.rp-stage__scroll > * { max-width: 520px; margin-left: auto; margin-right: auto; }

.rp-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: inherit;
  font: 800 15px/1 var(--font-display);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-spring) var(--ease-spring), background .2s var(--ease-out);
}
.rp-ghost[hidden] { display: none; }
.rp-ghost:active { transform: scale(.95); transition: transform var(--t-drop) var(--ease-drop); }
.rp-ghost svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; margin-left: -4px; }

.rp-friend {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink-fixed);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(3deg);
}

.rp-hero { text-align: center; }
.rp-hero__sentence {
  margin: 0 auto;
  max-width: 30ch;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: rgba(255, 255, 255, .78);
  text-wrap: balance;
}
.rp-seat--stage { width: 170px; height: 170px; margin-top: 52px; }
.rp-seat--stage .av { --size: 170px; }
.rp-stage .av__say { max-width: min(200px, 48vw); }

.rp-count {
  margin: 4px 0 0;
  font: 800 clamp(64px, 20vw, 108px)/.95 var(--font-display);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.rp-count__unit {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--hue-light, var(--pink-light));
}

.rp-wallbox {
  position: relative;
  height: min(38vh, 330px);
  margin-top: 18px;
}
.rp-wall { display: block; width: 100%; height: 100%; }
.rp-slap {
  position: absolute;
  top: 18px;
  right: -8px;
  width: min(34vw, 150px);
  transform: rotate(12deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35));
  pointer-events: none;
}
.rp-legend {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
}

.rp-after { opacity: 0; transform: translateY(16px); pointer-events: none; }
.rp-after.is-on { opacity: 1; transform: none; pointer-events: auto; transition: opacity .4s var(--ease-out), transform .5s var(--ease-pop); }

.rp-h2 {
  margin: 44px 0 0;
  font: 800 clamp(28px, 7vw, 38px)/1.05 var(--font-display);
  letter-spacing: -.03em;
}

.rp-cards {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.rp-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 10px;
  border-radius: 24px;
  corner-shape: squircle;
  background: #232243;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 24px -16px rgba(0, 0, 0, .6);
}
.rp-after.is-on .rp-card { animation: rp-card-in .5s var(--ease-pop) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes rp-card-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.rp-card img {
  width: 84px;
  height: 84px;
  transform: rotate(var(--tilt, -6deg));
}
.rp-card b {
  display: block;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.rp-card span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, .72);
}

.rp-soft {
  margin: 8px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, .72);
}

.rp-pledge { text-align: center; }
.rp-pad {
  position: relative;
  height: 150px;
  margin-top: 16px;
  border-radius: 24px;
  corner-shape: squircle;
  background: #0E0D22;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .5), inset 0 -1px 0 rgba(255, 255, 255, .06);
  touch-action: none;
}
.rp-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rp-pad__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: rgba(255, 255, 255, .22);
  pointer-events: none;
}
.rp-pad__clear { position: absolute; top: 8px; right: 8px; min-height: 36px; padding: 0 12px; font-size: 13px; }
.rp-pad.is-signed .rp-pad__hint { display: none; }

.rp-share {
  min-height: 66px;
  width: 100%;
  margin-top: 18px;
  padding: 0 24px 8px;
  font-size: 21px;
}
.rp-share[aria-busy="true"] { pointer-events: none; }
.rp-share__fine { font-size: 13px; }
.rp-share__more { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

.rp-app {
  margin-top: 56px;
  padding: 26px 20px 22px;
  border-radius: 28px;
  corner-shape: squircle;
  background: #232243;
  text-align: center;
}
.rp-app .rp-h2 { margin-top: 12px; }
.rp-app__tiles { display: inline-flex; gap: 6px; }
.rp-app__tiles i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--cl), var(--c) 30%, var(--cs));
}
.rp-app__fine { font-size: 13px; }
.rp-again { margin-top: 18px; }

/* the second key on the stage: ink on the dark, white face, so yellow stays the one action */
.rp-inkkey {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  margin-top: 18px;
  padding: 0 24px 7px;
  border-radius: 22px;
  corner-shape: squircle;
  background: linear-gradient(180deg, #FFFFFF, #F1F2F8 30%, #BDC0D3);
  color: var(--ink-fixed);
  font: 800 19px/1 var(--font-display);
  text-decoration: none;
  box-shadow: 0 16px 24px -14px rgba(0, 0, 0, .7);
  transform-origin: 50% 100%;
  transition: transform var(--t-spring) var(--ease-spring);
}
.rp-inkkey::before {
  content: "";
  position: absolute;
  inset: 4px 6px 11px;
  z-index: -1;
  border-radius: 18px;
  corner-shape: squircle;
  background: linear-gradient(180deg, #FFFFFF, #F4F5F9);
}
.rp-inkkey:active { transform: translateY(5px) scale(1.02, .95); transition: transform var(--t-drop) var(--ease-drop); }

.rp-small {
  margin: 28px 0 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .5);
}
.rp-small a { color: rgba(255, 255, 255, .8); }

/* ---------- The share sheet ---------- */

.rp-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.rp-sheet[hidden] { display: none; }
.rp-sheet__scrim { position: absolute; inset: 0; background: rgba(8, 8, 20, .6); animation: rp-fade .28s var(--ease-out); }
@keyframes rp-fade { from { opacity: 0; } }
.rp-sheet__paper {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  overflow-y: auto;
  padding: 18px 20px calc(18px + var(--safe-bottom));
  border-radius: 30px 30px 0 0;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  animation: rp-sheet-in .46s var(--ease-pop);
}
@keyframes rp-sheet-in { from { transform: translateY(100%); } }
.rp-sheet__title { margin: 4px 0 12px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.rp-sheet__preview {
  width: min(58vw, 250px, calc((94vh - 330px) * 9 / 16));
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #14132A;
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .6);
}
.rp-sheet__preview video,
.rp-sheet__preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-sheet__hint { color: var(--ink-soft); font-size: 14px; }
.rp-sheet__hint:empty { display: none; }
.rp-sheet__keys { display: grid; gap: 10px; margin-top: 14px; }
.rp-sheet__go { min-height: 60px; font-size: 20px; padding-bottom: 7px; }
.rp-sheet__go[hidden] { display: none; }
.rp-sheet__save,
.rp-sheet__close { background: var(--paper-2); color: var(--ink); }
.rp-sheet__save[hidden] { display: none; }
.rp-sheet__close { margin-top: 10px; }

/* ---------- Toast ---------- */

.rp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 80;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink-fixed);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .5);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease-pop), opacity .2s var(--ease-out);
}
.rp-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- The film: the hidden figure and canvas the video is drawn from ---------- */

.rp-film-cap,
.rp-film-canvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.rp-film-cap .av__say { display: none; }

body.rp-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .rp-stage, .rp-panel, .rp-sheet__paper, .rp-sheet__scrim, .rp-drawer__paper, .rp-drawer::backdrop, .rp-after.is-on .rp-card, .rp-slot.is-bumped, .rp-go, .rp-float { animation: none; }
}

@media (min-width: 761px) {
  .rp-build { padding-top: 24px; }
  .rp-seat { width: 180px; height: 180px; }
  .rp-seat .av { --size: 180px; }
}
