.tb-container {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --border: #334155;
    --glass: rgba(30, 41, 59, 0.7);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Spacing & Sizing Variables for Fluid Design */
    --container-padding: clamp(1rem, 5vw, 2rem);
    --header-margin: clamp(2rem, 5vw, 3rem);

    /* Body Styles Moved Here */
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: radial-gradient(circle at top right, #1e3a8a 0%, transparent 40%),
        radial-gradient(circle at bottom left, #0f4c75 0%, transparent 40%);
    background-attachment: fixed;

    /* Isolation Properties */
    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
    line-height: normal;

    /* Font Inheritance Source - moved from * reset so FA can override */
    font-family: system-ui, 'Outfit', sans-serif;
}

/* 
   Soft Reset for elements INSIDE tb-container.
   Using :where(.tb-container) reduces specificity to 0 for the container part,
   so the total specificity is 0 (universal selector).
   This allows external libraries like Plyr (specificity 10+) to override these styles.
*/
:where(.tb-container) * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* SVG Icon Base Styles */
.tb-container .icon-svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    display: inline-block;
    flex-shrink: 0;
}

.tb-container .app-container {
    width: 100%;
    max-width: 900px;
    /* Slightly wider for better desktop use */
    padding: var(--container-padding);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0 auto;
    /* Ensure centering within flex container */
}

/* Header */
.tb-container .app-header {
    text-align: center;
    margin-bottom: var(--header-margin);
    animation: fadeInDown 0.8s ease;
}

.tb-container .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: clamp(1.5rem, 5vw, 2rem);
    /* Fluid font size - Reduced for embed */
    font-weight: 700;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    /* Ensure it doesn't break on tiny screens */
}

.tb-container .logo i {
    color: var(--primary);
}

.tb-container .highlight {
    color: var(--primary);
}

.tb-container .subtitle {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

/* Search Section */
.tb-container .search-section {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: clamp(1.25rem, 4vw, 2rem);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.tb-container .input-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    /* Allow wrapping on small mobile */
}

.tb-container .input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    /* Ensure input doesn't get too small before wrapping */
}

.tb-container #urlInput {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1rem 5.5rem 1rem 1.5rem;
    /* Right padding for icons */
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tb-container #urlInput:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
}

/* Input Icon Buttons */
.tb-container .input-icon-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-muted);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smooth easing for position changes */
    font-size: 1rem;
}

.tb-container .input-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tb-container .input-icon-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Paste button - animates between two positions */
.tb-container #pasteBtn {
    right: 0.5rem;
    /* Default position (when clear button is hidden) */
}

.tb-container #pasteBtn.shifted {
    right: 3rem;
    /* Shifted position (when clear button is visible) */
}

/* Clear button - slides in from the right */
.tb-container #clearBtn {
    right: 0.5rem;
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
    /* Start slightly to the right */
    pointer-events: none;
    /* Disable clicks when hidden */
}

.tb-container #clearBtn:not(.hidden) {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.tb-container #clearBtn:hover {
    color: var(--danger);
}

.tb-container .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    white-space: nowrap;
    /* Prevent text breaking awkwardly */
}

/* Mobile Optimizations for Button */
@media (max-width: 600px) {
    .tb-container .btn-primary {
        flex: 1;
        /* Stretch to fill width when wrapped or in column */
        width: 100%;
    }

    .tb-container .input-group {
        flex-direction: column;
        /* Stack strictly on mobile */
    }

    .tb-container .input-wrapper {
        min-width: 0;
        width: 100%;
    }

    .tb-container #urlInput {
        padding: 1rem 5rem 1rem 1rem;
        /* Slightly reduce padding on mobile */
    }

    .tb-container .input-icon-btn {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.9rem;
    }

    .tb-container #pasteBtn {
        right: 0.5rem;
    }

    .tb-container #pasteBtn.shifted {
        right: 2.5rem;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .tb-container #urlInput {
        padding: 0.875rem 4.5rem 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .tb-container .input-icon-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }

    .tb-container #pasteBtn {
        right: 0.3rem;
    }

    .tb-container #pasteBtn.shifted {
        right: 2.2rem;
    }

    .tb-container #clearBtn {
        right: 0.3rem;
    }
}

.tb-container .btn-primary:active {
    transform: scale(0.98);
}

.tb-container .error-message {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    word-wrap: break-word;
    /* Ensure long errors wrap */
}

