:root {
  --l3-vh: 1vh;
  --l3-story-size: 84px;
  --l3-story-bg: #000;
  --l3-story-text: #fff;
  --l3-story-muted: rgba(255,255,255,.72);
  --l3-story-panel: rgba(0,0,0,.38);
  --l3-story-ring: #fff;
  --l3-story-seen: #000;
}

#l3-story-widget, #l3-story-widget *,
.l3-story-modal, .l3-story-modal * {
  box-sizing: border-box;
}

#l3-story-widget {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.l3-story-bubble {
  width: var(--l3-story-size);
  height: var(--l3-story-size);
  border-radius: 50%;
  padding: 3px;
  border: 0;
  background: var(--l3-story-ring);
  cursor: pointer;
  display: inline-block;
}

.l3-story-bubble.l3-seen {
  background: var(--l3-story-seen);
}

.l3-story-bubble.l3-empty {
  display: none !important;
}

.l3-story-bubble img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  border: 3px solid #000;
  background: #111;
}

.l3-hidden {
  display: none !important;
}

.l3-story-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh;
  height: calc(var(--l3-vh, 1vh) * 100) !important;
  z-index: 2147483000 !important;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}

.l3-story-media,
.l3-story-media img,
.l3-story-media video {
  width: 100%;
  height: 100%;
}

.l3-story-media img,
.l3-story-media video {
  object-fit: contain;
  background: #000;
  display: none;
}

.l3-progress-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 8;
  height: 3px;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  overflow: hidden;
}

.l3-progress-bar {
  width: 0%;
  height: 100%;
  background: #fff;
  border-radius: 999px;
}

.l3-tap-left,
.l3-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 5;
}

.l3-tap-left { left: 0; }
.l3-tap-right { right: 0; }

.l3-close,
.l3-pause,
.l3-sound {
  position: absolute;
  z-index: 10;
  border: 1px solid rgba(255,255,255,.28);
  background: var(--l3-story-panel);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: .82;
  transition: opacity .16s ease, background .16s ease;
}

.l3-close:hover,
.l3-pause:hover,
.l3-sound:hover {
  opacity: 1;
  background: rgba(0,0,0,.55);
}

.l3-close {
  top: 22px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 38px;
}

.l3-pause {
  left: 16px;
  bottom: 22px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.l3-sound {
  left: 78px;
  bottom: 22px;
  width: 42px;
  height: 38px;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1;
}

.l3-seen-counter,
.l3-time-label {
  position: absolute;
  z-index: 10;
  color: #fff;
  background: var(--l3-story-panel);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.l3-seen-counter {
  right: 14px;
  bottom: 22px;
}

.l3-time-label {
  left: 14px;
  top: 22px;
  max-width: calc(100% - 90px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l3-admin-shell {
  max-width: 520px;
  margin: 24px auto;
  padding: 22px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.l3-admin-shell h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.l3-admin-shell p {
  color: #555;
}

.l3-admin-shell label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 650;
}

.l3-admin-shell input,
.l3-admin-shell button {
  width: 100%;
  min-height: 42px;
  font: inherit;
}

.l3-admin-shell input {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #bbb;
}

.l3-admin-shell button {
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.l3-admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.l3-admin-status {
  margin-top: 12px;
  font-size: 14px;
  color: #333;
  min-height: 20px;
}

.l3-danger {
  background: #7a0000 !important;
}

.l3-admin-secret {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  cursor: default;
  user-select: none;
}

.l3-admin-secret-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,.04);
  display: inline-block;
}

@media (max-width: 768px) {
  .l3-story-media img,
  .l3-story-media video {
    object-fit: contain;
  }
  .l3-pause {
    opacity: 0;
    pointer-events: none;
  }
  .l3-sound {
    left: 14px;
    bottom: 22px;
  }
}
