:root {
  --glass-fill: rgb(255 255 255 / 0.09);
  --glass-sheen: linear-gradient(135deg, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0.03) 40%, rgb(255 255 255 / 0.1));
  --glass-rim:
    inset 0 1px 0 rgb(255 255 255 / 0.5),
    inset 1px 0 0 rgb(255 255 255 / 0.18),
    inset -1px 0 0 rgb(255 255 255 / 0.08),
    inset 0 -1px 0 rgb(255 255 255 / 0.06);
  --glass-blur: blur(24px) saturate(1.9);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #000;
  color: #fff;
  font: 15px/1.35 -apple-system, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

.corner-credit {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1;
  margin: 0;
  color: rgb(255 255 255 / 0.8);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  text-shadow: 0 1px 4px #000, 0 0 12px rgb(0 0 0 / 0.6);
}

.corner-credit:focus-visible {
  outline: 2px solid rgb(255 255 255 / 0.75);
  outline-offset: 3px;
}

/* Glass */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: var(--glass-rim), 0 12px 40px rgb(0 0 0 / 0.35);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.32), transparent 35%, transparent 65%, rgb(255 255 255 / 0.14));
  -webkit-mask: linear-gradient(#000, transparent 70%);
  mask: linear-gradient(#000, transparent 70%);
  pointer-events: none;
}

/* Chrome */
.chrome {
  position: fixed;
  inset: 0;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  pointer-events: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
  transition: opacity 0.35s var(--spring), transform 0.5s var(--spring), filter 0.35s, visibility 0.35s;
}

.actions.is-hidden {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  filter: blur(6px);
  visibility: hidden;
  pointer-events: none;
}

.is-app .pill--browser,
.is-phone .only-laptop,
.is-laptop .only-phone {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  cursor: pointer;
  transition: transform 0.25s var(--spring), background-color 0.25s;
}

.pill:active {
  transform: scale(0.94);
  background-color: rgb(255 255 255 / 0.22);
}

.pill[hidden] {
  display: none;
}

.picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(44px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(88vw, 430px);
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  transform: translateX(-50%);
  color: rgb(255 255 255 / 0.92);
  text-align: center;
  text-wrap: balance;
  transition: opacity 0.5s var(--spring), transform 0.6s var(--spring), filter 0.5s, display 0.6s allow-discrete;
}

.hint[hidden] {
  display: none;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.94);
  filter: blur(8px);
}

@starting-style {
  .hint:not([hidden]) {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.94);
    filter: blur(8px);
  }
}

/* Unavailable */
.unavailable {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(120% 80% at 20% 0%, rgb(120 140 190 / 0.35), transparent 60%),
    radial-gradient(90% 70% at 90% 100%, rgb(200 150 120 / 0.25), transparent 60%),
    #0b0d12;
  overflow-y: auto;
  touch-action: pan-y;
}

.unavailable[hidden] {
  display: none;
}

.unavailable__body {
  width: min(100%, 520px);
  margin-block: auto;
  padding: 32px 28px;
  border-radius: 40px;
}

.unavailable h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.unavailable p {
  margin: 0;
  color: rgb(255 255 255 / 0.78);
  font-size: 17px;
  line-height: 1.5;
}

.unavailable p.unavailable__status {
  margin-top: 12px;
  font-size: 15px;
}

.unavailable .pill {
  margin-top: 20px;
}

.unavailable__link {
  display: inline-block;
  margin-top: 24px;
  color: rgb(255 255 255 / 0.7);
  text-underline-offset: 3px;
}

/* Sheets */
.sheet {
  width: min(640px, calc(100vw - 20px));
  max-width: none;
  margin: auto auto max(10px, env(safe-area-inset-bottom));
  padding: 22px 22px 18px;
  border: 0;
  border-radius: 34px;
  color: #fff;
  outline: none;
  overflow: visible;
  opacity: 1;
  transform: none;
  filter: none;
  z-index: 30;
  transition:
    opacity 0.4s var(--spring),
    transform 0.65s var(--spring),
    filter 0.4s;
}

.sheet:not([open]) {
  opacity: 0;
  transform: translateY(60px);
  filter: blur(10px);
}

.sheet[open] {
  opacity: 1;
  transform: none;
  filter: none;
}

.sheet::backdrop {
  background: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.45));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sheet__eyebrow {
  margin: 0 0 14px;
  color: rgb(255 255 255 / 0.55);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sheet h2 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.sheet p {
  margin: 0 0 18px;
  color: rgb(255 255 255 / 0.74);
  font-size: 15px;
  line-height: 1.45;
  text-wrap: pretty;
}

.sheet p.sheet__status {
  margin: -6px 0 16px;
  color: rgb(255 255 255 / 0.55);
  font-size: 13px;
}

.sheet p.sheet__status[hidden] {
  display: none;
}

.sheet__link {
  color: #fff;
  text-underline-offset: 3px;
}

.sheet__cmd {
  display: block;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgb(0 0 0 / 0.28);
  box-shadow: var(--glass-rim);
  color: rgb(255 255 255 / 0.92);
  font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-user-select: all;
  user-select: all;
  overflow-x: auto;
  white-space: nowrap;
}

.has-hid .no-hid-only,
.no-hid .hid-only {
  display: none;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: tile;
}

.tiles li {
  position: relative;
  min-height: 108px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: var(--glass-rim);
  color: rgb(255 255 255 / 0.9);
  font-size: 13px;
  line-height: 1.35;
  counter-increment: tile;
  display: flex;
  align-items: flex-end;
}

.tiles li::before {
  content: counter(tile, decimal-leading-zero);
  position: absolute;
  top: 10px;
  left: 14px;
  color: rgb(255 255 255 / 0.32);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.sheet__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.sheet__cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(255 255 255 / 0.86));
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgb(0 0 0 / 0.06),
    0 8px 24px rgb(0 0 0 / 0.25);
  color: #0d0f14;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--spring);
}

.sheet__cta:active {
  transform: scale(0.96);
}

.sheet__cta:disabled {
  opacity: 0.6;
  cursor: wait;
}

.sheet__cta:focus-visible,
.sheet__credit:focus-visible {
  outline: 2px solid rgb(255 255 255 / 0.75);
  outline-offset: 3px;
}

.sheet__cta--quiet {
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: var(--glass-rim);
  color: #fff;
}

.sheet__credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-left: auto;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
  color: rgb(255 255 255 / 0.8);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.25s var(--spring), background-color 0.25s;
}

.sheet__credit svg {
  width: 18px;
  height: 18px;
}

.sheet__credit:active {
  transform: scale(0.96);
  background-color: rgb(255 255 255 / 0.12);
}

@media (hover: hover) {
  .sheet__credit:hover {
    background-color: rgb(255 255 255 / 0.1);
  }
}

@media (max-width: 420px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .tiles li {
    min-height: 0;
    padding-left: 50px;
    align-items: center;
  }

  .tiles li::before {
    top: 50%;
    translate: 0 -50%;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: rgb(28 30 36 / 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .actions,
  .pill,
  .hint,
  .sheet,
  .sheet__cta {
    transition: none;
  }
}
