/* Karuzela */
.trec-stories-container {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0 10px 0;
    background: #fff;
    -ms-overflow-style: none;
    scrollbar-width: none;
    text-align: center;
}

.trec-stories-container::-webkit-scrollbar {
    display: none;
}

.trec-stories-wrapper {
    display: inline-flex;
    gap: 6px;
    padding: 0 15px;
    margin: 0 auto;
    text-align: left;
}

.trec-story-item {
    width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* Obramowanie ZŁOTE */
.trec-story-ring img,
.trec-story-ring video {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #292929;
}

.trec-story-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(230.68deg, #76AB00 4.07%, #76AB00 95.93%);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Obramowanie SZARE (Gdy obejrzane) */
.trec-story-ring.viewed-story {
    background: #A9A9A9 !important;
}

/* Obrazek wewnątrz z przerwą */
.trec-story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid;
    border-color: white;
}

.trec-story-item:hover .trec-story-ring {
    transform: scale(1.05);
}

/* Tytuł pod kółeczkiem */
.trec-story-title {
    margin-top: 6px;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    color: #000000;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
}

/* Modal Odtwarzacza */
.trec-story-hidden {
    display: none !important;
}

#trec-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.trec-story-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 450px;
    background: #222;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.trec-story-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
    z-index: 18; 
    pointer-events: none; 
}

.trec-story-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    z-index: 18; 
    pointer-events: none;
}

@media (max-width: 768px) {
    .trec-story-content {
        max-width: 100% !important;
        border-radius: 0;
    }
}

.trec-story-progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 20;
}

.trec-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.trec-story-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
}

.trec-story-progress-fill.active {
    animation: storyProgress 5s linear forwards;
}

.trec-story-progress-fill.paused {
    animation-play-state: paused;
}

.trec-story-progress-fill.completed {
    width: 100%;
}

@keyframes storyProgress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.trec-story-header {
    position: absolute;
    top: 25px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
}

.trec-story-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trec-story-ring-modal {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 1.5px;
    background: linear-gradient(230.68deg, #76AB00 4.07%, #76AB00 95.93%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trec-story-ring-modal img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #222;
}

.trec-story-title-modal {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trec-story-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

#trec-story-mute,
#trec-story-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#trec-story-close svg {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

.trec-story-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

#trec-story-mute {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 0;
    display: block;
}

#trec-story-mute.trec-story-hidden {
    display: none !important;
}

#trec-story-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 0 5px;
}

.trec-story-media-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.trec-story-media-container img,
.trec-story-media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trec-story-hotspot {
    position: absolute;
    z-index: 15;
    cursor: pointer;
    display: none;
}

.trec-story-nav-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

.trec-story-nav-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    z-index: 9;
    cursor: pointer;
}

.trec-story-swipe-indicator {
    position: absolute;
    bottom: 30px;
    /* FIX żeby swipe up był widoczny na iPhone */
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    z-index: 20;
    display: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    animation: bounce 2s infinite;
    pointer-events: none;
}

.trec-story-swipe-indicator .swipe-arrow {
    display: block;
    font-size: 12px;
}

.trec-story-swipe-indicator .swipe-text {
    font-size: 12px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Zabezpieczenie CSS przed pokazaniem mobilnych stories na desktopie */
@media (min-width: 769px) {
    .trec-hide-desktop {
        display: none !important;
    }
}