/* Emojim on the web — the app's "Volt" identity: a night so deep it reads as
   black, translucent surfaces, and electric lime kept for the main action and
   for what is selected or done. The tokens match ios/Emojim/Design/Theme.swift. */

@font-face {
  font-family: "Grandstander";
  src: url("/fonts/Grandstander.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #c5f05a;
  --on-ink: #0b1004;
  --bg: #07090f;
  --fg: #f2f3ee;
  --fg-2: rgba(242, 243, 238, 0.62);
  --fg-3: rgba(242, 243, 238, 0.38);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-raised: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.1);
  --glow: rgba(197, 240, 90, 0.18);
  --warning: #ffb547;
  --danger: #ff6b5e;

  --font-playful: "Grandstander", ui-rounded, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
    "Noto Sans Arabic", "Noto Sans Devanagari", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --tracking-display: -0.035em;
  --column: 560px;

  color-scheme: dark;
}

/* Scripts where tight tracking breaks glyphs or joins, and Grandstander has none. */
:root:is([data-lang="ar"], [data-lang="hi"], [data-lang="zh"], [data-lang="ja"], [data-lang="ru"]) {
  --tracking-display: 0;
  --font-playful: var(--font-body);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The soft lime light at the top of every page. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 600px;
  background: radial-gradient(440px 440px at 62% 0, var(--glow), rgba(197, 240, 90, 0.045) 55%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

body.sheet-open {
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.icon {
  display: inline-flex;
  flex: none;
}

.playful {
  font-family: var(--font-playful);
  font-weight: 900;
  letter-spacing: 0;
}

/* MARK: Layout */

.screen {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.screen.pack {
  --column: 820px;
  gap: 22px;
}

.screen.centered {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  min-height: 70vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  font-family: "Grandstander", var(--font-playful);
  font-weight: 900;
  font-size: 22px;
  user-select: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 22.37%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Tucked up under the logo. */
.hero {
  margin-top: -16px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 11vw, 48px);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: var(--tracking-display);
}

.hero h1 em,
.pack-status h1 em {
  font-style: normal;
  color: var(--ink);
}

.lede {
  margin: 0;
  color: var(--fg-2);
}

.lede.small {
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

/* MARK: Home on a phone */

.home {
  padding-bottom: 0;
}

/* The photo card flows with the page; the button goes last and sticks to the bottom. */
.home .side {
  display: contents;
}

.home .cta-bar {
  order: 1;
  margin: 0 -20px;
}

/* Clear of the fade above the button once the page is scrolled to its end. */
.home > .site-footer {
  padding-bottom: 24px;
}

/* Only on a wide screen. */
.sticker-wall,
.steps,
.hero-eyebrow,
.float {
  display: none;
}

/* MARK: Desktop */

@media (min-width: 960px) {
  .screen {
    padding-left: 48px;
    padding-right: 48px;
  }

  /* A studio: the pack laid out on the left, the photos and the create
     button in a panel on the right that stays in view while the page scrolls. */
  .screen.home {
    --column: 1240px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-areas:
      "top top"
      "hero side"
      "wall side"
      "steps side"
      "packs packs"
      "footer footer";
    grid-template-rows: auto auto auto 1fr auto auto;
    column-gap: 72px;
    row-gap: 36px;
    padding-bottom: 40px;
  }

  .home > .topbar {
    grid-area: top;
    margin: 0 -48px;
    padding: 0 48px;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
  }

  .home > .hero {
    grid-area: hero;
    margin-top: 28px;
  }

  .hero-eyebrow {
    display: block;
    margin: 0 0 18px;
  }

  .hero h1 {
    margin: 0;
    font-size: clamp(64px, 6.4vw, 88px);
    line-height: 0.98;
  }

  .home > .marquee {
    display: none;
  }

  /* The whole pack, each sticker on its own tile, tilted a little this way
     and that, popping in one after another. */
  .sticker-wall {
    grid-area: wall;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }

  .wall-tile {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    transform: rotate(var(--r));
    transition: transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1), background-color 0.2s, border-color 0.2s;
    animation: tile-in 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) backwards;
    animation-delay: calc(var(--i) * 25ms);
  }

  .wall-tile:hover {
    transform: rotate(0) scale(1.12);
    background: var(--surface-raised);
    border-color: rgba(197, 240, 90, 0.4);
    z-index: 1;
  }

  .wall-tile img {
    width: 84%;
    height: 84%;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  }

  @keyframes tile-in {
    from {
      opacity: 0;
      transform: rotate(var(--r)) scale(0.6) translateY(12px);
    }
  }

  .steps {
    grid-area: steps;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-self: start;
  }

  .step {
    padding: 20px;
    display: grid;
    gap: 8px;
    align-content: start;
  }

  .step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  .step-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ink);
    color: var(--on-ink);
  }

  .step-number {
    font: 600 13px var(--font-mono);
    color: var(--fg-3);
  }

  .step h3 {
    margin: 0;
    font-size: 17px;
  }

  .step p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fg-2);
  }

  /* The create panel: the photos and the button in one lit card. */
  .home .side {
    grid-area: side;
    position: sticky;
    top: 28px;
    align-self: start;
    display: grid;
    margin-top: 28px;
    padding: 8px 8px 24px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(197, 240, 90, 0.07), rgba(255, 255, 255, 0.03) 40%);
    border: 1px solid rgba(197, 240, 90, 0.22);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(197, 240, 90, 0.03);
  }

  .home .side .photos {
    background: none;
    border: 0;
    padding: 20px 18px 8px;
  }

  .home .side .card-head h2 {
    font-size: 28px;
  }

  .home .cta-bar {
    position: static;
    order: 0;
    margin: 0;
    padding: 8px 18px 0;
    background: none;
  }

  .home .cta-bar::before {
    display: none;
  }

  .float {
    display: block;
    position: absolute;
    width: 116px;
    height: 116px;
    pointer-events: none;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
    animation: bob 6s ease-in-out infinite;
  }

  .float-1 {
    --r: -14deg;
    top: 46%;
    inset-inline-start: -78px;
  }

  .float-2 {
    --r: 12deg;
    top: -48px;
    inset-inline-end: -46px;
    animation-delay: -2s;
  }

  .float-3 {
    --r: -8deg;
    bottom: -40px;
    inset-inline-end: -56px;
    width: 96px;
    height: 96px;
    animation-delay: -4s;
  }

  @keyframes bob {
    0%,
    100% {
      transform: rotate(var(--r)) translateY(0);
    }
    50% {
      transform: rotate(var(--r)) translateY(-10px);
    }
  }

  .home > .packs {
    grid-area: packs;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .home .packs h2 {
    font-size: 28px;
  }

  .pack-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    overflow: visible;
  }

  .pack-card {
    width: auto;
  }

  .pack-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    padding: 16px;
    transition: transform 0.2s, border-color 0.2s;
  }

  .pack-card:hover .pack-cover {
    transform: translateY(-3px);
    border-color: rgba(197, 240, 90, 0.4);
  }

  .home > .site-footer {
    grid-area: footer;
    padding-bottom: 0;
  }

  /* The pack: the whole sheet in view, with the download button beside the
     status rather than across the page. */
  .screen.pack {
    --column: 1240px;
  }

  .pack .grid {
    gap: 22px 16px;
  }

  .pack-status h1 {
    font-size: 48px;
  }

  .cta-bar .cta-inner {
    max-width: 420px;
  }
}

