.frame-spinner-container {
    perspective: 800px;
    width: 100%;
    height: 180px; /* Fixed height to prevent collapse */
    display: block;
    position: relative;
    margin: 10px 0;
    overflow: visible; /* was hidden */
}

.spinner-items {
    transform-style: preserve-3d;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300px;
    height: 80px;
    margin-left: -150px; /* Center horizontally */
    margin-top: -40px;   /* Center vertically */
    transform-origin: center center;
    pointer-events: auto;
}


.frame-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70px;
    height: 35px;
    margin-left: -35px;
    margin-top: -17px;
    transform-origin: center center;
    
    /* Clean styling */
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    
    pointer-events: auto;
    user-select: none;
}

.frame-item.real-frame {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.frame-item.real-frame.active {
    background: #2196f3;
    color: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.frame-item.filler-frame {
    background: #fafafa;
    border-color: #e0e0e0;
    color: #999;
}

/* Ensure content widget stays on separate line */
.content-widget {
    display: block;
    width: 100%;
    margin-top: 10px;
    clear: both;
}

/* Spinner Track */
.spinner-track {
    position: relative;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    perspective: 1000px;
    perspective-origin: center center;
    cursor: grab;
}

.spinner-track:active {
    cursor: grabbing;
}

/* Individual Cylinder Items */
.cylinder-item {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 24px;
    background: white;
    border: 1px solid #333;
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: black;
    backface-visibility: hidden;
    transition: all 0.2s ease;
    transform-origin: center center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cylinder-item.active {
    background: white;
    color: black;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    border-color: #000;
    border-width: 2px;
    transform-origin: center center;
    z-index: 100;
}

.cylinder-item.adjacent {
    background: #f8f8f8;
    color: #333;
    border-color: #666;
    z-index: 50;
}

.cylinder-item.distant {
    background: #f0f0f0;
    color: #999;
    border-color: #ccc;
    z-index: 10;
}

/* Preview Text Area */
.spinner-preview {
    margin-top: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 12px 16px;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.preview-text {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cylinder-item.blank {
    background: #e8e8e8;
    color: #bbb;
    border-color: #ddd;
    z-index: 5;
    opacity: 0.4;
    pointer-events: none; /* Make blank cells non-interactive */
    cursor: default;
}

/* Spinner Preview and Controls Layout */
.spinner-preview {
    margin-top: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 12px 16px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-text {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

/* Delete Frame Button - now inline with preview */
.delete-frame-btn {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #dc2626;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 100px;
    height: 36px;
}

.delete-frame-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}

.delete-frame-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Touch/Drag Indicators */
.spinner-track::before {
    content: '⋮';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .frame-spinner-container {
        margin: 12px -8px;
        border-radius: 0;
        padding: 12px 16px;
    }
    
    .spinner-track {
        height: 70px;
    }
    
    .cylinder-item {
        height: 20px;
        font-size: 12px;
    }
    
    .spinner-preview {
        min-height: 50px;
        padding: 10px 12px;
    }
    
    .preview-text {
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .frame-spinner-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .cylinder-item.active {
        background: rgba(255,255,255,0.95);
        color: #2d3748;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .spinner-items,
    .cylinder-item {
        transition: none;
    }
}