/* Results Section */
.tb-container .results-section {
    animation: fadeInUp 0.5s ease;
    flex: 1;
    /* Ensure footer pushes down */
    min-height: 120px;
    /* CLS prevention */
}

.tb-container .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    flex-wrap: wrap;
    /* scale well */
    gap: 0.5rem;
}

.tb-container .results-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tb-container .view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.tb-container .view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.tb-container .view-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tb-container .view-btn.active {
    background: var(--primary);
    color: white;
}

.tb-container .breadcrumbs {
    display: flex;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    align-items: center;
}

.tb-container .crumb {
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.tb-container .crumb:hover {
    color: var(--primary);
}

.tb-container .crumb.active {
    color: var(--text-main);
    font-weight: 500;
    cursor: default;
}

.tb-container .crumb:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.tb-container .file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Grid View Styles */
.tb-container .file-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* Dynamic grid sizing based on item count */
/* 1 item - full width card with larger size */
.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) {
    grid-template-columns: 1fr;
    max-width: 100%;
}

.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) .file-item {
    padding: 2.5rem 2rem;
}

.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) .file-icon {
    width: 6rem;
    height: 6rem;
    font-size: 3.5rem;
}

/* Larger icons for 2-3 items */
.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(2)) .file-icon,
.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(2) ~ .file-item) .file-icon,
.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(3)) .file-icon,
.tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(3) ~ .file-item) .file-icon {
    width: 5rem;
    height: 5rem;
    font-size: 3rem;
}

.tb-container .file-list.grid-view .file-item {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: 0.75rem;
}

.tb-container .file-list.grid-view .file-icon {
    width: 4rem;
    height: 4rem;
    font-size: 2.5rem;
    margin: 0 auto;
    /* Center the icon */
}

.tb-container .file-list.grid-view .file-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.tb-container .file-list.grid-view .file-name {
    text-align: center;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
}

.tb-container .file-list.grid-view .file-meta {
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
}

/* List View Styles (default) */
.tb-container .file-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tb-container .file-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.tb-container .file-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.tb-container .file-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    min-width: 2.5rem;
    /* Prevent shrinking */
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    position: relative;
    /* For play overlay positioning */
}

/* Play icon overlay for video thumbnails */
.tb-container .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6rem;
    transition: all 0.2s ease;
    pointer-events: none;
    /* Allow clicks to pass through */
}

.tb-container .play-overlay i {
    margin-left: 2px;
    /* Optical centering for play icon */
}

.tb-container .file-item:hover .play-overlay {
    background: rgba(59, 130, 246, 0.9);
    /* Primary color on hover */
    transform: translate(-50%, -50%) scale(1.1);
}

.tb-container .file-info {
    flex: 1;
    overflow: hidden;
    /* For text ellipsis */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tb-container .file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    font-size: clamp(0.95rem, 2.5vw, 1rem);
}

.tb-container .file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Grid Adjustments */
@media (max-width: 600px) {
    .tb-container .file-list.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    /* Override for mobile - keep single item reasonable */
    .tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) .file-item {
        padding: 1.5rem 1rem;
    }

    .tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(1)) .file-icon {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 2.75rem;
    }

    .tb-container .file-list.grid-view .file-item {
        padding: 1rem 0.75rem;
    }

    .tb-container .file-list.grid-view .file-icon {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 2rem;
    }

    /* Adjust larger icons for 1-3 items on mobile */
    .tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(-n+3)) .file-icon,
    .tb-container .file-list.grid-view:has(.file-item:first-child:nth-last-child(-n+3) ~ .file-item) .file-icon {
        width: 4rem;
        height: 4rem;
        font-size: 2.5rem;
    }
}

@media (max-width: 400px) {
    .tb-container .file-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .tb-container .file-meta {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .tb-container .file-list.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Modal */
.tb-container .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
    padding: 1rem;
    /* Prevent edge touching on mobile */
}

/* MODAL SCROLLING & RESPONSIVENESS */
.tb-container .modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    /* Ensure it fits in viewport */
    overflow-y: auto;
    /* Enable scrolling if content exceeds height */
    border-radius: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2rem);
    position: relative;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: zoomIn 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    /* CLS prevention */
}

/* Custom Scrollbar for Modal */
.tb-container .modal-content::-webkit-scrollbar {
    width: 8px;
}

.tb-container .modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.tb-container .modal-content::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.tb-container .close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    /* Ensure on top */
}

.tb-container .close-modal:hover {
    color: var(--text-main);
}

.tb-container .modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    /* Prevent header squishing */
}

