:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --accent: #f43f5e;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(244, 63, 94, 0.3) 0px, transparent 50%);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.accent {
    color: var(--accent);
    background: -webkit-linear-gradient(45deg, var(--accent), #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.stats-card {
    margin-top: 1.5rem;
    text-align: left;
}

.seo-content {
    margin-top: 1.5rem;
    text-align: left;
}

.seo-content-title {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.seo-content-text {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.seo-content-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.site-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-header {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.stats-saves {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-totals {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    min-width: 110px;
}

.stat .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stats-recent-title {
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.recent-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.7rem;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.recent-title {
    font-weight: 600;
}

.recent-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

a.recent-item-play {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

a.recent-item-play:hover {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
}

.recent-play-hint {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.15rem;
}

.url-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.url-row input {
    width: 100%;
    margin-bottom: 0;
    min-width: 0;
    box-sizing: border-box;
}

.url-row .paste-btn {
    align-self: flex-start;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.url-row .paste-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary);
}

.paste-btn {
    flex-shrink: 0;
}

.url-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.25rem 0 0.75rem;
    line-height: 1.4;
}

.url-hint code {
    font-size: 0.8em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.url-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: left;
}

.preview-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
}

.preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-title {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.url-preview-error {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 8px;
}

.quality-options {
    margin-bottom: 1.5rem;
}

.quality-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.quality-row:last-child {
    margin-bottom: 0;
}

.quality-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 4rem;
}

.quality-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.quality-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quality-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
}

.quality-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.options {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.toggle-container {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.3rem;
    border-radius: 12px;
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.toggle-count {
    font-size: 0.8rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text-muted);
}

.toggle-btn.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.toggle-btn.active .toggle-count {
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.25);
}

#downloadBtn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
}

#downloadBtn:active {
    transform: translateY(0);
}

#downloadBtn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress-wrapper {
    margin-bottom: 1.5rem;
    text-align: left;
}

.progress-bar-bg {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#statusMessage {
    margin-top: 1.5rem;
    min-height: 1.5rem;
    font-size: 0.95rem;
    word-break: break-all;
}

#statusMessage a {
    color: #51cf66;
    text-decoration: underline;
}

#statusMessage a.action-btn {
    color: white;
    text-decoration: none;
}

.success-panel {
    text-align: left;
}