/* Laptop widths: a narrower panel, the steps stacked, and no stickers
   floating off the edge of the screen. */
@media (min-width: 960px) and (max-width: 1199px) {
  .screen.home {
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 48px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .float {
    display: none;
  }
}

/* Clear of the photo counter in the panel's corner. */
@media (min-width: 1200px) {
  .float-2 {
    top: -78px;
    inset-inline-end: -20px;
  }
}

@media (min-width: 960px) and (prefers-reduced-motion: reduce) {
  .wall-tile,
  .float {
    animation: none;
  }
}

/* MARK: Marquee */

.marquee {
  /* The track slides by its own width, which only lines up left to right. */
  direction: ltr;
  display: grid;
  gap: 10px;
  margin: 0 -20px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  --marquee-gap: 12px;
  display: flex;
  gap: var(--marquee-gap);
  width: max-content;
  animation: marquee 34s linear infinite;
}

.marquee-row.reverse .marquee-track {
  animation-direction: reverse;
  animation-duration: 40s;
}

.marquee img {
  width: 78px;
  height: 78px;
}

@keyframes marquee {
  to {
    /* Half the doubled row, plus half the gap between its two copies. */
    transform: translateX(calc(-50% - var(--marquee-gap) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
}

/* MARK: Photos */

.photos {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.card-head h2,
.packs h2 {
  margin: 0;
  font-size: 24px;
}

.count {
  font: 600 15px var(--font-mono);
  color: var(--fg-2);
}

.count.done {
  color: var(--ink);
}

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

.slot {
  position: relative;
}

/* As on iOS: a 3:4 tile with a dashed border, the camera's face guide in
   miniature, a "+" badge and the angle written inside. */
.slot-button {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border-radius: 18px;
  border: 1.2px dashed var(--line);
  background: var(--surface);
  overflow: hidden;
  display: block;
  color: var(--fg-3);
  transition: border-color 0.2s, transform 0.15s;
}

.slot-button:active {
  transform: scale(0.97);
}

.slot.next .slot-button {
  border-color: rgba(197, 240, 90, 0.7);
  color: var(--ink);
}

.slot.filled .slot-button {
  border: 1px solid var(--line);
}

.slot-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot.filled .slot-button::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.slot-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.guide-oval {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.guide-lines {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 2 3;
}

.slot.next .guide-lines {
  opacity: 0.7;
}

.slot-plus {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--fg);
}

.slot.next .slot-plus {
  background: var(--ink);
  color: var(--on-ink);
}

.slot-plus svg {
  stroke-width: 3;
}

.slot-label {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  z-index: 1;
  max-width: 100%;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot.filled .slot-label {
  color: #fff;
}

.slot-remove {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.slot-remove svg {
  stroke-width: 3;
}

.row {
  display: flex;
  gap: 10px;
}

.tip {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-2);
}

.tip .icon {
  color: var(--ink);
}

/* MARK: Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, background-color 0.2s, opacity 0.2s;
}

.button:not(:disabled):active {
  transform: scale(0.97);
}

.button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.button.primary {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 6px 18px rgba(197, 240, 90, 0.28);
}

.button.primary:disabled {
  background: var(--surface-raised);
  color: var(--fg-3);
  box-shadow: none;
}

.button.secondary {
  background: var(--surface-raised);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
}

.button.secondary:disabled {
  opacity: 0.4;
}

.button.compact {
  min-height: 46px;
}

.button.plain {
  background: none;
  color: var(--fg-2);
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
}

.button.destructive {
  background: rgba(255, 107, 94, 0.16);
  color: var(--danger);
  font-size: 15px;
  min-height: 52px;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--fg);
}

:root[dir="rtl"] .icon-button .icon:has(path[d^="M15 5"]) {
  transform: scaleX(-1);
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: none;
}

.screen.centered > .spinner {
  width: 34px;
  height: 34px;
  color: var(--ink);
}

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

/* MARK: Sticky call to action */

.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 14px 20px max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
}

.cta-bar::before {
  content: "";
  position: absolute;
  inset: -36px 0 100%;
  background: linear-gradient(rgba(7, 9, 15, 0), var(--bg));
  pointer-events: none;
}

.cta-inner {
  max-width: var(--column);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  text-align: center;
}

.footnote {
  margin: 0;
  font-size: 13px;
  color: var(--fg-3);
}

/* MARK: Packs */

.packs {
  display: grid;
  gap: 14px;
}

.packs:empty {
  display: none;
}

.pack-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px 4px;
  scrollbar-width: none;
}

.pack-list::-webkit-scrollbar {
  display: none;
}

.pack-card {
  flex: none;
  width: 128px;
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.pack-cover {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 10px;
}

.pack-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pack-cover .pack-mark {
  width: 40px;
  height: 40px;
  border-radius: 22.37%;
}

.pack-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pack-sub {
  margin-top: -6px;
  font: 12px var(--font-mono);
  color: var(--fg-3);
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.pack-sub.drawing {
  font: 600 12px var(--font-body);
  color: var(--ink);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--fg-3);
}

.site-footer a {
  color: var(--fg-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--fg);
}

/* MARK: Pack screen */

.pack-bar {
  gap: 12px;
}

.pack-name-button {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: none;
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
}

.pack-name-button .icon {
  color: var(--fg-3);
}

.pack-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-status {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.pack-status h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: var(--tracking-display);
}

.pack-status .button.secondary {
  width: auto;
  padding: 0 22px;
}

.eyebrow {
  font: 600 12px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
}

.eyebrow.accent {
  color: var(--ink);
}

.eyebrow.warning {
  color: var(--warning);
}

.progress-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: var(--fg-2);
}

.percent {
  font: 700 15px var(--font-mono);
  color: var(--fg);
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-raised);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 2%;
  border-radius: inherit;
  background: var(--ink);
  box-shadow: 0 0 12px rgba(197, 240, 90, 0.5);
  transition: width 0.5s ease;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}

@media (min-width: 620px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 820px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.cell {
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  gap: 6px;
  text-align: center;
  min-width: 0;
}

.cell-art {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.15s;
}

.cell.ready:active .cell-art {
  transform: scale(0.96);
}

.cell-art img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.cell-art .sticker {
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.cell-art .sample {
  opacity: 0.16;
  filter: grayscale(1);
}

.cell-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.cell-overlay.drawing {
  color: var(--ink);
  background: linear-gradient(110deg, transparent 30%, rgba(197, 240, 90, 0.14) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 125% 0;
  }
  to {
    background-position: -125% 0;
  }
}

.cell-overlay.failed {
  color: var(--warning);
}

.mini-button {
  margin-top: 2px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--fg);
}

.cell-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MARK: Sheets */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background-color 0.22s;
}

.backdrop.open {
  background: rgba(0, 0, 0, 0.6);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 32px 32px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  overscroll-behavior: contain;
}

.backdrop.open .sheet {
  transform: none;
}

.sheet.small {
  max-width: 420px;
}

@media (min-width: 620px) {
  .backdrop {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    border-radius: 32px;
    border-bottom: 1px solid var(--line);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s, opacity 0.22s;
  }

  .backdrop.open .sheet {
    opacity: 1;
  }
}

.sheet-body {
  display: grid;
  gap: 24px;
  padding: 28px 20px max(16px, env(safe-area-inset-bottom));
}

.sheet-header {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.sheet-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.sheet-header p {
  margin: 0;
  font-size: 15px;
  color: var(--fg-2);
}

.sheet-symbol {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--ink);
  color: var(--on-ink);
}

.sheet-actions {
  display: grid;
  gap: 4px;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: var(--bg);
}

.close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--fg-2);
  z-index: 1;
}

.points {
  list-style: none;
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 18px;
  border-radius: 20px;
  font-size: 15px;
}

.points li {
  display: flex;
  gap: 12px;
}

.points .icon {
  color: var(--ink);
}

.link {
  justify-self: center;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.fan {
  width: 132px;
  height: 132px;
  transform: rotate(-4deg);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 600;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  color: var(--fg-3);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--fg);
  outline: none;
  font-size: 16px;
}

.search-input::placeholder {
  color: var(--fg-3);
}

.team-list {
  border-radius: 20px;
  overflow: hidden;
}

.team-row {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border: 0;
  background: none;
  text-align: start;
}

.team-row + .team-row {
  box-shadow: inset 0 1px var(--line);
}

.team-row.selected {
  background: rgba(197, 240, 90, 0.08);
}

.club {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.club.plain {
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--fg-2);
}

.team-text {
  flex: 1;
  display: grid;
}

.team-name {
  font-weight: 600;
}

.team-sub {
  font-size: 12px;
  color: var(--fg-3);
}

.radio {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--fg-3);
  display: grid;
  place-items: center;
}

