:root {
  color-scheme: dark;
  --bg: #111;
  --ink: #f6f6f8;
  --muted: color-mix(in oklab, var(--ink) 68%, transparent);
  --glass: color-mix(in oklab, #0b0b10 55%, transparent);
  --line: color-mix(in oklab, white 18%, transparent);
  --accent: #7cffb3;
  --like: #ff3b5c;
  --vv-top: 0px;
  --vv-bottom: 0px;
  --vv-left: 0px;
  --vv-right: 0px;
  --vv-height: 100dvh;
  --bleed-h: 100lvh;
  --chrome-top: max(var(--vv-top), env(safe-area-inset-top, 0px));
  --chrome-bottom: max(var(--vv-bottom), env(safe-area-inset-bottom, 0px));
  --chrome-left: max(12px, var(--vv-left), env(safe-area-inset-left, 0px));
  --chrome-right: max(10px, var(--vv-right), env(safe-area-inset-right, 0px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100lvh;
  min-height: -webkit-fill-available;
  background: var(--bg);
  color: var(--ink);
  font-family: "SF Pro Display", "SF Pro Text", ui-rounded, "Segoe UI", system-ui, sans-serif;
}

body {
  overflow: hidden;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  height: 100lvh;
  min-height: var(--bleed-h);
  min-height: 100lvh;
  background: var(--bg);
}

.feed,
.card {
  height: 100%;
  min-height: 100%;
}

.status {
  position: fixed;
  left: 20px;
  right: 20px;
  top: calc(var(--chrome-top) + 56px);
  z-index: 8;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  text-align: center;
}

.cats {
  position: fixed;
  top: calc(var(--chrome-top) + 6px);
  left: var(--chrome-left);
  right: var(--chrome-right);
  z-index: 7;
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 4px 8px;
  pointer-events: none;
}

.cats__btn {
  pointer-events: auto;
  appearance: none;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: color-mix(in oklab, white 58%, transparent);
  font: inherit;
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px #000a;
  cursor: pointer;
  touch-action: manipulation;
}

.cats__btn[data-on="true"] {
  color: white;
  font-weight: 760;
}

.feed {
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.feed::-webkit-scrollbar {
  display: none;
}

.card {
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: var(--bg);
}

.card__still,
.card__anim {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card__anim {
  opacity: 0;
}

.card.is-active .card__anim.is-ready {
  opacity: 1;
}

.card__stage {
  position: absolute;
  top: var(--chrome-top);
  right: var(--vv-right);
  bottom: var(--chrome-bottom);
  left: var(--vv-left);
  z-index: 3;
  pointer-events: none;
}

.card__badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(148px, 42vw);
  aspect-ratio: 1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in oklab, #101018 36%, transparent);
  box-shadow: 0 10px 36px #0007;
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  transform: translate(-50%, -50%);
}

.card__play {
  pointer-events: auto;
  appearance: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px #0008;
  cursor: pointer;
  touch-action: manipulation;
}

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

.card__soon {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 8px #0008;
}

.rail {
  position: absolute;
  right: var(--chrome-right);
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rail__btn {
  pointer-events: auto;
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 52px;
  min-height: 56px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: white;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.rail__btn svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 6px #000a);
}

.rail__label {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 1px 6px #000c;
}

.rail__btn--like[data-on="true"] {
  color: var(--like);
}

.rail__btn--like[data-on="true"] path {
  fill: var(--like);
}

.rail__btn--bookmark[data-on="true"] path {
  fill: currentColor;
}

.card__meta {
  position: absolute;
  left: var(--chrome-left);
  right: 84px;
  bottom: 18px;
}

.card__label,
.card__source {
  margin: 0;
  text-shadow: 0 1px 8px #000c;
}

.card__label {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.card__source {
  display: inline-block;
  margin-top: 4px;
  color: color-mix(in oklab, white 82%, transparent);
  font-size: 14px;
}

.next-game {
  display: none;
  position: fixed;
  left: var(--chrome-left);
  bottom: calc(var(--chrome-bottom) + 18px);
  z-index: 6;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.next-game:active {
  transform: translateY(1px);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  align-items: end;
  background: color-mix(in oklab, black 35%, transparent);
}

.sheet[hidden] {
  display: none;
}

.sheet__panel {
  max-height: min(56dvh, 480px);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #16161c;
}

.sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sheet__title {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.sheet__close,
.sheet__post,
.install__ok {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, white 12%, transparent);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sheet__close {
  min-height: 36px;
  padding: 0 12px;
}

.sheet__list {
  margin: 0;
  padding: 0;
  max-height: 28dvh;
  overflow: auto;
  list-style: none;
}

.sheet__item,
.sheet__empty {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: color-mix(in oklab, white 88%, transparent);
}

.sheet__form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sheet__input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d0d12;
  color: var(--ink);
  font: inherit;
}

.sheet__post {
  min-height: 44px;
  padding: 0 16px;
}

.install {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(var(--chrome-top) + 54px);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.install[hidden] {
  display: none;
}

.install__copy {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.install__ok {
  min-height: 40px;
  padding: 0 14px;
  flex: none;
}

@media (min-width: 900px) {
  .next-game {
    display: inline-flex;
    align-items: center;
  }
}

@media (display-mode: standalone) {
  .install {
    display: none;
  }
}
