:root {
  color-scheme: dark;
}

body {
  margin: 0;
  background: #090909;
  overflow: hidden;
}

.header {
  display: none;
}

.shorts-shell {
  position: relative;
  height: 100dvh;
  background: #090909;
  color: #fff;
}

.shorts-home,
.short-status {
  position: absolute;
  z-index: 5;
  top: max(18px, env(safe-area-inset-top));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.shorts-home {
  left: 18px;
}

.short-status {
  right: 18px;
}

.shorts-feed {
  width: min(100%, 430px);
  height: 100%;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  background: #000;
}

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

.short-slide {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}

.short-slide video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.short-slide::after {
  content: "";
  position: absolute;
  inset: 70% 0 0;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.short-unmute,
.short-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font: inherit;
  cursor: pointer;
}

.short-unmute {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1.15rem;
}

.short-play {
  width: 76px;
  height: 76px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.short-overlay {
  position: absolute;
  z-index: 2;
  right: 96px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 18px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6);
}

.short-caption {
  margin: 0 0 8px;
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(1rem, 4.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.short-meta {
  min-height: 1.4em;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
}

.short-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.short-full-link,
.short-share {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.short-rail {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.short-rail-button {
  display: flex;
  min-width: 58px;
  padding: 0;
  border: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.short-rail-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.short-rail-icon,
.short-rail-svg {
  width: 32px;
  height: 32px;
  font-size: 2rem;
  line-height: 1;
  fill: currentColor;
}

.short-like.liked {
  color: #ff2d55;
}

.short-rail-count {
  font-size: 0.76rem;
  font-weight: 600;
}

.short-full-link {
  background: rgba(255, 255, 255, 0.18);
}

.shorts-state {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  background: #090909;
}

.shorts-state[hidden],
.shorts-toast[hidden] {
  display: none;
}

.shorts-toast {
  position: fixed;
  z-index: 30;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  text-align: center;
}

.short-share-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: none;
  color: #fff;
  background: rgba(0, 0, 0, 0.86);
}

.short-share-overlay.show {
  display: block;
}

.short-share-overlay-close {
  position: absolute;
  top: 20px;
  left: 20px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 2rem;
}

.short-share-overlay-guide {
  position: absolute;
  top: 28px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1.05rem;
}

.short-share-overlay-arrow {
  font-size: 2.3rem;
  line-height: 0.7;
}

.short-comment-sheet {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: none;
}

.short-comment-sheet.show {
  display: block;
}

.short-comment-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
}

.short-comment-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(100%, 430px);
  height: 70dvh;
  margin: 0 auto;
  border-radius: 18px 18px 0 0;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background: rgba(20, 20, 20, 0.97);
}

.short-comment-header {
  display: flex;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  align-items: center;
  justify-content: space-between;
}

.short-comment-header h2 {
  margin: 0;
  font-size: 1rem;
}

.short-comment-close {
  padding: 0 4px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 1.8rem;
}

.short-comment-list {
  flex: 1;
  padding: 6px 18px;
  overflow-y: auto;
}

.short-comment-item {
  position: relative;
  padding: 12px 52px 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.short-comment-item--deleted {
  opacity: 0.48;
}

.short-comment-deleted-label {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.76rem;
}

.short-comment-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.short-comment-meta span,
.short-comment-empty,
.short-composer-note {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.short-comment-text {
  margin: 5px 0 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.short-comment-delete {
  position: absolute;
  top: 11px;
  right: 0;
  border: 0;
  color: #ff8b9f;
  background: transparent;
}

.short-comments-more {
  align-self: center;
  margin: 6px;
  border: 0;
  color: #bfc8ff;
  background: transparent;
}

.short-comment-composer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.short-comment-composer input,
.short-comment-composer textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 9px 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
}

.short-login-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.short-login-error {
  grid-column: 1 / -1;
  color: #ff9baa;
  font-size: 0.8rem;
}

.short-login-reveal,
.short-compose-actions button,
.short-login-form button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: #fff;
  background: #667eea;
  font: inherit;
  font-weight: 600;
}

.short-register-link {
  margin-left: 14px;
  color: #bfc8ff;
  font-size: 0.86rem;
}

.short-compose-actions {
  display: flex;
  margin-top: 7px;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

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

  .short-login-error {
    grid-column: auto;
  }
}

@media (min-width: 700px) {
  .shorts-shell {
    background: radial-gradient(circle at center, #252525, #090909 62%);
  }

  .shorts-feed {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  }
}