.team-row.selected .radio {
  border-color: var(--ink);
}

.team-row.selected .radio::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
}

.sticker-sheet {
  justify-items: center;
  text-align: center;
}

.sticker-sheet h2 {
  margin: -8px 0 0;
  font-size: 26px;
}

.sticker-large {
  width: min(280px, 70vw);
  height: auto;
  aspect-ratio: 1;
}

.sticker-sheet .sheet-actions {
  width: 100%;
  gap: 10px;
}

/* MARK: Alerts */

.alert {
  display: grid;
  gap: 14px;
  padding: 26px 20px max(18px, env(safe-area-inset-bottom));
}

.alert-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.alert-title.center {
  text-align: center;
  font-size: 17px;
  color: var(--fg-2);
}

.action-list {
  display: grid;
  gap: 10px;
}

.alert-message {
  margin: 0;
  font-size: 15px;
  color: var(--fg-2);
}

.alert-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.alert-actions .button {
  min-height: 50px;
  font-size: 16px;
}

.field {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: rgba(197, 240, 90, 0.6);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: #1a1d24;
  border: 1px solid var(--line);
  font-size: 15px;
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* MARK: Camera */

body.camera-open {
  overflow: hidden;
}

.camera {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  overflow: hidden;
}

.camera.open {
  opacity: 1;
}

.camera-stage,
.camera-guide-layer,
.camera-controls {
  position: absolute;
  inset: 0;
}

/* The whole frame, never cropped: filling the screen would zoom in on it. */
.camera-video,
.camera-review {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.camera-stage.mirrored .camera-video {
  transform: scaleX(-1);
}

.camera-guide-layer {
  pointer-events: none;
}

.camera-guide {
  display: block;
}

.camera-dim {
  fill: rgba(0, 0, 0, 0.6);
}

.camera-lines {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 2 5;
}

.camera-oval {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 10 8;
}

.camera-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.camera-top {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-round,
.camera-round-spacer {
  width: 44px;
  height: 44px;
  flex: none;
}

.camera-round {
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(40, 40, 40, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
}

.camera-label,
.camera-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 15px;
  font-weight: 600;
}

.camera-label {
  height: 36px;
}

.camera-instruction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 15px;
  font-weight: 600;
}

.camera-spacer {
  flex: 1;
}

.camera-status {
  height: 44px;
  padding: 0 18px;
  margin-bottom: 28px;
  font-size: 16px;
}

.shutter {
  width: 82px;
  height: 82px;
  flex: none;
  padding: 0;
  border: 5px solid #fff;
  border-radius: 50%;
  background: none;
  display: grid;
  place-items: center;
}

.shutter span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.shutter:active span {
  transform: scale(0.85);
}

.camera-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.camera-flash.on {
  animation: flash 0.38s ease-out;
}

@keyframes flash {
  from {
    opacity: 0.8;
  }
}

.camera-loading {
  margin: auto;
  color: #fff;
}

.camera-review-actions {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 12px;
}

.camera .camera-stage:has(.camera-review)::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 280px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.camera-denied {
  margin: auto;
  max-width: 380px;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.camera-denied-icon {
  color: var(--ink);
}

.camera-denied h2 {
  margin: 0;
  font-size: 22px;
}

.camera-denied p {
  margin: 0;
  color: var(--fg-2);
  font-size: 15px;
}

.noscript {
  padding: 40px;
  text-align: center;
}