.tb-container .file-icon-large {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.tb-container #modalFileName {
    font-size: clamp(1.1rem, 4vw, 1.25rem);
    word-break: break-word;
    /* Handle long filenames better */
    line-height: 1.4;
}

.tb-container .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    /* Fluid columns */
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 1rem;
    flex-shrink: 0;
}

.tb-container .info-item {
    text-align: center;
}

.tb-container .info-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.tb-container .btn-success {
    width: 100%;
    background: var(--success);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: filter 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tb-container .btn-success:hover {
    filter: brightness(1.1);
}

.tb-container .download-result {
    margin-top: 1.5rem;
    flex-shrink: 0;
}

.tb-container .link-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens */
}

.tb-container #finalDownloadLink {
    flex: 1;
    min-width: 200px;
    /* Force wrap if too small */
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.tb-container .btn-icon {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 2.8rem;
    /* Slightly larger targets for touch */
    height: 2.8rem;
    flex-shrink: 0;
    display: flex;
    /* Centering */
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tb-container .btn-icon:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.tb-container .btn-primary-small {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
    height: 2.8rem;
    /* Match btn-icon height */
}

.tb-container .btn-primary-small:hover {
    background: var(--primary-hover);
}

/* Video Player Container in Modal */
.tb-container #videoActions {
    width: 100%;
    margin-top: 1rem;
    flex-shrink: 0;
    /* Let it grow but not shrink to zero */
}

/* Video Loading Overlay */
.tb-container .video-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Allow clicks to pass through to player controls */
}

.tb-container .video-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    /* Removed background box to show spinner directly over poster */
    padding: 2rem;
}

.tb-container .spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tb-container .video-loading-spinner p {
    color: var(--text-main);
    font-size: 0.9rem;
    margin: 0;
}

/* Footer */
.tb-container footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    /* Push to bottom */
    min-height: 120px;
    /* CLS prevention */
}

/* Floating Paste Button (Mobile Only) */
.tb-container .floating-paste-btn {
    display: none;
    /* Hidden by default on desktop */
    position: fixed;
    bottom: 2rem;
    left: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.tb-container .floating-paste-btn.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transition: none;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tb-container .floating-paste-btn:hover:not(.dragging) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tb-container .floating-paste-btn:active {
    transform: scale(0.95);
}

/* Show floating button only on mobile */
@media (max-width: 600px) {
    .tb-container .floating-paste-btn {
        display: flex;
        animation: fadeInUp 0.5s ease 0.3s backwards;
    }
}

/* Video Preview Player */
.tb-container .video-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    min-height: 200px;
    /* CLS prevention */
}

.tb-container .preview-thumbnail {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tb-container .preview-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
}

.tb-container .preview-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5rem;
    height: 5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /*padding-left: 0.3rem;*/
    /* Optical centering for play icon */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 2;
}

.tb-container .preview-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: white;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.tb-container .preview-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.tb-container .preview-loader {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: white;
    z-index: 3;
}

.tb-container .preview-loader .loader-spinner {
    width: 3rem;
    height: 3rem;
}

/* Hide preview when not needed */
.tb-container .video-preview.hidden {
    display: none;
}

/* Utilities */
.tb-container .hidden {
    display: none !important;
}

.tb-container .loader-spinner {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tb-container .load-more-spinner {
    padding: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.tb-container .inline-spinner {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: auto;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Additional Responsive Tweaks */
@media (max-width: 380px) {
    .tb-container .btn-primary-small {
        flex: 1;
        width: 100%;
    }

    .tb-container .btn-icon {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 400px) {
    .tb-container .logo {
        font-size: clamp(1.2rem, 7vw, 1.8rem);
        /* Fluidly shrink below 400px */
    }
}

/* Updates Section */
.tb-container .updates-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.tb-container .updates-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.tb-container .update-log {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tb-container .update-log li {
    font-size: 0.95rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tb-container .update-log li:last-child {
    border-bottom: none;
}

.tb-container .update-log .date {
    color: var(--text-main);
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Status Section */
.tb-container .status-section {
    margin-top: 2rem;
    padding: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.tb-container .status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tb-container .status-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    position: relative;
}

.tb-container .status-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1px solid var(--success);
    opacity: 0.5;
    animation: pulse 2s infinite;
}

.tb-container .telegram-link {
    background: #229ED9;
    /* Telegram Blue */
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 158, 217, 0.3);
}

.tb-container .telegram-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 158, 217, 0.4);
    background: #1c85c0;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}