.success-player-wrap {
    margin-top: 1rem;
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.success-player {
    display: block;
    width: 100%;
    max-height: 280px;
}

.success-player-audio {
    max-height: none;
    padding: 0.5rem;
}

.success-player-wrap.success-player-portrait {
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-player-wrap.success-player-portrait .success-player {
    object-fit: contain;
}

.success-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.success-actions-row {
    display: flex;
    gap: 0.65rem;
}

.success-actions-row .action-btn {
    flex: 1;
}

.success-text {
    font-weight: 600;
}

.action-btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.95rem;
}

.action-btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.action-btn.secondary {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.success-new {
    appearance: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.35rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.success-new:hover {
    color: var(--text);
}

/* First-time / how-to modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s ease;
}

.modal.modal-open {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    margin: -0.25rem -0.25rem 0 0;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    text-align: left;
}

.howto-steps {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.howto-steps li {
    margin-bottom: 0.85rem;
}

.howto-steps li:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-dont-show {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-dont-show input {
    margin: 0;
    width: auto;
    padding: 0;
}

.modal-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.modal-btn:hover {
    opacity: 0.95;
}

/* Share page – full-screen TikTok-style */
.share-page {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Lock document scroll so vertical swipes go to #shareFeed (not the window). */
.share-page.share-page--feed,
.share-page:has(#shareFeed) {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

/* Feed: vertical swipe between multiple videos – full viewport */
.share-feed {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    contain: layout style paint;
    scrollbar-width: none;
}

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

.share-slide {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    position: relative;
    contain: layout style paint;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.share-slide.is-active {
    z-index: 1;
}

.share-slide:not(.is-active) .share-swipe-hint {
    opacity: 0;
    visibility: hidden;
}

.share-feed--scrolled .share-swipe-hint {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.share-feed-sentinel {
    scroll-snap-align: none;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    pointer-events: none;
}

.share-feed-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 500;
}

.share-feed-loading[hidden],
.share-feed-end[hidden] {
    display: none !important;
}

.share-feed-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: shareFeedSpin 0.7s linear infinite;
}

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

.share-feed-end {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .share-swipe-hint {
        animation: none;
    }

    .share-feed-spinner {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.55);
    }
}

.share-slide .share-video-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #000;
}

.share-video-rot-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-video-rot-wrap.share-tiktok-sized {
    position: absolute;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 3;
}

/* Custom player shell (video + overlays) */
.share-custom-player {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

.share-custom-player .share-player-fullscreen {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

.share-player-big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    width: 4.5rem;
    height: 4.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
/* Author `display:flex` wins over [hidden] in many browsers — force hide when not in use */
.share-player-big-play[hidden] {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.share-player-big-play:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.share-player-big-play-icon {
    font-size: 1.75rem;
    margin-left: 0.2rem;
    line-height: 1;
}

.share-player-chrome {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    box-sizing: border-box;
    pointer-events: auto;
}

.share-player-btn {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.share-player-btn:active {
    background: rgba(255, 255, 255, 0.28);
}

.share-player-playpause .share-player-icon-play {
    display: none;
    margin-left: 0.15rem;
}

.share-custom-player.is-playing .share-player-playpause .share-player-icon-pause {
    display: block;
}

.share-custom-player.is-playing .share-player-playpause .share-player-icon-play {
    display: none;
}

.share-custom-player:not(.is-playing) .share-player-playpause .share-player-icon-pause {
    display: none;
}

.share-custom-player:not(.is-playing) .share-player-playpause .share-player-icon-play {
    display: block;
}

.share-custom-player.is-muted .share-player-mute .share-player-icon-unmuted {
    display: none;
}

.share-custom-player.is-muted .share-player-mute .share-player-icon-muted {
    display: block;
}

.share-custom-player:not(.is-muted) .share-player-mute .share-player-icon-muted {
    display: none;
}

.share-custom-player:not(.is-muted) .share-player-mute .share-player-icon-unmuted {
    display: block;
}

.share-player-scrub-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.share-player-scrub {
    padding: 0.35rem 0;
    cursor: pointer;
    touch-action: none;
}

.share-player-scrub-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.share-player-scrub-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: #fff;
    pointer-events: none;
}

.share-player-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: flex-end;
}

.share-player-views {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.8);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TikTok web: centered column, black sides, full video visible */
.share-video-rot-wrap[data-rot="0"] .share-player-fullscreen {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* 90° / 270°: same centered “phone column” after rotation */
.share-video-rot-wrap[data-rot="90"],
.share-video-rot-wrap[data-rot="270"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-video-rot-wrap[data-rot="90"] .share-player-fullscreen,
.share-video-rot-wrap[data-rot="270"] .share-player-fullscreen {
    position: relative;
    inset: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform-origin: center center;
}

.share-video-rot-wrap[data-rot="90"] .share-player-fullscreen {
    transform: rotate(90deg);
}

.share-video-rot-wrap[data-rot="270"] .share-player-fullscreen {
    transform: rotate(270deg);
}

.share-video-rot-wrap[data-rot="180"] .share-player-fullscreen {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: rotate(180deg);
    transform-origin: center center;
}

.share-slide .share-player-fullscreen {
    object-fit: contain;
    /* Let vertical drags scroll the snap feed on touch devices (tap still toggles play). */
    touch-action: pan-y;
}

.share-icon-rotate {
    font-size: 1.35rem;
    line-height: 1;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

/* Portrait (vertical) video: fill screen like TikTok */
/* Portrait (taller than wide): full-screen TikTok-style fill */
.share-video-frame.share-video-portrait .share-player-fullscreen {
    object-fit: cover;
    object-position: center center;
}

/* Landscape: letterbox so full frame visible */
.share-video-frame.share-video-landscape .share-player-fullscreen {
    object-fit: contain;
    object-position: center center;
}

.share-player-screen .share-video-frame.share-video-landscape .share-player-fullscreen {
    object-fit: contain;
}

.share-player-screen .share-video-frame.share-video-portrait .share-player-fullscreen {
    object-fit: cover;
}

/* Audio (song) slide */
.share-slide .share-audio-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    background:
        radial-gradient(ellipse 90% 60% at 50% 35%, rgba(59, 130, 246, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 70% 50% at 80% 80%, rgba(244, 63, 94, 0.08) 0%, transparent 65%),
        linear-gradient(180deg, #0b1220 0%, var(--bg-color) 45%, #020617 100%);
    padding: calc(3.5rem + env(safe-area-inset-top, 0px)) 1rem calc(5.5rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.share-audio-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
    min-height: 0;
}

.share-audio-frame .share-actions-right {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.share-player-screen:has(.share-audio-frame-single) {
    padding: 0;
    justify-content: stretch;
}

.share-audio-frame-single {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: calc(3.5rem + env(safe-area-inset-top, 0px)) 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.share-audio-player {
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.share-audio-visual {
    position: relative;
    width: 100%;
    height: clamp(14.5rem, 46vw, 18.5rem);
    border-radius: 22px;
    overflow: hidden;
    --spectrum-cool: 125, 211, 252;
    --spectrum-hot: 251, 146, 60;
    --spectrum-mid: 56, 189, 248;
    --spectrum-bg: 8, 20, 40;
    background:
        radial-gradient(ellipse 90% 70% at 50% 48%, rgba(var(--spectrum-mid), 0.28) 0%, transparent 55%),
        radial-gradient(70% 55% at 8% 12%, rgba(var(--spectrum-hot), 0.16) 0%, transparent 52%),
        radial-gradient(65% 55% at 92% 18%, rgba(var(--spectrum-cool), 0.14) 0%, transparent 50%),
        radial-gradient(50% 40% at 50% 100%, rgba(2, 8, 24, 0.9) 0%, transparent 70%),
        linear-gradient(165deg, rgba(var(--spectrum-bg), 0.98) 0%, rgba(1, 4, 14, 1) 100%);
    border: 1px solid rgba(var(--spectrum-cool), 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 48px rgba(var(--spectrum-mid), 0.14),
        0 16px 40px rgba(0, 0, 0, 0.45);
}

.share-audio-visual-bg {
    position: absolute;
    inset: -8%;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 18% 28%, rgba(56, 189, 248, 0.14) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 72% 58%, rgba(251, 191, 36, 0.1) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 50% 80%, rgba(125, 211, 252, 0.08) 0 1px, transparent 1.5px),
        radial-gradient(rgba(148, 163, 184, 0.14) 0.55px, transparent 0.7px);
    background-size: 42px 42px, 56px 56px, 28px 28px, 15px 15px;
    background-position: 0 0, 14px 10px, 6px 20px, 0 0;
    opacity: 0.65;
    animation: share-audio-grid-drift 18s linear infinite;
}

.share-audio-visual-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 70%, rgba(34, 211, 238, 0.12) 0%, transparent 28%),
        radial-gradient(circle at 88% 35%, rgba(251, 146, 60, 0.1) 0%, transparent 26%),
        radial-gradient(circle at 50% 50%, transparent 40%, rgba(2, 6, 18, 0.45) 100%);
    animation: share-audio-bg-pulse 5.5s ease-in-out infinite alternate;
}

@keyframes share-audio-bg-pulse {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

@keyframes share-audio-grid-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-16px, -16px, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .share-audio-visual-bg,
    .share-audio-visual-bg::after {
        animation: none;
    }
}

.share-audio-spectrum {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

.share-audio-player.is-playing .share-audio-visual {
    border-color: rgba(var(--spectrum-cool), 0.32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 48px rgba(var(--spectrum-mid), 0.22),
        0 0 80px rgba(var(--spectrum-hot), 0.1),
        0 16px 40px rgba(0, 0, 0, 0.45);
}

.share-audio-chrome {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.share-audio-btn {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.share-audio-btn:active {
    transform: scale(0.96);
}

.share-audio-playpause .share-audio-icon-play {
    display: none;
    margin-left: 0.12rem;
}

.share-audio-player.is-playing .share-audio-playpause .share-audio-icon-pause {
    display: block;
}

.share-audio-player.is-playing .share-audio-playpause .share-audio-icon-play {
    display: none;
}

.share-audio-player:not(.is-playing) .share-audio-playpause .share-audio-icon-pause {
    display: none;
}

.share-audio-player:not(.is-playing) .share-audio-playpause .share-audio-icon-play {
    display: block;
}

.share-audio-mute {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.share-audio-player.is-muted .share-audio-mute .share-audio-icon-unmuted {
    display: none;
}

.share-audio-player.is-muted .share-audio-mute .share-audio-icon-muted {
    display: block;
}

.share-audio-player:not(.is-muted) .share-audio-mute .share-audio-icon-muted {
    display: none;
}

.share-audio-player:not(.is-muted) .share-audio-mute .share-audio-icon-unmuted {
    display: block;
}

.share-audio-views {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.share-audio-scrub-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.share-audio-scrub {
    padding: 0.35rem 0;
    cursor: pointer;
    touch-action: none;
}

.share-audio-scrub-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.share-audio-scrub-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), #fb7185);
    pointer-events: none;
}

.share-audio-time {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: flex-end;
}

.share-audio-player .share-player-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.share-audio-card {
    background: rgba(22, 22, 28, 0.82);
    border-radius: 16px;
    padding: 0.8rem 0.95rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
}

.share-audio-card.is-expanded {
    pointer-events: auto;
}

.share-audio-card .share-audio-title {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-audio-card .share-meta-byline-audio {
    margin: 0;
    font-size: 0.76rem;
}

.share-audio-desc,
.share-audio-single-desc {
    margin: 0.4rem 0 0;
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-audio-card.is-expanded .share-audio-desc,
.share-audio-card-single.is-expanded .share-audio-single-desc {
    display: block;
    -webkit-line-clamp: unset;
    max-height: min(22vh, 7.5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.share-audio-card.is-expanded .share-audio-desc::-webkit-scrollbar,
.share-audio-card-single.is-expanded .share-audio-single-desc::-webkit-scrollbar {
    width: 4px;
}

.share-audio-card.is-expanded .share-audio-desc::-webkit-scrollbar-thumb,
.share-audio-card-single.is-expanded .share-audio-single-desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 4px;
}

.share-audio-frame .share-overlay-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.share-player-screen:has(.share-audio-single) {
    padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    gap: 1rem;
}

.share-audio-single {
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.share-audio-single .share-audio-player {
    max-width: none;
}

.share-audio-card-single {
    margin: 0;
}

.share-audio-card-single .share-audio-single-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    margin: 0 0 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-player-screen {
    flex: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    padding: 1rem;
    box-sizing: border-box;
}

/* Video: full-screen frame with overlaid controls */
.share-player-screen:has(.share-video-frame) {
    padding: 0;
    height: 100vh;
    height: 100dvh;
}

.share-video-frame {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: #000;
}

.share-player-screen .share-video-rot-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-player-screen .share-video-rot-wrap.share-tiktok-sized {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.share-player-screen .share-video-rot-wrap[data-rot="0"] .share-player-fullscreen {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-player-screen .share-video-rot-wrap[data-rot="90"] .share-player-fullscreen,
.share-player-screen .share-video-rot-wrap[data-rot="270"] .share-player-fullscreen {
    position: relative;
    object-fit: contain;
    transform-origin: center center;
}

.share-player-screen .share-video-rot-wrap[data-rot="90"] .share-player-fullscreen {
    transform: rotate(90deg);
}

.share-player-screen .share-video-rot-wrap[data-rot="270"] .share-player-fullscreen {
    transform: rotate(270deg);
}

.share-player-screen .share-video-rot-wrap[data-rot="180"] .share-player-fullscreen {
    object-fit: contain;
    transform: rotate(180deg);
    transform-origin: center center;
}

.share-player-fullscreen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-overlay-back {
    position: absolute;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    left: calc(1rem + env(safe-area-inset-left, 0px));
    z-index: 20;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.share-overlay-back:hover {
    color: #fff;
}

/* TikTok-style right-side icon strip */
.share-actions-right {
    position: absolute;
    right: calc(0.45rem + env(safe-area-inset-right, 0px));
    bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
    top: auto;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.05rem;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
}

.share-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    width: auto;
    min-width: 3.4rem;
    height: auto;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.share-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(20, 20, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.share-icon-btn:hover .share-icon-circle,
.share-icon-btn:focus-visible .share-icon-circle {
    background: rgba(40, 40, 55, 0.78);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.share-icon-btn:active {
    transform: scale(0.94);
}

.share-icon-btn:active .share-icon-circle {
    transform: scale(0.97);
}

.share-icon-label {
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    line-height: 1;
}

.share-icon-circle svg {
    display: block;
}

.share-icon-rotate .share-icon-circle {
    font-size: 0;
}

.share-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
    padding: 1.5rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.share-overlay-bottom .share-swipe-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Title card: bold headline + "Vanuatu • MP4 • Tik Tok" (video slides & single) */
.share-media-meta {
    position: absolute;
    left: calc(0.65rem + env(safe-area-inset-left, 0px));
    right: calc(4rem + env(safe-area-inset-right, 0px));
    bottom: calc(7.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 18;
    max-width: min(100%, 20rem);
    max-height: min(26vh, 9.5rem);
    overflow: hidden;
    pointer-events: none;
    text-align: left;
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}

.share-slide:not(.is-active) .share-media-meta {
    opacity: 0.92;
}

.share-media-card {
    background: rgba(10, 10, 14, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 0.55rem 0.7rem 0.6rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.share-media-meta.is-expanded {
    pointer-events: auto;
    max-height: min(42vh, 16rem);
    overflow: visible;
}

.share-meta-title {
    margin: 0 0 0.28rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-meta-byline {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-meta-sep {
    margin: 0 0.2em;
    color: rgba(255, 255, 255, 0.45);
}

.share-meta-desc {
    margin: 0.35rem 0 0;
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-media-meta.is-expanded .share-meta-desc {
    display: block;
    -webkit-line-clamp: unset;
    max-height: min(28vh, 10rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.share-meta-toggle {
    pointer-events: auto;
    margin-top: 0.2rem;
    padding: 0.15rem 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.share-meta-toggle:active {
    opacity: 0.85;
}

.share-player-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.share-player {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
}

.share-player-audio {
    max-height: none;
    padding: 0;
    border-radius: 999px;
}

.share-player-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.share-download-btn {
    min-width: 10rem;
}

.share-swipe-hint {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: opacity 0.25s ease, visibility 0.25s, transform 0.25s ease;
}

.share-slide.is-active .share-swipe-hint {
    animation: swipeHint 2.2s ease-in-out infinite;
}

@keyframes swipeHint {

    0%,
    100% {
        opacity: 0.45;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

.share-player-screen .back-link {
    margin-top: 1rem;
}

.share-player-screen .back-link a {
    color: var(--text-muted);
    text-decoration: underline;
}